[ft] Reject loading of font directory

This commit is contained in:
Behdad Esfahbod committed 2025-05-29 12:29:34 -06:00
1 parent 4adeb6a01e
commit 6fb10ded54
1 file changed
+4
+4
View File
@@ -1104,6 +1104,10 @@ _hb_ft_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data
FT_ULong length = 0;
FT_Error error;
/* In new FreeType, a tag value of 1 loads the SFNT table directory. Reject it. */
if (tag == 1)
return nullptr;
/* Note: FreeType like HarfBuzz uses the NONE tag for fetching the entire blob */
error = FT_Load_Sfnt_Table (ft_face, tag, 0, nullptr, &length);