Bug 1638331 - Expand the conditions for crashing in GetDWriteSystemFonts. r=jfkthame
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Fri, 15 May 2020 17:00:03 +0000
changeset 531330 9bfa9853d763b83aa4cbc63c8a5c50f991964d9e
parent 531329 d13804ab92d300ad22d7bcf9ba59943835732601
child 531331 de97e25e7c1b298f08a5d24708286f06d38fa5c3
push id116583
push userjmuizelaar@mozilla.com
push dateWed, 20 May 2020 20:04:42 +0000
treeherderautoland@9bfa9853d763 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1638331
milestone78.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 1638331 - Expand the conditions for crashing in GetDWriteSystemFonts. r=jfkthame We're not seeing any crashes so let's look for a null systemFonts as well. Differential Revision: https://phabricator.services.mozilla.com/D75546
gfx/2d/Factory.cpp
--- a/gfx/2d/Factory.cpp
+++ b/gfx/2d/Factory.cpp
@@ -928,17 +928,17 @@ RefPtr<IDWriteFontCollection> Factory::G
 
   if (!mDWriteFactory) {
     return nullptr;
   }
 
   RefPtr<IDWriteFontCollection> systemFonts;
   HRESULT hr =
       mDWriteFactory->GetSystemFontCollection(getter_AddRefs(systemFonts));
-  if (FAILED(hr)) {
+  if (FAILED(hr) || !systemFonts) {
     // only crash some of the time so those experiencing this problem
     // don't stop using Firefox
     if ((rand() & 0x3f) == 0) {
       gfxCriticalError(int(gfx::LogOptions::AssertOnCall))
           << "Failed to create DWrite system font collection";
     } else {
       gfxWarning() << "Failed to create DWrite system font collection";
     }