diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index 15c03dbe6..b9fabe2b1 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -736,7 +736,7 @@ struct InsertionSubtable if (unlikely (!buffer->move_to (mark))) return; if (buffer->idx < buffer->len && !before) - buffer->copy_glyph (); + if (unlikely (!buffer->copy_glyph ())) return; /* TODO We ignore KashidaLike setting. */ for (unsigned int i = 0; i < count; i++) buffer->output_glyph (glyphs[i]); @@ -764,7 +764,7 @@ struct InsertionSubtable unsigned int end = buffer->out_len; if (buffer->idx < buffer->len && !before) - buffer->copy_glyph (); + if (unlikely (!buffer->copy_glyph ())) return; /* TODO We ignore KashidaLike setting. */ for (unsigned int i = 0; i < count; i++) buffer->output_glyph (glyphs[i]); diff --git a/src/hb-buffer.hh b/src/hb-buffer.hh index 2e43f2e69..7ee204496 100644 --- a/src/hb-buffer.hh +++ b/src/hb-buffer.hh @@ -252,7 +252,7 @@ struct hb_buffer_t return true; } /* Copies glyph at idx to output but doesn't advance idx */ - bool copy_glyph () + HB_NODISCARD bool copy_glyph () { if (unlikely (!make_room_for (0, 1))) return false;