avcodec/smvjpegdec: check avcodec_decode_video2() return code

Fixes CID1271810

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-05-15 17:21:10 +02:00
parent cb0cc44f3a
commit 8d02ba5b7b
1 changed files with 4 additions and 0 deletions

View File

@ -155,6 +155,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);