diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-03-01 15:44:12 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-03-15 01:29:51 +0300 |
commit | c94875471e3ba3dc396c6919ff3ec9b14539cd71 (patch) | |
tree | bddd7f690acb3c033ea7af3d71990e1258399098 /libavutil | |
parent | 403b35e16e16a8c4a13e531ccdc23598f685ca20 (diff) |
avutil/timecode: Avoid fps overflow
Fixes: Integer overflow and division by 0
Fixes: poc-202102-div.mov
Found-by: 1vanChen of NSFOCUS Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/timecode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/timecode.c b/libavutil/timecode.c index b1b504edbf..2fc3295e25 100644 --- a/libavutil/timecode.c +++ b/libavutil/timecode.c @@ -114,8 +114,8 @@ char *av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum) } ff = framenum % fps; ss = framenum / fps % 60; - mm = framenum / (fps*60) % 60; - hh = framenum / (fps*3600); + mm = framenum / (fps*60LL) % 60; + hh = framenum / (fps*3600LL); if (tc->flags & AV_TIMECODE_FLAG_24HOURSMAX) hh = hh % 24; snprintf(buf, AV_TIMECODE_STR_SIZE, "%s%02d:%02d:%02d%c%02d", |