summaryrefslogtreecommitdiff
path: root/libavcodec/jpeg2000dec.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2013-05-02 23:56:19 +0200
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2013-05-05 10:01:22 +0200
commitd82729e5d929ba2a5bb421825c40c31d96f91c27 (patch)
tree92ff9b1c788bcd268e8f4734582018a887216ea9 /libavcodec/jpeg2000dec.c
parent3bb1c58e953256ca614c79a511cd0a94e4673e79 (diff)
Detect and skip mj2-style jp2c header.
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. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavcodec/jpeg2000dec.c')
-rw-r--r--libavcodec/jpeg2000dec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 20e5c9cc93..f9309be1ef 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_CODESTREAM) {
+ s->buf += 8;
}
if (bytestream_get_be16(&s->buf) != JPEG2000_SOC) {