[vlc-commits] freetype: fixed crash when looking for an empty string as font name

Felix Paul Kühne git at videolan.org
Thu Jun 14 20:33:53 CEST 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu Jun 14 20:32:25 2012 +0200| [48ef1e2f2aef23129661aba070e31832012dec2d] | committer: Felix Paul Kühne

freetype: fixed crash when looking for an empty string as font name

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

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

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index f4d9579..9cb9b7d 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -722,6 +722,9 @@ static char* MacLegacy_Select( filter_t *p_filter, const char* psz_fontname,
 
     *i_idx = 0;
 
+    if( psz_fontname == NULL )
+        return NULL;
+
     msg_Dbg( p_filter, "looking for %s", psz_fontname );
     cf_fontName = CFStringCreateWithCString( kCFAllocatorDefault, psz_fontname, kCFStringEncodingUTF8 );
 



More information about the vlc-commits mailing list