fix fuzz divide by zero

R=kjlubick@google.com

Bug: skia:10985
Change-Id: I68fdb03e9d3cd6d7826b0d4fb16d181f7f648699
Reviewed-on: https://skia-review.googlesource.com/c/164685
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This commit is contained in:
Cary Clark 2018-10-24 08:34:24 -04:00 committed by Skia Commit-Bot
parent 31abc5a4ee
commit db018dbcb9

View File

@ -637,9 +637,9 @@ bool SkOpAngle::endToSide(const SkOpAngle* rh, bool* inside) const {
maxY = SkTMax(maxY, curve[idx2].fY);
}
double maxWidth = SkTMax(maxX - minX, maxY - minY);
endDist /= maxWidth;
if (endDist < 5e-12) { // empirically found
return false;
endDist = sk_ieee_double_divide(endDist, maxWidth);
if (!(endDist >= 5e-12)) { // empirically found
return false; // ! above catches NaN
}
const SkDPoint* endPt = &rayEnd[0];
SkDPoint oppPt = iEnd.pt(closestEnd);