Bug 1464094 - follow-up - check that dlsym succeeded. r=me
authorLee Salzman <lsalzman@mozilla.com>
Fri, 01 Jun 2018 15:32:33 -0400
changeset 420942 6b0ad567bda49c8348e5ffbb1f8a5299e5015aa6
parent 420941 9c58416b4af610a00a9fb7b1344659afeb13ba60
child 420943 5b4895ad57fc37c84c59f08170a4fb380580afe8
push id34083
push userapavel@mozilla.com
push dateSat, 02 Jun 2018 23:03:25 +0000
treeherdermozilla-central@1f62ecdf59b6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1464094
milestone62.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 1464094 - follow-up - check that dlsym succeeded. r=me MozReview-Commit-ID: L6jOU6C9CHS
gfx/2d/ScaledFontFontconfig.cpp
--- a/gfx/2d/ScaledFontFontconfig.cpp
+++ b/gfx/2d/ScaledFontFontconfig.cpp
@@ -243,16 +243,20 @@ ScaledFontFontconfig::GetVariationSettin
   static bool firstTime = true;
   if (firstTime) {
     firstTime = false;
     getVar = (GetVarFunc)dlsym(RTLD_DEFAULT, "FT_Get_MM_Var");
     doneVar = (DoneVarFunc)dlsym(RTLD_DEFAULT, "FT_Done_MM_Var");
     getCoords = (GetVarDesignCoordsFunc)dlsym(RTLD_DEFAULT, "FT_Get_Var_Design_Coordinates");
   }
 
+  if (!getVar || !getCoords) {
+    return;
+  }
+
   cairo_scaled_font_t* sf = GetCairoScaledFont();
   FT_Face face = cairo_ft_scaled_font_lock_face(sf);
   if (face && face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS) {
     FT_MM_Var* mmVar;
     if ((*getVar)(face, &mmVar) == FT_Err_Ok) {
       aVariations->reserve(mmVar->num_axis);
       StackArray<FT_Fixed, 32> coords(mmVar->num_axis);
       if ((*getCoords)(face, mmVar->num_axis, coords.data()) == FT_Err_Ok) {