From 250bcd6fb691d6f15fa9ca71b475ce419d0b5e37 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 9 Sep 2016 23:12:14 -0700 Subject: [PATCH] [GX] Skip tail zero entries when setting variation coordinates --- src/hb-font.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hb-font.cc b/src/hb-font.cc index d27961db9..cce4359ce 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -1556,6 +1556,10 @@ hb_font_set_var_coords_normalized (hb_font_t *font, if (font->immutable) return; + /* Skip tail zero entries. */ + while (coords_length && !coords[coords_length - 1]) + coords_length--; + int *copy = (int *) calloc (coords_length, sizeof (coords[0])); if (unlikely (!copy)) return;