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

Unified Diff: src/pathops/SkOpSegment.cpp

Issue 2103903004: fix fuzz test that exceeds numeric limit (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 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/SkPathOpsTSect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpSegment.cpp
diff --git a/src/pathops/SkOpSegment.cpp b/src/pathops/SkOpSegment.cpp
index 24f76aa6de1bcc5d01bf11134490131982c62980..41d62369b644dfe12363173375bba0ab47ae0d9c 100644
--- a/src/pathops/SkOpSegment.cpp
+++ b/src/pathops/SkOpSegment.cpp
@@ -1130,7 +1130,9 @@ SkOpSegment* SkOpSegment::nextChase(SkOpSpanBase** startPtr, int* stepPtr, SkOpS
SkOpPtT* otherPtT = endSpan->ptT()->next();
other = otherPtT->segment();
foundSpan = otherPtT->span();
- otherEnd = step > 0 ? foundSpan->upCast()->next() : foundSpan->prev();
+ otherEnd = step > 0
+ ? foundSpan->upCastable() ? foundSpan->upCast()->next() : nullptr
mmoroz 2016/06/29 14:52:35 Not sure if it is a good idea to use a nested tern
+ : foundSpan->prev();
} else {
int loopCount = angle->loopCount();
if (loopCount > 2) {
@@ -1150,6 +1152,9 @@ SkOpSegment* SkOpSegment::nextChase(SkOpSpanBase** startPtr, int* stepPtr, SkOpS
foundSpan = endSpan = next->start();
otherEnd = next->end();
}
+ if (!otherEnd) {
+ return nullptr;
+ }
int foundStep = foundSpan->step(otherEnd);
if (*stepPtr != foundStep) {
return set_last(last, endSpan);
« no previous file with comments | « no previous file | src/pathops/SkPathOpsTSect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698