shithub: freetype+ttf2subf

Download patch

ref: f28c95c4a40842795fb159bff56b5be9fee867cd
parent: 4942c2bb7240136bc299a9fc7c375e58eb37f417
author: Werner Lemberg <[email protected]>
date: Thu Sep 17 15:30:26 EDT 2015

[type42] Fix memory leak (#45989).

* src/type42/t42parse.c (t42_parse_charstrings): Allow only a single
`CharStrings' array.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2015-09-17  Werner Lemberg  <[email protected]>
 
+	[type42] Fix memory leak (#45989).
+
+	* src/type42/t42parse.c (t42_parse_charstrings): Allow only a single
+	`CharStrings' array.
+
+2015-09-17  Werner Lemberg  <[email protected]>
+
 	[psaux] Fix memory leak (#45986).
 
 	* src/psaux/psobjs.c (ps_parser_load_field) <T1_FIELD_TYPE_MM_BBOX>:
--- a/src/type42/t42parse.c
+++ b/src/type42/t42parse.c
@@ -841,6 +841,15 @@
 
     /* initialize tables */
 
+    /* contrary to Type1, we disallow multiple CharStrings arrays */
+    if ( swap_table->init )
+    {
+      FT_ERROR(( "t42_parse_charstrings:"
+                 " only one CharStrings array allowed\n" ));
+      error = FT_THROW( Invalid_File_Format );
+      goto Fail;
+    }
+
     error = psaux->ps_table_funcs->init( code_table,
                                          loader->num_glyphs,
                                          memory );