[truetype] Fix integer overflow (#57287).

* src/truetype/ttgload.c (compute_glyph_metrics): Use `SUB_LONG'.
GSoC-2020-greg
Armin Hasitzka 5 years ago committed by Werner Lemberg
parent 3cb7b3f7cb
commit c67b9a1c5b
  1. 6
      ChangeLog
  2. 5
      src/truetype/ttgload.c

@ -1,3 +1,9 @@
2019-11-23 Armin Hasitzka <prince.cherusker@gmail.com>
[truetype] Fix integer overflow (#57287).
* src/truetype/ttgload.c (compute_glyph_metrics): Use `SUB_LONG'.
2019-11-23 Ben Wagner <bungeman@google.com>
[sfnt] Avoid sanitizer warning (#57286).

@ -2302,13 +2302,14 @@
if ( face->vertical_info &&
face->vertical.number_Of_VMetrics > 0 )
{
top = (FT_Short)FT_DivFix( loader->pp3.y - bbox.yMax,
top = (FT_Short)FT_DivFix( SUB_LONG( loader->pp3.y, bbox.yMax ),
y_scale );
if ( loader->pp3.y <= loader->pp4.y )
advance = 0;
else
advance = (FT_UShort)FT_DivFix( loader->pp3.y - loader->pp4.y,
advance = (FT_UShort)FT_DivFix( SUB_LONG( loader->pp3.y,
loader->pp4.y ),
y_scale );
}
else

Loading…
Cancel
Save