aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/smvjpegdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-06-08 20:00:16 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-06-08 20:02:22 +0200
commit9e9ec5ad2ab91ca850c14b4c67f53c0d2c12fc17 (patch)
tree71f1ab7dccbd12bf5266199b01fef3e813280138 /libavcodec/smvjpegdec.c
parentb94f045b18f14d6f5399fe6a1ff917a78c60e1fc (diff)
downloadffmpeg-9e9ec5ad2ab91ca850c14b4c67f53c0d2c12fc17.tar.gz
smvjpegdec: No frame at all is an error
This fixes a infinite loop Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/smvjpegdec.c')
-rw-r--r--libavcodec/smvjpegdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/smvjpegdec.c b/libavcodec/smvjpegdec.c
index 2086a2894b..919b9a5771 100644
--- a/libavcodec/smvjpegdec.c
+++ b/libavcodec/smvjpegdec.c
@@ -137,6 +137,8 @@ static int smvjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_siz
/* Are we at the start of a block? */
if (!cur_frame)
ret = avcodec_decode_video2(s->avctx, mjpeg_data, &s->mjpeg_data_size, avpkt);
+ else if (!s->mjpeg_data_size)
+ return AVERROR(EINVAL);
desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
if (desc && mjpeg_data->height % (s->frames_per_jpeg << desc->log2_chroma_h)) {