From 02c4a516dbcedc40cf7436105a56c6d913fa3675 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Tue, 7 Sep 2021 13:22:19 -0700 Subject: [PATCH] Add a debug message when offset overflow resolution fails. --- src/hb-repacker.hh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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); }