aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mjpegdec.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2016-02-25 13:26:13 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2016-02-25 13:26:13 +0100
commit0f31d401c35c6d39462c2b3e2aa7b573db0ccfde (patch)
tree4a4ac0e1078a95b90b3e6c440ccae5f3407565fb /libavcodec/mjpegdec.c
parent03af008e21ca91d54b53424e70e12e3688caef7c (diff)
downloadffmpeg-0f31d401c35c6d39462c2b3e2aa7b573db0ccfde.tar.gz
lavc/mjpegdec: Fix decoding images with Adobe_CM tag.
Fixes ticket #5267.
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r--libavcodec/mjpegdec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 69c9cf3626..113022ffef 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1677,7 +1677,11 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
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); /* flags0 */
skip_bits(&s->gb, 16); /* flags1 */