From 0761e7cdfd00d5347657bdf009c3035be4ebab44 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 18 May 2022 11:37:57 -0600 Subject: [PATCH] [subset-cff] Avoid resetting buffer as encoder does --- src/hb-subset-cff-common.hh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hb-subset-cff-common.hh b/src/hb-subset-cff-common.hh index 38b2731af..fa7545b0b 100644 --- a/src/hb-subset-cff-common.hh +++ b/src/hb-subset-cff-common.hh @@ -40,7 +40,7 @@ struct str_encoder_t str_encoder_t (str_buff_t &buff_) : buff (buff_), error (false) {} - void reset () { buff.resize (0); } + void reset () { buff.reset (); } void encode_byte (unsigned char b) { @@ -851,7 +851,6 @@ struct subr_subsetter_t bool encode_str (const parsed_cs_str_t &str, const unsigned int fd, str_buff_t &buff) const { - buff.reset (); str_encoder_t encoder (buff); encoder.reset (); /* if a prefix (CFF1 width or CFF2 vsindex) has been removed along with hints,