From ba31640427659ea2c096be1a26976e34348619cf Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Tue, 3 Apr 2018 11:27:50 -0400 Subject: [PATCH] Allow for divide by zero in miter calculation in GrAAConvexTessellator Bug: skia:7769, oss-fuzz:7302 Change-Id: Id5c70a3be5525ed6b414d7e03d7e94183835f8e3 Reviewed-on: https://skia-review.googlesource.com/118167 Reviewed-by: Brian Salomon Commit-Queue: Greg Daniel --- src/gpu/ops/GrAAConvexTessellator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gpu/ops/GrAAConvexTessellator.cpp b/src/gpu/ops/GrAAConvexTessellator.cpp index 9927d98b11..f72142eda8 100644 --- a/src/gpu/ops/GrAAConvexTessellator.cpp +++ b/src/gpu/ops/GrAAConvexTessellator.cpp @@ -572,7 +572,7 @@ void GrAAConvexTessellator::createOuterRing(const Ring& previousRing, SkScalar o SkPoint miter = previousRing.bisector(cur); SkScalar dotProd = normal1.dot(normal2); SkScalar sinHalfAngleSq = SkScalarHalf(SK_Scalar1 + dotProd); - SkScalar lengthSq = outsetSq / sinHalfAngleSq; + SkScalar lengthSq = sk_ieee_float_divide(outsetSq, sinHalfAngleSq); if (lengthSq > miterLimitSq) { // just bevel it this->addTri(originalIdx, perp1Idx, perp2Idx);