]> git.sesse.net Git - ffmpeg/commitdiff
avformat/sbgdec: Use av_sat_add64() in str_to_time()
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 31 Jan 2021 19:55:53 +0000 (20:55 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 1 Feb 2021 18:03:53 +0000 (19:03 +0100)
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>
libavformat/sbgdec.c

index 8672e2e976771bce2e488ed9e3ad5eb4cda225c9..64c84c16188e30e8906fc757719cff18b2e9a80d 100644 (file)
@@ -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;
 }