diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-11-28 21:31:16 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-09 13:53:29 +0200 |
commit | a8d260b66ac0f71c2092e632bd9521698aca620b (patch) | |
tree | 447f1893011b4be02b4be65d78d2d57d36f68325 | |
parent | 0c45348beffde91fc5a702273d79b5b4437c014f (diff) | |
download | ffmpeg-a8d260b66ac0f71c2092e632bd9521698aca620b.tar.gz |
avutil/timecode: Avoid undefined behavior with large framenum
Fixes: signed integer overflow: 2147462079 + 2149596 cannot be represented in type 'int'
Fixes: 27565/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5091972813160448
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1b1905739638c22b476c99c679b41f29fa00bf07)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavutil/timecode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/timecode.c b/libavutil/timecode.c index 60077ba0c0..76163d5553 100644 --- a/libavutil/timecode.c +++ b/libavutil/timecode.c @@ -49,7 +49,7 @@ int av_timecode_adjust_ntsc_framenum2(int framenum, int fps) d = framenum / frames_per_10mins; m = framenum % frames_per_10mins; - return framenum + 9 * drop_frames * d + drop_frames * ((m - drop_frames) / (frames_per_10mins / 10)); + return framenum + 9U * drop_frames * d + drop_frames * ((m - drop_frames) / (frames_per_10mins / 10)); } uint32_t av_timecode_get_smpte_from_framenum(const AVTimecode *tc, int framenum) |