This commit is contained in:
Behdad Esfahbod 2014-08-10 17:42:19 -04:00
parent b9993d8d6d
commit 92aeee3f04
2 changed files with 4 additions and 4 deletions

View File

@ -696,7 +696,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
CFRange range = CTRunGetStringRange (run); CFRange range = CTRunGetStringRange (run);
buffer->ensure (buffer->len + range.length); buffer->ensure (buffer->len + range.length);
if (buffer->in_error) if (unlikely (buffer->in_error))
FAIL ("Buffer resize failed"); FAIL ("Buffer resize failed");
hb_glyph_info_t *info = buffer->info + buffer->len; hb_glyph_info_t *info = buffer->info + buffer->len;
@ -738,7 +738,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
/* Needed buffer size in case we end up using scratch buffer. */ /* Needed buffer size in case we end up using scratch buffer. */
unsigned int alt_size = (sizeof (CGGlyph) + sizeof (CGPoint) + sizeof (CFIndex)) / sizeof (hb_glyph_info_t) + 2; unsigned int alt_size = (sizeof (CGGlyph) + sizeof (CGPoint) + sizeof (CFIndex)) / sizeof (hb_glyph_info_t) + 2;
buffer->ensure (MAX (buffer->len + num_glyphs, alt_size)); buffer->ensure (MAX (buffer->len + num_glyphs, alt_size));
if (buffer->in_error) if (unlikely (buffer->in_error))
FAIL ("Buffer resize failed"); FAIL ("Buffer resize failed");
scratch = buffer->get_scratch_buffer (&scratch_size); scratch = buffer->get_scratch_buffer (&scratch_size);

View File

@ -904,7 +904,7 @@ retry:
if (unlikely (hr == E_OUTOFMEMORY)) if (unlikely (hr == E_OUTOFMEMORY))
{ {
buffer->ensure (buffer->allocated * 2); buffer->ensure (buffer->allocated * 2);
if (buffer->in_error) if (unlikely (buffer->in_error))
FAIL ("Buffer resize failed"); FAIL ("Buffer resize failed");
goto retry; goto retry;
} }
@ -974,7 +974,7 @@ retry:
#undef utf16_index #undef utf16_index
buffer->ensure (glyphs_len); buffer->ensure (glyphs_len);
if (buffer->in_error) if (unlikely (buffer->in_error))
FAIL ("Buffer in error"); FAIL ("Buffer in error");
#undef FAIL #undef FAIL