2020-11-19 11:41:43 -05:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-11-19 11:41:43 -05:00
|
|
|
*/
|
|
|
|
|
2023-03-21 14:58:06 -04:00
|
|
|
#include <LibGfx/ImageFormats/JPEGLoader.h>
|
2020-11-19 11:41:43 -05:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2022-04-01 20:58:27 +03:00
|
|
|
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
2020-11-19 11:41:43 -05:00
|
|
|
{
|
2023-11-03 17:49:54 +00:00
|
|
|
AK::set_debug_enabled(false);
|
2023-02-18 16:09:16 -05:00
|
|
|
auto decoder_or_error = Gfx::JPEGImageDecoderPlugin::create({ data, size });
|
2023-01-20 10:13:14 +02:00
|
|
|
if (decoder_or_error.is_error())
|
|
|
|
return 0;
|
|
|
|
auto decoder = decoder_or_error.release_value();
|
2023-07-17 13:00:37 -04:00
|
|
|
(void)decoder->frame(0);
|
2020-11-19 11:41:43 -05:00
|
|
|
return 0;
|
|
|
|
}
|