From 7fd180c9d0014ac275422501e70e5122026eb364 Mon Sep 17 00:00:00 2001 From: Norbert Thiebaud Date: Tue, 18 Feb 2014 12:01:51 -0600 Subject: fix SIGBUS on mac due to Font Attribute not always available Change-Id: I95c574e6386cacc473cad232100a224ff6a08dbb --- vcl/quartz/ctfonts.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'vcl/quartz/ctfonts.cxx') diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index e5c3f5931149..6008aef625f2 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -310,9 +310,12 @@ ImplDevFontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool CFStringRef pUILang = CFStringCreateWithCharacters( kCFAllocatorDefault, aUILang.getStr(), aUILang.getLength() ); CFStringRef pLang = NULL; CFStringRef pFamilyName = (CFStringRef)CTFontDescriptorCopyLocalizedAttribute( pFD, kCTFontFamilyNameAttribute, &pLang ); - if ( CFStringCompare( pUILang, pLang, 0 ) != kCFCompareEqualTo ) + if ( !pLang || ( CFStringCompare( pUILang, pLang, 0 ) != kCFCompareEqualTo )) { - CFRelease( pFamilyName ); + if(pFamilyName) + { + CFRelease( pFamilyName ); + } pFamilyName = (CFStringRef)CTFontDescriptorCopyAttribute( pFD, kCTFontFamilyNameAttribute ); } #else -- cgit