1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavc/mjpegdec: Fix decoding images with Adobe_CM tag.

Fixes ticket #5267.
This commit is contained in:
Carl Eugen Hoyos 2016-02-25 13:26:13 +01:00
parent 03af008e21
commit 0f31d401c3

View File

@ -1677,7 +1677,11 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
goto out; goto out;
} }
if (id == AV_RB32("Adob") && (get_bits(&s->gb, 8) == 'e')) { if ( id == AV_RB32("Adob")
&& len >= 7
&& show_bits(&s->gb, 8) == 'e'
&& show_bits_long(&s->gb, 32) != AV_RB32("e_CM")) {
skip_bits(&s->gb, 8); /* 'e' */
skip_bits(&s->gb, 16); /* version */ skip_bits(&s->gb, 16); /* version */
skip_bits(&s->gb, 16); /* flags0 */ skip_bits(&s->gb, 16); /* flags0 */
skip_bits(&s->gb, 16); /* flags1 */ skip_bits(&s->gb, 16); /* flags1 */