提交 d6b3c83a 编写于 作者: B Behdad Esfahbod

Allow get_table() to return NULL

上级 ad365375
......@@ -324,10 +324,14 @@ hb_blob_t *
hb_face_get_table (hb_face_t *face,
hb_tag_t tag)
{
hb_blob_t *blob;
if (HB_UNLIKELY (!face || !face->get_table))
return hb_blob_create_empty ();
return face->get_table (tag, face->user_data);
blob = face->get_table (tag, face->user_data);
return blob? blob : hb_blob_create_empty ();
}
......
......@@ -159,7 +159,7 @@ _get_table (hb_tag_t tag, void *user_data)
/* TODO Use FT_Memory? */
buffer = malloc (length);
if (buffer == NULL)
return hb_blob_create_empty ();
return NULL;
error = FT_Load_Sfnt_Table (ft_face, tag, 0, buffer, &length);
if (error)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册