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

parthw-pk-vf
Alexei Podtelezhnikov 7 years ago
parent 207ca38fb5
commit 4f11209f5c
  1. 4
      ChangeLog
  2. 6
      src/base/ftobjs.c

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

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

Loading…
Cancel
Save