You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
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>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user