From e18e66779b9de02f56c9d404cec0e1ec891cb63a Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 14 Nov 2013 23:56:59 +0000 Subject: [PATCH] demux: strictly enforce the animation flag if the flag is incorrectly set in a VP8L or VP8/ALPH single image file the demux will now fail. Change-Id: Id4d5f2d3f6922a29b442c5d3d0acbe3d679e468a --- src/demux/demux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/demux/demux.c b/src/demux/demux.c index 52d79fce..a2368d6e 100644 --- a/src/demux/demux.c +++ b/src/demux/demux.c @@ -513,8 +513,9 @@ static ParseStatus ParseVP8X(WebPDemuxer* const dmux) { case MKFOURCC('A', 'L', 'P', 'H'): case MKFOURCC('V', 'P', '8', ' '): case MKFOURCC('V', 'P', '8', 'L'): { + const int has_frames = !!(dmux->feature_flags_ & ANIMATION_FLAG); // check that this isn't an animation (all frames should be in an ANMF). - if (anim_chunks > 0) return PARSE_ERROR; + if (anim_chunks > 0 || has_frames) return PARSE_ERROR; Rewind(mem, CHUNK_HEADER_SIZE); status = ParseSingleImage(dmux);