Bug 952721 - Don't crash if our surface allocation fails in TiledContentClient. r=Bas
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 02 May 2014 14:28:52 +1200
changeset 181705 29349a95578077deee641c47597159d181ea292b
parent 181704 875dfb1e2b88fcefeaf0657a2e932f452f99f2e2
child 181706 660cc013d558742a47c47d2f8ef596fc38820aab
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersBas
bugs952721
milestone32.0a1
Bug 952721 - Don't crash if our surface allocation fails in TiledContentClient. r=Bas
gfx/layers/client/TiledContentClient.cpp
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -660,16 +660,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