From 0c2bcce99642eae5f4f91940a78321f972c5976d Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Thu, 10 May 2018 10:51:04 -0400 Subject: [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 Commit-Queue: Florin Malita --- experimental/skottie/SkottieAdapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'experimental') 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 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), -- cgit v1.2.3