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>
This commit is contained in:
Gautam Ramakrishnan 2020-04-03 23:57:57 +05:30 committed by Michael Niedermayer
parent ec7fb45240
commit e116cb45c2

View File

@ -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) {