[vlc-commits] Freetype: fix regression

Jean-Baptiste Kempf git at videolan.org
Sun Mar 27 00:50:03 CET 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Mar 27 00:34:10 2011 +0100| [a02c06ff2433693845878db14878e5053af6ec02] | committer: Jean-Baptiste Kempf

Freetype: fix regression

Caused by [231a967145083b2e31d615e2ecd2896e27595e4d]
Sorry for the disturbance

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

 modules/misc/text_renderer/freetype.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/misc/text_renderer/freetype.c b/modules/misc/text_renderer/freetype.c
index e855734..c0a9150 100644
--- a/modules/misc/text_renderer/freetype.c
+++ b/modules/misc/text_renderer/freetype.c
@@ -347,6 +347,7 @@ static int Create( vlc_object_t *p_this )
         msg_Err( p_filter,"User didn't specify fontfile, using %s", psz_fontfamily);
 #endif
     }
+    p_sys->psz_fontfamily = psz_fontfamily;
 
     /* Set the font file */
 #ifdef HAVE_FONTCONFIG
@@ -356,11 +357,11 @@ static int Create( vlc_object_t *p_this )
     psz_fontfile = FontConfig_Select( NULL, psz_fontfamily, false, false,
                                       p_sys->i_default_font_size, &fontindex );
 
-    p_sys->psz_fontfamily = psz_fontfamily;
     msg_Dbg( p_filter, "Using %s as font from file %s", psz_fontfamily, psz_fontfile );
     if( !psz_fontfile )
-#else
         psz_fontfile = psz_fontfamily;
+#else
+    psz_fontfile = psz_fontfamily;
 #endif
 
     /* */
@@ -409,7 +410,6 @@ static int Create( vlc_object_t *p_this )
     p_filter->pf_render_html = NULL;
 #endif
 
-    free( psz_fontfamily );
     LoadFontsFromAttachments( p_filter );
 
     return VLC_SUCCESS;
@@ -444,8 +444,8 @@ static void Destroy( vlc_object_t *p_this )
 
 #ifdef HAVE_STYLES
     if( p_sys->p_xml ) xml_ReaderDelete( p_sys->p_xml );
-    free( p_sys->psz_fontfamily );
 #endif
+    free( p_sys->psz_fontfamily );
 
     /* FcFini asserts calling the subfunction FcCacheFini()
      * even if no other library functions have been made since FcInit(),



More information about the vlc-commits mailing list