Allow get_table() to return NULL

This commit is contained in:
Behdad Esfahbod 2010-04-23 19:59:53 -04:00
parent ad3653751b
commit d6b3c83a90
2 changed files with 6 additions and 2 deletions

View File

@ -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 ();
}

View File

@ -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)