[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:34:10 CEST 2012


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

freetype: fixed crash when looking for an empty string as font name
(cherry picked from commit 48ef1e2f2aef23129661aba070e31832012dec2d)

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

 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 6fb54df..b862bb4 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -721,6 +721,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