[glyf/coord-setter] Fix memory issue

This commit is contained in:
Behdad Esfahbod 2022-10-17 14:01:34 -06:00
parent 7efd68da39
commit 1a906162cb
1 changed files with 4 additions and 0 deletions

View File

@ -29,7 +29,11 @@ struct coord_setter_t
int& operator [] (unsigned idx) int& operator [] (unsigned idx)
{ {
if (new_coords.length < idx + 1) if (new_coords.length < idx + 1)
{
new_coords.resize (idx + 1); new_coords.resize (idx + 1);
font->coords = new_coords.arrayZ;
font->num_coords = new_coords.length;
}
return new_coords[idx]; return new_coords[idx];
} }