Index: src/effects/gradients/SkGradientShader.cpp |
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp |
index 52fbe81daf454925cefdf472c07b04a5ee81efb9..7ff97b343bdcfe35edc2f8c88170d7c174669cf3 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)) { |