mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-21 06:50:56 +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);
|
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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user