From 2e7c716511e8b2cfcd059fa2a2ed4cdd48b351bf Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 16 Oct 2018 18:35:03 -0700 Subject: [PATCH] [buffer] Add an assert See if it helps debugging https://bugs.chromium.org/p/chromium/issues/detail?id=895117 --- src/hb-buffer.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index 1d3b602b4..00e7e149c 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -359,6 +359,8 @@ hb_buffer_t::replace_glyphs (unsigned int num_in, { if (unlikely (!make_room_for (num_in, num_out))) return; + assert (idx + num_in <= len); + merge_clusters (idx, idx + num_in); hb_glyph_info_t orig_info = info[idx];