diff --git a/vcl/quartz/SystemFontList.cxx b/vcl/quartz/SystemFontList.cxx index fb0ea10dbaa1..015bab1a6b0a 100644 --- a/vcl/quartz/SystemFontList.cxx +++ b/vcl/quartz/SystemFontList.cxx @@ -38,10 +38,13 @@ static bool checkFontTypeSupported(CTFontDescriptorRef pFD, CFStringRef pFamilyName) { - int nFormat; + int nFormat = kCTFontFormatUnrecognized; CFNumberRef pFormat = static_cast(CTFontDescriptorCopyAttribute(pFD, kCTFontFormatAttribute)); - CFNumberGetValue(pFormat, kCFNumberIntType, &nFormat); - CFRelease(pFormat); + if (pFormat) + { + CFNumberGetValue(pFormat, kCFNumberIntType, &nFormat); + CFRelease(pFormat); + } if (nFormat == kCTFontFormatPostScript) { @@ -52,8 +55,10 @@ static bool checkFontTypeSupported(CTFontDescriptorRef pFD, CFStringRef pFamilyN { CFDataRef pTable = CTFontCopyTable(pFont, kCTFontTableCFF, kCTFontTableOptionNoOptions); if (pTable) + { nFormat = kCTFontFormatOpenTypePostScript; - CFRelease(pTable); + CFRelease(pTable); + } } CFRelease(pFont); }