xmvdemux: dont let current_stream become invalid.
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Apr 2012 17:41:54 +0000 (19:41 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Apr 2012 17:41:54 +0000 (19:41 +0200)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/xmv.c

index 596da5f..73c666d 100644 (file)
@@ -304,7 +304,7 @@ static int xmv_process_packet_header(AVFormatContext *s)
     xmv->current_stream = 0;
     if (!xmv->video.frame_count) {
         xmv->video.frame_count = 1;
-        xmv->current_stream    = 1;
+        xmv->current_stream    = xmv->stream_count > 1;
     }
 
     /* Packet audio header */