[truetype] Fix integer overflow (#57287).

* src/truetype/ttgload.c (compute_glyph_metrics): Use `SUB_LONG'.
This commit is contained in:
Armin Hasitzka 2019-11-23 11:01:18 +01:00 committed by Werner Lemberg
parent 3cb7b3f7cb
commit c67b9a1c5b
2 changed files with 9 additions and 2 deletions

View File

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

View File

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