From 2960d13f1bcd573f985b44a40f7340694a99dd9b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 6 Jun 2023 16:24:28 -0600 Subject: [PATCH] [subset/cff1] Micro-optimize string writing --- src/hb-ot-cff1-table.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh index 3471ee010..e100d94fb 100644 --- a/src/hb-ot-cff1-table.hh +++ b/src/hb-ot-cff1-table.hh @@ -647,11 +647,13 @@ struct CFF1StringIndex : CFF1Index return_trace (true); } + if (unlikely (sidmap.in_error ())) return_trace (false); + byte_str_array_t bytesArray; if (!bytesArray.resize (sidmap.get_population ())) return_trace (false); for (auto _ : sidmap) - bytesArray[_.second] = strings[_.first]; + bytesArray.arrayZ[_.second] = strings[_.first]; bool result = CFF1Index::serialize (c, bytesArray); return_trace (result);