Bug 1506495. Fallback to the system profile if we can't read the file for the profile. r=aosmond a=lizzard
authorJeff Muizelaar <jrmuizel@gmail.com>
Fri, 01 Feb 2019 14:10:22 -0500
changeset 515724 864ba4d0315680df488437a8c31a9c3de8040164
parent 515723 63b220f22addd222434d43e0ba0d46e263b58916
child 515725 9ab060b915fbe70bdf85fd48d783d80cc76b189c
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond, lizzard
bugs1506495
milestone66.0
Bug 1506495. Fallback to the system profile if we can't read the file for the profile. r=aosmond a=lizzard This is a better default than just assuming no profile.
gfx/thebes/gfxPlatform.cpp
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -2106,19 +2106,21 @@ void gfxPlatform::TransformPixel(const C
 void gfxPlatform::GetPlatformCMSOutputProfile(void*& mem, size_t& size) {
   mem = nullptr;
   size = 0;
 }
 
 void gfxPlatform::GetCMSOutputProfileData(void*& mem, size_t& size) {
   nsAutoCString fname;
   Preferences::GetCString("gfx.color_management.display_profile", fname);
+  mem = nullptr;
   if (!fname.IsEmpty()) {
     qcms_data_from_path(fname.get(), &mem, &size);
-  } else {
+  }
+  if (mem == nullptr) {
     gfxPlatform::GetPlatform()->GetPlatformCMSOutputProfile(mem, size);
   }
 }
 
 void gfxPlatform::CreateCMSOutputProfile() {
   if (!gCMSOutputProfile) {
     /* Determine if we're using the internal override to force sRGB as
        an output profile for reftests. See Bug 452125.