Bug 1357307 - Make sure gfxPrefs instance is created before accessing it. r=milan

This commit is contained in:
vincentliu 2017-04-24 14:10:17 +08:00
parent fd0681d297
commit 31140c21b1

View File

@ -19,6 +19,7 @@
#include "mozilla/widget/WidgetMessageUtils.h"
#include "gfxPlatform.h"
#include "gfxPrefs.h"
#include "qcms.h"
#ifdef DEBUG
@ -820,6 +821,8 @@ nsXPLookAndFeel::GetColorImpl(ColorID aID, bool aUseStandinsForNativeColors,
}
if (sUseNativeColors && NS_SUCCEEDED(NativeGetColor(aID, aResult))) {
MOZ_ASSERT(NS_IsMainThread());
gfxPrefs::GetSingleton();
if ((gfxPlatform::GetCMSMode() == eCMSMode_All) &&
!IsSpecialColor(aID, aResult)) {
qcms_transform *transform = gfxPlatform::GetCMSInverseRGBTransform();