summaryrefslogtreecommitdiff
path: root/layout/svg/nsCSSClipPathInstance.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-09-12 20:20:02 +0200
committerMoonchild <moonchild@palemoon.org>2020-09-12 20:20:02 +0200
commit9eb8b61b8c30255bd3be8c67031e5f14bc1ab8a5 (patch)
tree1252061e34708b421aee47560b405ac4f88c3a24 /layout/svg/nsCSSClipPathInstance.cpp
parentc779684b3b0ce46aa45ba0c9989f3fc86801cea5 (diff)
downloaduxp-9eb8b61b8c30255bd3be8c67031e5f14bc1ab8a5.tar.gz
Issue #1650 - Add null check.
There are situations where nsCSSClipPathinstance->CreateClipPath(dt) returns null. We need to check for this before trying to use its functions. If there is no clip path, then always return "no hit".
Diffstat (limited to 'layout/svg/nsCSSClipPathInstance.cpp')
-rw-r--r--layout/svg/nsCSSClipPathInstance.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/layout/svg/nsCSSClipPathInstance.cpp b/layout/svg/nsCSSClipPathInstance.cpp
index 01f7de248e..e923eaa0e7 100644
--- a/layout/svg/nsCSSClipPathInstance.cpp
+++ b/layout/svg/nsCSSClipPathInstance.cpp
@@ -59,7 +59,7 @@ nsCSSClipPathInstance::HitTestBasicShapeClip(nsIFrame* aFrame,
RefPtr<Path> path = instance.CreateClipPath(drawTarget);
float pixelRatio = float(nsPresContext::AppUnitsPerCSSPixel()) /
aFrame->PresContext()->AppUnitsPerDevPixel();
- return path->ContainsPoint(ToPoint(aPoint) * pixelRatio, Matrix());
+ return path ? path->ContainsPoint(ToPoint(aPoint) * pixelRatio, Matrix()) : false;
}
already_AddRefed<Path>