diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 0532039aa..10e0ae427 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -2284,19 +2284,19 @@ struct VarData unsigned int lcount = is_long ? word_count : 0; const HBUINT8 *bytes = get_delta_bytes (); - const HBUINT8 *row = bytes + inner * (scount + count); + const HBUINT8 *row = bytes + inner * get_row_size (); float delta = 0.; unsigned int i = 0; - const HBINT16 *lcursor = reinterpret_cast (row); + const HBINT32 *lcursor = reinterpret_cast (row); for (; i < lcount; i++) { float scalar = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count, cache); delta += scalar * *lcursor++; } const HBINT16 *scursor = reinterpret_cast (lcursor); - for (; i < scount; i++) + for (; i < lcount + scount; i++) { float scalar = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count, cache); delta += scalar * *scursor++;