mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
Fuzzers: Add a DDS fuzzer
This commit is contained in:
parent
581236b24a
commit
b5658d75f5
3 changed files with 20 additions and 0 deletions
17
Meta/Lagom/Fuzzers/FuzzDDSLoader.cpp
Normal file
17
Meta/Lagom/Fuzzers/FuzzDDSLoader.cpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* Copyright (c) 2023, MacDue <macdue@dueutil.tech>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibGfx/ImageFormats/DDSLoader.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
||||
{
|
||||
auto decoder_or_error = Gfx::DDSImageDecoderPlugin::create({ data, size });
|
||||
if (decoder_or_error.is_error())
|
||||
return 0;
|
||||
auto decoder = decoder_or_error.release_value();
|
||||
(void)decoder->frame(0);
|
||||
return 0;
|
||||
}
|
|
@ -3,6 +3,7 @@ set(FUZZER_TARGETS
|
|||
BMPLoader
|
||||
Brotli
|
||||
CyrillicDecoder
|
||||
DDSLoader
|
||||
DeflateCompression
|
||||
DeflateDecompression
|
||||
ELF
|
||||
|
@ -72,6 +73,7 @@ set(FUZZER_DEPENDENCIES_BMPLoader LibGfx)
|
|||
set(FUZZER_DEPENDENCIES_Brotli LibCompress)
|
||||
set(FUZZER_DEPENDENCIES_CSSParser LibWeb)
|
||||
set(FUZZER_DEPENDENCIES_CyrillicDecoder LibTextCodec)
|
||||
set(FUZZER_DEPENDENCIES_DDSLoader LibGfx)
|
||||
set(FUZZER_DEPENDENCIES_DeflateCompression LibCompress)
|
||||
set(FUZZER_DEPENDENCIES_DeflateDecompression LibCompress)
|
||||
set(FUZZER_DEPENDENCIES_ELF LibELF)
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
T(Brotli) \
|
||||
T(CSSParser) \
|
||||
T(CyrillicDecoder) \
|
||||
T(DDSLoader) \
|
||||
T(DeflateCompression) \
|
||||
T(DeflateDecompression) \
|
||||
T(ELF) \
|
||||
|
|
Loading…
Add table
Reference in a new issue