avformat/mov: Do not use reference stream in mov_read_sidx() if there is no reference...
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 12 Feb 2019 22:28:35 +0000 (23:28 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 14 Feb 2019 20:55:43 +0000 (21:55 +0100)
Fixes: NULL pointer dereference
Fixes: clusterfuzz-testcase-minimized-audio_decoder_fuzzer-5634316373721088

Reported-by: Chris Cunningham <chcunningham@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mov.c

index 73a5ec2..bbd588c 100644 (file)
@@ -5045,7 +5045,7 @@ static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
                 }
             }
         }
-        for (i = 0; i < c->fc->nb_streams; i++) {
+        if (ref_st) for (i = 0; i < c->fc->nb_streams; i++) {
             st = c->fc->streams[i];
             sc = st->priv_data;
             if (!sc->has_sidx) {