diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index ce5eb07f2..389dcf890 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -2511,7 +2511,12 @@ struct VarRegionAxis }; struct SparseVarRegionAxis { - float evaluate (int coord) const { return axis.evaluate (coord); } + float evaluate (const int *coords, unsigned int coord_len) const + { + unsigned i = axisIndex; + int coord = i < coord_len ? coords[i] : 0; + return axis.evaluate (coord); + } bool sanitize (hb_sanitize_context_t *c) const { @@ -2703,9 +2708,7 @@ struct SparseVariationRegion : Array16Of unsigned int count = len; for (unsigned int i = 0; i < count; i++) { - unsigned j = arrayZ[i].axisIndex; - int coord = j < coord_len ? coords[j] : 0; - float factor = arrayZ[i].evaluate (coord); + float factor = arrayZ[i].evaluate (coords, coord_len); if (factor == 0.f) return 0.; v *= factor;