Bug 1083624 - Fix assertion failure in Factory::GetDirect3D10Device(). r=bas.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 16 Oct 2014 19:02:51 -0700
changeset 210840 cbf06fe7f47a049662b813109522b64198da7362
parent 210839 35da3c99e658095b737623ab8e543fb740f872a4
child 210841 83544b7dad714d493bb3a044a50a170e055185e0
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbas
bugs1083624
milestone36.0a1
Bug 1083624 - Fix assertion failure in Factory::GetDirect3D10Device(). r=bas.
gfx/2d/Factory.cpp
--- a/gfx/2d/Factory.cpp
+++ b/gfx/2d/Factory.cpp
@@ -543,21 +543,22 @@ Factory::SetDirect3D10Device(ID3D10Devic
   // On Windows 8 error codes are the default, but on Windows 7 the
   // default is to throw (or perhaps only with some drivers?)
   aDevice->SetExceptionMode(0);
   mD3D10Device = aDevice;
 }
 
 ID3D10Device1*
 Factory::GetDirect3D10Device()
-
 {
 #ifdef DEBUG
-  UINT mode = mD3D10Device->GetExceptionMode();
-  MOZ_ASSERT(0 == mode);
+  if (mD3D10Device) {
+    UINT mode = mD3D10Device->GetExceptionMode();
+    MOZ_ASSERT(0 == mode);
+  }
 #endif
   return mD3D10Device;
 }
 
 #ifdef USE_D2D1_1
 TemporaryRef<DrawTarget>
 Factory::CreateDrawTargetForD3D11Texture(ID3D11Texture2D *aTexture, SurfaceFormat aFormat)
 {