bug 618592 - fix harfbuzz hang on lookup with empty rule. r=behdad a=blocking-beta8 for landing on a CLOSED TREE

This commit is contained in:
Jonathan Kew 2010-12-13 18:46:07 -08:00
parent 27abc97fdb
commit 848ff489bf

View File

@ -230,7 +230,7 @@ static inline bool apply_lookup (hb_apply_context_t *c,
apply_lookup_func_t apply_func)
{
unsigned int end = MIN (c->buffer->len, c->buffer->i + c->context_length);
if (unlikely (c->buffer->i + count > end))
if (unlikely (count == 0 || c->buffer->i + count > end))
return false;
/* TODO We don't support lookupRecord arrays that are not increasing: