diff options
author | caryclark <caryclark@google.com> | 2016-06-28 09:23:57 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-28 09:23:57 -0700 |
commit | 3f0753d3eccece8ac7f02f6af36d66a96c3dfb26 (patch) | |
tree | a7dca73764a07182471f1c69de159d92059ee9bf /src/pathops/SkPathOpsConic.cpp | |
parent | 74139f1b49d02b38006170c3e50439c1b33b175f (diff) |
fix fuzz bugs
Detect more places where the pathops numerics cause numbers
to become nearly identical and subsequently fail. These tests
have extreme inputs and cannot succeed.
Also remove the expectSuccess parameter from PathOpsDebug
and check instead in the test framework.
R=mbarbella@chromium.org
TBR=reed@google.com
BUG=623072,623022
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2103513002
Review-Url: https://codereview.chromium.org/2103513002
Diffstat (limited to 'src/pathops/SkPathOpsConic.cpp')
-rw-r--r-- | src/pathops/SkPathOpsConic.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pathops/SkPathOpsConic.cpp b/src/pathops/SkPathOpsConic.cpp index 86bad262e3..dd523211de 100644 --- a/src/pathops/SkPathOpsConic.cpp +++ b/src/pathops/SkPathOpsConic.cpp @@ -34,7 +34,10 @@ int SkDConic::FindExtrema(const double src[], SkScalar w, double t[1]) { double tValues[2]; int roots = SkDQuad::RootsValidT(coeff[0], coeff[1], coeff[2], tValues); - SkASSERT(0 == roots || 1 == roots); + // In extreme cases, the number of roots returned can be 2. Pathops + // will fail later on, so there's no advantage to plumbing in an error + // return here. + // SkASSERT(0 == roots || 1 == roots); if (1 == roots) { t[0] = tValues[0]; |