mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-03 19:18:01 +00:00
lavc/pngdec: improve chunk length check
The length does not cover the chunk type or CRC.
This commit is contained in:
parent
8e4390de48
commit
ae08eec6a1
@ -1217,7 +1217,7 @@ static int decode_frame_common(AVCodecContext *avctx, PNGDecContext *s,
|
|||||||
}
|
}
|
||||||
|
|
||||||
length = bytestream2_get_be32(&s->gb);
|
length = bytestream2_get_be32(&s->gb);
|
||||||
if (length > 0x7fffffff || length > bytestream2_get_bytes_left(&s->gb)) {
|
if (length > 0x7fffffff || length + 8 > bytestream2_get_bytes_left(&s->gb)) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "chunk too big\n");
|
av_log(avctx, AV_LOG_ERROR, "chunk too big\n");
|
||||||
ret = AVERROR_INVALIDDATA;
|
ret = AVERROR_INVALIDDATA;
|
||||||
goto fail;
|
goto fail;
|
||||||
|
Loading…
Reference in New Issue
Block a user