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 531313 9bfa9853d763b83aa4cbc63c8a5c50f991964d9e
parent 531312 d13804ab92d300ad22d7bcf9ba59943835732601
child 531314 de97e25e7c1b298f08a5d24708286f06d38fa5c3
push id37437
push usernerli@mozilla.com
push dateThu, 21 May 2020 02:34:41 +0000
treeherdermozilla-central@3d91ba9e1d25 [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";
     }