jpegdec: fix CJPG decoding.
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 18 Jun 2011 21:59:27 +0000 (23:59 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 19 Jun 2011 01:54:16 +0000 (03:54 +0200)
Fixes ticket133

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mjpegdec.c

index 4e58fef..d80dad7 100644 (file)
@@ -993,8 +993,11 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s,
 
     predictor= get_bits(&s->gb, 8); /* JPEG Ss / lossless JPEG predictor /JPEG-LS NEAR */
     ilv= get_bits(&s->gb, 8);    /* JPEG Se / JPEG-LS ILV */
-    prev_shift = get_bits(&s->gb, 4); /* Ah */
-    point_transform= get_bits(&s->gb, 4); /* Al */
+    if(s->avctx->codec_tag != AV_RL32("CJPG")){
+        prev_shift = get_bits(&s->gb, 4); /* Ah */
+        point_transform= get_bits(&s->gb, 4); /* Al */
+    }else
+        prev_shift= point_transform= 0;
 
     for(i=0;i<nb_components;i++)
         s->last_dc[i] = 1024;