src/hb-buffer-private.hh | 6 +++++- src/hb-ot-layout.cc | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-)
New commits: commit f0599db761d7fc2d585d86e757a797f75ebc7499 Author: Behdad Esfahbod <[email protected]> Date: Thu Nov 5 23:52:41 2015 -0800 Fix hang in OOM situations Fixes https://github.com/behdad/harfbuzz/issues/161 diff --git a/src/hb-buffer-private.hh b/src/hb-buffer-private.hh index 8d9ae7c..ecebb3e 100644 --- a/src/hb-buffer-private.hh +++ b/src/hb-buffer-private.hh @@ -174,7 +174,11 @@ struct hb_buffer_t { if (have_output) { if (unlikely (out_info != info || out_len != idx)) { - if (unlikely (!make_room_for (1, 1))) return; + if (unlikely (!make_room_for (1, 1))) + { + idx++; // So we don't hang indefinitely... + return; + } out_info[out_len] = info[idx]; } out_len++; commit f92bd86cc8c11d262d1830c631cb7c63fc9d4bc8 Author: Behdad Esfahbod <[email protected]> Date: Thu Nov 5 23:52:29 2015 -0800 Don't process lookups if buffer is in error diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 275a960..4111004 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -954,7 +954,7 @@ apply_string (OT::hb_apply_context_t *c, { hb_buffer_t *buffer = c->buffer; - if (unlikely (!buffer->len || !c->lookup_mask)) + if (unlikely (buffer->in_error || !buffer->len || !c->lookup_mask)) return; c->set_lookup_props (lookup.get_props ()); _______________________________________________ HarfBuzz mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/harfbuzz
