From 1e05ea79d057fbae5f680589d4ee7d3c6a971689 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 5 Jan 2018 14:01:37 +0000 Subject: [PATCH] [ot] Short-circuit base instance advance variation --- src/hb-ot-hmtx-table.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh index e710aee42..29770f7a1 100644 --- a/src/hb-ot-hmtx-table.hh +++ b/src/hb-ot-hmtx-table.hh @@ -144,7 +144,7 @@ struct hmtxvmtx } return table->longMetric[MIN (glyph, (uint32_t) num_advances - 1)].advance - + var_table->get_advance_var (glyph, font->coords, font->num_coords); // TODO Optimize?! + + (font->num_coords ? var_table->get_advance_var (glyph, font->coords, font->num_coords) : 0); // TODO Optimize?! } public: