Fix invalid switch in FuzzCanvas
Also tweak when we report OOM - AFL-fuzz is fine, but libfuzzer should abort, not exit. Bug: skia: Change-Id: Ic19277bbceec5e7c0ac966d6d9ac677bcfebcfae Reviewed-on: https://skia-review.googlesource.com/93201 Commit-Queue: Kevin Lubick <kjlubick@google.com> Reviewed-by: Hal Canary <halcanary@google.com>
This commit is contained in:
parent
1f096ac6ab
commit
54f20e0df6
@ -135,6 +135,7 @@ inline void Fuzz::next(SkMatrix* m) {
|
||||
m->set9(buffer);
|
||||
return;
|
||||
default:
|
||||
SkASSERT(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -223,6 +224,9 @@ static sk_sp<SkColorFilter> make_fuzz_colorfilter(Fuzz* fuzz, int depth) {
|
||||
fuzz->nextN(tableB, SK_ARRAY_COUNT(tableB));
|
||||
return SkTableColorFilter::MakeARGB(tableA, tableR, tableG, tableB);
|
||||
}
|
||||
default:
|
||||
SkASSERT(false);
|
||||
break;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@ -411,6 +415,7 @@ static sk_sp<SkShader> make_fuzz_shader(Fuzz* fuzz, int depth) {
|
||||
}
|
||||
}
|
||||
default:
|
||||
SkASSERT(false);
|
||||
break;
|
||||
}
|
||||
return nullptr;
|
||||
@ -608,7 +613,7 @@ static sk_sp<SkImageFilter> make_fuzz_imageFilter(Fuzz* fuzz, int depth) {
|
||||
return nullptr;
|
||||
}
|
||||
uint8_t imageFilterType;
|
||||
fuzz->nextRange(&imageFilterType, 0, 24);
|
||||
fuzz->nextRange(&imageFilterType, 0, 23);
|
||||
switch (imageFilterType) {
|
||||
case 0:
|
||||
return nullptr;
|
||||
@ -1023,6 +1028,7 @@ static SkTDArray<uint8_t> make_fuzz_text(Fuzz* fuzz, const SkPaint& paint) {
|
||||
break;
|
||||
default:
|
||||
SkASSERT(false);
|
||||
break;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
@ -1065,6 +1071,7 @@ static sk_sp<SkTextBlob> make_fuzz_textblob(Fuzz* fuzz) {
|
||||
break;
|
||||
default:
|
||||
SkASSERT(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return textBlobBuilder.make();
|
||||
@ -1663,6 +1670,7 @@ static void fuzz_canvas(Fuzz* fuzz, SkCanvas* canvas, int depth = 9) {
|
||||
break;
|
||||
}
|
||||
default:
|
||||
SkASSERT(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ static void fuzz_path(Fuzz* fuzz, SkPath* path, int maxOps) {
|
||||
path->close();
|
||||
break;
|
||||
default:
|
||||
SkASSERT(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ void sk_abort_no_print() {
|
||||
|
||||
void sk_out_of_memory(void) {
|
||||
SkDEBUGFAIL("sk_out_of_memory");
|
||||
#if defined(IS_FUZZING)
|
||||
#if defined(IS_FUZZING_WITH_AFL)
|
||||
exit(1);
|
||||
#else
|
||||
abort();
|
||||
|
Loading…
Reference in New Issue
Block a user