aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/gradients
diff options
context:
space:
mode:
Diffstat (limited to 'src/effects/gradients')
-rw-r--r--src/effects/gradients/SkGradientShader.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 710bde826e..820c5b225d 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -790,7 +790,7 @@ sk_sp<SkShader> SkGradientShader::MakeLinear(const SkPoint pts[2],
SkShader::TileMode mode,
uint32_t flags,
const SkMatrix* localMatrix) {
- if (!pts) {
+ if (!pts || !SkScalarIsFinite((pts[1] - pts[0]).length())) {
return nullptr;
}
if (!valid_grad(colors, pos, colorCount, mode)) {