mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:57:45 +00:00
LibGfx/WOFF: Return error if numTables
is 0
This is consistent with WOFF2.
This commit is contained in:
parent
52f78d07b8
commit
6e4c97a328
1 changed files with 1 additions and 1 deletions
|
@ -94,7 +94,7 @@ ErrorOr<NonnullRefPtr<Font>> Font::try_load_from_externally_owned_memory(Readonl
|
|||
auto expected_total_sfnt_size = sizeof(OpenType::TableDirectory) + header.num_tables * 16;
|
||||
if (header.length > buffer.size())
|
||||
return Error::from_string_literal("Invalid WOFF length");
|
||||
if (header.num_tables > NumericLimits<u16>::max() / 16)
|
||||
if (header.num_tables == 0 || header.num_tables > NumericLimits<u16>::max() / 16)
|
||||
return Error::from_string_literal("Invalid WOFF numTables");
|
||||
if (header.reserved != 0)
|
||||
return Error::from_string_literal("Invalid WOFF reserved field");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue