[FFmpeg-cvslog] lavc/mjpegdec: Fix decoding images with Adobe_CM tag.

Carl Eugen Hoyos git at videolan.org
Thu Feb 25 13:33:04 CET 2016


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Thu Feb 25 13:26:13 2016 +0100| [0f31d401c35c6d39462c2b3e2aa7b573db0ccfde] | committer: Carl Eugen Hoyos

lavc/mjpegdec: Fix decoding images with Adobe_CM tag.

Fixes ticket #5267.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0f31d401c35c6d39462c2b3e2aa7b573db0ccfde
---

 libavcodec/mjpegdec.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 69c9cf3..113022f 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 */



More information about the ffmpeg-cvslog mailing list