aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/smvjpegdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-15 17:21:10 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-15 17:21:48 +0200
commitcdd25f9a3df3905543a5546cf6076d2eaf895736 (patch)
tree495a2f7be652084c9198d3fc4469edd4f9e9946c /libavcodec/smvjpegdec.c
parent294469416d8193a28710d802bb0c46e5fa09fad7 (diff)
downloadffmpeg-cdd25f9a3df3905543a5546cf6076d2eaf895736.tar.gz
avcodec/smvjpegdec: check avcodec_decode_video2() return code
Fixes CID1271810 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/smvjpegdec.c')
-rw-r--r--libavcodec/smvjpegdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/smvjpegdec.c b/libavcodec/smvjpegdec.c
index f30d240e2c..45faff29fc 100644
--- a/libavcodec/smvjpegdec.c
+++ b/libavcodec/smvjpegdec.c
@@ -156,6 +156,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);