diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-01-31 20:55:53 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-02-01 19:03:53 +0100 |
commit | 5441699f8392bc3442f32137d8128d98a3b7b812 (patch) | |
tree | f3352ff7a1aae980afdeb81ec3d570657d15f1d9 | |
parent | 7ceceee8b6ceed2f5a1d53cde1afefad531b5a78 (diff) | |
download | ffmpeg-5441699f8392bc3442f32137d8128d98a3b7b812.tar.gz |
avformat/sbgdec: Use av_sat_add64() in str_to_time()
Fixes: signed integer overflow: 7279992792120000000 + 4611686018427387904 cannot be represented in type 'long long'
Fixes: 29744/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6434060249464832
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>
-rw-r--r-- | libavformat/sbgdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/sbgdec.c b/libavformat/sbgdec.c index 8672e2e976..64c84c1618 100644 --- a/libavformat/sbgdec.c +++ b/libavformat/sbgdec.c @@ -199,7 +199,7 @@ static int str_to_time(const char *str, int64_t *rtime) cur = end; ts = av_clipd(seconds * AV_TIME_BASE, INT64_MIN/2, INT64_MAX/2); } - *rtime = (hours * 3600LL + minutes * 60LL) * AV_TIME_BASE + ts; + *rtime = av_sat_add64((hours * 3600LL + minutes * 60LL) * AV_TIME_BASE, ts); return cur - str; } |