aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-09-30 19:11:34 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2023-10-03 20:09:27 +0200
commitdedc78b4b5bdab869f3038798334639d617d2309 (patch)
tree821fda2ed82af599d99ccf4a51bb424d9ab2223f /libavformat
parent446b0090cbb66ee614dcf6ca79c78dc8eb7f0e37 (diff)
downloadffmpeg-dedc78b4b5bdab869f3038798334639d617d2309.tar.gz
avformat/concatdec: Check in/outpoint for overflow
Fixes: signed integer overflow: 91542414454000000 - -9154241494546000000 cannot be represented in type 'long' Fixes: 51896/clusterfuzz-testcase-minimized-ffmpeg_dem_CONCAT_fuzzer-4739147999084544 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/concatdec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 5d4f67d0ac..114b6c6564 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -667,7 +667,9 @@ static int concat_read_header(AVFormatContext *avf)
else
time = cat->files[i].start_time;
if (cat->files[i].user_duration == AV_NOPTS_VALUE) {
- if (cat->files[i].inpoint == AV_NOPTS_VALUE || cat->files[i].outpoint == AV_NOPTS_VALUE)
+ if (cat->files[i].inpoint == AV_NOPTS_VALUE || cat->files[i].outpoint == AV_NOPTS_VALUE ||
+ cat->files[i].outpoint - (uint64_t)cat->files[i].inpoint != av_sat_sub64(cat->files[i].outpoint, cat->files[i].inpoint)
+ )
break;
cat->files[i].user_duration = cat->files[i].outpoint - cat->files[i].inpoint;
}