diff options
author | Cary Clark <caryclark@google.com> | 2017-03-01 14:02:02 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-01 19:43:07 +0000 |
commit | 8af026ee0d437fa0e07bdc362fcc778ef9e4da3e (patch) | |
tree | 320fd685575853631b9f8e0100ccd914b3f9eadb /src/pathops/SkIntersections.cpp | |
parent | afb41033efae3f5c71cac8c6127236efab613125 (diff) |
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>
Diffstat (limited to 'src/pathops/SkIntersections.cpp')
-rw-r--r-- | src/pathops/SkIntersections.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pathops/SkIntersections.cpp b/src/pathops/SkIntersections.cpp index 79206c34ef..f17e5dbc38 100644 --- a/src/pathops/SkIntersections.cpp +++ b/src/pathops/SkIntersections.cpp @@ -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; |