serenity/Meta/Lagom/Fuzzers/FuzzMP3Loader.cpp
kleines Filmröllchen 8df714ff1e Meta/Fuzzers: Extract common audio fuzzing code
Apart from the class used audio fuzzers have identical behavior: Create
a memory stream from the fuzzer input and pass this to the loader, then
try to load audio until an error occurs. Since the loader plugins need
to have the same static create() function anyways for LibAudio itself,
we can unify the fuzzer implementations and reduce code duplication.
2023-07-05 11:58:50 +01:00

14 lines
334 B
C++

/*
* Copyright (c) 2023, kleines Filmröllchen <filmroellchen@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "AudioFuzzerCommon.h"
#include <LibAudio/MP3Loader.h>
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
return fuzz_audio_loader<Audio::MP3LoaderPlugin>(data, size);
}