HB_BUFFER_ALLOCATE_VAR (buffer, lig_props);
HB_BUFFER_ALLOCATE_VAR (buffer, syllable);
- const GDEF &gdef = *hb_ot_layout_from_face (face)->gdef;
+ /* TODO This pattern is duplicated from gsubgpos-private.h. Do something about it. */
+ const GDEF &gdef = hb_ot_layout_from_face (face) &&
+ !HB_SHAPER_DATA_IS_INVALID (hb_ot_layout_from_face (face)) ?
+ *hb_ot_layout_from_face (face)->gdef : Null(GDEF);
unsigned int count = buffer->len;
for (unsigned int i = 0; i < count; i++) {
buffer->info[i].lig_props() = buffer->info[i].syllable() = 0;