fix path measure fuzzes

these fixes suppress debug asserts
when the fuzzer is run

R=reed@google.com,kjlubick@google.com

Bug: skia:
Change-Id: I7b8c16fe475056213314ecb588a4368b547836b0
Reviewed-on: https://skia-review.googlesource.com/137363
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
This commit is contained in:
Cary Clark 2018-06-25 10:06:03 -04:00 committed by Skia Commit-Bot
parent 0ea256c4db
commit 86d87d2e69

View File

@ -265,7 +265,7 @@ SkScalar SkPathMeasure::compute_conic_segs(const SkConic& conic, SkScalar distan
int halft = (mint + maxt) >> 1;
SkPoint halfPt = conic.evalAt(tValue2Scalar(halft));
if (!halfPt.isFinite()) {
return 0;
return distance;
}
if (tspan_big_enough(maxt - mint) && conic_too_curvy(minPt, halfPt, maxPt)) {
distance = this->compute_conic_segs(conic, distance, mint, minPt, halft, halfPt, ptIndex);
@ -620,6 +620,9 @@ bool SkPathMeasure::getPosTan(SkScalar distance, SkPoint* pos, SkVector* tangent
SkScalar t;
const Segment* seg = this->distanceToSegment(distance, &t);
if (SkScalarIsNaN(t)) {
return false;
}
compute_pos_tan(&fPts[seg->fPtIndex], seg->fType, t, pos, tangent);
return true;