fix a few more fuzzes
authorcaryclark <caryclark@google.com>
Mon, 24 Oct 2016 15:41:45 +0000 (08:41 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 24 Oct 2016 15:41:45 +0000 (08:41 -0700)
Minor changes to fix some fuzz conditions.
A couple of ignored asserts when the data
is fuzzy, and one fail condition when the
underlying data has already been deleted.

TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2443243002

Review-Url: https://codereview.chromium.org/2443243002

src/pathops/SkIntersections.cpp
src/pathops/SkOpCoincidence.cpp
src/pathops/SkOpSpan.h

index 9683796a5b52634e209064981c00580ffbf02e2b..79206c34efb4def38632ebe5bb2e421cc9cf3469 100644 (file)
@@ -67,7 +67,7 @@ int SkIntersections::insert(double one, double two, const SkDPoint& pt) {
         }
     }
     if (fUsed >= fMax) {
-        SkASSERT(0);  // FIXME : this error, if it is to be handled at runtime in release, must
+        SkOPASSERT(0);  // FIXME : this error, if it is to be handled at runtime in release, must
                       // be propagated all the way back down to the caller, and return failure.
         fUsed = 0;
         return 0;
index 1390533a51a025cc92cffd6e673f9883f9a168f5..dadcfa520bd7efd679081679c4a0d5f237293931 100755 (executable)
@@ -794,7 +794,7 @@ bool SkOpCoincidence::addMissing(bool* added  DEBUG_COIN_DECLARE_PARAMS()) {
                     return true;
                 }
                 const SkOpPtT* ice = inner->coinPtTEnd();
-                SkASSERT(!ice->deleted());
+                FAIL_IF(ice->deleted());
                 if (outerOpp != innerOpp && this->overlap(ocs, oce, ics, ice, &overS, &overE)) {
                     (void) this->addIfMissing(ocs->starter(oce), ics->starter(ice),
                             overS, overE, outerOppWritable, innerOppWritable, added
index 023e7acfbe92d84a3e9581575354bd0bef06b791..219020a575f90fde902ce8b18779575b37ff60df 100644 (file)
@@ -518,7 +518,7 @@ public:
     void setOppValue(int oppValue) {
         SkASSERT(!final());
         SkASSERT(fOppSum == SK_MinS32);
-        SkASSERT(!oppValue || !fDone);
+        SkOPASSERT(!oppValue || !fDone);
         fOppValue = oppValue;
     }