shithub: freetype+ttf2subf

Download patch

ref: 8dc17bb47b205f08bd3020ed93793d04db02627a
parent: 448d128ec5821ec8147d58950860de0d70d0f42f
author: Werner Lemberg <[email protected]>
date: Mon May 7 07:24:48 EDT 2012

[type1] Fix Savannah bug #36386.

* src/type1/t1load.c (t1_load_keyword): Ignore keyword if context is
not valid.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-07  Werner Lemberg  <[email protected]>
+
+	[type1] Fix Savannah bug #36386.
+
+	* src/type1/t1load.c (t1_load_keyword): Ignore keyword if context is
+	not valid.
+
 2012-04-07  Werner Lemberg  <[email protected]>
 
 	Remove compiler warning.
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -1011,13 +1011,24 @@
       max_objects  = 0;
     }
 
-    if ( field->type == T1_FIELD_TYPE_INTEGER_ARRAY ||
-         field->type == T1_FIELD_TYPE_FIXED_ARRAY   )
-      error = T1_Load_Field_Table( &loader->parser, field,
-                                   objects, max_objects, 0 );
+    if ( *objects )
+    {
+      if ( field->type == T1_FIELD_TYPE_INTEGER_ARRAY ||
+           field->type == T1_FIELD_TYPE_FIXED_ARRAY   )
+        error = T1_Load_Field_Table( &loader->parser, field,
+                                     objects, max_objects, 0 );
+      else
+        error = T1_Load_Field( &loader->parser, field,
+                               objects, max_objects, 0 );
+    }
     else
-      error = T1_Load_Field( &loader->parser, field,
-                             objects, max_objects, 0 );
+    {
+      FT_TRACE1(( "t1_load_keyword: ignoring keyword `%s'"
+                  " which is not valid at this point\n"
+                  "                 (probably due to missing keywords)\n",
+                 field->ident ));
+      error = T1_Err_Ok;
+    }
 
   Exit:
     return error;
@@ -1970,8 +1981,8 @@
 
               if ( !( dict & keyword->dict ) )
               {
-                FT_TRACE1(( "parse_dict: found %s but ignoring it "
-                            "since it is in the wrong dictionary\n",
+                FT_TRACE1(( "parse_dict: found `%s' but ignoring it"
+                            " since it is in the wrong dictionary\n",
                             keyword->ident ));
                 break;
               }