mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 07:54:58 +00:00
Fuzzers: Add JBIG2 fuzzer
This commit is contained in:
parent
8f4930f2df
commit
dd593d16c4
3 changed files with 23 additions and 0 deletions
20
Meta/Lagom/Fuzzers/FuzzJBIG2Loader.cpp
Normal file
20
Meta/Lagom/Fuzzers/FuzzJBIG2Loader.cpp
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2024, the SerenityOS developers.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <LibGfx/ImageFormats/JBIG2Loader.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::JBIG2ImageDecoderPlugin::create({ data, size });
|
||||||
|
if (decoder_or_error.is_error())
|
||||||
|
return 0;
|
||||||
|
auto decoder = decoder_or_error.release_value();
|
||||||
|
(void)decoder->frame(0);
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -19,6 +19,7 @@ set(FUZZER_TARGETS
|
||||||
ICOLoader
|
ICOLoader
|
||||||
ILBMLoader
|
ILBMLoader
|
||||||
IMAPParser
|
IMAPParser
|
||||||
|
JBIG2Loader
|
||||||
JPEGLoader
|
JPEGLoader
|
||||||
Js
|
Js
|
||||||
JsonParser
|
JsonParser
|
||||||
|
@ -92,6 +93,7 @@ set(FUZZER_DEPENDENCIES_ICCProfile LibGfx)
|
||||||
set(FUZZER_DEPENDENCIES_ICOLoader LibGfx)
|
set(FUZZER_DEPENDENCIES_ICOLoader LibGfx)
|
||||||
set(FUZZER_DEPENDENCIES_ILBMLoader LibGfx)
|
set(FUZZER_DEPENDENCIES_ILBMLoader LibGfx)
|
||||||
set(FUZZER_DEPENDENCIES_IMAPParser LibIMAP)
|
set(FUZZER_DEPENDENCIES_IMAPParser LibIMAP)
|
||||||
|
set(FUZZER_DEPENDENCIES_JBIG2Loader LibGfx)
|
||||||
set(FUZZER_DEPENDENCIES_JPEGLoader LibGfx)
|
set(FUZZER_DEPENDENCIES_JPEGLoader LibGfx)
|
||||||
set(FUZZER_DEPENDENCIES_Js LibJS)
|
set(FUZZER_DEPENDENCIES_Js LibJS)
|
||||||
set(FUZZER_DEPENDENCIES_LzmaDecompression LibArchive LibCompress)
|
set(FUZZER_DEPENDENCIES_LzmaDecompression LibArchive LibCompress)
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
T(ICOLoader) \
|
T(ICOLoader) \
|
||||||
T(ILBMLoader) \
|
T(ILBMLoader) \
|
||||||
T(IMAPParser) \
|
T(IMAPParser) \
|
||||||
|
T(JBIG2Loader) \
|
||||||
T(JPEGLoader) \
|
T(JPEGLoader) \
|
||||||
T(Js) \
|
T(Js) \
|
||||||
T(JsonParser) \
|
T(JsonParser) \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue