From 74cdd75f6fb5c6df74f12e4724ecd84edab0dddd Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Tue, 27 Nov 2018 17:55:40 +0100 Subject: [PATCH] [truetype] Fix numeric overflow (#55103). * src/truetype/ttgload.c (compute_glyph_metrics): Use `SUB_LONG'. --- ChangeLog | 6 ++++++ src/truetype/ttgload.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 04b4fbd3d..b10dffbfe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-11-27 Ben Wagner + + [truetype Fix numeric overflow (#55103). + + * src/truetype/ttgload.c (compute_glyph_metrics): Use `SUB_LONG'. + 2018-11-18 Alexei Podtelezhnikov [builds] Belated DLL support with vc2002-vc2008. diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 3028622f7..1d84450a8 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -2160,7 +2160,7 @@ glyph->metrics.horiBearingX = bbox.xMin; glyph->metrics.horiBearingY = bbox.yMax; - glyph->metrics.horiAdvance = loader->pp2.x - loader->pp1.x; + glyph->metrics.horiAdvance = SUB_LONG(loader->pp2.x, loader->pp1.x); /* Adjust advance width to the value contained in the hdmx table */ /* unless FT_LOAD_COMPUTE_METRICS is set or backward compatibility */