[subset-cff] Pre-alloc out buffer

This commit is contained in:
Behdad Esfahbod 2022-05-18 11:45:27 -06:00
parent 0761e7cdfd
commit 7c86f2e763
1 changed files with 1 additions and 0 deletions

View File

@ -853,6 +853,7 @@ struct subr_subsetter_t
{ {
str_encoder_t encoder (buff); str_encoder_t encoder (buff);
encoder.reset (); encoder.reset ();
buff.alloc (str.get_count () * 3);
/* if a prefix (CFF1 width or CFF2 vsindex) has been removed along with hints, /* if a prefix (CFF1 width or CFF2 vsindex) has been removed along with hints,
* re-insert it at the beginning of charstreing */ * re-insert it at the beginning of charstreing */
if (str.has_prefix () && str.is_hint_dropped ()) if (str.has_prefix () && str.is_hint_dropped ())