mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
avformat/icodec: Check size
Fixes: signed integer overflow: 14 + 2147483647 cannot be represented in type 'int' Fixes: 471688026/clusterfuzz-testcase-minimized-ffmpeg_dem_ICO_fuzzer-5616495813263360 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:
committed by
michaelni
parent
a7a009a3eb
commit
237d03717f
@@ -113,7 +113,7 @@ static int read_header(AVFormatContext *s)
|
||||
avio_skip(pb, 5);
|
||||
|
||||
ico->images[i].size = avio_rl32(pb);
|
||||
if (ico->images[i].size <= 0) {
|
||||
if (ico->images[i].size <= 0 || ico->images[i].size > INT_MAX - 14) {
|
||||
av_log(s, AV_LOG_ERROR, "Invalid image size %d\n", ico->images[i].size);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user