diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-19 16:24:58 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-02-02 14:18:21 +0100 |
commit | cc2da17f867de541423b9e361c79fee1875b6023 (patch) | |
tree | 0d41b872b19311696507899917949ac2796549be /libavformat | |
parent | 5b115c2cbe39e198b35730a9df67a48d43a96efe (diff) | |
download | ffmpeg-cc2da17f867de541423b9e361c79fee1875b6023.tar.gz |
avformat/sbgdec: Check for timestamp overflow in parse_time_sequence()
Fixes: signed integer overflow: 3458015007900000256 + 6425686373040000000 cannot be represented in type 'long'
Fixes: 26430/clusterfuzz-testcase-minimized-ffmpeg_dem_BRSTM_fuzzer-5761175004119040
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 685ed1cbd139d1da04d432a3d3be9929666761bf)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/sbgdec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/sbgdec.c b/libavformat/sbgdec.c index de1de271bb..ae2e0a0d02 100644 --- a/libavformat/sbgdec.c +++ b/libavformat/sbgdec.c @@ -536,6 +536,9 @@ static int parse_time_sequence(struct sbg_parser *p, int inblock) return AVERROR_INVALIDDATA; } ts.type = p->current_time.type; + + if (av_sat_add64(p->current_time.t, rel_ts) != p->current_time.t + (uint64_t)rel_ts) + return AVERROR_INVALIDDATA; ts.t = p->current_time.t + rel_ts; r = parse_fade(p, &fade); if (r < 0) |