提交 03408ce7 编写于 作者: B Behdad Esfahbod

Fix more possible buffer overruns

I have this function, but can't clean up it to my satisfaction.
上级 7d479900
...@@ -316,13 +316,15 @@ static inline bool apply_lookup (hb_apply_context_t *c, ...@@ -316,13 +316,15 @@ static inline bool apply_lookup (hb_apply_context_t *c,
* for reverse lookup here. * for reverse lookup here.
*/ */
for (unsigned int i = 0; i < count; /* NOP */) for (unsigned int i = 0; i < count; /* NOP */)
{
while (c->should_mark_skip_current_glyph ())
{ {
if (unlikely (c->buffer->idx == end)) if (unlikely (c->buffer->idx == end))
return true; return true;
while (c->should_mark_skip_current_glyph ())
{
/* No lookup applied for this index */ /* No lookup applied for this index */
c->buffer->next_glyph (); c->buffer->next_glyph ();
if (unlikely (c->buffer->idx == end))
return true;
} }
if (lookupCount && i == lookupRecord->sequenceIndex) if (lookupCount && i == lookupRecord->sequenceIndex)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册