mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00

Typeface::try_load_from_externally_owned_memory() relies on that external owner keeping the memory around. However, neither WOFF nor WOFF2 do so - they both create separate ByteBuffers to hold the TTF data. So, rename them to make it clearer that they don't have any requirements on the byte owner.
23 lines
562 B
C++
23 lines
562 B
C++
/*
|
|
* Copyright (c) 2023, Tim Ledbetter <timledbetter@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibGfx/Font/WOFF/Loader.h>
|
|
#include <LibTest/TestCase.h>
|
|
|
|
#define TEST_INPUT(x) ("test-inputs/" x)
|
|
|
|
TEST_CASE(malformed_woff)
|
|
{
|
|
Array test_inputs = {
|
|
TEST_INPUT("woff/invalid_sfnt_size.woff"sv)
|
|
};
|
|
|
|
for (auto test_input : test_inputs) {
|
|
auto file = MUST(Core::MappedFile::map(test_input));
|
|
auto font_or_error = WOFF::try_load_from_bytes(file->bytes());
|
|
EXPECT(font_or_error.is_error());
|
|
}
|
|
}
|