Fix more hangs in case of buffer allocation errors

Hopefully
fixes https://github.com/behdad/harfbuzz/issues/214
This commit is contained in:
Behdad Esfahbod 2016-02-02 16:39:19 +08:00
parent b693992ea1
commit b894a85ad1
3 changed files with 3 additions and 3 deletions

View File

@ -1246,7 +1246,7 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
/* TODO Set glyph_props? */ /* TODO Set glyph_props? */
/* Insert dottedcircle after possible Repha. */ /* Insert dottedcircle after possible Repha. */
while (buffer->idx < buffer->len && while (buffer->idx < buffer->len && !buffer->in_error &&
last_syllable == buffer->cur().syllable() && last_syllable == buffer->cur().syllable() &&
buffer->cur().indic_category() == OT_Repha) buffer->cur().indic_category() == OT_Repha)
buffer->next_glyph (); buffer->next_glyph ();

View File

@ -451,7 +451,7 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
buffer->idx = 0; buffer->idx = 0;
unsigned int last_syllable = 0; unsigned int last_syllable = 0;
while (buffer->idx < buffer->len) while (buffer->idx < buffer->len && !buffer->in_error)
{ {
unsigned int syllable = buffer->cur().syllable(); unsigned int syllable = buffer->cur().syllable();
syllable_type_t syllable_type = (syllable_type_t) (syllable & 0x0F); syllable_type_t syllable_type = (syllable_type_t) (syllable & 0x0F);

View File

@ -522,7 +522,7 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
/* TODO Set glyph_props? */ /* TODO Set glyph_props? */
/* Insert dottedcircle after possible Repha. */ /* Insert dottedcircle after possible Repha. */
while (buffer->idx < buffer->len && while (buffer->idx < buffer->len && !buffer->in_error &&
last_syllable == buffer->cur().syllable() && last_syllable == buffer->cur().syllable() &&
buffer->cur().use_category() == USE_R) buffer->cur().use_category() == USE_R)
buffer->next_glyph (); buffer->next_glyph ();