mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-24 08:21:32 +01:00
[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:
1 parent
c7ec53d991
commit
290063c643
1 file changed
+1
-2
+1
-2
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user