vlc | branch: master | Felix Paul Kühne <[email protected]> | Sun Sep 29 
14:14:23 2013 +0200| [13e35edc81b6eb03e50c2911723ab6e8d9af89f0] | committer: 
Felix Paul Kühne

quartztext: add basic font-fallback mechanism instead of crashing (close #9369)

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

 modules/text_renderer/quartztext.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/text_renderer/quartztext.c 
b/modules/text_renderer/quartztext.c
index eb5da4a..837f02c 100644
--- a/modules/text_renderer/quartztext.c
+++ b/modules/text_renderer/quartztext.c
@@ -534,8 +534,11 @@ static void setFontAttibutes(char *psz_fontname, int 
i_font_size, uint32_t i_fon
     CFStringRef p_cfString;
     CTFontRef   p_font;
 
-    // Handle font name and size
-    p_cfString = CFStringCreateWithCString(NULL,
+    // fallback on default
+    if (!psz_fontname)
+        psz_fontname = (char *)DEFAULT_FONT;
+
+    p_cfString = CFStringCreateWithCString(kCFAllocatorDefault,
                                             psz_fontname,
                                             kCFStringEncodingUTF8);
     p_font     = CTFontCreateWithName(p_cfString,

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to