aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-02-25 23:11:40 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2024-03-10 19:49:04 +0100
commitb2d7cbc378fa276d62fd676c037b9df59fc319a0 (patch)
treead8583836ad9b177bfbb4ef0d4c54f0202f643be /libavformat
parent5db09574dfd40d3e15db9336a34398405a1c601b (diff)
downloadffmpeg-b2d7cbc378fa276d62fd676c037b9df59fc319a0.tar.gz
avformat/concatdec: Check in and outpoints to be to produce a positive representable duration
Fixes: signed integer overflow: -93000000 - 9223372036839000000 cannot be represented in type 'long' Fixes: 64546/clusterfuzz-testcase-minimized-ffmpeg_dem_CONCAT_fuzzer-5110813828186112 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/concatdec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 2abe479fb0..ac541a592f 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -638,6 +638,12 @@ static int concat_parse_script(AVFormatContext *avf)
}
}
+ if (file->inpoint != AV_NOPTS_VALUE && file->outpoint != AV_NOPTS_VALUE) {
+ if (file->inpoint > file->outpoint ||
+ file->outpoint - (uint64_t)file->inpoint > INT64_MAX)
+ ret = AVERROR_INVALIDDATA;
+ }
+
fail:
for (arg = 0; arg < MAX_ARGS; arg++)
av_freep(&arg_str[arg]);