Bug 1186875 - check if FcFontSort returns non-null. r=jtd

This commit is contained in:
Lee Salzman 2015-07-31 14:37:19 -04:00
Родитель 52ee71547c
Коммит 20e9dbbf1a
1 изменённых файлов: 4 добавлений и 0 удалений

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

@ -1410,6 +1410,10 @@ gfxFcPlatformFontList::FindGenericFamily(const nsAString& aGeneric,
nsAutoRef<FcFontSet> faces(FcFontSort(nullptr, genericPattern, FcFalse,
nullptr, &result));
if (!faces) {
return nullptr;
}
// -- pick the first font for which a font family exists
for (int i = 0; i < faces->nfont; i++) {
FcPattern* font = faces->fonts[i];