diff --git a/src/OT/Layout/GPOS/MarkBasePosFormat1.hh b/src/OT/Layout/GPOS/MarkBasePosFormat1.hh index 73839a4c8..938369a50 100644 --- a/src/OT/Layout/GPOS/MarkBasePosFormat1.hh +++ b/src/OT/Layout/GPOS/MarkBasePosFormat1.hh @@ -122,6 +122,11 @@ struct MarkBasePosFormat1_2 hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input; skippy_iter.set_lookup_props (LookupFlag::IgnoreMarks); + if (c->last_base_until > buffer->idx) + { + c->last_base_until = 0; + c->last_base = -1; + } unsigned j; for (j = buffer->idx; j > c->last_base_until; j--) { diff --git a/src/OT/Layout/GPOS/MarkLigPosFormat1.hh b/src/OT/Layout/GPOS/MarkLigPosFormat1.hh index 447187102..7e7b438aa 100644 --- a/src/OT/Layout/GPOS/MarkLigPosFormat1.hh +++ b/src/OT/Layout/GPOS/MarkLigPosFormat1.hh @@ -104,6 +104,11 @@ struct MarkLigPosFormat1_2 hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input; skippy_iter.set_lookup_props (LookupFlag::IgnoreMarks); + if (c->last_base_until > buffer->idx) + { + c->last_base_until = 0; + c->last_base = -1; + } unsigned j; for (j = buffer->idx; j > c->last_base_until; j--) { diff --git a/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-shape-fuzzer-6377756666757120 b/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-shape-fuzzer-6377756666757120 new file mode 100644 index 000000000..718e169a7 Binary files /dev/null and b/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-shape-fuzzer-6377756666757120 differ