]> git.sesse.net Git - ffmpeg/commitdiff
lavc/mjpegdec: Detect more CMYK images.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Mon, 17 Aug 2015 13:53:41 +0000 (15:53 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Mon, 17 Aug 2015 13:53:41 +0000 (15:53 +0200)
Fixes ticket #4772.

libavcodec/mjpegdec.c

index 899af4e6a66b2ba66e6471371fa88bf128a0332e..039fe0edfb44b5bc324a42ab40f9e88876f37c50 100644 (file)
@@ -345,6 +345,12 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
                i, h_count[i], v_count[i],
                s->component_id[i], s->quant_index[i]);
     }
+    if (   nb_components == 4
+        && s->component_id[0] == 'C' - 1
+        && s->component_id[1] == 'M' - 1
+        && s->component_id[2] == 'Y' - 1
+        && s->component_id[3] == 'K' - 1)
+        s->adobe_transform = 0;
 
     if (s->ls && (s->h_max > 1 || s->v_max > 1)) {
         avpriv_report_missing_feature(s->avctx, "Subsampling in JPEG-LS");