From 17d039349f892195b2854b45d7ee691ee6c85b81 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 16 Apr 2019 22:15:14 +0200 Subject: [PATCH] avformat/mov: Skip stsd adjustment without chunks Fixes: Assertion failure Fixes: clusterfuzz-testcase-minimized-media_pipeline_integration_fuzzer-5683096400822272 Found-by: Clusterfuzz Reported-by: Dan Sanders Signed-off-by: Michael Niedermayer (cherry picked from commit 18a567c369d74af5ef651b07c4c5615f5598616b) Signed-off-by: Michael Niedermayer --- libavformat/mov.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index 7a34a228c1..1c85b51029 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -7278,6 +7278,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++) { int64_t next = time_sample + mov_get_stsc_samples(sc, i); @@ -7289,6 +7290,7 @@ static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp, av_assert0(next == (int)next); time_sample = next; } + } return sample; }