[hb-old] Fixup not-enough-space handling

This commit is contained in:
Behdad Esfahbod 2012-07-25 19:22:57 -04:00
parent 91e721ea86
commit 9550a8c4e8
1 changed files with 8 additions and 7 deletions

View File

@ -329,14 +329,15 @@ retry:
#undef ALLOCATE_ARRAY #undef ALLOCATE_ARRAY
if (!HB_ShapeItem (&item)) if (!HB_ShapeItem (&item))
return false;
if (unlikely (item.num_glyphs > num_glyphs))
{ {
buffer->ensure (buffer->allocated * 2); if (unlikely (item.num_glyphs > num_glyphs))
if (buffer->in_error) {
FAIL ("Buffer resize failed"); buffer->ensure (buffer->allocated * 2);
goto retry; if (buffer->in_error)
FAIL ("Buffer resize failed");
goto retry;
}
return false;
} }
num_glyphs = item.num_glyphs; num_glyphs = item.num_glyphs;