mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 15:10:19 +00:00
Fuzzers: Add JPEG2000 fuzzer
This commit is contained in:
parent
9ec5a1591d
commit
2e142105c9
Notes:
sideshowbarker
2024-07-17 02:14:39 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/2e142105c9 Pull-request: https://github.com/SerenityOS/serenity/pull/23682 Reviewed-by: https://github.com/LucasChollet Reviewed-by: https://github.com/Zaggy1024 Reviewed-by: https://github.com/timschumi ✅
3 changed files with 23 additions and 0 deletions
20
Meta/Lagom/Fuzzers/FuzzJPEG2000Loader.cpp
Normal file
20
Meta/Lagom/Fuzzers/FuzzJPEG2000Loader.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright (c) 2024, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibGfx/ImageFormats/JPEG2000Loader.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
||||
{
|
||||
AK::set_debug_enabled(false);
|
||||
auto decoder_or_error = Gfx::JPEG2000ImageDecoderPlugin::create({ data, size });
|
||||
if (decoder_or_error.is_error())
|
||||
return 0;
|
||||
auto decoder = decoder_or_error.release_value();
|
||||
(void)decoder->frame(0);
|
||||
return 0;
|
||||
}
|
|
@ -20,6 +20,7 @@ set(FUZZER_TARGETS
|
|||
ILBMLoader
|
||||
IMAPParser
|
||||
JBIG2Loader
|
||||
JPEG2000Loader
|
||||
JPEGLoader
|
||||
Js
|
||||
JsonParser
|
||||
|
@ -94,6 +95,7 @@ set(FUZZER_DEPENDENCIES_ICOLoader LibGfx)
|
|||
set(FUZZER_DEPENDENCIES_ILBMLoader LibGfx)
|
||||
set(FUZZER_DEPENDENCIES_IMAPParser LibIMAP)
|
||||
set(FUZZER_DEPENDENCIES_JBIG2Loader LibGfx)
|
||||
set(FUZZER_DEPENDENCIES_JPEG2000Loader LibGfx)
|
||||
set(FUZZER_DEPENDENCIES_JPEGLoader LibGfx)
|
||||
set(FUZZER_DEPENDENCIES_Js LibJS)
|
||||
set(FUZZER_DEPENDENCIES_LzmaDecompression LibArchive LibCompress)
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
T(ILBMLoader) \
|
||||
T(IMAPParser) \
|
||||
T(JBIG2Loader) \
|
||||
T(JPEG2000Loader) \
|
||||
T(JPEGLoader) \
|
||||
T(Js) \
|
||||
T(JsonParser) \
|
||||
|
|
Loading…
Reference in a new issue