From a35ab3e6e024d0b548ded26a2e3b8ecd838ead93 Mon Sep 17 00:00:00 2001 From: caryclark Date: Thu, 20 Oct 2016 08:32:18 -0700 Subject: fix fuzzers Many old pathops-related fuzz failures have built up while the codebase was under a state a flux. Now that the code is stable, address these failures. Most of the CL plumbs the debug global state to downstream routines so that, if the data is not trusted (ala fuzzed) the function can safely exit without asserting. TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2426173002 Review-Url: https://chromiumcodereview.appspot.com/2426173002 --- tests/PathOpsCubicConicIntersectionTest.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests/PathOpsCubicConicIntersectionTest.cpp') diff --git a/tests/PathOpsCubicConicIntersectionTest.cpp b/tests/PathOpsCubicConicIntersectionTest.cpp index fae1233a55..d7924634b2 100644 --- a/tests/PathOpsCubicConicIntersectionTest.cpp +++ b/tests/PathOpsCubicConicIntersectionTest.cpp @@ -12,8 +12,8 @@ #include "Test.h" static struct cubicConic { - SkDCubic cubic; - SkDConic conic; + CubicPts cubic; + ConicPts conic; } cubicConicTests[] = { {{{{188.60000610351562, 2041.5999755859375}, {188.60000610351562, 2065.39990234375}, {208, 2084.800048828125}, {231.80000305175781, 2084.800048828125}}}, @@ -29,9 +29,13 @@ static struct cubicConic { static const int cubicConicTests_count = (int) SK_ARRAY_COUNT(cubicConicTests); static void cubicConicIntersection(skiatest::Reporter* reporter, int index) { - const SkDCubic& cubic = cubicConicTests[index].cubic; + const CubicPts& cu = cubicConicTests[index].cubic; + SkDCubic cubic; + cubic.debugSet(cu.fPts); SkASSERT(ValidCubic(cubic)); - const SkDConic& conic = cubicConicTests[index].conic; + const ConicPts& co = cubicConicTests[index].conic; + SkDConic conic; + conic.debugSet(co.fPts.fPts, co.fWeight); SkASSERT(ValidConic(conic)); SkReduceOrder reduce1; SkReduceOrder reduce2; -- cgit v1.2.3