[kerx/morx] More end-of-text protection

This commit is contained in:
Behdad Esfahbod 2018-10-15 10:20:39 -07:00
parent 8f3048a1f8
commit bb35725cd7
1 changed files with 2 additions and 2 deletions

View File

@ -172,7 +172,7 @@ struct KerxSubTableFormat1
* list. Discovered by testing. */
unsigned int idx = stack[i];
int v = *actions++;
if (buffer->info[idx].mask & kern_mask)
if (idx < buffer->len && buffer->info[idx].mask & kern_mask)
{
/* XXX Non-forward direction... */
if (HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction))
@ -340,7 +340,7 @@ struct KerxSubTableFormat4
hb_buffer_t *buffer = driver->buffer;
unsigned int flags = entry->flags;
if (mark_set && entry->data.ankrActionIndex != 0xFFFF)
if (mark_set && entry->data.ankrActionIndex != 0xFFFF && buffer->idx < buffer->len)
{
hb_glyph_position_t &o = buffer->cur_pos();
switch (action_type)