mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
Lagom/Fuzzers: Add fuzzer for FLAC loader
This commit is contained in:
parent
bc44753adb
commit
448e8c6f45
2 changed files with 24 additions and 0 deletions
|
@ -20,6 +20,7 @@ add_simple_fuzzer(FuzzCyrillicDecoder)
|
|||
add_simple_fuzzer(FuzzDeflateCompression)
|
||||
add_simple_fuzzer(FuzzDeflateDecompression)
|
||||
add_simple_fuzzer(FuzzELF)
|
||||
add_simple_fuzzer(FuzzFlacLoader)
|
||||
add_simple_fuzzer(FuzzGemini)
|
||||
add_simple_fuzzer(FuzzGIFLoader)
|
||||
add_simple_fuzzer(FuzzGzipCompression)
|
||||
|
|
23
Meta/Lagom/Fuzzers/FuzzFlacLoader.cpp
Normal file
23
Meta/Lagom/Fuzzers/FuzzFlacLoader.cpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibAudio/FlacLoader.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
||||
{
|
||||
auto flac_data = ByteBuffer::copy(data, size);
|
||||
auto flac = make<Audio::FlacLoaderPlugin>(flac_data);
|
||||
|
||||
if (!flac->sniff())
|
||||
return 1;
|
||||
|
||||
while (flac->get_more_samples())
|
||||
;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Reference in a new issue