[FFmpeg-devel] [PATCH] avformat/mov: Do not use reference stream in mov_read_sidx() if there is no reference stream

Michael Niedermayer michael at niedermayer.cc
Wed Feb 13 00:28:35 EET 2019


Fixes: NULL pointer dereference
Fixes: clusterfuzz-testcase-minimized-audio_decoder_fuzzer-5634316373721088

Reported-by: Chris Cunningham <chcunningham at google.com>
Reviewed-by: Chris Cunningham <chcunningham at google.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavformat/mov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 73a5ec240e..6aaba1e290 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5048,7 +5048,7 @@ static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         for (i = 0; i < c->fc->nb_streams; i++) {
             st = c->fc->streams[i];
             sc = st->priv_data;
-            if (!sc->has_sidx) {
+            if (ref_st && !sc->has_sidx) {
                 st->duration = sc->track_end = av_rescale(ref_st->duration, sc->time_scale, ref_sc->time_scale);
             }
         }
-- 
2.20.1



More information about the ffmpeg-devel mailing list