aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-15 17:21:10 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-10 02:13:11 +0200
commit41c81556a70cd32fc153a614a2088a926b779b39 (patch)
tree68deab415a329ada4f0ce54a763471ce57b6e498
parentf58c9746c3972873e80b385846a451c479d69d6e (diff)
downloadffmpeg-41c81556a70cd32fc153a614a2088a926b779b39.tar.gz
avcodec/smvjpegdec: check avcodec_decode_video2() return code
Fixes CID1271810 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit cdd25f9a3df3905543a5546cf6076d2eaf895736) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/smvjpegdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/smvjpegdec.c b/libavcodec/smvjpegdec.c
index 7d848394fb..9d9ad63fb2 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);