From f3bdf1fc39fb779790325304c4e705db59dceb8f Mon Sep 17 00:00:00 2001 From: Sotaro Ikeda Date: Thu, 22 May 2014 06:17:03 -0700 Subject: [PATCH] Bug 1012737 - Add erro check to GrallocTextureClientOGL::GetAsDrawTarget() r=nical --- gfx/layers/opengl/GrallocTextureClient.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gfx/layers/opengl/GrallocTextureClient.cpp b/gfx/layers/opengl/GrallocTextureClient.cpp index 50be454947fa..9519677c1544 100644 --- a/gfx/layers/opengl/GrallocTextureClient.cpp +++ b/gfx/layers/opengl/GrallocTextureClient.cpp @@ -171,6 +171,10 @@ GrallocTextureClientOGL::GetAsDrawTarget() MOZ_ASSERT(IsValid()); MOZ_ASSERT(mMappedBuffer, "Calling TextureClient::GetAsDrawTarget without locking :("); + if (!IsValid() || !IsAllocated()) { + return nullptr; + } + if (mDrawTarget) { return mDrawTarget; }