diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2024-12-22 00:28:21 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-12-24 02:45:13 +0100 |
commit | 6ba33b50f51b17eef0449f20b3524f174dc9c3cc (patch) | |
tree | 3038b28e34471e8c52fcb1f05cb13688a3836575 /libavutil/timecode.c | |
parent | f1ddba24a0cf2394b2e256ed0eb1db0b4d935b7c (diff) | |
download | ffmpeg-6ba33b50f51b17eef0449f20b3524f174dc9c3cc.tar.gz |
avutil/timecode: Avoid fps overflow in av_timecode_get_smpte_from_framenum()
Fix from c94875471e3ba3dc396c6919ff3ec9b14539cd71
Found-by: Youngjae Choi <youngjaechoi@korea.ac.kr>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavutil/timecode.c')
-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 f40a10eb38..f454466f97 100644 --- a/libavutil/timecode.c +++ b/libavutil/timecode.c @@ -61,8 +61,8 @@ uint32_t av_timecode_get_smpte_from_framenum(const AVTimecode *tc, int framenum) framenum = av_timecode_adjust_ntsc_framenum2(framenum, tc->fps); ff = framenum % fps; ss = framenum / fps % 60; - mm = framenum / (fps*60) % 60; - hh = framenum / (fps*3600) % 24; + mm = framenum / (fps*60LL) % 60; + hh = framenum / (fps*3600LL) % 24; return av_timecode_get_smpte(tc->rate, drop, hh, mm, ss, ff); } |