diff options
Diffstat (limited to 'thirdparty/harfbuzz/src/hb-subset.cc')
-rw-r--r-- | thirdparty/harfbuzz/src/hb-subset.cc | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/thirdparty/harfbuzz/src/hb-subset.cc b/thirdparty/harfbuzz/src/hb-subset.cc index 048bdf1888..bb46e5b97f 100644 --- a/thirdparty/harfbuzz/src/hb-subset.cc +++ b/thirdparty/harfbuzz/src/hb-subset.cc @@ -104,20 +104,16 @@ _repack (hb_tag_t tag, const hb_serialize_context_t& c) if (!c.offset_overflow ()) return c.copy_blob (); - hb_vector_t<char> buf; - int buf_size = c.end - c.start; - if (unlikely (!buf.alloc (buf_size))) - return nullptr; - - hb_serialize_context_t repacked ((void *) buf, buf_size); - hb_resolve_overflows (c.object_graph (), tag, &repacked); + hb_blob_t* result = hb_resolve_overflows (c.object_graph (), tag); - if (unlikely (repacked.in_error ())) - // TODO(garretrieger): refactor so we can share the resize/retry logic with the subset - // portion. + if (unlikely (!result)) + { + DEBUG_MSG (SUBSET, nullptr, "OT::%c%c%c%c offset overflow resolution failed.", + HB_UNTAG (tag)); return nullptr; + } - return repacked.copy_blob (); + return result; } template<typename TableType> |