mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:37:35 +00:00
Fuzzers: Add a WebP fuzzer
This commit is contained in:
parent
1fc56e56c3
commit
a34b300393
2 changed files with 21 additions and 0 deletions
|
@ -76,6 +76,7 @@ add_simple_fuzzer(FuzzRSAKeyParsing LibCrypto)
|
||||||
add_simple_fuzzer(FuzzVP9Decoder LibVideo)
|
add_simple_fuzzer(FuzzVP9Decoder LibVideo)
|
||||||
add_simple_fuzzer(FuzzWAVLoader LibAudio)
|
add_simple_fuzzer(FuzzWAVLoader LibAudio)
|
||||||
add_simple_fuzzer(FuzzWasmParser LibWasm)
|
add_simple_fuzzer(FuzzWasmParser LibWasm)
|
||||||
|
add_simple_fuzzer(FuzzWebPLoader LibGfx)
|
||||||
add_simple_fuzzer(FuzzWOFF LibGfx)
|
add_simple_fuzzer(FuzzWOFF LibGfx)
|
||||||
add_simple_fuzzer(FuzzXML LibXML)
|
add_simple_fuzzer(FuzzXML LibXML)
|
||||||
add_simple_fuzzer(FuzzZip LibArchive)
|
add_simple_fuzzer(FuzzZip LibArchive)
|
||||||
|
|
20
Meta/Lagom/Fuzzers/FuzzWebPLoader.cpp
Normal file
20
Meta/Lagom/Fuzzers/FuzzWebPLoader.cpp
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2023, the SerenityOS developers.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <LibGfx/ImageFormats/WebPLoader.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
||||||
|
{
|
||||||
|
auto decoder_or_error = Gfx::WebPImageDecoderPlugin::create({ data, size });
|
||||||
|
if (decoder_or_error.is_error())
|
||||||
|
return 0;
|
||||||
|
auto decoder = decoder_or_error.release_value();
|
||||||
|
decoder->initialize();
|
||||||
|
(void)decoder->frame(0);
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue