Bug 1305378 - Check texture is valid before creating a render target, r=mattwoodrow,mtseng a=ritu
authorpeter chang <pchang@mozilla.com>
Fri, 30 Sep 2016 17:35:35 +0800
changeset 350623 9c7f589a8f74bc57fe02a85abb4bd5aa352af129
parent 350622 6b1a3f769aa6d826bd404750e7af66702ff01214
child 350624 c8c31aad61a18cbb9cdb589ef5118da8bab0e3af
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, mtseng, ritu
bugs1305378
milestone50.0
Bug 1305378 - Check texture is valid before creating a render target, r=mattwoodrow,mtseng a=ritu MozReview-Commit-ID: L4ruAMEDN9z
gfx/layers/d3d9/CompositorD3D9.cpp
--- a/gfx/layers/d3d9/CompositorD3D9.cpp
+++ b/gfx/layers/d3d9/CompositorD3D9.cpp
@@ -192,16 +192,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)
 {