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

Unified Diff: src/pathops/SkOpCoincidence.cpp

Issue 2224823004: template intersection fuzz fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix for 633608 Created 4 years, 4 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 | « no previous file | src/pathops/SkPathOpsOp.cpp » ('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 a9c3204003cc0faaf61fe5a779cf93dc5898558d..bb26b1370f6e3acdb82efa995f32f61a2b85a641 100755
--- a/src/pathops/SkOpCoincidence.cpp
+++ b/src/pathops/SkOpCoincidence.cpp
@@ -461,6 +461,9 @@ bool SkOpCoincidence::addExpanded() {
}
}
if (test != end) {
+ if (!test->upCastable()) {
+ return false;
+ }
test = test->upCast()->next();
}
if (oTest != oEnd) {
@@ -606,7 +609,9 @@ bool SkOpCoincidence::addIfMissing(const SkOpPtT* over1s, const SkOpPtT* over1e,
bool SkOpCoincidence::addOrOverlap(SkOpSegment* coinSeg, SkOpSegment* oppSeg,
double coinTs, double coinTe, double oppTs, double oppTe) {
SkTDArray<SkCoincidentSpans*> overlaps;
- SkASSERT(fTop);
+ if (!fTop) {
+ return false;
+ }
if (!this->checkOverlap(fTop, coinSeg, oppSeg, coinTs, coinTe, oppTs, oppTe, &overlaps)) {
return false;
}
@@ -683,6 +688,9 @@ bool SkOpCoincidence::addOrOverlap(SkOpSegment* coinSeg, SkOpSegment* oppSeg,
: coinSeg->addT(coinTs, SkOpSegment::kNoAliasMatch, nullptr);
SkOpPtT* osWritable = os ? const_cast<SkOpPtT*>(os)
: oppSeg->addT(oppTs, SkOpSegment::kNoAliasMatch, nullptr);
+ if (!osWritable) {
+ return false;
+ }
csWritable->span()->addOppAndMerge(osWritable->span());
cs = csWritable;
os = osWritable;
@@ -1379,6 +1387,9 @@ bool SkOpCoincidence::mark() {
}
}
while ((oNext = oNext->upCast()->next()) != oEnd) {
+ if (!oNext->upCastable()) {
+ return false;
+ }
if (!oNext->upCast()->insertCoincidence(segment, flipped)) {
return false;
}
« no previous file with comments | « no previous file | src/pathops/SkPathOpsOp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698