Bug 1408078 - Add missing null-checks in MacOSFontEntry::SupportsOpenTypeFeature. r=jrmuizel

This commit is contained in:
Jonathan Kew 2017-10-12 18:43:58 +01:00
Родитель ed36a3172e
Коммит 0028134967
1 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -692,10 +692,14 @@ MacOSFontEntry::SupportsOpenTypeFeature(Script aScript, uint32_t aFeatureTag)
mHasAATSmallCapsInitialized = true;
CTFontRef ctFont =
CTFontCreateWithGraphicsFont(mFontRef, 0.0, nullptr, nullptr);
CFArrayRef features = CTFontCopyFeatures(ctFont);
CFRelease(ctFont);
mHasAATSmallCaps = CheckForAATSmallCaps(features);
CFRelease(features);
if (ctFont) {
CFArrayRef features = CTFontCopyFeatures(ctFont);
CFRelease(ctFont);
if (features) {
mHasAATSmallCaps = CheckForAATSmallCaps(features);
CFRelease(features);
}
}
return mHasAATSmallCaps;
}
return gfxFontEntry::SupportsOpenTypeFeature(aScript, aFeatureTag);