From d831e935df1725a5a22190569544eed46a738b25 Mon Sep 17 00:00:00 2001 From: Qunxin Liu Date: Thu, 4 Aug 2022 10:15:21 -0700 Subject: [PATCH] bug fix in VarData get_delta () when LONG_WORDS flag is set, item row is not computed correctly lcursor should be interpreted as INT32 --- src/hb-ot-layout-common.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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++;