Fuzzers: Add a WebP fuzzer
This commit is contained in:
parent
1fc56e56c3
commit
a34b300393
Notes:
sideshowbarker
2024-07-17 03:05:16 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/a34b300393 Pull-request: https://github.com/SerenityOS/serenity/pull/18222 Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/skyrising Reviewed-by: https://github.com/timschumi
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(FuzzWAVLoader LibAudio)
|
||||
add_simple_fuzzer(FuzzWasmParser LibWasm)
|
||||
add_simple_fuzzer(FuzzWebPLoader LibGfx)
|
||||
add_simple_fuzzer(FuzzWOFF LibGfx)
|
||||
add_simple_fuzzer(FuzzXML LibXML)
|
||||
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
Reference in a new issue