aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mjpegdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-02-27 20:02:40 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-02-27 20:24:39 +0100
commit6904168c79f21911a04bf1a17b3e11abeedd5250 (patch)
tree9ad545983dc62171996fbc3f86b23aef93580fe8 /libavcodec/mjpegdec.c
parent681e72a668abecea4bb34cdb8c7d5d045147a3d9 (diff)
downloadffmpeg-6904168c79f21911a04bf1a17b3e11abeedd5250.tar.gz
avcodec/mjpegdec: Print error in case of CMYK
Also fail if AV_EF_EXPLODE is set. We do not fail by default, but rather return some image as it may be usefull to the end user to see what is on the image, for example text could be read quite fine and objects recognized. Possibly fixes Ticket3424 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r--libavcodec/mjpegdec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 3469f70c93..67b27e1474 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -378,6 +378,11 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
if (s->rgb)
s->avctx->pix_fmt = s->bits <= 9 ? AV_PIX_FMT_ABGR : AV_PIX_FMT_RGBA64;
else {
+ if (s->adobe_transform == 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "CMYK Unsupported\n");
+ if (s->avctx->err_recognition & AV_EF_EXPLODE)
+ goto unk_pixfmt;
+ }
s->avctx->pix_fmt = s->bits <= 8 ? AV_PIX_FMT_YUVA444P : AV_PIX_FMT_YUVA444P16;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
}
@@ -1836,6 +1841,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
av_dict_free(&s->exif_metadata);
av_freep(&s->stereo3d);
+ s->adobe_transform = -1;
buf_ptr = buf;
buf_end = buf + buf_size;