From 560714336135d9bf851146ead65a6c68cf4220ed Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Tue, 19 Jun 2018 08:33:52 -0400 Subject: fix fuzzer bugs in pathops one from clusterfuzz, one from Skia fuzzer R=kjlubick@google.com Bug:853938 Change-Id: If456bf45e4d75edecf4e4e8222ddcdaa301455f4 Reviewed-on: https://skia-review.googlesource.com/135701 Commit-Queue: Cary Clark Commit-Queue: Kevin Lubick Auto-Submit: Cary Clark Reviewed-by: Kevin Lubick --- src/pathops/SkOpCoincidence.cpp | 2 +- src/pathops/SkOpSegment.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/pathops') diff --git a/src/pathops/SkOpCoincidence.cpp b/src/pathops/SkOpCoincidence.cpp index a25a67e168..5677b021aa 100644 --- a/src/pathops/SkOpCoincidence.cpp +++ b/src/pathops/SkOpCoincidence.cpp @@ -838,7 +838,7 @@ bool SkOpCoincidence::addMissing(bool* added DEBUG_COIN_DECLARE_PARAMS()) { } } else if (outerCoin == innerOpp) { const SkOpPtT* oce = outer->coinPtTEnd(); - SkASSERT(!oce->deleted()); + FAIL_IF(oce->deleted()); const SkOpPtT* ioe = inner->oppPtTEnd(); SkASSERT(!ioe->deleted()); if (outerOpp != innerCoin && this->overlap(ocs, oce, ios, ioe, &overS, &overE)) { diff --git a/src/pathops/SkOpSegment.cpp b/src/pathops/SkOpSegment.cpp index df70034f93..fd969f6c78 100644 --- a/src/pathops/SkOpSegment.cpp +++ b/src/pathops/SkOpSegment.cpp @@ -768,6 +768,9 @@ SkOpSegment* SkOpSegment::findNextXor(SkOpSpanBase** nextStart, SkOpSpanBase** n SkOpSegment* nextSegment; int activeCount = 0; do { + if (!nextAngle) { + return nullptr; + } nextSegment = nextAngle->segment(); ++activeCount; if (!foundAngle || (foundDone && activeCount & 1)) { -- cgit v1.2.3