diff --git a/src/hb-aat-layout-common.hh b/src/hb-aat-layout-common.hh index 2e6274f34..5eaec5e86 100644 --- a/src/hb-aat-layout-common.hh +++ b/src/hb-aat-layout-common.hh @@ -786,7 +786,8 @@ struct StateTableDriver buffer->unsafe_to_concat (); int state = StateTableT::STATE_START_OF_TEXT; - auto *last_range = ac->range_flags && (*ac->range_flags) ? &(*ac->range_flags)[0] : nullptr; + // If there's only one range, we already checked the flag. + auto *last_range = ac->range_flags && (ac->range_flags->length > 1) ? &(*ac->range_flags)[0] : nullptr; for (buffer->idx = 0; buffer->successful;) { if (last_range) diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index b86d5a05a..51003807d 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -618,7 +618,8 @@ struct NoncontextualSubtable hb_glyph_info_t *info = c->buffer->info; unsigned int count = c->buffer->len; - auto *last_range = c->range_flags && (*c->range_flags) ? &(*c->range_flags)[0] : nullptr; + // If there's only one range, we already checked the flag. + auto *last_range = c->range_flags && (c->range_flags->length > 1) ? &(*c->range_flags)[0] : nullptr; for (unsigned int i = 0; i < count; i++) { if (last_range)