Bug 1126918 - NewShSurfaceHandle can return null. Guard against it. r=jgilbert, a=sledru
authorMilan Sreckovic <milan@mozilla.com>
Mon, 02 Feb 2015 17:18:29 -0500
changeset 245414 89cfa8ff9fc5
parent 245413 521cf86d194b
child 245415 2f2abd6ffebb
child 245416 47ec64cc562f
push id661
push userryanvm@gmail.com
push date2015-02-19 21:33 +0000
treeherdermozilla-release@2f2abd6ffebb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert, sledru
bugs1126918
milestone36.0
Bug 1126918 - NewShSurfaceHandle can return null. Guard against it. r=jgilbert, a=sledru CLOSED TREE
gfx/layers/client/CanvasClient.cpp
--- a/gfx/layers/client/CanvasClient.cpp
+++ b/gfx/layers/client/CanvasClient.cpp
@@ -326,16 +326,19 @@ TexClientFromReadback(SharedSurface* src
 }
 
 ////////////////////////////////////////
 
 static TemporaryRef<gl::ShSurfHandle>
 CloneSurface(gl::SharedSurface* src, gl::SurfaceFactory* factory)
 {
     RefPtr<gl::ShSurfHandle> dest = factory->NewShSurfHandle(src->mSize);
+    if (!dest) {
+        return nullptr;
+    }
     SharedSurface::ProdCopy(src, dest->Surf(), factory);
     return dest.forget();
 }
 
 void
 CanvasClientSharedSurface::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
 {
   if (mFront) {