avformat/xmv: Discard remainder of packet on error
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 6 Nov 2015 01:13:36 +0000 (02:13 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 6 Nov 2015 01:24:01 +0000 (02:24 +0100)
Fixes infinite loop
Fixes: 9c48ae2680c5f23bca3d20ff0f325fd8/asan_generic_4c254d_1374_993f1e5967dd6f844b8d72f978ce2a6c.pss

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/xmv.c

index 06c070c..14d007a 100644 (file)
@@ -554,8 +554,11 @@ static int xmv_read_packet(AVFormatContext *s,
 
         result = xmv_fetch_audio_packet(s, pkt, xmv->current_stream - 1);
     }
-    if (result)
+    if (result) {
+        xmv->current_stream = 0;
+        xmv->video.current_frame = xmv->video.frame_count;
         return result;
+    }
 
 
     /* Increase our counters */