diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-01-31 20:55:53 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-02-02 14:18:22 +0100 |
commit | 32c6304cf01d87e3ef76606e5eb8723b2d61e26f (patch) | |
tree | 9a2698f36aa25ceaf3eec0abcb040abf40c70738 | |
parent | 3a777a340bffc0bd71c13f923dd9c8ae92e712b9 (diff) | |
download | ffmpeg-32c6304cf01d87e3ef76606e5eb8723b2d61e26f.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>
(cherry picked from commit 5441699f8392bc3442f32137d8128d98a3b7b812)
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 92dd1dc089..d2a5a82c27 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; } |