diff --git a/gfx/layers/composite/ContainerLayerComposite.cpp b/gfx/layers/composite/ContainerLayerComposite.cpp index 555d3907abde..9e1b172cdedf 100644 --- a/gfx/layers/composite/ContainerLayerComposite.cpp +++ b/gfx/layers/composite/ContainerLayerComposite.cpp @@ -530,6 +530,10 @@ ContainerRender(ContainerT* aContainer, LayerManagerComposite::AutoAddMaskEffect autoMaskEffect(aContainer->GetMaskLayer(), effectChain, !aContainer->GetTransform().CanDraw2D()); + if (autoMaskEffect.Failed()) { + NS_WARNING("Failed to apply a mask effect."); + return; + } aContainer->AddBlendModeEffect(effectChain); effectChain.mPrimaryEffect = new EffectRenderTarget(surface); diff --git a/gfx/layers/composite/LayerManagerComposite.h b/gfx/layers/composite/LayerManagerComposite.h index d5183186e55c..3955ec36214e 100644 --- a/gfx/layers/composite/LayerManagerComposite.h +++ b/gfx/layers/composite/LayerManagerComposite.h @@ -184,6 +184,7 @@ public: bool aIs3D = false); ~AutoAddMaskEffect(); + bool Failed() const { return !mCompositable; } private: CompositableHost* mCompositable; };