fix fuzzer

turn asserts into error returns to fix fuzz

R=kjlubick@google.com
BUG=skia:6162

Change-Id: I7508eb5cb41425dcfc2718aaa9cc1ee8aa00acc9
Reviewed-on: https://skia-review.googlesource.com/9118
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
This commit is contained in:
Cary Clark 2017-03-01 14:02:02 -05:00 committed by Skia Commit-Bot
parent afb41033ef
commit 8af026ee0d

View File

@ -82,8 +82,12 @@ int SkIntersections::insert(double one, double two, const SkDPoint& pt) {
fIsCoincident[1] += fIsCoincident[1] & clearMask;
}
fPt[index] = pt;
SkASSERT(one >= 0 && one <= 1);
SkASSERT(two >= 0 && two <= 1);
if (one < 0 || one > 1) {
return -1;
}
if (two < 0 || two > 1) {
return -1;
}
fT[0][index] = one;
fT[1][index] = two;
++fUsed;