Lagom/Fuzzers: Add a fuzzer for our TIFF decoder
This commit is contained in:
parent
26a3be17c8
commit
8612aee640
Notes:
sideshowbarker
2024-07-17 10:39:39 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/8612aee640 Pull-request: https://github.com/SerenityOS/serenity/pull/21666 Reviewed-by: https://github.com/nico ✅ Reviewed-by: https://github.com/tcl3
3 changed files with 21 additions and 0 deletions
18
Meta/Lagom/Fuzzers/FuzzTIFFLoader.cpp
Normal file
18
Meta/Lagom/Fuzzers/FuzzTIFFLoader.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* Copyright (c) 2023, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibGfx/ImageFormats/TIFFLoader.h>
|
||||
#include <stdio.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
||||
{
|
||||
auto decoder_or_error = Gfx::TIFFImageDecoderPlugin::create({ data, size });
|
||||
if (decoder_or_error.is_error())
|
||||
return 0;
|
||||
auto decoder = decoder_or_error.release_value();
|
||||
(void)decoder->frame(0);
|
||||
return 0;
|
||||
}
|
|
@ -53,6 +53,7 @@ set(FUZZER_TARGETS
|
|||
SQLParser
|
||||
Tar
|
||||
TGALoader
|
||||
TIFFLoader
|
||||
TTF
|
||||
TinyVGLoader
|
||||
URL
|
||||
|
@ -126,6 +127,7 @@ set(FUZZER_DEPENDENCIES_ShellPosix LibShell)
|
|||
set(FUZZER_DEPENDENCIES_SQLParser LibSQL)
|
||||
set(FUZZER_DEPENDENCIES_Tar LibArchive)
|
||||
set(FUZZER_DEPENDENCIES_TGALoader LibGfx)
|
||||
set(FUZZER_DEPENDENCIES_TIFFLoader LibGfx)
|
||||
set(FUZZER_DEPENDENCIES_TTF LibGfx)
|
||||
set(FUZZER_DEPENDENCIES_TinyVGLoader LibGfx)
|
||||
set(FUZZER_DEPENDENCIES_UTF16BEDecoder LibTextCodec)
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
T(SQLParser) \
|
||||
T(Tar) \
|
||||
T(TGALoader) \
|
||||
T(TIFFLoader) \
|
||||
T(TTF) \
|
||||
T(TinyVGLoader) \
|
||||
T(URL) \
|
||||
|
|
Loading…
Add table
Reference in a new issue