shithub: freetype+ttf2subf

Download patch

ref: c5f1bc4b36108c0b7e0235031f929ab18cf1b164
parent: 5081674c5f3c2c7bcf49bc48f8618dd091325c9d
author: Alexei Podtelezhnikov <[email protected]>
date: Tue Oct 25 18:31:42 EDT 2016

[cff] Correct cmap format reporting (#24819).

* src/cff/cffdrivr.c (cff_get_cmap_info): Throw an error on synthetic
charmap instead of guessing its format and language.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-10-25  Alexei Podtelezhnikov  <[email protected]>
+
+	[cff] Correct cmap format reporting (#24819).
+
+	* src/cff/cffdrivr.c (cff_get_cmap_info): Throw an error on synthetic
+	charmap instead of guessing its format and language.
+
 2016-10-22  Werner Lemberg  <[email protected]>
 
 	[truetype] Fix SCANTYPE instruction (#49394).
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -494,9 +494,6 @@
     FT_Library  library = FT_FACE_LIBRARY( face );
 
 
-    cmap_info->language = 0;
-    cmap_info->format   = 0;
-
     if ( cmap->clazz != &CFF_CMAP_ENCODING_CLASS_REC_GET &&
          cmap->clazz != &CFF_CMAP_UNICODE_CLASS_REC_GET  )
     {
@@ -509,6 +506,8 @@
       if ( service && service->get_cmap_info )
         error = service->get_cmap_info( charmap, cmap_info );
     }
+    else
+      error = FT_THROW( Invalid_CharMap_Format );
 
     return error;
   }