[FFmpeg-devel] [PATCH] Detect and skip mj2-style jp2c header.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri May 3 00:00:56 CEST 2013


This this fixes one of the issues with
http://blogs.bu.edu/mhirsch/files/2012/08/Rotate180CCW-checkerboard.mj2_.zip
and at least allows to demux the file properly instead
of failing during probing.
---
 libavcodec/jpeg2000dec.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 20e5c9c..a4a5f43 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -1269,6 +1269,8 @@ static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data,
                    "couldn't find jpeg2k codestream atom\n");
             return -1;
         }
+    } else if (AV_RB16(s->buf) != JPEG2000_SOC && AV_RB32(s->buf + 4) == JP2_CO
+        s->buf += 8;
     }
 
     if (bytestream_get_be16(&s->buf) != JPEG2000_SOC) {
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list