Index: src/effects/SkDiscretePathEffect.cpp |
diff --git a/src/effects/SkDiscretePathEffect.cpp b/src/effects/SkDiscretePathEffect.cpp |
index 5af6ab4ceb2962ca0a113f343afee9e8fedfb2dd..1c6039c842369b6ba4a614d776a5edbb8b2bf896 100644 |
--- a/src/effects/SkDiscretePathEffect.cpp |
+++ b/src/effects/SkDiscretePathEffect.cpp |
@@ -14,6 +14,12 @@ |
sk_sp<SkPathEffect> SkDiscretePathEffect::Make(SkScalar segLength, SkScalar deviation, |
uint32_t seedAssist) { |
+ if (!SkScalarIsFinite(segLength) || !SkScalarIsFinite(deviation)) { |
+ return nullptr; |
+ } |
+ if (segLength <= SK_ScalarNearlyZero) { |
+ return nullptr; |
+ } |
return sk_sp<SkPathEffect>(new SkDiscretePathEffect(segLength, deviation, seedAssist)); |
} |