[FFmpeg-cvslog] avcodec/smvjpegdec: check avcodec_decode_video2() return code

Michael Niedermayer git at videolan.org
Tue Jun 2 00:50:14 CEST 2015


ffmpeg | branch: release/2.4 | Michael Niedermayer <michaelni at gmx.at> | Fri May 15 17:21:10 2015 +0200| [7969c0c6f1560f9e0f440ab79a381fc166c2a455] | committer: Michael Niedermayer

avcodec/smvjpegdec: check avcodec_decode_video2() return code

Fixes CID1271810

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit cdd25f9a3df3905543a5546cf6076d2eaf895736)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/smvjpegdec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/smvjpegdec.c b/libavcodec/smvjpegdec.c
index 69327cd..88912ca 100644
--- a/libavcodec/smvjpegdec.c
+++ b/libavcodec/smvjpegdec.c
@@ -137,6 +137,10 @@ static int smvjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_siz
     if (!cur_frame) {
         av_frame_unref(mjpeg_data);
         ret = avcodec_decode_video2(s->avctx, mjpeg_data, &s->mjpeg_data_size, avpkt);
+        if (ret < 0) {
+            s->mjpeg_data_size = 0;
+            return ret;
+        }
     } else if (!s->mjpeg_data_size)
         return AVERROR(EINVAL);
 



More information about the ffmpeg-cvslog mailing list