[vlc-commits] freetype: fix crash is no monotype font name was set

Felix Paul Kühne git at videolan.org
Mon Jan 27 16:17:54 CET 2014


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Jan 27 16:11:06 2014 +0100| [375f89a51ae81de3bb5b9c6a6b10839e2289629c] | committer: Felix Paul Kühne

freetype: fix crash is no monotype font name was set

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

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

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index 3401621..573d49b 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -1927,6 +1927,17 @@ static int Create( vlc_object_t *p_this )
 #endif
     }
 
+    /* set default psz_monofontname */
+    if( !psz_monofontfamily || !*psz_monofontfamily )
+    {
+        free( psz_monofontfamily );
+#ifdef HAVE_GET_FONT_BY_FAMILY_NAME
+        psz_monofontfamily = strdup( DEFAULT_MONOSPACE_FAMILY );
+#else
+        psz_monofontfamily = File_Select( DEFAULT_MONOSPACE_FONT_FILE );
+#endif
+    }
+
     /* Set the current font file */
     p_sys->style.psz_fontname = psz_fontname;
     p_sys->style.psz_monofontname = psz_monofontfamily;



More information about the vlc-commits mailing list