diff options
author | bungeman <bungeman@google.com> | 2015-04-29 14:35:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-29 14:35:50 -0700 |
commit | 6837b38a62a1621ff43c7e1085b1a3bd208fcd49 (patch) | |
tree | 293ff488091eac63f8c525bbeccf6de9cb3b5734 | |
parent | 9954bc38c498f6b9e9d8c0bcc5cd00d45bfc6e23 (diff) |
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
-rw-r--r-- | src/ports/SkFontMgr_fontconfig.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp index 58597d9395..f03e5acaf1 100644 --- a/src/ports/SkFontMgr_fontconfig.cpp +++ b/src/ports/SkFontMgr_fontconfig.cpp @@ -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; |