mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-27 05:00:37 +00:00
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:
parent
ec7fb45240
commit
e116cb45c2
@ -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…
Reference in New Issue
Block a user