[vlc-commits] [Git][videolan/vlc][master] core: avoid bogus comparison on large date divider
Steve Lhomme (@robUx4)
gitlab at videolan.org
Tue Sep 16 15:01:29 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
e8b252de by Steve Lhomme at 2025-09-16T14:47:05+00:00
core: avoid bogus comparison on large date divider
If i_divider_num > UINT32_MAX/2 when multiplied by 2 it makes a small number
and the assert fails. We use uint64_t comparisons instead.
Fixes #29308
- - - - -
1 changed file:
- src/misc/mtime.c
Changes:
=====================================
src/misc/mtime.c
=====================================
@@ -99,7 +99,7 @@ vlc_tick_t date_Increment( date_t *p_date, uint32_t i_nb_samples )
if( p_date->i_remainder >= p_date->i_divider_num )
{
/* This is Bresenham algorithm. */
- assert( p_date->i_remainder < 2*p_date->i_divider_num);
+ assert( p_date->i_remainder < UINT64_C(2)*p_date->i_divider_num);
p_date->date += 1;
p_date->i_remainder -= p_date->i_divider_num;
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e8b252de7526ea2478f42558485467cc92156373
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e8b252de7526ea2478f42558485467cc92156373
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list