diff --git a/src/hb-repacker.hh b/src/hb-repacker.hh index 237033864..cbab791e2 100644 --- a/src/hb-repacker.hh +++ b/src/hb-repacker.hh @@ -430,9 +430,13 @@ struct graph_t update_incoming_edge_count (); for (const auto& o : overflows) { + const auto& parent = vertices_[o.parent]; const auto& child = vertices_[o.child]; - DEBUG_MSG (SUBSET_REPACK, nullptr, " overflow from %d => %d (%d incoming , %d outgoing)", + DEBUG_MSG (SUBSET_REPACK, nullptr, + " overflow from %d (%d in, %d out) => %d (%d in, %d out)", o.parent, + parent.incoming_edges, + parent.obj.links.length, o.child, child.incoming_edges, child.obj.links.length); @@ -762,6 +766,13 @@ hb_resolve_overflows (const hb_vector_t& pac c->err (HB_SERIALIZE_ERROR_OTHER); return; } + + if (sorted_graph.will_overflow ()) + { + c->err (HB_SERIALIZE_ERROR_OFFSET_OVERFLOW); + DEBUG_MSG (SUBSET_REPACK, nullptr, "Offset overflow resolution failed."); + return; + } sorted_graph.serialize (c); }