mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 11:19:55 +00:00
lavc/mjpegdec: Skip unknown APPx marker on bayer images
Samples: - Embedded JPEG images in the DNG images here: https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris <velocityra@gmail.com>
This commit is contained in:
parent
c44aa7f176
commit
fcf0ebc4a9
@ -1807,8 +1807,15 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
|
||||
int len, id, i;
|
||||
|
||||
len = get_bits(&s->gb, 16);
|
||||
if (len < 6)
|
||||
if (len < 6) {
|
||||
if (s->bayer) {
|
||||
// Pentax K-1 (digital camera) JPEG images embedded in DNG images contain unknown APP0 markers
|
||||
av_log(s->avctx, AV_LOG_WARNING, "skipping APPx (len=%"PRId32") for bayer-encoded image\n", len);
|
||||
skip_bits(&s->gb, len);
|
||||
return 0;
|
||||
} else
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (8 * len > get_bits_left(&s->gb))
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user