* src/truetype/ttgload.c (compute_glyph_metrics): Fix overflow. Reported as https://bugs.chromium.org/p/chromium/issues/detail?id=777151
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/ChangeLog b/ChangeLog
index a573e4a..7f0793d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2018-08-05 Werner Lemberg <wl@gnu.org>
+
+ * src/truetype/ttgload.c (compute_glyph_metrics): Fix overflow.
+
+ Reported as
+
+ https://bugs.chromium.org/p/chromium/issues/detail?id=777151
+
2018-08-04 Werner Lemberg <wl@gnu.org>
* src/truetype/ttinterp.c (opcode_name): Fix typos.
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index f0f6a06..9e98f11 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -2284,13 +2284,13 @@
/* XXX: for now, we have no better algorithm for the lsb, but it */
/* should work fine. */
/* */
- glyph->metrics.vertBearingX = glyph->metrics.horiBearingX -
- glyph->metrics.horiAdvance / 2;
+ glyph->metrics.vertBearingX = SUB_LONG( glyph->metrics.horiBearingX,
+ glyph->metrics.horiAdvance / 2 );
glyph->metrics.vertBearingY = top;
glyph->metrics.vertAdvance = advance;
}
- return 0;
+ return FT_Err_Ok;
}