ladybird/Meta/Lagom/Fuzzers/FuzzWAVLoader.cpp

24 lines
476 B
C++
Raw Normal View History

2021-02-28 19:43:07 -03:00
/*
* Copyright (c) 2021, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
2021-02-28 19:43:07 -03:00
*/
#include <LibAudio/WavLoader.h>
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
auto wav_data = ByteBuffer::copy(data, size).release_value();
2021-02-28 19:43:07 -03:00
auto wav = make<Audio::WavLoaderPlugin>(wav_data);
if (!wav->sniff())
return 1;
while (wav->get_more_samples())
;
return 0;
}