Bug 1305378 - Check texture is valid before creating a render target, r?mtseng
MozReview-Commit-ID: L4ruAMEDN9z
--- a/gfx/layers/d3d9/CompositorD3D9.cpp
+++ b/gfx/layers/d3d9/CompositorD3D9.cpp
@@ -193,16 +193,20 @@ CompositorD3D9::CreateTexture(const gfx:
already_AddRefed<CompositingRenderTarget>
CompositorD3D9::CreateRenderTargetFromSource(const gfx::IntRect &aRect,
const CompositingRenderTarget *aSource,
const gfx::IntPoint &aSourcePoint)
{
RefPtr<IDirect3DTexture9> texture = CreateTexture(aRect, aSource, aSourcePoint);
+ if (!texture) {
+ return nullptr;
+ }
+
return MakeAndAddRef<CompositingRenderTargetD3D9>(texture,
INIT_MODE_NONE,
aRect);
}
void
CompositorD3D9::SetRenderTarget(CompositingRenderTarget *aRenderTarget)
{