From: reed Date: Sun, 3 Apr 2016 01:40:40 +0000 (-0700) Subject: check for bad params sent to discrete patheffect X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~129^2~1165 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18c00976bd62938fa13bc9d490ac8fd39b769f6d;p=platform%2Fupstream%2FlibSkiaSharp.git check for bad params sent to discrete patheffect BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1853953002 TBR= Review URL: https://codereview.chromium.org/1853953002 --- diff --git a/src/effects/SkDiscretePathEffect.cpp b/src/effects/SkDiscretePathEffect.cpp index 5af6ab4..1c6039c 100644 --- a/src/effects/SkDiscretePathEffect.cpp +++ b/src/effects/SkDiscretePathEffect.cpp @@ -14,6 +14,12 @@ sk_sp 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(new SkDiscretePathEffect(segLength, deviation, seedAssist)); }