[FFmpeg-devel,1/2] avformat/mov: Skip stsd adjustment without chunks

Submitted by Michael Niedermayer on April 16, 2019, 10:21 p.m.

Details

Message ID 20190416222155.31323-1-michael@niedermayer.cc
State Accepted
Commit 18a567c369d74af5ef651b07c4c5615f5598616b
Headers show

Commit Message

Michael Niedermayer April 16, 2019, 10:21 p.m.
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>
---
 libavformat/mov.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Michael Niedermayer April 24, 2019, 10:43 a.m.
On Wed, Apr 17, 2019 at 12:21:54AM +0200, Michael Niedermayer wrote:
> 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>
> ---
>  libavformat/mov.c | 2 ++
>  1 file changed, 2 insertions(+)

will apply patchset

[...]

Patch hide | download patch | download mbox

diff --git a/libavformat/mov.c b/libavformat/mov.c
index d5ce077e63..a87571b7d1 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7872,6 +7872,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);
@@ -7883,6 +7884,7 @@  static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp,
         av_assert0(next == (int)next);
         time_sample = next;
     }
+    }
 
     return sample;
 }