Commit e116cb45 authored by Gautam Ramakrishnan's avatar Gautam Ramakrishnan Committed by Michael Niedermayer

libavcodec/jpeg2000dec.c: Handle non EOC streams

This patch allows decoding of j2k streams which do
not have an EOC marker.
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent ec7fb452
...@@ -1939,8 +1939,12 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s) ...@@ -1939,8 +1939,12 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
len = bytestream2_get_be16(&s->g); len = bytestream2_get_be16(&s->g);
if (len < 2 || bytestream2_get_bytes_left(&s->g) < len - 2) { if (len < 2 || bytestream2_get_bytes_left(&s->g) < len - 2) {
av_log(s->avctx, AV_LOG_ERROR, "Invalid len %d left=%d\n", len, bytestream2_get_bytes_left(&s->g)); if (s->avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT) {
return AVERROR_INVALIDDATA; av_log(s->avctx, AV_LOG_ERROR, "Invalid len %d left=%d\n", len, bytestream2_get_bytes_left(&s->g));
return AVERROR_INVALIDDATA;
}
av_log(s->avctx, AV_LOG_WARNING, "Missing EOC Marker.\n");
break;
} }
switch (marker) { switch (marker) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment