aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-06-19 08:33:52 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-19 12:58:00 +0000
commit560714336135d9bf851146ead65a6c68cf4220ed (patch)
tree343cbaf8658979e1a03df0c58b89976134b5fddf /src/pathops
parentf2030783094e502fb74221077a5ee7cb41287fe4 (diff)
fix fuzzer bugs in pathops
one from clusterfuzz, one from Skia fuzzer R=kjlubick@google.com Bug:853938 Change-Id: If456bf45e4d75edecf4e4e8222ddcdaa301455f4 Reviewed-on: https://skia-review.googlesource.com/135701 Commit-Queue: Cary Clark <caryclark@skia.org> Commit-Queue: Kevin Lubick <kjlubick@google.com> Auto-Submit: Cary Clark <caryclark@skia.org> Reviewed-by: Kevin Lubick <kjlubick@google.com>
Diffstat (limited to 'src/pathops')
-rw-r--r--src/pathops/SkOpCoincidence.cpp2
-rw-r--r--src/pathops/SkOpSegment.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/pathops/SkOpCoincidence.cpp b/src/pathops/SkOpCoincidence.cpp
index a25a67e168..5677b021aa 100644
--- a/src/pathops/SkOpCoincidence.cpp
+++ b/src/pathops/SkOpCoincidence.cpp
@@ -838,7 +838,7 @@ bool SkOpCoincidence::addMissing(bool* added DEBUG_COIN_DECLARE_PARAMS()) {
}
} else if (outerCoin == innerOpp) {
const SkOpPtT* oce = outer->coinPtTEnd();
- SkASSERT(!oce->deleted());
+ FAIL_IF(oce->deleted());
const SkOpPtT* ioe = inner->oppPtTEnd();
SkASSERT(!ioe->deleted());
if (outerOpp != innerCoin && this->overlap(ocs, oce, ios, ioe, &overS, &overE)) {
diff --git a/src/pathops/SkOpSegment.cpp b/src/pathops/SkOpSegment.cpp
index df70034f93..fd969f6c78 100644
--- a/src/pathops/SkOpSegment.cpp
+++ b/src/pathops/SkOpSegment.cpp
@@ -768,6 +768,9 @@ SkOpSegment* SkOpSegment::findNextXor(SkOpSpanBase** nextStart, SkOpSpanBase** n
SkOpSegment* nextSegment;
int activeCount = 0;
do {
+ if (!nextAngle) {
+ return nullptr;
+ }
nextSegment = nextAngle->segment();
++activeCount;
if (!foundAngle || (foundDone && activeCount & 1)) {