diff options
author | caryclark <caryclark@google.com> | 2015-11-02 07:32:58 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-02 07:32:58 -0800 |
commit | 952ebfe2280043b16a316e9e27a41802f1c4cb7c (patch) | |
tree | 87e980777d2cab5576719f4c375b831cb6ac889e /tests | |
parent | 574a4c153d8a3f42b2806848f5c23cbf55e18bbb (diff) |
path ops: fix fuzz-found divide by zero
TBR=reed@google.com
BUG=542391
Review URL: https://codereview.chromium.org/1427913005
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PathOpsOpTest.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/PathOpsOpTest.cpp b/tests/PathOpsOpTest.cpp index 2f230936ff..7639cd9e8f 100644 --- a/tests/PathOpsOpTest.cpp +++ b/tests/PathOpsOpTest.cpp @@ -5755,7 +5755,33 @@ path.close(); testPathFailOp(reporter, path1, path2, (SkPathOp) 2, filename); } + +static void fuzz753_91(skiatest::Reporter* reporter, const char* filename) { + SkPath path; + path.setFillType((SkPath::FillType) 0); +path.moveTo(SkBits2Float(0x42910000), SkBits2Float(0x00000000)); // 72.5f, 0 +path.lineTo(SkBits2Float(0x42166668), SkBits2Float(0x00000000)); // 37.6f, 0 +path.cubicTo(SkBits2Float(0x42166668), SkBits2Float(0xc1966668), SkBits2Float(0x41c66668), SkBits2Float(0xc20a6666), SkBits2Float(0x40f00010), SkBits2Float(0xc21ccccd)); // 37.6f, -18.8f, 24.8f, -34.6f, 7.50001f, -39.2f +path.lineTo(SkBits2Float(0x41840004), SkBits2Float(0xc291cccd)); // 16.5f, -72.9f +path.lineTo(SkBits2Float(0x42fb6668), SkBits2Float(0x42c73334)); // 125.7f, 99.6f +path.lineTo(SkBits2Float(0x43646668), SkBits2Float(0x43880ccd)); // 228.4f, 272.1f + + SkPath path1(path); + path.reset(); + path.setFillType((SkPath::FillType) 0); +path.moveTo(SkBits2Float(0x428bf702), SkBits2Float(0xcf223cbf)); // 69.9824f, -2.72189e+09f +path.lineTo(SkBits2Float(0x42112d68), SkBits2Float(0xcf223cbf)); // 36.2943f, -2.72189e+09f +path.cubicTo(SkBits2Float(0x4220d9fc), SkBits2Float(0xcf223cc0), SkBits2Float(0x420ee118), SkBits2Float(0xcf223cc0), SkBits2Float(0x41cef2f8), SkBits2Float(0xcf223cc0)); // 40.2129f, -2.72189e+09f, 35.7198f, -2.72189e+09f, 25.8686f, -2.72189e+09f +path.lineTo(SkBits2Float(0x424a99e0), SkBits2Float(0xcf223cc0)); // 50.6503f, -2.72189e+09f +path.cubicTo(SkBits2Float(0x42266e32), SkBits2Float(0xcf223cc0), SkBits2Float(0x41f0fa20), SkBits2Float(0xcf223cc0), SkBits2Float(0x41872ed4), SkBits2Float(0xcf223cc0)); // 41.6076f, -2.72189e+09f, 30.1221f, -2.72189e+09f, 16.8979f, -2.72189e+09f +path.lineTo(SkBits2Float(0x40f8fbe0), SkBits2Float(0xcf223cc0)); // 7.78075f, -2.72189e+09f + + SkPath path2(path); + testPathFailOp(reporter, path1, path2, (SkPathOp) 2, filename); +} + static struct TestDesc failTests[] = { + TEST(fuzz753_91), TEST(fuzz714), TEST(fuzz487a), TEST(fuzz433), |