mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Lagom/Fuzzers: Add a fuzzer for our TIFF decoder
This commit is contained in:
committed by
Andrew Kaster
parent
26a3be17c8
commit
8612aee640
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) \
|
||||
|
||||
Reference in New Issue
Block a user