Bug 1043929 - Unlock the mask texture in case of failure. r=Bas

This commit is contained in:
Nicolas Silva 2014-07-28 14:58:20 +02:00
parent 0701665f10
commit b0759630b1

View File

@ -147,12 +147,23 @@ CompositableHost::AddMaskEffect(EffectChain& aEffects,
{
RefPtr<TextureSource> source;
RefPtr<TextureHost> host = GetAsTextureHost();
if (host && host->Lock()) {
source = host->GetTextureSources();
if (!host) {
NS_WARNING("Using compositable with no valid TextureHost as mask");
return false;
}
if (!host->Lock()) {
NS_WARNING("Failed to lock the mask texture");
return false;
}
source = host->GetTextureSources();
MOZ_ASSERT(source);
if (!source) {
NS_WARNING("Using compositable with no texture host as mask layer");
NS_WARNING("The TextureHost was successfully locked but can't provide a TextureSource");
host->Unlock();
return false;
}