diff --git a/Meta/Lagom/Fuzzers/CMakeLists.txt b/Meta/Lagom/Fuzzers/CMakeLists.txt index 445c271ade..a9b5c0b6ed 100644 --- a/Meta/Lagom/Fuzzers/CMakeLists.txt +++ b/Meta/Lagom/Fuzzers/CMakeLists.txt @@ -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) diff --git a/Meta/Lagom/Fuzzers/FuzzMatroskaReader.cpp b/Meta/Lagom/Fuzzers/FuzzMatroskaReader.cpp new file mode 100644 index 0000000000..ac59b7c34c --- /dev/null +++ b/Meta/Lagom/Fuzzers/FuzzMatroskaReader.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022, the SerenityOS developers. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +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; +} diff --git a/Meta/Lagom/Fuzzers/FuzzVP9Decoder.cpp b/Meta/Lagom/Fuzzers/FuzzVP9Decoder.cpp new file mode 100644 index 0000000000..4827a1f9aa --- /dev/null +++ b/Meta/Lagom/Fuzzers/FuzzVP9Decoder.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022, the SerenityOS developers. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +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; +}