From 6fb10ded54e4640f75f829acb754b05da5c26362 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 29 May 2025 12:29:34 -0600 Subject: [PATCH] [ft] Reject loading of font directory --- src/hb-ft.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hb-ft.cc b/src/hb-ft.cc index 5319fe6b0..cb209ab8c 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -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);