fix fuzz with null check

TBR=reed@google.com
BUG=skia:5819

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2925

Change-Id: I1957d3f8f5c78bed41bb7fe413ae870df24f7c50
Reviewed-on: https://skia-review.googlesource.com/2925
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
This commit is contained in:
Cary Clark 2016-10-04 10:53:31 -04:00
parent 9161ef012f
commit 3fdf52cf38
2 changed files with 38 additions and 0 deletions

View File

@ -490,6 +490,7 @@ bool SkOpCoincidence::addExpanded(DEBUG_COIN_DECLARE_ONLY_PARAMS()) {
walk = walk->upCast()->next();
} while (!(walkOpp = walk->ptT()->contains(oSeg))
&& walk != coin->coinPtTEnd()->span());
FAIL_IF(!walkOpp);
nextT = walk->t();
oNextT = walkOpp->fT;
}

View File

@ -7948,7 +7948,44 @@ path.conicTo(SkBits2Float(0x7f52753a), SkBits2Float(0x8072ffff), SkBits2Float(0x
testPathOpFuzz(reporter, path1, path2, (SkPathOp) 3, filename);
}
static void fuzz763_45(skiatest::Reporter* reporter, const char* filename) {
SkPath path;
path.setFillType((SkPath::FillType) 0);
SkPath path1(path);
path.reset();
path.setFillType((SkPath::FillType) 0);
path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
path.cubicTo(SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x7a303030), SkBits2Float(0x7a303030), SkBits2Float(0x30303030)); // 6.40969e-10f, 6.40969e-10f, 6.40969e-10f, 2.28705e+35f, 2.28705e+35f, 6.40969e-10f
path.conicTo(SkBits2Float(0x30303030), SkBits2Float(0x74303030), SkBits2Float(0x74303030), SkBits2Float(0x30303030), SkBits2Float(0x74303030)); // 6.40969e-10f, 5.58363e+31f, 5.58363e+31f, 6.40969e-10f, 5.58363e+31f
path.conicTo(SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030)); // 6.40969e-10f, 6.40969e-10f, 6.40969e-10f, 6.40969e-10f, 6.40969e-10f
path.moveTo(SkBits2Float(0x30303030), SkBits2Float(0x30303030)); // 6.40969e-10f, 6.40969e-10f
path.moveTo(SkBits2Float(0x77773030), SkBits2Float(0x30303030)); // 5.01357e+33f, 6.40969e-10f
path.conicTo(SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x7a743030), SkBits2Float(0x74303030), SkBits2Float(0x30303030)); // 6.40969e-10f, 6.40969e-10f, 3.16974e+35f, 5.58363e+31f, 6.40969e-10f
path.lineTo(SkBits2Float(0x77773030), SkBits2Float(0x30303030)); // 5.01357e+33f, 6.40969e-10f
path.close();
path.moveTo(SkBits2Float(0x77773030), SkBits2Float(0x30303030)); // 5.01357e+33f, 6.40969e-10f
path.lineTo(SkBits2Float(0x7f303030), SkBits2Float(0x7a303030)); // 2.34194e+38f, 2.28705e+35f
path.conicTo(SkBits2Float(0x77303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0xf9303030), SkBits2Float(0x7a303030)); // 3.57352e+33f, 6.40969e-10f, 6.40969e-10f, -5.71764e+34f, 2.28705e+35f
path.conicTo(SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030)); // 6.40969e-10f, 6.40969e-10f, 6.40969e-10f, 6.40969e-10f, 6.40969e-10f
path.quadTo(SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030)); // 6.40969e-10f, 6.40969e-10f, 6.40969e-10f, 6.40969e-10f
path.quadTo(SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030)); // 6.40969e-10f, 6.40969e-10f, 6.40969e-10f, 6.40969e-10f
path.conicTo(SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030)); // 6.40969e-10f, 6.40969e-10f, 6.40969e-10f, 6.40969e-10f, 6.40969e-10f
path.conicTo(SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x7a303030), SkBits2Float(0x30303030)); // 6.40969e-10f, 6.40969e-10f, 6.40969e-10f, 2.28705e+35f, 6.40969e-10f
path.cubicTo(SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x7a303030), SkBits2Float(0x30303030)); // 6.40969e-10f, 6.40969e-10f, 6.40969e-10f, 6.40969e-10f, 2.28705e+35f, 6.40969e-10f
path.conicTo(SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030)); // 6.40969e-10f, 6.40969e-10f, 6.40969e-10f, 6.40969e-10f, 6.40969e-10f
path.moveTo(SkBits2Float(0x77303030), SkBits2Float(0xff303030)); // 3.57352e+33f, -2.34194e+38f
path.conicTo(SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x7f773030), SkBits2Float(0x7a7a3030), SkBits2Float(0x7a303030)); // 6.40969e-10f, 6.40969e-10f, 3.2857e+38f, 3.24763e+35f, 2.28705e+35f
path.quadTo(SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x77303030), SkBits2Float(0x30303030)); // 6.40969e-10f, 6.40969e-10f, 3.57352e+33f, 6.40969e-10f
path.conicTo(SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x7b303030), SkBits2Float(0x73303030), SkBits2Float(0x30303030)); // 6.40969e-10f, 6.40969e-10f, 9.14822e+35f, 1.39591e+31f, 6.40969e-10f
path.quadTo(SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x30303030), SkBits2Float(0x7a7a3030)); // 6.40969e-10f, 6.40969e-10f, 6.40969e-10f, 3.24763e+35f
SkPath path2(path);
testPathOpFuzz(reporter, path1, path2, (SkPathOp) 3, filename);
}
static struct TestDesc failTests[] = {
TEST(fuzz763_45),
TEST(fuzz763_44),
TEST(fuzz763_43),
TEST(fuzz763_42),