diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-04-06 22:12:00 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-04-06 22:12:00 +0200 |
commit | 964c9830fa956249e5f3f3e30bf5d2d307ca3572 (patch) | |
tree | 4440ac163261ee1d41f252c42f299c7488d41f53 /layout/svg/nsSVGUtils.cpp | |
parent | 81cdb56fa3e232a232745a76effeda8f407b6f65 (diff) | |
download | UXP-964c9830fa956249e5f3f3e30bf5d2d307ca3572.tar UXP-964c9830fa956249e5f3f3e30bf5d2d307ca3572.tar.gz UXP-964c9830fa956249e5f3f3e30bf5d2d307ca3572.tar.lz UXP-964c9830fa956249e5f3f3e30bf5d2d307ca3572.tar.xz UXP-964c9830fa956249e5f3f3e30bf5d2d307ca3572.zip |
Add nullcheck in nsSVGUtils::PaintFrameWithEffects
Some SVGs define a mask but an invalid mask frame. Check to make sure
we have a `maskFrame` that isn't null before trying to use it.
This resolves #1034
Diffstat (limited to 'layout/svg/nsSVGUtils.cpp')
-rw-r--r-- | layout/svg/nsSVGUtils.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp index 0bded21ff..98e5f9b5f 100644 --- a/layout/svg/nsSVGUtils.cpp +++ b/layout/svg/nsSVGUtils.cpp @@ -734,9 +734,12 @@ nsSVGUtils::PaintFrameWithEffects(nsIFrame *aFrame, RefPtr<SourceSurface> maskSurface; if (maskUsage.shouldGenerateMaskLayer) { - maskSurface = - maskFrame->GetMaskForMaskedFrame(&aContext, aFrame, aTransform, - maskUsage.opacity, &maskTransform); + // Make sure we have a mask frame. + if (maskFrame) { + maskSurface = + maskFrame->GetMaskForMaskedFrame(&aContext, aFrame, aTransform, + maskUsage.opacity, &maskTransform); + } if (!maskSurface) { // Entire surface is clipped out. |