[MPlayer-cvslog] r29607 - trunk/libvo/font_load_ft.c

reimar subversion at mplayerhq.hu
Tue Sep 1 12:17:23 CEST 2009


Author: reimar
Date: Tue Sep  1 12:17:22 2009
New Revision: 29607

Log:
Fix memleak when using fontconfig without a font name.

Modified:
   trunk/libvo/font_load_ft.c

Modified: trunk/libvo/font_load_ft.c
==============================================================================
--- trunk/libvo/font_load_ft.c	Tue Sep  1 11:36:04 2009	(r29606)
+++ trunk/libvo/font_load_ft.c	Tue Sep  1 12:17:22 2009	(r29607)
@@ -1157,10 +1157,8 @@ void load_font_ft(int width, int height,
 #ifdef CONFIG_FONTCONFIG
     if (font_fontconfig > 0)
     {
-	if (!font_name)
-	    font_name = strdup("sans-serif");
 	FcInit();
-	fc_pattern = FcNameParse(font_name);
+	fc_pattern = FcNameParse(font_name ? font_name : "sans-serif");
 	FcConfigSubstitute(0, fc_pattern, FcMatchPattern);
 	FcDefaultSubstitute(fc_pattern);
 	fc_pattern2 = fc_pattern;


More information about the MPlayer-cvslog mailing list