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>
if (r < 0)
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);
if (!st)
return AVERROR(ENOMEM);