aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkOpSegment.cpp
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@google.com>2016-11-15 13:22:25 -0500
committerGravatar Cary Clark <caryclark@google.com>2016-11-15 19:03:36 +0000
commit918fb1fe6ff5349a2d1e5fb6872139f5fb931480 (patch)
tree3ee1a67b9d336959d885d6a4bb819e3bedc2d795 /src/pathops/SkOpSegment.cpp
parentfb191da789c988b6ed1502cc1c210be3f9c53b52 (diff)
fuzz hang fix and pathops client debugging
The ASAN fuzzer on chrome caught a hanging state. To capture the data, allow the pathops client debugging to run in a release build. TBR=reed@google.com BUG=665295 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4834 Change-Id: I6b2c2baabd63994f63aa730d2ee7828986b5ab89 Reviewed-on: https://skia-review.googlesource.com/4834 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
Diffstat (limited to 'src/pathops/SkOpSegment.cpp')
-rw-r--r--src/pathops/SkOpSegment.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pathops/SkOpSegment.cpp b/src/pathops/SkOpSegment.cpp
index f3f874710e..a1818d36cd 100644
--- a/src/pathops/SkOpSegment.cpp
+++ b/src/pathops/SkOpSegment.cpp
@@ -837,12 +837,19 @@ SkOpSpanBase* SkOpSegment::markAndChaseDone(SkOpSpanBase* start, SkOpSpanBase* e
markDone(minSpan);
SkOpSpanBase* last = nullptr;
SkOpSegment* other = this;
+ SkOpSpan* priorDone = nullptr;
+ SkOpSpan* lastDone = nullptr;
while ((other = other->nextChase(&start, &step, &minSpan, &last))) {
if (other->done()) {
SkASSERT(!last);
break;
}
+ if (lastDone == minSpan || priorDone == minSpan) {
+ return nullptr;
+ }
other->markDone(minSpan);
+ priorDone = lastDone;
+ lastDone = minSpan;
}
return last;
}