diff --git a/src/OT/glyf/CompositeGlyph.hh b/src/OT/glyf/CompositeGlyph.hh index 94e00d3ae..c9422cd3d 100644 --- a/src/OT/glyf/CompositeGlyph.hh +++ b/src/OT/glyf/CompositeGlyph.hh @@ -108,6 +108,7 @@ struct CompositeGlyphRecord float matrix[4]; contour_point_t trans; get_transformation (matrix, trans); + points.alloc (points.length + 4); // For phantom points if (unlikely (!points.resize (points.length + 1))) return false; points[points.length - 1] = trans; return true; diff --git a/src/OT/glyf/VarCompositeGlyph.hh b/src/OT/glyf/VarCompositeGlyph.hh index b4f465786..eb4f50439 100644 --- a/src/OT/glyf/VarCompositeGlyph.hh +++ b/src/OT/glyf/VarCompositeGlyph.hh @@ -196,6 +196,7 @@ struct VarCompositeGlyphRecord { unsigned num_points = get_num_points (); + points.alloc (points.length + num_points + 4); // For phantom points if (unlikely (!points.resize (points.length + num_points, false))) return false; contour_point_t *rec_points = points.as_array ().sub_array (points.length - num_points).arrayZ; memset (rec_points, 0, num_points * sizeof (rec_points[0]));