diff options
author | 2016-09-09 07:41:36 -0700 | |
---|---|---|
committer | 2016-09-09 07:41:36 -0700 | |
commit | c9b90d15df5fcee848812fbab3d714aba9e41e69 (patch) | |
tree | 8340b73517593e8159c819bb3520789011c7db76 /src | |
parent | a42405aa522cd33292b9817da460e9f29e00a201 (diff) |
fix fuzzer
Earlier fix aborted coincident loop on wrong condition.
This aborts only when it reaches the end, and then
propagates the error out correctly.
TBR=reed@google.com
BUG=644680, 644684
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2327053002
Review-Url: https://codereview.chromium.org/2327053002
Diffstat (limited to 'src')
-rwxr-xr-x | src/pathops/SkOpCoincidence.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/pathops/SkOpCoincidence.cpp b/src/pathops/SkOpCoincidence.cpp index 0548ed5a05..b0cb243700 100755 --- a/src/pathops/SkOpCoincidence.cpp +++ b/src/pathops/SkOpCoincidence.cpp @@ -551,8 +551,8 @@ double SkOpCoincidence::TRange(const SkOpPtT* overS, double t, do { const SkOpPtT* contained = work->contains(coinSeg); if (!contained) { - if (work->t() >= t) { - return 1; + if (work->final()) { + break; } continue; } @@ -567,8 +567,9 @@ double SkOpCoincidence::TRange(const SkOpPtT* overS, double t, } SkASSERT(work->ptT() != overE); } while ((work = work->upCast()->next())); - SkASSERT(coinStart); - SkASSERT(coinEnd); + if (!coinStart || !coinEnd) { + return 1; + } // while overS->fT <=t and overS contains coinSeg double denom = foundEnd->fT - foundStart->fT; double sRatio = denom ? (t - foundStart->fT) / denom : 1; |