diff --git a/src/hb-repacker.hh b/src/hb-repacker.hh index b2f48762d..2ffc69c65 100644 --- a/src/hb-repacker.hh +++ b/src/hb-repacker.hh @@ -77,6 +77,7 @@ struct graph_t // TODO(garretrieger): once priority is high enough, should try // setting distance = 0 which will force to sort immediately after // it's parent where possible. + int64_t modified_distance = distance + distance_modifier (); return (modified_distance << 24) | (0x00FFFFFF & order); } @@ -254,6 +255,8 @@ struct graph_t remap_obj_indices (id_map, &sorted_graph); sorted_graph.as_array ().reverse (); + + vertices_.fini_deep (); vertices_ = sorted_graph; sorted_graph.fini_deep (); } @@ -319,6 +322,8 @@ struct graph_t remap_obj_indices (id_map, &sorted_graph); sorted_graph.as_array ().reverse (); + + vertices_.fini_deep (); vertices_ = sorted_graph; sorted_graph.fini_deep (); } @@ -335,11 +340,11 @@ struct graph_t positions_invalid = true; + auto* clone = vertices_.push (); auto& child = vertices_[child_idx]; clone_buffer_t* buffer = clone_buffers_.push (); buffer->copy (child.obj); - auto* clone = vertices_.push (); clone->obj.head = buffer->head; clone->obj.tail = buffer->tail; clone->distance = child.distance; diff --git a/src/hb-subset.cc b/src/hb-subset.cc index 2db027034..46cfbe9d0 100644 --- a/src/hb-subset.cc +++ b/src/hb-subset.cc @@ -142,10 +142,14 @@ _subset (hb_subset_plan_t *plan) if (needed) { hb_blob_t *dest_blob = _repack (tag, serializer); - if (!dest_blob) return false; - DEBUG_MSG (SUBSET, nullptr, "OT::%c%c%c%c final subset table size: %u bytes.", HB_UNTAG (tag), dest_blob->length); - result = c.plan->add_table (tag, dest_blob); - hb_blob_destroy (dest_blob); + if (dest_blob) + { + DEBUG_MSG (SUBSET, nullptr, "OT::%c%c%c%c final subset table size: %u bytes.", HB_UNTAG (tag), dest_blob->length); + result = c.plan->add_table (tag, dest_blob); + hb_blob_destroy (dest_blob); + } else { + result = false; + } } else {