shithub: freetype+ttf2subf

Download patch

ref: 4f11209f5cd4f83f185042d54ad1c892dffb5ed1
parent: 207ca38fb5e99a638e9ea86d86b28fc895661122
author: Alexei Podtelezhnikov <apodtele@gmail.com>
date: Thu Jun 28 17:31:35 EDT 2018

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

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -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;