aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-09-30 00:56:06 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-03-26 00:08:25 +0100
commitb8e754525ca3d3fd835f7360e11f29b02b39cd62 (patch)
treea02506aecb12e0e3bfd925ab6ead3f5d27bc6e50 /libavformat
parent50d8e4f27398fd5778485a827d7a2817921f8540 (diff)
downloadffmpeg-b8e754525ca3d3fd835f7360e11f29b02b39cd62.tar.gz
avformat/iff: Saturate avio_tell() + 12
Fixes: signed integer overflow: 9223372036854775796 + 12 cannot be represented in type 'long long' Fixes: 51896/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-4898373660704768 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/iff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/iff.c b/libavformat/iff.c
index 633e0c11fd..0cbe125337 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -218,7 +218,7 @@ static int parse_dsd_diin(AVFormatContext *s, AVStream *st, uint64_t eof)
{
AVIOContext *pb = s->pb;
- while (avio_tell(pb) + 12 <= eof && !avio_feof(pb)) {
+ while (av_sat_add64(avio_tell(pb), 12) <= eof && !avio_feof(pb)) {
uint32_t tag = avio_rl32(pb);
uint64_t size = avio_rb64(pb);
uint64_t orig_pos = avio_tell(pb);
@@ -255,7 +255,7 @@ static int parse_dsd_prop(AVFormatContext *s, AVStream *st, uint64_t eof)
int dsd_layout[6];
ID3v2ExtraMeta *id3v2_extra_meta;
- while (avio_tell(pb) + 12 <= eof && !avio_feof(pb)) {
+ while (av_sat_add64(avio_tell(pb), 12) <= eof && !avio_feof(pb)) {
uint32_t tag = avio_rl32(pb);
uint64_t size = avio_rb64(pb);
uint64_t orig_pos = avio_tell(pb);