fix more chrome asan fuzzer failures
Small change to gracefully quit when fuzzer values cause pathops to fail. TBR=reed@google.com BUG=657411, 657559 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2426393004 Review-Url: https://chromiumcodereview.appspot.com/2426393004
This commit is contained in:
parent
3f490cc642
commit
96dc1c9efa
@ -239,7 +239,7 @@ void SkOpCoincidence::add(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* o
|
||||
oppPtTStart = oppPtTStart->span()->ptT();
|
||||
oppPtTEnd = oppPtTEnd->span()->ptT();
|
||||
SkOPASSERT(coinPtTStart->fT < coinPtTEnd->fT);
|
||||
SkASSERT(oppPtTStart->fT != oppPtTEnd->fT);
|
||||
SkOPASSERT(oppPtTStart->fT != oppPtTEnd->fT);
|
||||
SkOPASSERT(!coinPtTStart->deleted());
|
||||
SkOPASSERT(!coinPtTEnd->deleted());
|
||||
SkOPASSERT(!oppPtTStart->deleted());
|
||||
@ -976,8 +976,10 @@ bool SkOpCoincidence::apply(DEBUG_COIN_DECLARE_ONLY_PARAMS()) {
|
||||
const SkOpSpanBase* end = coin->coinPtTEnd()->span();
|
||||
SkASSERT(start == start->starter(end));
|
||||
bool flipped = coin->flipped();
|
||||
SkOpSpan* oStart = (flipped ? coin->oppPtTEndWritable()
|
||||
: coin->oppPtTStartWritable())->span()->upCast();
|
||||
SkOpSpanBase* oStartBase = (flipped ? coin->oppPtTEndWritable()
|
||||
: coin->oppPtTStartWritable())->span();
|
||||
FAIL_IF(!oStartBase->upCastable());
|
||||
SkOpSpan* oStart = oStartBase->upCast();
|
||||
if (oStart->deleted()) {
|
||||
continue;
|
||||
}
|
||||
@ -1075,6 +1077,7 @@ bool SkOpCoincidence::apply(DEBUG_COIN_DECLARE_ONLY_PARAMS()) {
|
||||
if (next == end) {
|
||||
break;
|
||||
}
|
||||
FAIL_IF(!next->upCastable());
|
||||
start = next->upCast();
|
||||
// if the opposite ran out too soon, just reuse the last span
|
||||
if (!oNext || !oNext->upCastable()) {
|
||||
@ -1306,6 +1309,7 @@ bool SkOpCoincidence::mark(DEBUG_COIN_DECLARE_ONLY_PARAMS()) {
|
||||
SkAssertResult(next->upCast()->insertCoincidence(oSegment, flipped, ordered));
|
||||
}
|
||||
while ((oNext = oNext->upCast()->next()) != oEnd) {
|
||||
FAIL_IF(!oNext->upCastable());
|
||||
FAIL_IF(!oNext->upCast()->insertCoincidence(segment, flipped, ordered));
|
||||
}
|
||||
} while ((coin = coin->next()));
|
||||
|
@ -80,7 +80,7 @@ public:
|
||||
|
||||
void setCoinPtTEnd(const SkOpPtT* ptT) {
|
||||
SkOPASSERT(ptT == ptT->span()->ptT());
|
||||
SkASSERT(!fCoinPtTStart || ptT->fT != fCoinPtTStart->fT);
|
||||
SkOPASSERT(!fCoinPtTStart || ptT->fT != fCoinPtTStart->fT);
|
||||
SkASSERT(!fCoinPtTStart || fCoinPtTStart->segment() == ptT->segment());
|
||||
fCoinPtTEnd = ptT;
|
||||
ptT->setCoincident();
|
||||
|
@ -8299,7 +8299,57 @@ path.quadTo(SkBits2Float(0x5adada72), SkBits2Float(0x52525252), SkBits2Float(0x7
|
||||
testPathOpFuzz(reporter, path1, path2, (SkPathOp) 0, filename);
|
||||
}
|
||||
|
||||
static void fuzz763_57(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(0x68546829), SkBits2Float(0x555b2d29)); // 4.01225e+24f, 1.50617e+13f
|
||||
path.moveTo(SkBits2Float(0x1f2a322a), SkBits2Float(0x4b7b2108)); // 3.60404e-20f, 1.6458e+07f
|
||||
path.lineTo(SkBits2Float(0x2829ed84), SkBits2Float(0x5b2d2d55)); // 9.43289e-15f, 4.8745e+16f
|
||||
path.moveTo(SkBits2Float(0x6838552d), SkBits2Float(0xf0684f5b)); // 3.48195e+24f, -2.87586e+29f
|
||||
path.conicTo(SkBits2Float(0x212a1f5b), SkBits2Float(0x2a8cef2a), SkBits2Float(0x682d2953), SkBits2Float(0xce682103), SkBits2Float(0x4b7bc055)); // 5.76397e-19f, 2.50349e-13f, 3.27093e+24f, -9.73619e+08f, 1.64988e+07f
|
||||
path.lineTo(SkBits2Float(0x5b2c6829), SkBits2Float(0x3b2a8c55)); // 4.85282e+16f, 0.00260236f
|
||||
path.lineTo(SkBits2Float(0x6838552d), SkBits2Float(0xf0684f5b)); // 3.48195e+24f, -2.87586e+29f
|
||||
path.close();
|
||||
path.moveTo(SkBits2Float(0x6838552d), SkBits2Float(0xf0684f5b)); // 3.48195e+24f, -2.87586e+29f
|
||||
path.conicTo(SkBits2Float(0xd2c00321), SkBits2Float(0xc0394b7b), SkBits2Float(0x8c08ed7a), SkBits2Float(0x211f2f2a), SkBits2Float(0x704b7b03)); // -4.12343e+11f, -2.89523f, -1.05485e-31f, 5.39337e-19f, 2.51897e+29f
|
||||
path.cubicTo(SkBits2Float(0x2d6829ed), SkBits2Float(0x5b2d555b), SkBits2Float(0x68275b2d), SkBits2Float(0x21685527), SkBits2Float(0x0321082a), SkBits2Float(0x6a4b7bc0)); // 1.3197e-11f, 4.8789e+16f, 3.16127e+24f, 7.87174e-19f, 4.7323e-37f, 6.14991e+25f
|
||||
path.conicTo(SkBits2Float(0x212a8ced), SkBits2Float(0x0321081f), SkBits2Float(0x6a4b7bc0), SkBits2Float(0x2829ed84), SkBits2Float(0x5b2d2d55)); // 5.77848e-19f, 4.7323e-37f, 6.14991e+25f, 9.43289e-15f, 4.8745e+16f
|
||||
path.moveTo(SkBits2Float(0x6839552d), SkBits2Float(0xf0683b5b)); // 3.50084e+24f, -2.87489e+29f
|
||||
path.conicTo(SkBits2Float(0x212a1f5b), SkBits2Float(0x228cef2a), SkBits2Float(0x682d2953), SkBits2Float(0xee682103), SkBits2Float(0x287bc055)); // 5.76397e-19f, 3.82003e-18f, 3.27093e+24f, -1.79601e+28f, 1.3975e-14f
|
||||
path.lineTo(SkBits2Float(0x5b2c6829), SkBits2Float(0x212a8c55)); // 4.85282e+16f, 5.7784e-19f
|
||||
path.conicTo(SkBits2Float(0x4b03213b), SkBits2Float(0xc07b2a08), SkBits2Float(0x5b2d7a6a), SkBits2Float(0xf0556830), SkBits2Float(0x2a8c555b)); // 8.59372e+06f, -3.92444f, 4.88298e+16f, -2.64185e+29f, 2.49282e-13f
|
||||
path.conicTo(SkBits2Float(0x0321212a), SkBits2Float(0x4b7bd2c0), SkBits2Float(0xed7ac039), SkBits2Float(0x2f2a8c08), SkBits2Float(0x7b03211f)); // 4.73517e-37f, 1.65035e+07f, -4.85023e+27f, 1.55112e-10f, 6.80863e+35f
|
||||
path.lineTo(SkBits2Float(0x6839552d), SkBits2Float(0xf0683b5b)); // 3.50084e+24f, -2.87489e+29f
|
||||
path.close();
|
||||
path.moveTo(SkBits2Float(0x6839552d), SkBits2Float(0xf0683b5b)); // 3.50084e+24f, -2.87489e+29f
|
||||
path.lineTo(SkBits2Float(0x6829ed27), SkBits2Float(0x2d555b2d)); // 3.20982e+24f, 1.21279e-11f
|
||||
path.moveTo(SkBits2Float(0x68275b2d), SkBits2Float(0xf0685527)); // 3.16127e+24f, -2.87614e+29f
|
||||
path.conicTo(SkBits2Float(0x721f2a5b), SkBits2Float(0x212a8c55), SkBits2Float(0x0321082a), SkBits2Float(0x6a4b7b28), SkBits2Float(0x4797ed7a)); // 3.1526e+30f, 5.7784e-19f, 4.7323e-37f, 6.14984e+25f, 77787
|
||||
path.lineTo(SkBits2Float(0x68275b2d), SkBits2Float(0xf0685527)); // 3.16127e+24f, -2.87614e+29f
|
||||
path.close();
|
||||
path.moveTo(SkBits2Float(0x68275b2d), SkBits2Float(0xf0685527)); // 3.16127e+24f, -2.87614e+29f
|
||||
path.quadTo(SkBits2Float(0x2828102a), SkBits2Float(0x2c682921), SkBits2Float(0x8c555bf6), SkBits2Float(0x6d03de30)); // 9.32938e-15f, 3.2992e-12f, -1.64366e-31f, 2.5507e+27f
|
||||
path.cubicTo(SkBits2Float(0x683f2d55), SkBits2Float(0xf05b684b), SkBits2Float(0x8c55272d), SkBits2Float(0x212a292a), SkBits2Float(0x0321082a), SkBits2Float(0x211f2a21)); // 3.61123e+24f, -2.71613e+29f, -1.64207e-31f, 5.76527e-19f, 4.7323e-37f, 5.39271e-19f
|
||||
path.lineTo(SkBits2Float(0x3a803adf), SkBits2Float(0x8a294f1a)); // 0.000978317f, -8.15193e-33f
|
||||
path.quadTo(SkBits2Float(0x291d9628), SkBits2Float(0x2a43e62b), SkBits2Float(0x093a2a81), SkBits2Float(0x5c5c8ced)); // 3.49912e-14f, 1.73993e-13f, 2.24089e-33f, 2.48318e+17f
|
||||
path.lineTo(SkBits2Float(0x68275b2d), SkBits2Float(0xf0685527)); // 3.16127e+24f, -2.87614e+29f
|
||||
path.close();
|
||||
path.moveTo(SkBits2Float(0x68275b2d), SkBits2Float(0xf0685527)); // 3.16127e+24f, -2.87614e+29f
|
||||
path.cubicTo(SkBits2Float(0x3ac2213a), SkBits2Float(0x291d9628), SkBits2Float(0x2a43e62b), SkBits2Float(0x293a2a81), SkBits2Float(0x5c5c8ced), SkBits2Float(0x5c5c6e5c)); // 0.00148109f, 3.49912e-14f, 1.73993e-13f, 4.13372e-14f, 2.48318e+17f, 2.48183e+17f
|
||||
path.lineTo(SkBits2Float(0x1f212a8c), SkBits2Float(0xc0032108)); // 3.41283e-20f, -2.04889f
|
||||
path.lineTo(SkBits2Float(0xed847b4b), SkBits2Float(0x2d552829)); // -5.12513e+27f, 1.21166e-11f
|
||||
path.conicTo(SkBits2Float(0x552d5b5b), SkBits2Float(0x3b5a6839), SkBits2Float(0x5b2df068), SkBits2Float(0x2a212a1f), SkBits2Float(0x532a8cef)); // 1.1913e+13f, 0.00333263f, 4.89595e+16f, 1.43143e-13f, 7.32509e+11f
|
||||
|
||||
SkPath path2(path);
|
||||
testPathOpFuzz(reporter, path1, path2, (SkPathOp) 0, filename);
|
||||
}
|
||||
|
||||
static struct TestDesc failTests[] = {
|
||||
TEST(fuzz763_57),
|
||||
TEST(fuzz763_56),
|
||||
TEST(fuzz763_55),
|
||||
TEST(fuzz763_54),
|
||||
|
@ -155,10 +155,71 @@ path.quadTo(SkBits2Float(0xb6b6b6e9), SkBits2Float(0xb6b6b6b6), SkBits2Float(0xe
|
||||
testSimplifyFuzz(reporter, path, filename);
|
||||
}
|
||||
|
||||
static void fuzz763_2(skiatest::Reporter* reporter, const char* filename) {
|
||||
SkPath path;
|
||||
path.setFillType((SkPath::FillType) 0);
|
||||
path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
|
||||
path.cubicTo(SkBits2Float(0x76773011), SkBits2Float(0x5d66fe78), SkBits2Float(0xbbeeff66), SkBits2Float(0x637677a2), SkBits2Float(0x205266fe), SkBits2Float(0xec296fdf)); // 1.25339e+33f, 1.0403e+18f, -0.00729363f, 4.54652e+21f, 1.78218e-19f, -8.19347e+26f
|
||||
path.lineTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
|
||||
path.close();
|
||||
path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
|
||||
path.quadTo(SkBits2Float(0xec4eecec), SkBits2Float(0x6e6f10ec), SkBits2Float(0xb6b6ecf7), SkBits2Float(0xb6b6b6b6)); // -1.00063e+27f, 1.84968e+28f, -5.45161e-06f, -5.44529e-06f
|
||||
path.moveTo(SkBits2Float(0x002032b8), SkBits2Float(0xecfeb6b6)); // 2.95693e-39f, -2.46344e+27f
|
||||
path.moveTo(SkBits2Float(0x73737300), SkBits2Float(0x73735273)); // 1.9288e+31f, 1.9278e+31f
|
||||
path.cubicTo(SkBits2Float(0x1616ece4), SkBits2Float(0xdf020018), SkBits2Float(0x77772965), SkBits2Float(0x1009db73), SkBits2Float(0x80ececec), SkBits2Float(0xf7ffffff)); // 1.21917e-25f, -9.36751e+18f, 5.01303e+33f, 2.71875e-29f, -2.17582e-38f, -1.03846e+34f
|
||||
path.lineTo(SkBits2Float(0x73737300), SkBits2Float(0x73735273)); // 1.9288e+31f, 1.9278e+31f
|
||||
path.close();
|
||||
path.moveTo(SkBits2Float(0x73737300), SkBits2Float(0x73735273)); // 1.9288e+31f, 1.9278e+31f
|
||||
path.conicTo(SkBits2Float(0xec0700ec), SkBits2Float(0xecececec), SkBits2Float(0xececccec), SkBits2Float(0x772965ec), SkBits2Float(0x77777377)); // -6.52837e+26f, -2.2914e+27f, -2.29019e+27f, 3.4358e+33f, 5.0189e+33f
|
||||
path.moveTo(SkBits2Float(0xfe817477), SkBits2Float(0xdf665266)); // -8.60376e+37f, -1.65964e+19f
|
||||
path.close();
|
||||
path.moveTo(SkBits2Float(0xfe817477), SkBits2Float(0xdf665266)); // -8.60376e+37f, -1.65964e+19f
|
||||
path.quadTo(SkBits2Float(0x29ec02ec), SkBits2Float(0x1009ecec), SkBits2Float(0x80ececec), SkBits2Float(0xf7ffffff)); // 1.0481e-13f, 2.7201e-29f, -2.17582e-38f, -1.03846e+34f
|
||||
path.lineTo(SkBits2Float(0xfe817477), SkBits2Float(0xdf665266)); // -8.60376e+37f, -1.65964e+19f
|
||||
path.close();
|
||||
path.moveTo(SkBits2Float(0xfe817477), SkBits2Float(0xdf665266)); // -8.60376e+37f, -1.65964e+19f
|
||||
path.conicTo(SkBits2Float(0xff003aff), SkBits2Float(0xdbec2300), SkBits2Float(0xecececec), SkBits2Float(0x6fdf6052), SkBits2Float(0x41ecec29)); // -1.70448e+38f, -1.32933e+17f, -2.2914e+27f, 1.38263e+29f, 29.6153f
|
||||
path.lineTo(SkBits2Float(0xfe817477), SkBits2Float(0xdf665266)); // -8.60376e+37f, -1.65964e+19f
|
||||
path.close();
|
||||
path.moveTo(SkBits2Float(0xfe817477), SkBits2Float(0xdf665266)); // -8.60376e+37f, -1.65964e+19f
|
||||
path.quadTo(SkBits2Float(0xecf76e6f), SkBits2Float(0xeccfddec), SkBits2Float(0xecececcc), SkBits2Float(0x66000066)); // -2.39301e+27f, -2.01037e+27f, -2.2914e+27f, 1.51118e+23f
|
||||
path.lineTo(SkBits2Float(0xfe817477), SkBits2Float(0xdf665266)); // -8.60376e+37f, -1.65964e+19f
|
||||
path.close();
|
||||
path.moveTo(SkBits2Float(0xfe817477), SkBits2Float(0xdf665266)); // -8.60376e+37f, -1.65964e+19f
|
||||
path.cubicTo(SkBits2Float(0x772965df), SkBits2Float(0x77777377), SkBits2Float(0x77777876), SkBits2Float(0x665266fe), SkBits2Float(0xecececdf), SkBits2Float(0x0285806e)); // 3.4358e+33f, 5.0189e+33f, 5.0193e+33f, 2.48399e+23f, -2.2914e+27f, 1.96163e-37f
|
||||
path.lineTo(SkBits2Float(0xecececeb), SkBits2Float(0xecec0700)); // -2.2914e+27f, -2.28272e+27f
|
||||
path.lineTo(SkBits2Float(0xfe817477), SkBits2Float(0xdf665266)); // -8.60376e+37f, -1.65964e+19f
|
||||
path.close();
|
||||
path.moveTo(SkBits2Float(0xfe817477), SkBits2Float(0xdf665266)); // -8.60376e+37f, -1.65964e+19f
|
||||
path.lineTo(SkBits2Float(0x65ecfaec), SkBits2Float(0xde777729)); // 1.39888e+23f, -4.45794e+18f
|
||||
path.conicTo(SkBits2Float(0x74777777), SkBits2Float(0x66fe7876), SkBits2Float(0xecdf6660), SkBits2Float(0x726eecec), SkBits2Float(0x29d610ec)); // 7.84253e+31f, 6.00852e+23f, -2.16059e+27f, 4.73241e+30f, 9.50644e-14f
|
||||
path.lineTo(SkBits2Float(0xfe817477), SkBits2Float(0xdf665266)); // -8.60376e+37f, -1.65964e+19f
|
||||
path.close();
|
||||
path.moveTo(SkBits2Float(0xd0ecec10), SkBits2Float(0x6e6eecdb)); // -3.17991e+10f, 1.84859e+28f
|
||||
path.quadTo(SkBits2Float(0x003affec), SkBits2Float(0xec2300ef), SkBits2Float(0xecececdb), SkBits2Float(0xcfececec)); // 5.41827e-39f, -7.88237e+26f, -2.2914e+27f, -7.9499e+09f
|
||||
path.lineTo(SkBits2Float(0xd0ecec10), SkBits2Float(0x6e6eecdb)); // -3.17991e+10f, 1.84859e+28f
|
||||
path.close();
|
||||
path.moveTo(SkBits2Float(0xd0ecec10), SkBits2Float(0x6e6eecdb)); // -3.17991e+10f, 1.84859e+28f
|
||||
path.quadTo(SkBits2Float(0xecccec80), SkBits2Float(0xfa66ecec), SkBits2Float(0x66fa0000), SkBits2Float(0x772965df)); // -1.9819e+27f, -2.99758e+35f, 5.90296e+23f, 3.4358e+33f
|
||||
path.moveTo(SkBits2Float(0x77777790), SkBits2Float(0x00807677)); // 5.01923e+33f, 1.17974e-38f
|
||||
path.close();
|
||||
path.moveTo(SkBits2Float(0x77777790), SkBits2Float(0x00807677)); // 5.01923e+33f, 1.17974e-38f
|
||||
path.cubicTo(SkBits2Float(0xecececec), SkBits2Float(0xfe66eaec), SkBits2Float(0xecdf1452), SkBits2Float(0x806eecec), SkBits2Float(0x10ececec), SkBits2Float(0xec000000)); // -2.2914e+27f, -7.67356e+37f, -2.15749e+27f, -1.01869e-38f, 9.34506e-29f, -6.1897e+26f
|
||||
path.lineTo(SkBits2Float(0x77777790), SkBits2Float(0x00807677)); // 5.01923e+33f, 1.17974e-38f
|
||||
path.close();
|
||||
path.moveTo(SkBits2Float(0x77777790), SkBits2Float(0x00807677)); // 5.01923e+33f, 1.17974e-38f
|
||||
path.cubicTo(SkBits2Float(0x52668062), SkBits2Float(0x2965df66), SkBits2Float(0x77777377), SkBits2Float(0x76777773), SkBits2Float(0x1697fe78), SkBits2Float(0xeebfff00)); // 2.47499e+11f, 5.1042e-14f, 5.0189e+33f, 1.2548e+33f, 2.4556e-25f, -2.971e+28f
|
||||
path.lineTo(SkBits2Float(0x77777790), SkBits2Float(0x00807677)); // 5.01923e+33f, 1.17974e-38f
|
||||
path.close();
|
||||
|
||||
testSimplifyFuzz(reporter, path, filename);
|
||||
}
|
||||
|
||||
|
||||
#define TEST(test) test(reporter, #test)
|
||||
|
||||
DEF_TEST(PathOpsSimplifyFail, reporter) {
|
||||
TEST(fuzz763_2);
|
||||
TEST(fuzz763_1);
|
||||
TEST(fuzz_x2);
|
||||
TEST(fuzz_x1);
|
||||
|
Loading…
Reference in New Issue
Block a user