From dde91fde96cfe77f2ada5eebb360e79fcc042101 Mon Sep 17 00:00:00 2001 From: Urvang Joshi Date: Wed, 23 Oct 2013 17:25:23 -0700 Subject: [PATCH] Demux: Correct the extended format validation Earlier "f = f->next_" was executing for both inner and outer loop, thus skipping validation of some frames. Change-Id: Ice5cdb4ff5da78384aa0573addd3a5e5efa0b10c --- src/demux/demux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/demux/demux.c b/src/demux/demux.c index 6c2a8ce2..cd039573 100644 --- a/src/demux/demux.c +++ b/src/demux/demux.c @@ -623,7 +623,7 @@ static int CheckFrameBounds(const Frame* const frame, int exact, static int IsValidExtendedFormat(const WebPDemuxer* const dmux) { const int has_fragments = !!(dmux->feature_flags_ & FRAGMENTS_FLAG); const int has_frames = !!(dmux->feature_flags_ & ANIMATION_FLAG); - const Frame* f; + const Frame* f = dmux->frames_; if (dmux->state_ == WEBP_DEMUX_PARSING_HEADER) return 1; @@ -631,7 +631,7 @@ static int IsValidExtendedFormat(const WebPDemuxer* const dmux) { if (dmux->loop_count_ < 0) return 0; if (dmux->state_ == WEBP_DEMUX_DONE && dmux->frames_ == NULL) return 0; - for (f = dmux->frames_; f != NULL; f = f->next_) { + while (f != NULL) { const int cur_frame_set = f->frame_num_; int frame_count = 0, fragment_count = 0;