Browse Source

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 5441699f83)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.3.2
Michael Niedermayer 5 years ago
parent
commit
32c6304cf0
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/sbgdec.c

+ 1
- 1
libavformat/sbgdec.c View 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;
}



Loading…
Cancel
Save