[morx] Handle end-of-text conditions in Insertion

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10955
This commit is contained in:
Behdad Esfahbod 2018-10-14 19:39:31 -07:00
parent 60c1397673
commit 1c76c8f6ff
1 changed files with 4 additions and 4 deletions

View File

@ -620,12 +620,12 @@ struct InsertionSubtable
unsigned int end = buffer->out_len;
buffer->move_to (mark);
if (!before)
if (buffer->idx < buffer->len && !before)
buffer->copy_glyph ();
/* TODO We ignore KashidaLike setting. */
for (unsigned int i = 0; i < count; i++)
buffer->output_glyph (glyphs[i]);
if (!before)
if (buffer->idx < buffer->len && !before)
buffer->skip_glyph ();
buffer->move_to (end + count);
@ -644,12 +644,12 @@ struct InsertionSubtable
unsigned int end = buffer->out_len;
if (!before)
if (buffer->idx < buffer->len && !before)
buffer->copy_glyph ();
/* TODO We ignore KashidaLike setting. */
for (unsigned int i = 0; i < count; i++)
buffer->output_glyph (glyphs[i]);
if (!before)
if (buffer->idx < buffer->len && !before)
buffer->skip_glyph ();
/* Humm. Not sure where to move to. There's this wording under