[vlc-commits] Try to parse unrecognized color names as hexadecimal value (freetype).

Laurent Aimar git at videolan.org
Sat Jun 25 20:23:20 CEST 2011


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Jun 19 02:27:09 2011 +0200| [e32bee084bb036a1df2e4dd39cd53ef2a3557735] | committer: Laurent Aimar

Try to parse unrecognized color names as hexadecimal value (freetype).

They should be prefixed by '#' but it is not always done...

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e32bee084bb036a1df2e4dd39cd53ef2a3557735
---

 modules/misc/text_renderer/freetype.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/modules/misc/text_renderer/freetype.c b/modules/misc/text_renderer/freetype.c
index c431748..7b66938 100644
--- a/modules/misc/text_renderer/freetype.c
+++ b/modules/misc/text_renderer/freetype.c
@@ -1212,6 +1212,11 @@ static int HandleFontAttributes( xml_reader_t *p_xml_reader,
             }
             else
             {
+                char *end;
+                uint32_t i_value = strtol( value, &end, 16 );
+                if( *end == '\0' || *end == ' ' )
+                    i_font_color = i_value & 0x00ffffff;
+
                 for( int i = 0; p_html_colors[i].psz_name != NULL; i++ )
                 {
                     if( !strncasecmp( value, p_html_colors[i].psz_name, strlen(p_html_colors[i].psz_name) ) )



More information about the vlc-commits mailing list