r3d: fix an invalid read introduced in 6bf4c1d
authorAnton Khirnov <anton@khirnov.net>
Sun, 13 Dec 2015 06:13:37 +0000 (07:13 +0100)
committerAnton Khirnov <anton@khirnov.net>
Mon, 14 Dec 2015 11:12:42 +0000 (12:12 +0100)
libavformat/r3d.c

index fb066a6..9db1d4b 100644 (file)
@@ -352,7 +352,7 @@ static int r3d_read_packet(AVFormatContext *s, AVPacket *pkt)
         case MKTAG('R','E','D','A'):
             if (!r3d->audio_channels)
                 return -1;
-            if (s->streams[1]->discard == AVDISCARD_ALL)
+            if (s->nb_streams >= 2 && s->streams[1]->discard == AVDISCARD_ALL)
                 goto skip;
             if (!(err = r3d_read_reda(s, pkt, &atom)))
                 return 0;