aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-03-26 00:16:39 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2024-03-26 23:25:35 +0100
commit007486058c2eb7a7518450a2ddb4fa98845887a3 (patch)
treef1e5b732898b257c3ad5ff9a922b145b00915d3d
parent1eb8cbd09c5f22d7ba9e0d443712a6ab80648637 (diff)
downloadffmpeg-007486058c2eb7a7518450a2ddb4fa98845887a3.tar.gz
avformat/concatdec: Check user_duration sum
Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_CONCAT_fuzzer-6434245599690752 Fixes: signed integer overflow: 9223372026773000000 + 22337000000 cannot be represented in type 'long' 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/concatdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 6017c2c76b..b1d0de18f1 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -679,6 +679,8 @@ static int concat_read_header(AVFormatContext *avf)
cat->files[i].user_duration = cat->files[i].outpoint - cat->files[i].inpoint;
}
cat->files[i].duration = cat->files[i].user_duration;
+ if (time + (uint64_t)cat->files[i].user_duration > INT64_MAX)
+ return AVERROR_INVALIDDATA;
time += cat->files[i].user_duration;
}
if (i == cat->nb_files) {