From cf3ce69f00a4c98416fa900ed7e0a28f076eb775 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 17 Mar 2024 13:57:26 -0600 Subject: [PATCH] [TupleValues] Add a pre-alloc --- src/hb-open-type.hh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 1c84b7777..9ce37b838 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -1722,6 +1722,8 @@ struct TupleValues { unsigned i = 0; unsigned count = consume_all ? UINT_MAX : values.length; + if (consume_all) + values.alloc ((end - p) / 2); while (i < count) { if (unlikely (p + 1 > end)) return consume_all;