summaryrefslogtreecommitdiffstats
path: root/layout
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@wolfbeast.com>2019-04-03 19:51:52 +0200
committerGitHub <noreply@github.com>2019-04-03 19:51:52 +0200
commita04fdfd890ca64988b4fd43a30c284cb994e7ddc (patch)
tree5ad603af31162b324d76d6e510bbc5146c5a12ff /layout
parent352121c2a31c70cb1aa3effda88138ec94291464 (diff)
parent00baf283622b47ad7926c6e62364854d3dfbc00a (diff)
downloadUXP-a04fdfd890ca64988b4fd43a30c284cb994e7ddc.tar
UXP-a04fdfd890ca64988b4fd43a30c284cb994e7ddc.tar.gz
UXP-a04fdfd890ca64988b4fd43a30c284cb994e7ddc.tar.lz
UXP-a04fdfd890ca64988b4fd43a30c284cb994e7ddc.tar.xz
UXP-a04fdfd890ca64988b4fd43a30c284cb994e7ddc.zip
Merge pull request #1035 from kn-yami/bug1360343
Fix SVG mask crashes
Diffstat (limited to 'layout')
-rw-r--r--layout/svg/nsSVGMaskFrame.cpp3
-rw-r--r--layout/svg/nsSVGUtils.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/layout/svg/nsSVGMaskFrame.cpp b/layout/svg/nsSVGMaskFrame.cpp
index b8e4b32ae..a22833d61 100644
--- a/layout/svg/nsSVGMaskFrame.cpp
+++ b/layout/svg/nsSVGMaskFrame.cpp
@@ -274,7 +274,8 @@ nsSVGMaskFrame::GetMaskForMaskedFrame(gfxContext* aContext,
}
RefPtr<DataSourceSurface> maskSurface = maskSnapshot->GetDataSurface();
DataSourceSurface::MappedSurface map;
- if (!maskSurface->Map(DataSourceSurface::MapType::READ, &map)) {
+ if (!maskSurface ||
+ !maskSurface->Map(DataSourceSurface::MapType::READ, &map)) {
return nullptr;
}
diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp
index 0bded21ff..b8794a05d 100644
--- a/layout/svg/nsSVGUtils.cpp
+++ b/layout/svg/nsSVGUtils.cpp
@@ -685,7 +685,7 @@ nsSVGUtils::PaintFrameWithEffects(nsIFrame *aFrame,
bool isOK = effectProperties.HasNoFilterOrHasValidFilter();
nsSVGClipPathFrame *clipPathFrame = effectProperties.GetClipPathFrame(&isOK);
nsSVGMaskFrame *maskFrame = effectProperties.GetFirstMaskFrame(&isOK);
- if (!isOK) {
+ if (!isOK || !maskFrame) {
// Some resource is invalid. We shouldn't paint anything.
return DrawResult::SUCCESS;
}