lxfdec: fix "no audio stream" check. avoid null ptrs deref
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 13 Nov 2012 22:03:38 +0000 (23:03 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 13 Nov 2012 23:03:42 +0000 (00:03 +0100)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/lxfdec.c

index bf17d87..dbb5f53 100644 (file)
@@ -165,7 +165,7 @@ static int get_packet_header(AVFormatContext *s)
         break;
     case 1:
         //audio
-        if (!(st = s->streams[1])) {
+        if (!s->streams || !(st = s->streams[1])) {
             av_log(s, AV_LOG_INFO, "got audio packet, but no audio stream present\n");
             break;
         }