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>
pull/336/head
Gautam Ramakrishnan 5 years ago committed by Michael Niedermayer
parent ec7fb45240
commit e116cb45c2
  1. 8
      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) {

Loading…
Cancel
Save