ffplay: check return code of avcodec_decode_video2()
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 8 Jun 2012 12:41:23 +0000 (14:41 +0200)
committerMarton Balint <cus@passwd.hu>
Fri, 8 Jun 2012 19:32:10 +0000 (21:32 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Marton Balint <cus@passwd.hu>
ffplay.c

index cb62614..01a010e 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -1504,7 +1504,8 @@ static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacke
         return 0;
     }
 
-    avcodec_decode_video2(is->video_st->codec, frame, &got_picture, pkt);
+    if(avcodec_decode_video2(is->video_st->codec, frame, &got_picture, pkt) < 0)
+        return -1;
 
     if (got_picture) {
         int ret = 1;