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>
This commit is contained in:
Michael Niedermayer 2024-02-25 23:11:40 +01:00
parent 5db09574df
commit b2d7cbc378
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 6 additions and 0 deletions

View File

@ -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: fail:
for (arg = 0; arg < MAX_ARGS; arg++) for (arg = 0; arg < MAX_ARGS; arg++)
av_freep(&arg_str[arg]); av_freep(&arg_str[arg]);