mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-18 04:47:12 +00:00
avutil/timecode: do not trash bits on invalid av_timecode_get_smpte arguments
The function has no way to return error, so let's clip or calculate modulo. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
d0596e0bb0
commit
5357401671
@ -84,6 +84,11 @@ uint32_t av_timecode_get_smpte(AVRational rate, int drop, int hh, int mm, int ss
|
||||
ff /= 2;
|
||||
}
|
||||
|
||||
hh = hh % 24;
|
||||
mm = av_clip(mm, 0, 59);
|
||||
ss = av_clip(ss, 0, 59);
|
||||
ff = ff % 40;
|
||||
|
||||
tc |= drop << 30;
|
||||
tc |= (ff / 10) << 28;
|
||||
tc |= (ff % 10) << 24;
|
||||
|
Loading…
Reference in New Issue
Block a user