* src/truetype/ttgload.c (compute_glyph_metrics): Fix overflow.

Reported as

  https://bugs.chromium.org/p/chromium/issues/detail?id=777151
This commit is contained in:
Werner Lemberg 2018-08-05 07:21:10 +02:00
parent ced9c311f6
commit 720ae67f35
2 changed files with 11 additions and 3 deletions

View File

@ -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.

View File

@ -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;
}