Bug 1186875 - check if FcFontSort returns non-null. r=jtd
authorLee Salzman <lsalzman@mozilla.com>
Fri, 31 Jul 2015 14:37:19 -0400
changeset 287524 67ee7f75059ed7f68cf457507b4981089dae5fe1
parent 287523 6bf7a4af01c21ae3040913bc4e4f62afb1646759
child 287525 e057fc16e2e0e61c8d352598aa87a31ec6fc4252
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjtd
bugs1186875
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1186875 - check if FcFontSort returns non-null. r=jtd
gfx/thebes/gfxFcPlatformFontList.cpp
--- a/gfx/thebes/gfxFcPlatformFontList.cpp
+++ b/gfx/thebes/gfxFcPlatformFontList.cpp
@@ -1405,16 +1405,20 @@ gfxFcPlatformFontList::FindGenericFamily
     FcConfigSubstitute(nullptr, genericPattern, FcMatchPattern);
     FcDefaultSubstitute(genericPattern);
 
     // -- sort to get the closest matches
     FcResult result;
     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];
         FcChar8* mappedGeneric = nullptr;
 
         // not scalable? skip...
         FcBool scalable;
         if (FcPatternGetBool(font, FC_SCALABLE, 0, &scalable) != FcResultMatch ||