1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

avformat/sbgdec: Check that end is not before start

Fixes: signed integer overflow: -9223372036854775808 + -5279949906739200 cannot be represented in type 'long'
Fixes: 26908/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6329610851319808

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>
(cherry picked from commit 9ef60a66f1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2020-11-10 00:04:50 +01:00
parent a675945380
commit 82728dee12

View File

@ -1411,6 +1411,11 @@ static av_cold int sbg_read_header(AVFormatContext *avf)
if (r < 0) if (r < 0)
goto fail; goto fail;
if (script.end_ts != AV_NOPTS_VALUE && script.end_ts < script.start_ts) {
r = AVERROR_INVALIDDATA;
goto fail;
}
st = avformat_new_stream(avf, NULL); st = avformat_new_stream(avf, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);