[FFmpeg-cvslog] ffplay: check return code of avcodec_decode_video2()

Michael Niedermayer git at videolan.org
Sat Jun 9 00:33:02 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Jun  8 14:41:23 2012 +0200| [349b65eee2fd5590b7e511c915dcd2d3aef3960e] | committer: Marton Balint

ffplay: check return code of avcodec_decode_video2()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=349b65eee2fd5590b7e511c915dcd2d3aef3960e
---

 ffplay.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ffplay.c b/ffplay.c
index cb62614..01a010e 100644
--- 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;



More information about the ffmpeg-cvslog mailing list