]> git.sesse.net Git - vlc/commitdiff
freetype: fallback to the system font if no font is specified in the style (fix ...
authorLudovic Fauvet <etix@videolan.org>
Wed, 28 Aug 2013 10:54:21 +0000 (12:54 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 28 Aug 2013 11:02:45 +0000 (13:02 +0200)
This fixes a potential NULL pointer dereference and also enables the marq
filter to use the user specified font.

Reported-by: Tillmann Karras <tillmann@selfnet.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/text_renderer/freetype.c

index cdc92430c65fc224b628fdb268a71f9fa0fa2887..05fa2a21a3ab873960a34d9fe474421364404454 100644 (file)
@@ -2674,7 +2674,8 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
     {
         text_style_t *p_style;
         if( p_region_in->p_style )
-            p_style = CreateStyle( p_region_in->p_style->psz_fontname,
+            p_style = CreateStyle( p_region_in->p_style->psz_fontname ? p_region_in->p_style->psz_fontname
+                                                                      : p_sys->psz_fontfamily,
                                    p_region_in->p_style->i_font_size > 0 ? p_region_in->p_style->i_font_size
                                                                          : p_sys->i_font_size,
                                    (p_region_in->p_style->i_font_color & 0xffffff) |