From 346ab9884b019ce919c2ab2ee3a3c373bec6fc33 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Mon, 24 Feb 2020 08:46:08 +0330 Subject: [PATCH] [gvar] Return gracefully even if coords_count != gvar's axis count It shouldn't be that common to have the situation, even so, no need to reject entire a glyph even if gvar isn't used. --- src/hb-ot-var-gvar-table.hh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hb-ot-var-gvar-table.hh b/src/hb-ot-var-gvar-table.hh index a77ed0b15..28196647b 100644 --- a/src/hb-ot-var-gvar-table.hh +++ b/src/hb-ot-var-gvar-table.hh @@ -563,8 +563,7 @@ struct gvar const int *coords, unsigned int coord_count, const hb_array_t points) const { - if (!coord_count) return true; - if (unlikely (coord_count != gvar_table->axisCount)) return false; + if (!coord_count || coord_count != gvar_table->axisCount) return true; const GlyphVarData *var_data = gvar_table->get_glyph_var_data (glyph); if (var_data == &Null (GlyphVarData)) return true;