提交 424a81df 编写于 作者: M Michael Niedermayer

avcodec/shorten: Check non COMM chunk len before skip in decode_aiff_header()

Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 8024/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5109204648984576

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: NMichael Niedermayer <michael@niedermayer.cc>
上级 936f4a2c
...@@ -234,11 +234,11 @@ static int decode_aiff_header(AVCodecContext *avctx, const uint8_t *header, ...@@ -234,11 +234,11 @@ static int decode_aiff_header(AVCodecContext *avctx, const uint8_t *header,
while (bytestream2_get_le32(&gb) != MKTAG('C', 'O', 'M', 'M')) { while (bytestream2_get_le32(&gb) != MKTAG('C', 'O', 'M', 'M')) {
len = bytestream2_get_be32(&gb); len = bytestream2_get_be32(&gb);
bytestream2_skip(&gb, len + (len & 1)); if (len < 0 || bytestream2_get_bytes_left(&gb) < 18LL + len + (len&1)) {
if (len < 0 || bytestream2_get_bytes_left(&gb) < 18) {
av_log(avctx, AV_LOG_ERROR, "no COMM chunk found\n"); av_log(avctx, AV_LOG_ERROR, "no COMM chunk found\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
bytestream2_skip(&gb, len + (len & 1));
} }
len = bytestream2_get_be32(&gb); len = bytestream2_get_be32(&gb);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册