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

Unified Diff: src/pathops/SkOpSpan.cpp

Issue 2166543002: fix fuzzer (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 | « no previous file | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpSpan.cpp
diff --git a/src/pathops/SkOpSpan.cpp b/src/pathops/SkOpSpan.cpp
index 577a9db32669670449b66d84005bf6433ce7f5a4..1cdfe91a248dc6aad728707a933f5508c67ca8ff 100755
--- a/src/pathops/SkOpSpan.cpp
+++ b/src/pathops/SkOpSpan.cpp
@@ -387,9 +387,18 @@ bool SkOpSpan::insertCoincidence(const SkOpSegment* segment, bool flipped) {
SkOpPtT* next = &fPtT;
while ((next = next->next()) != &fPtT) {
if (next->segment() == segment) {
- SkOpSpan* span = flipped ? next->span()->prev() : next->span()->upCast();
- if (!span) {
- return false;
+ SkOpSpan* span;
+ if (flipped) {
+ span = next->span()->prev();
+ if (!span) {
+ return false;
+ }
+ } else {
+ SkOpSpanBase* base = next->span();
+ if (!base->upCastable()) {
+ return false;
+ }
+ span = base->upCast();
}
this->insertCoincidence(span);
return true;
« no previous file with comments | « no previous file | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698