avidec: Dont crash on avi packets that belong to dv streams in dv in avi
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Apr 2012 15:42:09 +0000 (17:42 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 5 May 2012 22:50:25 +0000 (00:50 +0200)
Fixes null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 096231d497457be9496b0be01ff6da2093186c3c)

libavformat/avidec.c

index ec2204c..72aa607 100644 (file)
@@ -954,6 +954,11 @@ start_sync:
             st = s->streams[n];
             ast = st->priv_data;
 
+            if (!ast) {
+                av_log(s, AV_LOG_WARNING, "Skiping foreign stream %d packet\n", n);
+                continue;
+            }
+
             if(s->nb_streams>=2){
                 AVStream *st1  = s->streams[1];
                 AVIStream *ast1= st1->priv_data;