mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +00: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
|
BMPLoader
|
||||||
Brotli
|
Brotli
|
||||||
CyrillicDecoder
|
CyrillicDecoder
|
||||||
|
DDSLoader
|
||||||
DeflateCompression
|
DeflateCompression
|
||||||
DeflateDecompression
|
DeflateDecompression
|
||||||
ELF
|
ELF
|
||||||
|
@ -72,6 +73,7 @@ set(FUZZER_DEPENDENCIES_BMPLoader LibGfx)
|
||||||
set(FUZZER_DEPENDENCIES_Brotli LibCompress)
|
set(FUZZER_DEPENDENCIES_Brotli LibCompress)
|
||||||
set(FUZZER_DEPENDENCIES_CSSParser LibWeb)
|
set(FUZZER_DEPENDENCIES_CSSParser LibWeb)
|
||||||
set(FUZZER_DEPENDENCIES_CyrillicDecoder LibTextCodec)
|
set(FUZZER_DEPENDENCIES_CyrillicDecoder LibTextCodec)
|
||||||
|
set(FUZZER_DEPENDENCIES_DDSLoader LibGfx)
|
||||||
set(FUZZER_DEPENDENCIES_DeflateCompression LibCompress)
|
set(FUZZER_DEPENDENCIES_DeflateCompression LibCompress)
|
||||||
set(FUZZER_DEPENDENCIES_DeflateDecompression LibCompress)
|
set(FUZZER_DEPENDENCIES_DeflateDecompression LibCompress)
|
||||||
set(FUZZER_DEPENDENCIES_ELF LibELF)
|
set(FUZZER_DEPENDENCIES_ELF LibELF)
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
T(Brotli) \
|
T(Brotli) \
|
||||||
T(CSSParser) \
|
T(CSSParser) \
|
||||||
T(CyrillicDecoder) \
|
T(CyrillicDecoder) \
|
||||||
|
T(DDSLoader) \
|
||||||
T(DeflateCompression) \
|
T(DeflateCompression) \
|
||||||
T(DeflateDecompression) \
|
T(DeflateDecompression) \
|
||||||
T(ELF) \
|
T(ELF) \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue