[vlc-devel] [PATCH] text_style: fix overflow in vlc_html_color

Salah-Eddin Shaban salah at videolan.org
Wed Jul 4 00:54:59 CEST 2018


This was heppening on Windows for colors like #ff0000ff

fixes #19974
---
 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..52ef89a62a 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 = strtoul( psz_hex, &psz_end, 16 );
         if( *psz_end == 0 || isspace( *psz_end ) )
         {
             switch( psz_end - psz_hex )
-- 
2.13.7



More information about the vlc-devel mailing list