From 13deea7cbd5becb0746585177b9d67e0a52516e7 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 18 Oct 2022 13:38:12 -0600 Subject: [PATCH] [glyf/VarComposite] Clamp axis coordinates --- src/OT/glyf/VarCompositeGlyph.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/OT/glyf/VarCompositeGlyph.hh b/src/OT/glyf/VarCompositeGlyph.hh index 51e40bdbf..489fb911d 100644 --- a/src/OT/glyf/VarCompositeGlyph.hh +++ b/src/OT/glyf/VarCompositeGlyph.hh @@ -238,7 +238,9 @@ struct VarCompositeGlyphRecord for (unsigned i = 0; i < count; i++) { unsigned axis_index = axis_width == 1 ? *p++ : *q++; - setter[axis_index] = axis_points[i].x; + signed v = axis_points[i].x; + v = hb_clamp (v, -(1<<14), (1<<14)); + setter[axis_index] = v; } }