From c9b90d15df5fcee848812fbab3d714aba9e41e69 Mon Sep 17 00:00:00 2001 From: caryclark Date: Fri, 9 Sep 2016 07:41:36 -0700 Subject: 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 --- src/pathops/SkOpCoincidence.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') 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; -- cgit v1.2.3