aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/concatdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2025-07-13 03:10:27 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2025-07-21 01:27:23 +0200
commit8cdb47e47a7a53a3c635a71bf712d79119eb86b4 (patch)
tree532cc83c2b6e4d98f6e442e156c2d496ee04a08f /libavformat/concatdec.c
parent749aaf27448b686b029a2ffa4e5d23f878e2f703 (diff)
downloadffmpeg-8cdb47e47a7a53a3c635a71bf712d79119eb86b4.tar.gz
avformat/concatdec: Clip duration in one more case in get_best_effort_duration()
Fixes: signed integer overflow: 40000 - -9223372036854770000 cannot be represented in type 'long' Fixes: 427262541/clusterfuzz-testcase-minimized-ffmpeg_dem_CONCAT_fuzzer-4831506940100608 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/concatdec.c')
-rw-r--r--libavformat/concatdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index fe65d0c768..e0c2c87248 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -326,7 +326,7 @@ static int64_t get_best_effort_duration(ConcatFile *file, AVFormatContext *avf)
if (file->outpoint != AV_NOPTS_VALUE)
return av_sat_sub64(file->outpoint, file->file_inpoint);
if (avf->duration > 0)
- return avf->duration - (file->file_inpoint - file->file_start_time);
+ return av_sat_sub64(avf->duration, file->file_inpoint - file->file_start_time);
if (file->next_dts != AV_NOPTS_VALUE)
return file->next_dts - file->file_inpoint;
return AV_NOPTS_VALUE;