[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,8 +329,7 @@ retry:
#undef ALLOCATE_ARRAY #undef ALLOCATE_ARRAY
if (!HB_ShapeItem (&item)) if (!HB_ShapeItem (&item))
return false; {
if (unlikely (item.num_glyphs > num_glyphs)) if (unlikely (item.num_glyphs > num_glyphs))
{ {
buffer->ensure (buffer->allocated * 2); buffer->ensure (buffer->allocated * 2);
@ -338,6 +337,8 @@ retry:
FAIL ("Buffer resize failed"); FAIL ("Buffer resize failed");
goto retry; goto retry;
} }
return false;
}
num_glyphs = item.num_glyphs; num_glyphs = item.num_glyphs;
/* Ok, we've got everything we need, now compose output buffer, /* Ok, we've got everything we need, now compose output buffer,