From 429428660b247bb3ccb3195aa8b3abe3194d4d5b Mon Sep 17 00:00:00 2001 From: caryclark Date: Fri, 19 Aug 2016 07:01:33 -0700 Subject: 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 --- src/pathops/SkOpCoincidence.cpp | 3 +++ src/pathops/SkOpCoincidence.h | 2 +- src/pathops/SkPathOpsTSect.h | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/pathops') 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* SkTSect::extractCoincident( if (!oppFirst) { return nullptr; } + if (!oppLast) { + return nullptr; + } // reduce coincident runs to single entries this->validate(); sect2->validate(); -- cgit v1.2.3