diff options
author | gohai <gottfried.haider@gmail.com> | 2023-03-17 22:41:51 +0800 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-03-17 15:44:45 +0100 |
commit | d5577002d5e41de5558c97ebcefc63c19452d569 (patch) | |
tree | 78586afdddae67429e4b3a4c379301769fcb0b3e | |
parent | 3918a8492be9b162d94f5b3bf8ba6d4fd2a7fce0 (diff) | |
download | serenity-d5577002d5e41de5558c97ebcefc63c19452d569.zip |
LibGfx/OpenType: Fix bound-check
-rw-r--r-- | Userland/Libraries/LibGfx/Font/OpenType/Font.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp b/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp index e0f27fe5b6..f2439bdaa6 100644 --- a/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp +++ b/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp @@ -1005,6 +1005,7 @@ Optional<i16> GPOS::glyph_kerning(u16 left_glyph_id, u16 right_glyph_id) const auto lookup_list_slice = m_slice.slice(header.lookup_list_offset); if (lookup_list_slice.size() < sizeof(LookupList)) { dbgln_if(OPENTYPE_GPOS_DEBUG, "GPOS table lookup list slice is too small"); + return {}; } auto const& lookup_list = *bit_cast<LookupList const*>(lookup_list_slice.data()); |