mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:27:35 +00:00
Lagom/Fuzzers: Add a fuzzer for our TIFF decoder
This commit is contained in:
parent
26a3be17c8
commit
8612aee640
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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue