[face] Avoid infinite-loop in building a face blob

This commit is contained in:
Behdad Esfahbod 2025-02-26 14:06:35 -07:00
parent 6a7b4dcae6
commit 6fbd6bb34e

View file

@ -524,9 +524,11 @@ hb_face_reference_blob (hb_face_t *face)
hb_face_get_table_tags (face, offset, &count, tags);
for (unsigned i = 0; i < count; i++)
{
hb_blob_t *table = hb_face_reference_table (face, tags[i]);
hb_face_builder_add_table (builder, tags[i], table);
hb_blob_destroy (table);
if (unlikely (!tags[i]))
continue;
hb_blob_t *table = hb_face_reference_table (face, tags[i]);
hb_face_builder_add_table (builder, tags[i], table);
hb_blob_destroy (table);
}
}