Bug 1305378 - Check texture is valid before creating a render target, r=mattwoodrow,mtseng
authorpeter chang <pchang@mozilla.com>
Fri, 30 Sep 2016 17:35:35 +0800
changeset 316641 800c4a33c285930094b42787ba6ab02a757347e8
parent 316640 c0817cce76da48fb6bfb3ff4111bed9f5de4603a
child 316642 690b07d2bc701ea389d6aabfa8231e58778bb9a4
push id30778
push usercbook@mozilla.com
push dateThu, 06 Oct 2016 09:56:14 +0000
treeherdermozilla-central@cc3ee8d499c5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, mtseng
bugs1305378
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1305378 - Check texture is valid before creating a render target, r=mattwoodrow,mtseng MozReview-Commit-ID: L4ruAMEDN9z
gfx/layers/d3d9/CompositorD3D9.cpp
--- 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)
 {