mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
LibAudio: Extract loader stream creation from the plugins
This removes a lot of duplicated stream creation code from the plugins, and also simplifies the way that the appropriate plugin is found. This mirrors the ImageDecoderPlugin design and necessitates new sniffing methods on the loaders.
This commit is contained in:
committed by
Sam Atkins
parent
dfd48ab643
commit
5f1dbbaaa6
@@ -4,14 +4,16 @@
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/MemoryStream.h>
|
||||
#include <LibAudio/QOALoader.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
||||
{
|
||||
auto qoa_data = ByteBuffer::copy(data, size).release_value();
|
||||
auto qoa_or_error = Audio::QOALoaderPlugin::create(qoa_data.bytes());
|
||||
auto const qoa_bytes = ByteBuffer::copy(data, size).release_value();
|
||||
auto qoa_data = try_make<FixedMemoryStream>(qoa_bytes).release_value();
|
||||
auto qoa_or_error = Audio::QOALoaderPlugin::create(move(qoa_data));
|
||||
|
||||
if (qoa_or_error.is_error())
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user