aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkOpCoincidence.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2016-09-07 08:21:09 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-07 08:21:09 -0700
commitb393a49e5fa7e69ba67692929e9fa2a4e1f6bbb1 (patch)
tree5655f33260f8b6373555e315cab961aee5b06e3a /src/pathops/SkOpCoincidence.cpp
parent77320dbabcddf05c0a1489eaf1f496729dc8de0e (diff)
fix pathops fuzzers
Extreme values trigger asserts that in range values allow. Disable asserts and other tests to prevent extreme values from crashing. TBR=reed@google.com BUG=644684. 644680, 644640 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2316173002 Review-Url: https://codereview.chromium.org/2316173002
Diffstat (limited to 'src/pathops/SkOpCoincidence.cpp')
-rwxr-xr-xsrc/pathops/SkOpCoincidence.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/pathops/SkOpCoincidence.cpp b/src/pathops/SkOpCoincidence.cpp
index 61ea3ef444..0548ed5a05 100755
--- a/src/pathops/SkOpCoincidence.cpp
+++ b/src/pathops/SkOpCoincidence.cpp
@@ -551,6 +551,9 @@ double SkOpCoincidence::TRange(const SkOpPtT* overS, double t,
do {
const SkOpPtT* contained = work->contains(coinSeg);
if (!contained) {
+ if (work->t() >= t) {
+ return 1;
+ }
continue;
}
if (work->t() <= t) {
@@ -795,7 +798,9 @@ bool SkOpCoincidence::addMissing() {
const SkOpSegment* outerCoin = ocs->segment();
SkASSERT(!outerCoin->done()); // if it's done, should have already been removed from list
const SkOpPtT* oos = outer->oppPtTStart();
- SkASSERT(!oos->deleted());
+ if (oos->deleted()) {
+ return false;
+ }
const SkOpSegment* outerOpp = oos->segment();
SkASSERT(!outerOpp->done());
SkOpSegment* outerCoinWritable = const_cast<SkOpSegment*>(outerCoin);
@@ -816,7 +821,9 @@ bool SkOpCoincidence::addMissing() {
SkOpSegment* innerOppWritable = const_cast<SkOpSegment*>(innerOpp);
if (outerCoin == innerCoin) {
const SkOpPtT* oce = outer->coinPtTEnd();
- SkASSERT(!oce->deleted());
+ if (oce->deleted()) {
+ return false;
+ }
const SkOpPtT* ice = inner->coinPtTEnd();
SkASSERT(!ice->deleted());
if (outerOpp != innerOpp && this->overlap(ocs, oce, ics, ice, &overS, &overE)) {
@@ -852,7 +859,9 @@ bool SkOpCoincidence::addMissing() {
const SkOpPtT* ooe = outer->oppPtTEnd();
SkASSERT(!ooe->deleted());
const SkOpPtT* ioe = inner->oppPtTEnd();
- SkASSERT(!ioe->deleted());
+ if (ioe->deleted()) {
+ return false;
+ }
SkASSERT(outerCoin != innerCoin);
if (this->overlap(oos, ooe, ios, ioe, &overS, &overE)) {
added |= this->addIfMissing(oos->starter(ooe), ios->starter(ioe),
@@ -1394,7 +1403,7 @@ bool SkOpCoincidence::removeCollapsed() {
}
void SkOpCoincidence::fixUp(SkOpPtT* deleted, const SkOpPtT* kept) {
- SkASSERT(deleted != kept);
+ SkOPASSERT(deleted != kept);
if (fHead) {
this->fixUp(fHead, deleted, kept);
}
@@ -1453,7 +1462,9 @@ bool SkOpCoincidence::mark() {
SkOpSpanBase* end = coin->coinPtTEndWritable()->span();
SkASSERT(!end->deleted());
SkOpSpanBase* oStart = coin->oppPtTStartWritable()->span();
- SkASSERT(!oStart->deleted());
+ if (oStart->deleted()) {
+ return false;
+ }
SkOpSpanBase* oEnd = coin->oppPtTEndWritable()->span();
SkASSERT(!oEnd->deleted());
bool flipped = coin->flipped();