2021-02-28 19:43:07 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* 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)
|
|
|
|
|
{
|
2021-09-05 19:59:52 -03:00
|
|
|
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;
|
|
|
|
|
}
|