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

Unified Diff: src/pathops/SkOpCoincidence.cpp

Issue 2427253005: fix more fuzz, carsvg (Closed)
Patch Set: Created 4 years, 2 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/SkOpAngle.cpp ('k') | tests/PathOpsSimplifyFailTest.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 d16f6f86421883789b0a2395f986794bb9548623..f87931830f8531495c5002f8c86daf4de900da97 100755
--- a/src/pathops/SkOpCoincidence.cpp
+++ b/src/pathops/SkOpCoincidence.cpp
@@ -481,7 +481,12 @@ bool SkOpCoincidence::addExpanded(DEBUG_COIN_DECLARE_ONLY_PARAMS()) {
}
if (oTest != oEnd) {
oPriorT = oTest->t();
- oTest = coin->flipped() ? oTest->prev() : oTest->upCast()->next();
+ if (coin->flipped()) {
+ oTest = oTest->prev();
+ } else {
+ FAIL_IF(!oTest->upCastable());
+ oTest = oTest->upCast()->next();
+ }
FAIL_IF(!oTest);
}
@@ -864,6 +869,7 @@ bool SkOpCoincidence::addOverlap(const SkOpSegment* seg1, const SkOpSegment* seg
s2 = overS->find(seg2o);
e2 = overE->find(seg2o);
FAIL_IF(!s2);
+ FAIL_IF(!e2);
if (!s2->starter(e2)->span()->upCast()->windValue()) {
return true;
}
@@ -1306,6 +1312,7 @@ bool SkOpCoincidence::mark(DEBUG_COIN_DECLARE_ONLY_PARAMS()) {
SkAssertResult(next->upCast()->insertCoincidence(oSegment, flipped, ordered));
}
while ((oNext = oNext->upCast()->next()) != oEnd) {
+ FAIL_IF(!oNext->upCastable());
FAIL_IF(!oNext->upCast()->insertCoincidence(segment, flipped, ordered));
}
} while ((coin = coin->next()));
« no previous file with comments | « src/pathops/SkOpAngle.cpp ('k') | tests/PathOpsSimplifyFailTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698