aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@google.com>2018-06-29 09:49:02 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-29 15:25:27 +0000
commitc91fe3ab1c5dd109e436768f848dda6814755ae6 (patch)
tree50cb3224dc6bfbb90766cb5257c379dc2eacfeed /src/pathops
parent4e85e80a5a32f11b850830f7bf6ee45ca195d137 (diff)
fix fuzzer found timeout
curiously, test case ran fine with skia's fuzzer, but hung with ubsan chrome fuzzer. R=kjlubick@google.com Bug:858985 Change-Id: Ie747ba9b902a25e59330a084fbdd5246d9de4920 Reviewed-on: https://skia-review.googlesource.com/138520 Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'src/pathops')
-rw-r--r--src/pathops/SkPathOpsSimplify.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pathops/SkPathOpsSimplify.cpp b/src/pathops/SkPathOpsSimplify.cpp
index bfb3b8d7c1..70f730bf21 100644
--- a/src/pathops/SkPathOpsSimplify.cpp
+++ b/src/pathops/SkPathOpsSimplify.cpp
@@ -88,6 +88,7 @@ static bool bridgeWinding(SkOpContourHead* contourList, SkPathWriter* simple) {
// returns true if all edges were processed
static bool bridgeXor(SkOpContourHead* contourList, SkPathWriter* simple) {
bool unsortable = false;
+ int safetyNet = 1000000;
do {
SkOpSpan* span = FindUndone(contourList);
if (!span) {
@@ -97,6 +98,9 @@ static bool bridgeXor(SkOpContourHead* contourList, SkPathWriter* simple) {
SkOpSpanBase* start = span->next();
SkOpSpanBase* end = span;
do {
+ if (--safetyNet < 0) {
+ return false;
+ }
if (!unsortable && current->done()) {
break;
}