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 <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Greg Daniel 2018-04-03 11:27:50 -04:00 committed by Skia Commit-Bot
parent ea49523b5f
commit ba31640427

View File

@ -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);