mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Fuzzers: Avoid unnecessary ByteBuffer copies in FuzzWAVLoader
Avoid trying to memcpy from 0-byte sources as well, by bailing early on nullptr data inputs.
This commit is contained in:
parent
0c95d9962c
commit
fb179bc289
Notes:
sideshowbarker
2024-07-17 18:28:48 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/fb179bc289 Pull-request: https://github.com/SerenityOS/serenity/pull/12677 Issue: https://github.com/SerenityOS/serenity/issues/9466 Reviewed-by: https://github.com/linusg ✅ Reviewed-by: https://github.com/trflynn89
1 changed files with 4 additions and 2 deletions
|
@ -10,8 +10,10 @@
|
|||
|
||||
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());
|
||||
if (!data)
|
||||
return 0;
|
||||
auto wav_data = ReadonlyBytes { data, size };
|
||||
auto wav = make<Audio::WavLoaderPlugin>(wav_data);
|
||||
|
||||
for (;;) {
|
||||
auto samples = wav->get_more_samples();
|
||||
|
|
Loading…
Reference in a new issue