1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 16:47:34 +00:00

Tests: Add regression tests for fixed OSS-Fuzz test cases

This commit is contained in:
Tim Ledbetter 2023-10-21 23:22:32 +01:00 committed by Andreas Kling
parent c62dded5cc
commit cb16c217b8
18 changed files with 119 additions and 0 deletions

View file

@ -12,3 +12,7 @@ install(FILES vp9_4k.webm DESTINATION usr/Tests/LibVideo)
install(FILES vp9_clamp_reference_mvs.webm DESTINATION usr/Tests/LibVideo)
install(FILES vp9_oob_blocks.webm DESTINATION usr/Tests/LibVideo)
install(FILES master_elements_containing_crc32.mkv DESTINATION usr/Tests/LibVideo)
install(FILES oss-fuzz-testcase-52630.vp9 DESTINATION usr/Tests/LibVideo)
install(FILES oss-fuzz-testcase-53977.vp9 DESTINATION usr/Tests/LibVideo)
install(FILES oss-fuzz-testcase-62054.vp9 DESTINATION usr/Tests/LibVideo)
install(FILES oss-fuzz-testcase-63182.vp9 DESTINATION usr/Tests/LibVideo)

View file

@ -59,6 +59,23 @@ TEST_CASE(vp9_oob_blocks)
decode_video("./vp9_oob_blocks.webm"sv, 240);
}
TEST_CASE(vp9_malformed_frame)
{
Array test_inputs = {
"./oss-fuzz-testcase-52630.vp9"sv,
"./oss-fuzz-testcase-53977.vp9"sv,
"./oss-fuzz-testcase-62054.vp9"sv,
"./oss-fuzz-testcase-63182.vp9"sv
};
for (auto test_input : test_inputs) {
auto file = MUST(Core::MappedFile::map(test_input));
Video::VP9::Decoder vp9_decoder;
auto maybe_decoder_error = vp9_decoder.receive_sample(file->bytes());
EXPECT(maybe_decoder_error.is_error());
}
}
BENCHMARK_CASE(vp9_4k)
{
decode_video("./vp9_4k.webm"sv, 2);

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
I<EFBFBD>

Binary file not shown.