mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
Fuzzers: Add a DDS fuzzer
This commit is contained in:
parent
581236b24a
commit
b5658d75f5
Notes:
sideshowbarker
2024-07-17 06:39:26 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/b5658d75f5 Pull-request: https://github.com/SerenityOS/serenity/pull/20079 Reviewed-by: https://github.com/LucasChollet ✅
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…
Reference in a new issue