diff --git a/gfx/layers/d3d9/ImageLayerD3D9.cpp b/gfx/layers/d3d9/ImageLayerD3D9.cpp index bcb75008e9e0..94e8eefb3943 100644 --- a/gfx/layers/d3d9/ImageLayerD3D9.cpp +++ b/gfx/layers/d3d9/ImageLayerD3D9.cpp @@ -138,6 +138,12 @@ already_AddRefed ImageContainerD3D9::CreateImage(const Image::Format *aFormats, PRUint32 aNumFormats) { + if (mManager->GetBackendType() != GetBackendType()) { + // Whoops, we've got a valid layer manager but it's not the same type as us! + // Better to fail than crash. + return nsnull; + } + if (!aNumFormats) { return nsnull; }