Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-08-22 21:31:32 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-09-25 14:51:52 +0300
commit7c00e515a0e589f4c90f1f09f91ae1a5fe4cdd99 (patch)
treedf67ef6f9cd2c8dab203c056a4a1ef912feb9c88
parentdf0d34caafdcef5dac9e9ceedbd6e8920bdf5833 (diff)
libavformat/iff: Check for overflow in body_end calculation
Fixes: signed integer overflow: -6322983228386819992 - 5557477266266529857 cannot be represented in type 'long' Fixes: 50112/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-6329186221948928 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 bcb46903040e5a5199281f4ad0a1fdaf750ebc37) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/iff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/iff.c b/libavformat/iff.c
index 16baaca439..06785c748b 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -502,6 +502,9 @@ static int iff_read_header(AVFormatContext *s)
case ID_DST:
case ID_MDAT:
iff->body_pos = avio_tell(pb);
+ if (iff->body_pos < 0 || iff->body_pos + data_size > INT64_MAX)
+ return AVERROR_INVALIDDATA;
+
iff->body_end = iff->body_pos + data_size;
iff->body_size = data_size;
if (chunk_id == ID_DST) {