ljpeg: Check that lowres is 0 as lowres is not possible with ljpeg.
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 14 Dec 2011 21:48:30 +0000 (22:48 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 14 Dec 2011 21:50:49 +0000 (22:50 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mjpegdec.c

index a1ff022..babf301 100644 (file)
@@ -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);