mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
20f0858f67
LibFuzzer documentation [1] states that all return values except for 0 and -1 are currently reserved for future use. -1 is a special return value that causes LibFuzzer to not add a testing input to the testing corpus, regardless of the code coverage that it causes. [1] https://llvm.org/docs/LibFuzzer.html
19 lines
524 B
C++
19 lines
524 B
C++
/*
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibVideo/Containers/Matroska/Reader.h>
|
|
#include <stddef.h>
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(u8 const* data, size_t size)
|
|
{
|
|
auto matroska_reader_result = Video::Matroska::Reader::from_data({ data, size });
|
|
if (matroska_reader_result.is_error())
|
|
return 0;
|
|
(void)matroska_reader_result.value().segment_information();
|
|
(void)matroska_reader_result.value().track_count();
|
|
return 0;
|
|
}
|