Check for NULL familyName in SkFontMgr_fontconfig.

If the familyName is NULL, don't bother spending time trying to add
it to the FcPattern.

Review URL: https://codereview.chromium.org/1115073002
This commit is contained in:
bungeman 2015-04-29 14:35:49 -07:00 committed by Commit bot
parent 9954bc38c4
commit 6837b38a62

View File

@ -771,10 +771,12 @@ protected:
FCLocker lock;
SkAutoFcPattern pattern;
FcValue familyNameValue;
familyNameValue.type = FcTypeString;
familyNameValue.u.s = reinterpret_cast<const FcChar8*>(familyName);
FcPatternAddWeak(pattern, FC_FAMILY, familyNameValue, FcFalse);
if (familyName) {
FcValue familyNameValue;
familyNameValue.type = FcTypeString;
familyNameValue.u.s = reinterpret_cast<const FcChar8*>(familyName);
FcPatternAddWeak(pattern, FC_FAMILY, familyNameValue, FcFalse);
}
fcpattern_from_skfontstyle(style, pattern);
SkAutoFcCharSet charSet;