Bug 1156058 - Null pointer check. r=jgilbert

--HG--
extra : rebase_source : a54cee6a3ce6c8fd64cbfacd86fb470de738ee52
This commit is contained in:
Milan Sreckovic 2015-04-24 11:21:26 -07:00
parent cca934f12e
commit 698d695b89

View File

@ -356,10 +356,11 @@ CanvasClientSharedSurface::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
mFront->Surf()->Fence(); mFront->Surf()->Fence();
} else { } else {
mFront = gl->Screen()->Front(); mFront = gl->Screen()->Front();
if (!mFront)
return;
} }
MOZ_ASSERT(mFront); if (!mFront) {
gfxCriticalError() << "Invalid canvas front buffer";
return;
}
// Alright, now sort out the IPC goop. // Alright, now sort out the IPC goop.
SharedSurface* surf = mFront->Surf(); SharedSurface* surf = mFront->Surf();
@ -375,7 +376,7 @@ CanvasClientSharedSurface::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
newTex = TexClientFromReadback(surf, forwarder, flags, layersBackend); newTex = TexClientFromReadback(surf, forwarder, flags, layersBackend);
} }
MOZ_ASSERT(newTex);
if (!newTex) { if (!newTex) {
// May happen in a release build in case of memory pressure. // May happen in a release build in case of memory pressure.
gfxCriticalError() << "Failed to allocate a TextureClient for SharedSurface Canvas. size: " << aSize; gfxCriticalError() << "Failed to allocate a TextureClient for SharedSurface Canvas. size: " << aSize;