From 1a906162cb5d2445975cc571bc808e025f31b5d1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 17 Oct 2022 14:01:34 -0600 Subject: [PATCH] [glyf/coord-setter] Fix memory issue --- src/OT/glyf/coord-setter.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/OT/glyf/coord-setter.hh b/src/OT/glyf/coord-setter.hh index c3d5ce5b7..8ef20e76a 100644 --- a/src/OT/glyf/coord-setter.hh +++ b/src/OT/glyf/coord-setter.hh @@ -29,7 +29,11 @@ struct coord_setter_t int& operator [] (unsigned idx) { if (new_coords.length < idx + 1) + { new_coords.resize (idx + 1); + font->coords = new_coords.arrayZ; + font->num_coords = new_coords.length; + } return new_coords[idx]; }