allow divide-by-zero in conics

Bug: oss-fuzz:6633
Change-Id: Id4cf78d208735d51cc85f78225b7f31619cbd397
Reviewed-on: https://skia-review.googlesource.com/130026
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This commit is contained in:
Mike Reed 2018-05-24 14:12:47 -04:00 committed by Skia Commit-Bot
parent 7d8276cbab
commit 5a5e08495e

View File

@ -1331,7 +1331,7 @@ SkScalar SkConic::TransformW(const SkPoint pts[], SkScalar w, const SkMatrix& ma
double w0 = dst[0].fZ;
double w1 = dst[1].fZ;
double w2 = dst[2].fZ;
return sk_double_to_float(sqrt((w1 * w1) / (w0 * w2)));
return sk_double_to_float(sqrt(sk_ieee_double_divide(w1 * w1, w0 * w2)));
}
int SkConic::BuildUnitArc(const SkVector& uStart, const SkVector& uStop, SkRotationDirection dir,