Bug 952721 - Don't crash if our surface allocation fails in TiledContentClient. r=Bas, a=sledru
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 02 May 2014 14:28:52 +1200
changeset 192207 0a9afc76690c
parent 192206 f15b4b99adc4
child 192208 c0f1a5d2645b
push id3524
push userryanvm@gmail.com
push date2014-05-06 13:39 +0000
Treeherderresults
reviewersBas, sledru
bugs952721
milestone30.0
Bug 952721 - Don't crash if our surface allocation fails in TiledContentClient. r=Bas, a=sledru
gfx/layers/client/TiledContentClient.cpp
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -659,16 +659,20 @@ ClientTiledLayerBuffer::PaintThebes(cons
           GetContentType());
 
       mSinglePaintDrawTarget =
         gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
           gfx::IntSize(ceilf(bounds.width * mResolution),
                        ceilf(bounds.height * mResolution)),
           gfx::ImageFormatToSurfaceFormat(format));
 
+      if (!mSinglePaintDrawTarget) {
+        return;
+      }
+
       ctxt = new gfxContext(mSinglePaintDrawTarget);
 
       mSinglePaintBufferOffset = nsIntPoint(bounds.x, bounds.y);
     }
     ctxt->NewPath();
     ctxt->Scale(mResolution, mResolution);
     ctxt->Translate(gfxPoint(-bounds.x, -bounds.y));
 #ifdef GFX_TILEDLAYER_PREF_WARNINGS