diff options
author | Gautam Ramakrishnan <gautamramk@gmail.com> | 2020-04-03 21:27:57 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-04-04 19:04:21 +0300 |
commit | e116cb45c231910fc58ea489a1e5fc5aadab6a87 (patch) | |
tree | 30cf9f70473e6d5d10a3e6fa122c3eddeab5a990 /libavcodec/jpeg2000dec.c | |
parent | ec7fb4524012e254d9f03cfe0253eb4f2c89dbeb (diff) |
libavcodec/jpeg2000dec.c: Handle non EOC streams
This patch allows decoding of j2k streams which do
not have an EOC marker.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/jpeg2000dec.c')
-rw-r--r-- | libavcodec/jpeg2000dec.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 7103cd6ceb..e71a84c4b8 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -1939,8 +1939,12 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s) len = bytestream2_get_be16(&s->g); 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)); - return AVERROR_INVALIDDATA; + if (s->avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT) { + 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) { |