mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
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> (cherry picked from commit c94875471e3ba3dc396c6919ff3ec9b14539cd71) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
c09a3b10cd
commit
f3a82afec9
@ -96,8 +96,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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user