Bug 974356 - 3/4 - Make TextureHost::CreateIPDLActor check for bad MemoryTextures - r=nical
authorBenoit Jacob <bjacob@mozilla.com>
Tue, 25 Feb 2014 08:12:49 -0500
changeset 170700 20c507b7615ec2d1a812880ca14c400b3a28da82
parent 170699 b4a5fe646f2730adac0d57778cff3401a25ca087
child 170701 321b2a16f0d742cc59d25f082446ef4e7456079d
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersnical
bugs974356
milestone30.0a1
Bug 974356 - 3/4 - Make TextureHost::CreateIPDLActor check for bad MemoryTextures - r=nical
gfx/layers/composite/TextureHost.cpp
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -56,16 +56,22 @@ public:
 };
 
 // static
 PTextureParent*
 TextureHost::CreateIPDLActor(ISurfaceAllocator* aAllocator,
                              const SurfaceDescriptor& aSharedData,
                              TextureFlags aFlags)
 {
+  if (aSharedData.type() == SurfaceDescriptor::TSurfaceDescriptorMemory &&
+      !aAllocator->IsSameProcess())
+  {
+    NS_ERROR("A client process is trying to peek at our address space using a MemoryTexture!");
+    return nullptr;
+  }
   TextureParent* actor = new TextureParent(aAllocator);
   DebugOnly<bool> status = actor->Init(aSharedData, aFlags);
   MOZ_ASSERT(status);
   return actor;
 }
 
 // static
 bool