Chromium Code Reviews| 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); |