Fix another move_to assertion failure

If buf->idx is at end, don't set end past it...

Fixes https://github.com/behdad/harfbuzz/issues/173
This commit is contained in:
Behdad Esfahbod 2015-11-18 23:04:45 -08:00
parent abadc1717d
commit 37b40cd8a1

View File

@ -988,7 +988,7 @@ static inline bool apply_lookup (hb_apply_context_t *c,
/* end can't go back past the current match position.
* Note: this is only true because we do NOT allow MultipleSubst
* with zero sequence len. */
end = MAX ((int) match_positions[idx] + 1, int (end) + delta);
end = MAX (MIN((int) match_positions[idx] + 1, (int) new_len), int (end) + delta);
unsigned int next = idx + 1; /* next now is the position after the recursed lookup. */