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 340507 7d32fc01323516a87123b7d71afe07bae469968d
parent 340506 3e11e42465cccc18b08a71b9968dfa97af042568
child 340508 637b73dad0ae2f0232deaf39ff674d6174dc506c
push id10124
push userkwierso@gmail.com
push dateMon, 10 Oct 2016 21:14:21 +0000
treeherdermozilla-aurora@6031d730c46a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, mtseng, ritu
bugs1305378
milestone51.0a2
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)
 {