1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:37:36 +00:00

Fuzzers: Add VP9Decoder and MatroskaReader fuzzers for LibVideo

This commit is contained in:
Andrew Kaster 2022-10-11 21:44:06 -06:00 committed by Linus Groh
parent bf014c4d20
commit b704f82487
3 changed files with 34 additions and 0 deletions

View file

@ -32,6 +32,7 @@ add_simple_fuzzer(FuzzGzipCompression LibCompress)
add_simple_fuzzer(FuzzGzipDecompression LibCompress)
add_simple_fuzzer(FuzzICOLoader LibGfx)
add_simple_fuzzer(FuzzJPGLoader LibGfx)
add_simple_fuzzer(FuzzMatroskaReader LibVideo)
add_simple_fuzzer(FuzzMD5 LibCrypto)
add_simple_fuzzer(FuzzMP3Loader LibAudio)
add_simple_fuzzer(FuzzPEM LibCrypto)
@ -64,6 +65,7 @@ add_simple_fuzzer(FuzzTTF LibGfx)
add_simple_fuzzer(FuzzURL)
add_simple_fuzzer(FuzzUTF16BEDecoder LibTextCodec)
add_simple_fuzzer(FuzzRSAKeyParsing LibCrypto)
add_simple_fuzzer(FuzzVP9Decoder LibVideo)
add_simple_fuzzer(FuzzWAVLoader LibAudio)
add_simple_fuzzer(FuzzWasmParser LibWasm)
add_simple_fuzzer(FuzzWOFF LibGfx)

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibVideo/MatroskaReader.h>
#include <stddef.h>
extern "C" int LLVMFuzzerTestOneInput(u8 const* data, size_t size)
{
auto matroska_document = Video::MatroskaReader::parse_matroska_from_data(data, size);
if (!matroska_document)
return -1;
return 0;
}

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibVideo/VP9/Decoder.h>
#include <stddef.h>
extern "C" int LLVMFuzzerTestOneInput(u8 const* data, size_t size)
{
Video::VP9::Decoder vp9_decoder;
if (auto decode_error = vp9_decoder.decode({ data, size }); decode_error.is_error())
return -1;
return 0;
}