mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +00:00

This is to differentiate between the upcoming `AllocatingMemoryStream`, which automatically allocates memory as needed instead of operating on a static memory area.
24 lines
657 B
C++
24 lines
657 B
C++
/*
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibCompress/Brotli.h>
|
|
#include <LibCore/MemoryStream.h>
|
|
#include <stdio.h>
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
|
{
|
|
auto bufstream_result = Core::Stream::FixedMemoryStream::construct({ data, size });
|
|
if (bufstream_result.is_error()) {
|
|
dbgln("MemoryStream::construct() failed.");
|
|
return 0;
|
|
}
|
|
auto bufstream = bufstream_result.release_value();
|
|
|
|
auto brotli_stream = Compress::BrotliDecompressionStream { *bufstream };
|
|
|
|
(void)brotli_stream.read_until_eof();
|
|
return 0;
|
|
}
|