From 7c86f2e763e44b4c96cd26f1ce06225b4aba977f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 18 May 2022 11:45:27 -0600 Subject: [PATCH] [subset-cff] Pre-alloc out buffer --- src/hb-subset-cff-common.hh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hb-subset-cff-common.hh b/src/hb-subset-cff-common.hh index fa7545b0b..638694beb 100644 --- a/src/hb-subset-cff-common.hh +++ b/src/hb-subset-cff-common.hh @@ -853,6 +853,7 @@ struct subr_subsetter_t { str_encoder_t encoder (buff); encoder.reset (); + buff.alloc (str.get_count () * 3); /* if a prefix (CFF1 width or CFF2 vsindex) has been removed along with hints, * re-insert it at the beginning of charstreing */ if (str.has_prefix () && str.is_hint_dropped ())