[sfnt] Make `tt_cmap4_char_map_linear' more robust (#46078).

* src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Take care of
border conditions (i.e., if the loop exits naturally).
This commit is contained in:
Werner Lemberg 2015-10-01 20:00:27 +02:00
parent feb1f138b7
commit 90e437e3cd
2 changed files with 11 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2015-10-01 Werner Lemberg <wl@gnu.org>
[sfnt] Make `tt_cmap4_char_map_linear' more robust (#46078).
* src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Take care of
border conditions (i.e., if the loop exits naturally).
2015-10-01 Werner Lemberg <wl@gnu.org>
* src/autofit/afranges.c (af_deva_nonbase_uniranges): Fix ranges.

View File

@ -1130,18 +1130,16 @@
/* we have an invalid glyph index; if there is an overflow, */
/* we can adjust `charcode', otherwise the whole segment is */
/* invalid */
gindex = 0;
if ( (FT_Int)charcode + delta < 0 &&
(FT_Int)end + delta >= 0 )
{
charcode = (FT_UInt)( -delta );
gindex = 0;
}
else if ( (FT_Int)charcode + delta < 0x10000L &&
(FT_Int)end + delta >= 0x10000L )
{
charcode = (FT_UInt)( 0x10000L - delta );
gindex = 0;
}
else
continue;
}