mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-11 17:00:37 +00:00
LibGfx/WOFF: Return error if numTables
is 0
This is consistent with WOFF2.
This commit is contained in:
parent
52f78d07b8
commit
6e4c97a328
Notes:
sideshowbarker
2024-07-18 04:38:32 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/6e4c97a328 Pull-request: https://github.com/SerenityOS/serenity/pull/21593
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…
Reference in a new issue