avformat/mov: Skip stsd adjustment without chunks
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 16 Apr 2019 20:15:14 +0000 (22:15 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 9 May 2019 09:21:25 +0000 (11:21 +0200)
Fixes: Assertion failure
Fixes: clusterfuzz-testcase-minimized-media_pipeline_integration_fuzzer-5683096400822272

Found-by: Clusterfuzz
Reported-by: Dan Sanders <sandersd@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 18a567c369d74af5ef651b07c4c5615f5598616b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mov.c

index f22a407..df9640f 100644 (file)
@@ -6002,6 +6002,7 @@ static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp,
     }
 
     /* adjust stsd index */
+    if (sc->chunk_count) {
     time_sample = 0;
     for (i = 0; i < sc->stsc_count; i++) {
         int next = time_sample + mov_get_stsc_samples(sc, i);
@@ -6012,6 +6013,7 @@ static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp,
         }
         time_sample = next;
     }
+    }
 
     ret = mov_seek_auxiliary_info(s, sc);
     if (ret < 0) {