aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2016-08-19 07:01:33 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-19 07:01:33 -0700
commit429428660b247bb3ccb3195aa8b3abe3194d4d5b (patch)
tree0027662e36d5b3bc19cbf03071615253e346d4e8 /src/pathops
parent83b24ff0825eadf200c3b5d87c669beb270a8680 (diff)
fix fuzzes
TBR=reed@google.com BUG=639157, 638783 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255243003 Review-Url: https://codereview.chromium.org/2255243003
Diffstat (limited to 'src/pathops')
-rwxr-xr-xsrc/pathops/SkOpCoincidence.cpp3
-rw-r--r--src/pathops/SkOpCoincidence.h2
-rw-r--r--src/pathops/SkPathOpsTSect.h3
3 files changed, 7 insertions, 1 deletions
diff --git a/src/pathops/SkOpCoincidence.cpp b/src/pathops/SkOpCoincidence.cpp
index 5bae6f56b8..ea84e04e01 100755
--- a/src/pathops/SkOpCoincidence.cpp
+++ b/src/pathops/SkOpCoincidence.cpp
@@ -1364,6 +1364,9 @@ bool SkOpCoincidence::mark() {
return true;
}
do {
+ if (!coin->coinPtTStartWritable()->span()->upCastable()) {
+ return false;
+ }
SkOpSpan* start = coin->coinPtTStartWritable()->span()->upCast();
SkASSERT(!start->deleted());
SkOpSpanBase* end = coin->coinPtTEndWritable()->span();
diff --git a/src/pathops/SkOpCoincidence.h b/src/pathops/SkOpCoincidence.h
index 4b3e4726ab..cd184e353f 100644
--- a/src/pathops/SkOpCoincidence.h
+++ b/src/pathops/SkOpCoincidence.h
@@ -81,7 +81,7 @@ public:
void setCoinPtTStart(const SkOpPtT* ptT) {
SkASSERT(ptT == ptT->span()->ptT());
- SkASSERT(!fCoinPtTEnd || ptT->fT != fCoinPtTEnd->fT);
+ SkOPASSERT(!fCoinPtTEnd || ptT->fT != fCoinPtTEnd->fT);
SkASSERT(!fCoinPtTEnd || fCoinPtTEnd->segment() == ptT->segment());
fCoinPtTStart = ptT;
ptT->setCoincident();
diff --git a/src/pathops/SkPathOpsTSect.h b/src/pathops/SkPathOpsTSect.h
index 85d3b10d95..bd26e5ace3 100644
--- a/src/pathops/SkPathOpsTSect.h
+++ b/src/pathops/SkPathOpsTSect.h
@@ -1220,6 +1220,9 @@ SkTSpan<TCurve, OppCurve>* SkTSect<TCurve, OppCurve>::extractCoincident(
if (!oppFirst) {
return nullptr;
}
+ if (!oppLast) {
+ return nullptr;
+ }
// reduce coincident runs to single entries
this->validate();
sect2->validate();