aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2016-04-02 18:40:40 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-02 18:40:40 -0700
commit18c00976bd62938fa13bc9d490ac8fd39b769f6d (patch)
treed9bc6f55159bacdb130f89ce49dec9579c54ba62 /src/effects
parent6db0a7bdceb6be85721bfb0db8dea7fd27db5970 (diff)
check for bad params sent to discrete patheffect
Diffstat (limited to 'src/effects')
-rw-r--r--src/effects/SkDiscretePathEffect.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/effects/SkDiscretePathEffect.cpp b/src/effects/SkDiscretePathEffect.cpp
index 5af6ab4ceb..1c6039c842 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));
}