Fixes: Integer overflow and division by 0 Fixes: poc-202102-div.mov
Showing the changes to libavutil/timecode.c (1 of 1 file). Show all
Unified · Split
| @@ -114,8 +114,8 @@ char *av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum) · 113 unmodified lines | ||
| 114 | 114 | } |
| 115 | 115 | ff = framenum % fps; |
| 116 | 116 | ss = framenum / fps % 60; |
| 117 | − mm = framenum / (fps*60) % 60; | |
| 118 | − hh = framenum / (fps*3600); | |
| 117 | + mm = framenum / (fps*60LL) % 60; | |
| 118 | + hh = framenum / (fps*3600LL); | |
| 119 | 119 | if (tc->flags & AV_TIMECODE_FLAG_24HOURSMAX) |
| 120 | 120 | hh = hh % 24; |
| 121 | 121 | snprintf(buf, AV_TIMECODE_STR_SIZE, "%s%02d:%02d:%02d%c%02d", |