mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-12 02:04:58 +00:00
avformat/iamf_reader: Check len before summing
Fixes: integer overflow Fixes: 67275/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5438920751906816 Fixes: 67688/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5970342318243840 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
d6ed6f6e8d
commit
f26ee6e066
@ -284,9 +284,9 @@ int ff_iamf_read_packet(AVFormatContext *s, IAMFDemuxContext *c,
|
|||||||
|
|
||||||
len = ff_iamf_parse_obu_header(header, size, &obu_size, &start_pos, &type,
|
len = ff_iamf_parse_obu_header(header, size, &obu_size, &start_pos, &type,
|
||||||
&skip_samples, &discard_padding);
|
&skip_samples, &discard_padding);
|
||||||
if (len < 0 || obu_size > max_size) {
|
if (len < 0 || obu_size > max_size || len > INT_MAX - read) {
|
||||||
av_log(s, AV_LOG_ERROR, "Failed to read obu\n");
|
av_log(s, AV_LOG_ERROR, "Failed to read obu\n");
|
||||||
return len;
|
return len < 0 ? len : AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
avio_seek(pb, -(size - start_pos), SEEK_CUR);
|
avio_seek(pb, -(size - start_pos), SEEK_CUR);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user