mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:07:34 +00:00
Meta+Tests: Add a fuzzer and a test for the ILBM decoder
This commit is contained in:
parent
fda5590313
commit
0986533c11
5 changed files with 31 additions and 0 deletions
18
Meta/Lagom/Fuzzers/FuzzILBMLoader.cpp
Normal file
18
Meta/Lagom/Fuzzers/FuzzILBMLoader.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* Copyright (c) 2023, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibGfx/ImageFormats/ILBMLoader.h>
|
||||
#include <stdio.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
||||
{
|
||||
auto decoder_or_error = Gfx::ILBMImageDecoderPlugin::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