You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avformat/sbgdec: Check opt_duration and start for overflow
Fixes: signed integer overflow: 2788626175500000000 + 7118941284000000000 cannot be represented in type 'long' Fixes: 35215/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6123272247836672 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:
@@ -936,6 +936,9 @@ static int expand_timestamps(void *log, struct sbg_script *s)
|
|||||||
}
|
}
|
||||||
if (s->start_ts == AV_NOPTS_VALUE)
|
if (s->start_ts == AV_NOPTS_VALUE)
|
||||||
s->start_ts = (s->opt_start_at_first && s->tseq) ? s->tseq[0].ts.t : now;
|
s->start_ts = (s->opt_start_at_first && s->tseq) ? s->tseq[0].ts.t : now;
|
||||||
|
if (s->start_ts > INT64_MAX - s->opt_duration)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
s->end_ts = s->opt_duration ? s->start_ts + s->opt_duration :
|
s->end_ts = s->opt_duration ? s->start_ts + s->opt_duration :
|
||||||
AV_NOPTS_VALUE; /* may be overridden later by -E option */
|
AV_NOPTS_VALUE; /* may be overridden later by -E option */
|
||||||
cur_ts = now;
|
cur_ts = now;
|
||||||
|
Reference in New Issue
Block a user