1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:47:44 +00:00

Fuzzers: Add a TinyVG fuzzer

This commit is contained in:
MacDue 2023-07-17 22:33:53 +01:00 committed by Andreas Kling
parent 0bdc93bca8
commit 581236b24a
3 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,17 @@
/*
* Copyright (c) 2023, MacDue <macdue@dueutil.tech>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibGfx/ImageFormats/TinyVGLoader.h>
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto decoder_or_error = Gfx::TinyVGImageDecoderPlugin::create({ data, size });
if (decoder_or_error.is_error())
return 0;
auto decoder = decoder_or_error.release_value();
(void)decoder->frame(0);
return 0;
}