History

avutil/timecode: Avoid fps overflow

Fixes: Integer overflow and division by 0 Fixes: poc-202102-div.mov

Michael Niedermayer committed 5 years ago

Commit c9487541 parent 403b35e1 file · +2 −2Browse files

Showing the changes to libavutil/timecode.c (1 of 1 file). Show all

Unified · Split

libavutil/timecode.c+2−2
@@ -114,8 +114,8 @@ char *av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum) · 113 unmodified lines
114 }114 }
115 ff = framenum % fps;115 ff = framenum % fps;
116 ss = framenum / fps % 60;116 ss = framenum / fps % 60;
117 mm = framenum / (fps*60) % 60;117 mm = framenum / (fps*60LL) % 60;
118 hh = framenum / (fps*3600);118 hh = framenum / (fps*3600LL);
119 if (tc->flags & AV_TIMECODE_FLAG_24HOURSMAX)119 if (tc->flags & AV_TIMECODE_FLAG_24HOURSMAX)
120 hh = hh % 24;120 hh = hh % 24;
121 snprintf(buf, AV_TIMECODE_STR_SIZE, "%s%02d:%02d:%02d%c%02d",121 snprintf(buf, AV_TIMECODE_STR_SIZE, "%s%02d:%02d:%02d%c%02d",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t