From 33972b3bf6cd9a63424a2213e5b80bff474b7d10 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 21 Apr 2023 12:37:51 -0600 Subject: [PATCH] [glyf] Increase CompositeGlyf memory allocation The 50% wasn't justified by logic. --- src/OT/glyf/CompositeGlyph.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OT/glyf/CompositeGlyph.hh b/src/OT/glyf/CompositeGlyph.hh index 0cc43d500..f43dd2239 100644 --- a/src/OT/glyf/CompositeGlyph.hh +++ b/src/OT/glyf/CompositeGlyph.hh @@ -340,7 +340,7 @@ struct CompositeGlyph /* try to allocate more memories than source glyph bytes * in case that there might be an overflow for int8 value * and we would need to use int16 instead */ - char *o = (char *) hb_calloc (source_len + source_len/2, sizeof (char)); + char *o = (char *) hb_calloc (source_len * 2, sizeof (char)); if (unlikely (!o)) return false; const CompositeGlyphRecord *c = reinterpret_cast (source_bytes.arrayZ + GlyphHeader::static_size);