blob: 6e0c21f21f716cef08a1d20f03ffb5d687d37943 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
/*
* Copyright (c) 2021, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#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();
auto wav = make<Audio::WavLoaderPlugin>(wav_data.bytes());
for (;;) {
auto samples = wav->get_more_samples();
if (samples.is_error())
return 2;
if (samples.value()->sample_count() > 0)
break;
}
return 0;
}
|