]> git.sesse.net Git - vlc/commitdiff
freetype: fixed crash when looking for an empty string as font name
authorFelix Paul Kühne <fkuehne@videolan.org>
Thu, 14 Jun 2012 18:32:25 +0000 (20:32 +0200)
committerFelix Paul Kühne <fkuehne@videolan.org>
Thu, 14 Jun 2012 18:32:42 +0000 (20:32 +0200)
modules/text_renderer/freetype.c

index f4d9579f202cc4fd425aabb55d6f75b7e249b7a3..9cb9b7db645e8b7c6e618bed7871dcc1215893ec 100644 (file)
@@ -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 );