LibCompress: Upgrade compression fuzzer into a roundtrip fuzzer

This commit is contained in:
Martin Janiczek 2023-09-26 20:04:37 +02:00 committed by Tim Schumacher
parent 70ac6918d1
commit 0465ba242b
Notes: sideshowbarker 2024-07-17 04:34:25 +09:00
3 changed files with 10 additions and 4 deletions

View File

@ -10,6 +10,12 @@
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
AK::set_debug_enabled(false);
(void)Compress::GzipCompressor::compress_all(ReadonlyBytes { data, size });
auto input = ReadonlyBytes { data, size };
auto compressed = MUST(Compress::GzipCompressor::compress_all(input));
auto decompressed = MUST(Compress::GzipDecompressor::decompress_all(compressed));
VERIFY(decompressed == input);
return 0;
}

View File

@ -11,8 +11,8 @@ set(FUZZER_TARGETS
FlacLoader
Gemini
GIFLoader
GzipCompression
GzipDecompression
GzipRoundtrip
HttpRequest
ICCProfile
ICOLoader
@ -83,8 +83,8 @@ set(FUZZER_DEPENDENCIES_ELF LibELF)
set(FUZZER_DEPENDENCIES_FlacLoader LibAudio)
set(FUZZER_DEPENDENCIES_Gemini LibGemini)
set(FUZZER_DEPENDENCIES_GIFLoader LibGfx)
set(FUZZER_DEPENDENCIES_GzipCompression LibCompress)
set(FUZZER_DEPENDENCIES_GzipDecompression LibCompress)
set(FUZZER_DEPENDENCIES_GzipRoundtrip LibCompress)
set(FUZZER_DEPENDENCIES_HttpRequest LibHTTP)
set(FUZZER_DEPENDENCIES_ICCProfile LibGfx)
set(FUZZER_DEPENDENCIES_ICOLoader LibGfx)

View File

@ -25,8 +25,8 @@
T(FlacLoader) \
T(Gemini) \
T(GIFLoader) \
T(GzipCompression) \
T(GzipDecompression) \
T(GzipRoundtrip) \
T(HttpRequest) \
T(ICCProfile) \
T(ICOLoader) \