mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
avformat/wavdec: More complete size check in find_guid()
Fixes: signed integer overflow: 9223372036854775807 + 8 cannot be represented in type 'long' Fixes: 27341/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-5442833206738944 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
2eb6417417
commit
a207df2acb
@ -666,7 +666,7 @@ static int64_t find_guid(AVIOContext *pb, const uint8_t guid1[16])
|
|||||||
while (!avio_feof(pb)) {
|
while (!avio_feof(pb)) {
|
||||||
avio_read(pb, guid, 16);
|
avio_read(pb, guid, 16);
|
||||||
size = avio_rl64(pb);
|
size = avio_rl64(pb);
|
||||||
if (size <= 24)
|
if (size <= 24 || size > INT64_MAX - 8)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
if (!memcmp(guid, guid1, 16))
|
if (!memcmp(guid, guid1, 16))
|
||||||
return size;
|
return size;
|
||||||
|
Loading…
Reference in New Issue
Block a user