Check for failures from add table.

This commit is contained in:
Garret Rieger 2018-02-09 17:24:16 -08:00
parent 4816064c0e
commit d2170d1478

View File

@ -270,7 +270,7 @@ _add_head_and_set_loca_version (hb_face_t *source, bool use_short_loca, hb_face_
HB_MEMORY_MODE_WRITABLE, HB_MEMORY_MODE_WRITABLE,
head_prime, head_prime,
free); free);
hb_subset_face_add_table (dest, HB_OT_TAG_head, head_prime_blob); has_head = has_head && hb_subset_face_add_table (dest, HB_OT_TAG_head, head_prime_blob);
hb_blob_destroy (head_prime_blob); hb_blob_destroy (head_prime_blob);
} }
@ -290,8 +290,8 @@ _subset_glyf (hb_subset_plan_t *plan, hb_face_t *source, hb_face_t *dest)
bool use_short_loca = false; bool use_short_loca = false;
// TODO(grieger): Migrate to subset function on the table like cmap. // TODO(grieger): Migrate to subset function on the table like cmap.
if (hb_subset_glyf_and_loca (plan, source, &use_short_loca, &glyf_prime, &loca_prime)) { if (hb_subset_glyf_and_loca (plan, source, &use_short_loca, &glyf_prime, &loca_prime)) {
hb_subset_face_add_table (dest, HB_OT_TAG_glyf, glyf_prime); success = success && hb_subset_face_add_table (dest, HB_OT_TAG_glyf, glyf_prime);
hb_subset_face_add_table (dest, HB_OT_TAG_loca, loca_prime); success = success && hb_subset_face_add_table (dest, HB_OT_TAG_loca, loca_prime);
success = success && _add_head_and_set_loca_version (source, use_short_loca, dest); success = success && _add_head_and_set_loca_version (source, use_short_loca, dest);
} else { } else {
success = false; success = false;
@ -326,8 +326,7 @@ _subset_table (hb_subset_plan_t *plan,
return subset<const OT::cmap> (plan, source, dest); return subset<const OT::cmap> (plan, source, dest);
default: default:
// Default action, copy table as is. // Default action, copy table as is.
hb_subset_face_add_table (dest, tag, table_blob); return hb_subset_face_add_table (dest, tag, table_blob);
return true;
} }
} }