[vlc-commits] freetype: avoid segfault in FaceStyleEquals()

Devin Heitmueller git at videolan.org
Wed Jan 2 14:18:32 CET 2013


vlc | branch: master | Devin Heitmueller <dheitmueller at kernellabs.com> | Wed Jan  2 13:48:02 2013 +0100| [765b3082e3320feb19ba915bc465e8d9355ec758] | committer: Rafaël Carré

freetype: avoid segfault in FaceStyleEquals()

This can happen if the font name is NULL

Signed-off-by: Rafaël Carré <funman at videolan.org>

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

 modules/text_renderer/freetype.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index eec6967..ac94c62 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -1610,6 +1610,10 @@ static int ProcessNodes( filter_t *p_filter,
 
     if( p_font_style )
     {
+        /* If the font is not specified in the style, assume the system font */
+        if(!p_font_style->psz_fontname)
+             p_font_style->psz_fontname = strdup(p_sys->psz_fontfamily);
+
         rv = PushFont( &p_fonts,
                p_font_style->psz_fontname,
                p_font_style->i_font_size > 0 ? p_font_style->i_font_size



More information about the vlc-commits mailing list