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

Unified Diff: src/pathops/SkOpCoincidence.cpp

Issue 2426393004: fix more chrome asan fuzzer failures (Closed)
Patch Set: add fail check 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/SkOpCoincidence.h ('k') | tests/PathOpsOpTest.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..dcd22854f8a72449432f72ede2b72bcbba4e08be 100755
--- a/src/pathops/SkOpCoincidence.cpp
+++ b/src/pathops/SkOpCoincidence.cpp
@@ -239,7 +239,7 @@ void SkOpCoincidence::add(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* o
oppPtTStart = oppPtTStart->span()->ptT();
oppPtTEnd = oppPtTEnd->span()->ptT();
SkOPASSERT(coinPtTStart->fT < coinPtTEnd->fT);
- SkASSERT(oppPtTStart->fT != oppPtTEnd->fT);
+ SkOPASSERT(oppPtTStart->fT != oppPtTEnd->fT);
SkOPASSERT(!coinPtTStart->deleted());
SkOPASSERT(!coinPtTEnd->deleted());
SkOPASSERT(!oppPtTStart->deleted());
@@ -976,8 +976,10 @@ bool SkOpCoincidence::apply(DEBUG_COIN_DECLARE_ONLY_PARAMS()) {
const SkOpSpanBase* end = coin->coinPtTEnd()->span();
SkASSERT(start == start->starter(end));
bool flipped = coin->flipped();
- SkOpSpan* oStart = (flipped ? coin->oppPtTEndWritable()
- : coin->oppPtTStartWritable())->span()->upCast();
+ SkOpSpanBase* oStartBase = (flipped ? coin->oppPtTEndWritable()
+ : coin->oppPtTStartWritable())->span();
+ FAIL_IF(!oStartBase->upCastable());
+ SkOpSpan* oStart = oStartBase->upCast();
if (oStart->deleted()) {
continue;
}
@@ -1075,6 +1077,7 @@ bool SkOpCoincidence::apply(DEBUG_COIN_DECLARE_ONLY_PARAMS()) {
if (next == end) {
break;
}
+ FAIL_IF(!next->upCastable());
start = next->upCast();
// if the opposite ran out too soon, just reuse the last span
if (!oNext || !oNext->upCastable()) {
@@ -1306,6 +1309,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/SkOpCoincidence.h ('k') | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698