提交 1e9e344b 编写于 作者: B Behdad Esfahbod

Fix hb_face_count() sanitize referencing

上级 a8cc0b59
...@@ -52,10 +52,13 @@ hb_face_count (hb_blob_t *blob) ...@@ -52,10 +52,13 @@ hb_face_count (hb_blob_t *blob)
if (unlikely (!blob)) if (unlikely (!blob))
return 0; return 0;
hb_blob_t *sanitized = OT::Sanitizer<OT::OpenTypeFontFile> ().sanitize (blob); /* TODO We shouldn't be sanitizing blob. Port to run sanitizer and return if not sane. */
hb_blob_t *sanitized = OT::Sanitizer<OT::OpenTypeFontFile> ().sanitize (hb_blob_reference (blob));
const OT::OpenTypeFontFile& ot = *sanitized->as<OT::OpenTypeFontFile> (); const OT::OpenTypeFontFile& ot = *sanitized->as<OT::OpenTypeFontFile> ();
unsigned int ret = ot.get_face_count ();
hb_blob_destroy (sanitized);
return ot.get_face_count (); return ret;
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册