Bug 999736 - Add a null check in ContentHostTexture::Lock. r=bjacob
authorNicolas Silva <nical@mozilla.com>
Wed, 23 Apr 2014 14:19:29 +0200
changeset 180110 3d11450e02cbf94ae316902850d74191130ba65f
parent 180109 16d11bb0d2fc122aa81960f740ced37d90364411
child 180111 412bc4b9dd921e3fcf18127d00e43d4d5595557e
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersbjacob
bugs999736
milestone31.0a1
Bug 999736 - Add a null check in ContentHostTexture::Lock. r=bjacob
gfx/layers/composite/ContentHost.h
--- a/gfx/layers/composite/ContentHost.h
+++ b/gfx/layers/composite/ContentHost.h
@@ -147,16 +147,19 @@ public:
   virtual void PrintInfo(nsACString& aTo, const char* aPrefix) MOZ_OVERRIDE;
 
   virtual void UseTextureHost(TextureHost* aTexture) MOZ_OVERRIDE;
   virtual void UseComponentAlphaTextures(TextureHost* aTextureOnBlack,
                                          TextureHost* aTextureOnWhite) MOZ_OVERRIDE;
 
   virtual bool Lock() {
     MOZ_ASSERT(!mLocked);
+    if (!mTextureHost) {
+      return false;
+    }
     if (!mTextureHost->Lock()) {
       return false;
     }
 
     if (mTextureHostOnWhite && !mTextureHostOnWhite->Lock()) {
       return false;
     }