aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2018-05-10 10:51:04 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-10 15:27:45 +0000
commit0c2bcce99642eae5f4f91940a78321f972c5976d (patch)
treedfc082af172bfc599fb149f71bcc0cea5ea519db /experimental
parent2d46a009266150dcdf1c9dda32c0ba0c79248979 (diff)
[skottie] Allow divide-by-zero in PolyStarAdapter::apply
This is safe because count == 0 will produce an empty path. Bug: oss-fuzz:8213 Change-Id: Ie3b546c614ba22eef1ba16a182016c2edd0bd641 Reviewed-on: https://skia-review.googlesource.com/127323 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'experimental')
-rw-r--r--experimental/skottie/SkottieAdapter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/experimental/skottie/SkottieAdapter.cpp b/experimental/skottie/SkottieAdapter.cpp
index 5186e2c2f8..7ce2f978a4 100644
--- a/experimental/skottie/SkottieAdapter.cpp
+++ b/experimental/skottie/SkottieAdapter.cpp
@@ -54,7 +54,7 @@ PolyStarAdapter::PolyStarAdapter(sk_sp<sksg::Path> wrapped_node, Type t)
void PolyStarAdapter::apply() {
const auto count = SkScalarTruncToInt(fPointCount);
- const auto arc = SK_ScalarPI * 2 / count;
+ const auto arc = sk_ieee_float_divide(SK_ScalarPI * 2, count);
const auto pt_on_circle = [](const SkPoint& c, SkScalar r, SkScalar a) {
return SkPoint::Make(c.x() + r * std::cos(a),