diff options
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
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 |