Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Unified Diff: src/ports/SkFontMgr_fontconfig.cpp

Issue 1115073002: Check for NULL familyName in SkFontMgr_fontconfig. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontMgr_fontconfig.cpp
diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp
index 58597d93952bcc07a630c1c9a8a85f1445df13bc..f03e5acaf1382d50fc6ababd4d682f7cabacd632 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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698