]> git.sesse.net Git - vlc/commitdiff
freetype: fix crash is no monotype font name was set
authorFelix Paul Kühne <fkuehne@videolan.org>
Mon, 27 Jan 2014 15:11:06 +0000 (16:11 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Mon, 27 Jan 2014 15:17:49 +0000 (16:17 +0100)
modules/text_renderer/freetype.c

index 34016213fadad41df3f0deb633f518f0b5914b82..573d49b2548d711a41ba25cc706c5271f41df767 100644 (file)
@@ -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;