From 6bb478eeeb665ddb1801a424679644b5b2b6c9e1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 12 Dec 2022 11:39:06 -0700 Subject: [PATCH] [VarC] Clamp after addition --- src/OT/glyf/VarCompositeGlyph.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OT/glyf/VarCompositeGlyph.hh b/src/OT/glyf/VarCompositeGlyph.hh index 4e755a095..353c37479 100644 --- a/src/OT/glyf/VarCompositeGlyph.hh +++ b/src/OT/glyf/VarCompositeGlyph.hh @@ -248,8 +248,9 @@ struct VarCompositeGlyphRecord { unsigned axis_index = axis_width == 1 ? *p++ : *q++; signed v = axis_points[i].x; + v += setter[axis_index]; v = hb_clamp (v, -(1<<14), (1<<14)); - setter[axis_index] += v; + setter[axis_index] = v; } }