diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-11-14 22:13:52 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-02-02 14:18:21 +0100 |
commit | 76db6abd3d063e042d21e90deef26769fd2920b8 (patch) | |
tree | b5a0f3f5b9ecbc1ca109e94cc58e82b6a1b5113c | |
parent | 7612e1b4e5d3dc2145602443a839bdb4d6885457 (diff) | |
download | ffmpeg-76db6abd3d063e042d21e90deef26769fd2920b8.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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index ba3930c261..ad1c863d2c 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -613,7 +613,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; |