aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-11-14 22:13:52 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-10 16:04:26 +0200
commita1206b3fc641b4b956069616c24081932da9f43e (patch)
tree1be47e6e895d772aa93dae2a43a5bcefaa0def3b
parentd3606caee9215b3c2875f049c0a96d73913d10df (diff)
downloadffmpeg-a1206b3fc641b4b956069616c24081932da9f43e.tar.gz
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> (cherry picked from commit a207df2acb92d6366ab2f0f18ba35709066b8eec) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/wavdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index fe0456ea1d..e7614818c8 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -612,7 +612,7 @@ static int64_t find_guid(AVIOContext *pb, const uint8_t guid1[16])
while (!avio_feof(pb)) {
avio_read(pb, guid, 16);
size = avio_rl64(pb);
- if (size <= 24)
+ if (size <= 24 || size > INT64_MAX - 8)
return AVERROR_INVALIDDATA;
if (!memcmp(guid, guid1, 16))
return size;