Allow get_table() to return NULL
This commit is contained in:
parent
ad3653751b
commit
d6b3c83a90
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user