From 506547c958b5e03d5b712b94b2333dffac0e6b7e Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Thu, 4 Aug 2022 21:36:21 +0000 Subject: [PATCH] [repacker] Use hb_pair_t constructor instead of hb_pair (). hb_pair was causing corrupted gid values. --- src/graph/pairpos-graph.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/graph/pairpos-graph.hh b/src/graph/pairpos-graph.hh index 00cae4fad..20e54da44 100644 --- a/src/graph/pairpos-graph.hh +++ b/src/graph/pairpos-graph.hh @@ -351,19 +351,19 @@ struct PairPosFormat2 : public OT::Layout::GPOS_impl::PairPosFormat2_4sanitize (coverage_v) || !class_def_1_table->sanitize (class_def_1_v)) - return false; + return -1; auto klass_map = + coverage_table->iter () | hb_map_retains_sorting ([&] (hb_codepoint_t gid) { - return hb_pair (gid, class_def_1_table->get_class (gid)); + return hb_pair_t (gid, class_def_1_table->get_class (gid)); }) | hb_filter ([&] (hb_codepoint_t klass) { return klass >= start && klass < end; }, hb_second) | hb_map_retains_sorting ([&] (hb_pair_t gid_and_class) { // Classes must be from 0...N so subtract start - return hb_pair (gid_and_class.first, gid_and_class.second - start); + return hb_pair_t (gid_and_class.first, gid_and_class.second - start); }) ; @@ -492,7 +492,7 @@ struct PairPosFormat2 : public OT::Layout::GPOS_impl::PairPosFormat2_4iter () | hb_map_retains_sorting ([&] (hb_codepoint_t gid) { - return hb_pair (gid, class_def_1_table->get_class (gid)); + return hb_pair_t (gid, class_def_1_table->get_class (gid)); }) | hb_filter ([&] (hb_codepoint_t klass) { return klass < count;