Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: src/pathops/SkOpCoincidence.cpp

Issue 2169863002: fix fuzzer bug (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pathops/SkOpCoincidence.h ('k') | src/pathops/SkOpSegment.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpCoincidence.cpp
diff --git a/src/pathops/SkOpCoincidence.cpp b/src/pathops/SkOpCoincidence.cpp
index af330dfe1eb68bb6d06b177595987468eda6f25d..d750ce78b97fe39ab007c5eceaa9809bf9828b60 100755
--- a/src/pathops/SkOpCoincidence.cpp
+++ b/src/pathops/SkOpCoincidence.cpp
@@ -268,7 +268,7 @@ void SkOpCoincidence::add(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* o
}
// description below
-void SkOpCoincidence::addEndMovedSpans(const SkOpSpan* base, const SkOpSpanBase* testSpan) {
+bool SkOpCoincidence::addEndMovedSpans(const SkOpSpan* base, const SkOpSpanBase* testSpan) {
const SkOpPtT* testPtT = testSpan->ptT();
const SkOpPtT* stopPtT = testPtT;
const SkOpSegment* baseSeg = base->segment();
@@ -324,9 +324,12 @@ void SkOpCoincidence::addEndMovedSpans(const SkOpSpan* base, const SkOpSpanBase*
SkTSwap(coinTs, coinTe);
SkTSwap(oppTs, oppTe);
}
- (void) this->addOrOverlap(coinSeg, oppSeg, coinTs, coinTe, oppTs, oppTe);
+ if (!this->addOrOverlap(coinSeg, oppSeg, coinTs, coinTe, oppTs, oppTe)) {
+ return false;
+ }
}
}
+ return true;
}
// description below
@@ -337,10 +340,14 @@ bool SkOpCoincidence::addEndMovedSpans(const SkOpPtT* ptT) {
return false;
}
if (!prev->isCanceled()) {
- this->addEndMovedSpans(base, base->prev());
+ if (!this->addEndMovedSpans(base, base->prev())) {
+ return false;
+ }
}
if (!base->isCanceled()) {
- this->addEndMovedSpans(base, base->next());
+ if (!this->addEndMovedSpans(base, base->next())) {
+ return false;
+ }
}
return true;
}
@@ -631,7 +638,9 @@ bool SkOpCoincidence::addOrOverlap(SkOpSegment* coinSeg, SkOpSegment* oppSeg,
if (overlap && cs && ce && overlap->contains(cs, ce)) {
return false;
}
- SkASSERT(cs != ce || !cs);
+ if (cs == ce && cs) {
+ return false;
+ }
const SkOpPtT* os = oppSeg->existing(oppTs, coinSeg);
const SkOpPtT* oe = oppSeg->existing(oppTe, coinSeg);
if (overlap && os && oe && overlap->contains(os, oe)) {
« no previous file with comments | « src/pathops/SkOpCoincidence.h ('k') | src/pathops/SkOpSegment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698