[vlc-commits] text_style: fix overflow in vlc_html_color
Salah-Eddin Shaban
git at videolan.org
Wed Jul 11 15:59:58 CEST 2018
vlc | branch: master | Salah-Eddin Shaban <salah at videolan.org> | Wed Jul 4 01:19:50 2018 +0300| [e966ae8c6e5bf08620eedf44e1a81a31749f0084] | committer: Jean-Baptiste Kempf
text_style: fix overflow in vlc_html_color
This was happening on Windows for color values above #7FFFFFFF
fixes #19974
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e966ae8c6e5bf08620eedf44e1a81a31749f0084
---
src/misc/text_style.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/misc/text_style.c b/src/misc/text_style.c
index 43944afb5a..0695f94d89 100644
--- a/src/misc/text_style.c
+++ b/src/misc/text_style.c
@@ -312,7 +312,7 @@ unsigned int vlc_html_color( const char *psz_value, bool* ok )
(*psz_hex >= '0' && *psz_hex <= '9') ||
(*psz_hex >= 'A' && *psz_hex <= 'F') )
{
- uint32_t i_value = strtol( psz_hex, &psz_end, 16 );
+ uint32_t i_value = (uint32_t)strtoul( psz_hex, &psz_end, 16 );
if( *psz_end == 0 || isspace( *psz_end ) )
{
switch( psz_end - psz_hex )
More information about the vlc-commits
mailing list