Meta: Add a fuzzer for the QOILoader

This commit is contained in:
Linus Groh 2021-12-21 12:11:00 +01:00
parent 67788641d3
commit 92672b1520
Notes: sideshowbarker 2024-07-17 22:31:38 +09:00
3 changed files with 22 additions and 0 deletions

View file

@ -34,6 +34,7 @@ add_simple_fuzzer(FuzzPBMLoader LagomGfx)
add_simple_fuzzer(FuzzPGMLoader LagomGfx)
add_simple_fuzzer(FuzzPPMLoader LagomGfx)
add_simple_fuzzer(FuzzPDF LagomPDF)
add_simple_fuzzer(FuzzQOILoader LagomGfx)
add_simple_fuzzer(FuzzQuotedPrintableParser LagomIMAP)
add_simple_fuzzer(FuzzHebrewDecoder LagomTextCodec)
add_simple_fuzzer(FuzzHttpRequest LagomHTTP)

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2020, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibGfx/QOILoader.h>
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
Gfx::QOIImageDecoderPlugin decoder(data, size);
(void)decoder.frame(0);
return 0;
}

View file

@ -24,6 +24,7 @@
T(PGMLoader) \
T(PNGLoader) \
T(PPMLoader) \
T(QOILoader) \
T(RegexECMA262) \
T(RegexPosixExtended) \
T(Shell) \
@ -87,6 +88,10 @@ ENUMERATE_TARGETS(__ENUMERATE_TARGET)
#include <Meta/Lagom/Fuzzers/FuzzPPMLoader.cpp>
#undef LLVMFuzzerTestOneInput
#define LLVMFuzzerTestOneInput TestQOILoader
#include <Meta/Lagom/Fuzzers/FuzzQOILoader.cpp>
#undef LLVMFuzzerTestOneInput
#define LLVMFuzzerTestOneInput TestRegexECMA262
#include <Meta/Lagom/Fuzzers/FuzzRegexECMA262.cpp>
#undef LLVMFuzzerTestOneInput