Bug 1145981 - Do not crash when a DIB texture is updated without a compositor. r=jrmuizel

This commit is contained in:
Nicolas Silva
2015-03-27 11:16:27 +01:00
parent c5b10c535a
commit 02da2bf4ee
2 changed files with 8 additions and 4 deletions

View File

@@ -145,6 +145,12 @@ DIBTextureHost::BindTextureSource(CompositableTextureSourceRef& aTexture)
void
DIBTextureHost::Updated(const nsIntRegion* aRegion)
{
if (!mCompositor) {
// This can happen if we send textures to a compositable that isn't yet
// attached to a layer.
return;
}
if (!mTextureSource) {
mTextureSource = mCompositor->CreateDataTextureSource(mFlags);
}