diff --git a/src/OT/Layout/GSUB/SingleSubstFormat1.hh b/src/OT/Layout/GSUB/SingleSubstFormat1.hh index 1cd3f9d9c..2c2733d4c 100644 --- a/src/OT/Layout/GSUB/SingleSubstFormat1.hh +++ b/src/OT/Layout/GSUB/SingleSubstFormat1.hh @@ -109,7 +109,7 @@ struct SingleSubstFormat1_3 return 0; } - if (alternate_count && *alternate_count) + if (alternate_count && *alternate_count && alternate_glyphs) { hb_codepoint_t d = deltaGlyphID; hb_codepoint_t mask = get_mask (); diff --git a/src/OT/Layout/GSUB/SingleSubstFormat2.hh b/src/OT/Layout/GSUB/SingleSubstFormat2.hh index 4c98f05ae..8e6df7d63 100644 --- a/src/OT/Layout/GSUB/SingleSubstFormat2.hh +++ b/src/OT/Layout/GSUB/SingleSubstFormat2.hh @@ -89,7 +89,7 @@ struct SingleSubstFormat2_4 return 0; } - if (alternate_count && *alternate_count) + if (alternate_count && *alternate_count && alternate_glyphs) { glyph_id = substitute[index];