From f129f593f70e0b922558fce21fc6ad819f7fe2e2 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 14 Dec 2011 22:48:30 +0100 Subject: [PATCH] ljpeg: Check that lowres is 0 as lowres is not possible with ljpeg. Signed-off-by: Michael Niedermayer --- libavcodec/mjpegdec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index a1ff022712..babf3016df 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -233,6 +233,11 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) return -1; } + if(s->lossless && s->avctx->lowres){ + av_log(s->avctx, AV_LOG_ERROR, "lowres is not possible with lossless jpeg\n"); + return -1; + } + height = get_bits(&s->gb, 16); width = get_bits(&s->gb, 16);