From 9eb8b61b8c30255bd3be8c67031e5f14bc1ab8a5 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sat, 12 Sep 2020 20:20:02 +0200 Subject: 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". --- layout/svg/nsCSSClipPathInstance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/svg/nsCSSClipPathInstance.cpp b/layout/svg/nsCSSClipPathInstance.cpp index 01f7de248..e923eaa0e 100644 --- a/layout/svg/nsCSSClipPathInstance.cpp +++ b/layout/svg/nsCSSClipPathInstance.cpp @@ -59,7 +59,7 @@ nsCSSClipPathInstance::HitTestBasicShapeClip(nsIFrame* aFrame, RefPtr 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 -- cgit v1.2.3