From d5577002d5e41de5558c97ebcefc63c19452d569 Mon Sep 17 00:00:00 2001 From: gohai Date: Fri, 17 Mar 2023 22:41:51 +0800 Subject: LibGfx/OpenType: Fix bound-check --- Userland/Libraries/LibGfx/Font/OpenType/Font.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'Userland/Libraries/LibGfx/Font') 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 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(lookup_list_slice.data()); -- cgit v1.2.3