* src/base/ftobjs.c (FT_Set_Charmap): Robustify.

This commit is contained in:
Alexei Podtelezhnikov 2018-06-28 21:31:35 -04:00
parent 207ca38fb5
commit 4f11209f5c
2 changed files with 6 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2018-06-28 Alexei Podtelezhnikov <apodtele@gmail.com>
* src/base/ftobjs.c (FT_Set_Charmap): Robustify.
2018-06-25 Werner Lemberg <wl@gnu.org>
[truetype] Fix memory leak.

View File

@ -3526,14 +3526,12 @@
if ( !cur || !charmap )
return FT_THROW( Invalid_CharMap_Handle );
if ( FT_Get_CMap_Format( charmap ) == 14 )
return FT_THROW( Invalid_Argument );
limit = cur + face->num_charmaps;
for ( ; cur < limit; cur++ )
{
if ( cur[0] == charmap )
if ( cur[0] == charmap &&
FT_Get_CMap_Format ( charmap ) != 14 )
{
face->charmap = cur[0];
return FT_Err_Ok;