mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:17:34 +00:00
Fuzzers: Avoid unnecessary ByteBuffer copies in FuzzWAVLoader
Avoid trying to memcpy from 0-byte sources as well, by bailing early on nullptr data inputs.
This commit is contained in:
parent
0c95d9962c
commit
fb179bc289
1 changed files with 4 additions and 2 deletions
|
@ -10,8 +10,10 @@
|
||||||
|
|
||||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
||||||
{
|
{
|
||||||
auto wav_data = ByteBuffer::copy(data, size).release_value();
|
if (!data)
|
||||||
auto wav = make<Audio::WavLoaderPlugin>(wav_data.bytes());
|
return 0;
|
||||||
|
auto wav_data = ReadonlyBytes { data, size };
|
||||||
|
auto wav = make<Audio::WavLoaderPlugin>(wav_data);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
auto samples = wav->get_more_samples();
|
auto samples = wav->get_more_samples();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue