[face] Fix a potential crasher if not enough font data

In hb_face_count().

Fixes https://github.com/memononen/Skribidi/pull/67
This commit is contained in:
Behdad Esfahbod committed 2025-07-28 03:19:17 -06:00
1 parent c7ec53d991
commit 290063c643
1 file changed
+1 -2
+1 -2
View File
@@ -84,8 +84,7 @@ hb_face_count (hb_blob_t *blob)
hb_sanitize_context_t c (blob);
const char *start = hb_blob_get_data (blob, nullptr);
auto *ot = reinterpret_cast<OT::OpenTypeFontFile *> (const_cast<char *> (start));
auto *ot = blob->as<OT::OpenTypeFontFile> ();
if (unlikely (!ot->sanitize (&c)))
return 0;