ladybird/Meta/Lagom/Fuzzers/FuzzBrotli.cpp

21 lines
502 B
C++
Raw Normal View History

2022-04-06 19:16:04 +00:00
/*
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
2023-01-25 19:19:05 +00:00
#include <AK/MemoryStream.h>
2022-04-06 19:16:04 +00:00
#include <LibCompress/Brotli.h>
#include <stdio.h>
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
AK::set_debug_enabled(false);
FixedMemoryStream bufstream { { data, size } };
2022-04-06 19:16:04 +00:00
auto brotli_stream = Compress::BrotliDecompressionStream { MaybeOwned<Stream> { bufstream } };
2022-04-06 19:16:04 +00:00
(void)brotli_stream.read_until_eof();
return 0;
2022-04-06 19:16:04 +00:00
}