aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-03-26 00:50:36 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2024-03-26 23:25:41 +0100
commit61dca9e150b723a160d4a570885f3e5326c3d276 (patch)
treef3ecdcb47e95298a0afb3be65f16a2f657e2e6a4
parent75317ec4420d9853526291e8aa18f3ea17321525 (diff)
downloadffmpeg-61dca9e150b723a160d4a570885f3e5326c3d276.tar.gz
avformat/wavdec: satuarte next_tag_ofs, data_end
Fixes: signed integer overflow: 5053074104798691550 + 5053074104259715104 cannot be represented in type 'long' Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-6515315309936640 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg 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 89855670d9..0fed1ee639 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -453,7 +453,7 @@ static int wav_read_header(AVFormatContext *s)
}
if (rf64 || bw64) {
- next_tag_ofs = wav->data_end = avio_tell(pb) + data_size;
+ next_tag_ofs = wav->data_end = av_sat_add64(avio_tell(pb), data_size);
} else if (size != 0xFFFFFFFF) {
data_size = size;
next_tag_ofs = wav->data_end = size ? next_tag_ofs : INT64_MAX;