From fae33ae252b0f1e90a79b356d9abd94b63295b5e Mon Sep 17 00:00:00 2001 From: Milan Sreckovic Date: Mon, 2 Feb 2015 17:18:29 -0500 Subject: [PATCH] Bug 1126918 - NewShSurfaceHandle can return null. Guard against it. r=jgilbert --- gfx/layers/client/CanvasClient.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gfx/layers/client/CanvasClient.cpp b/gfx/layers/client/CanvasClient.cpp index 6c6a3cb5d14b..9eb940a61b52 100644 --- a/gfx/layers/client/CanvasClient.cpp +++ b/gfx/layers/client/CanvasClient.cpp @@ -333,6 +333,9 @@ static TemporaryRef CloneSurface(gl::SharedSurface* src, gl::SurfaceFactory* factory) { RefPtr dest = factory->NewShSurfHandle(src->mSize); + if (!dest) { + return nullptr; + } SharedSurface::ProdCopy(src, dest->Surf(), factory); return dest.forget(); }