shithub: freetype+ttf2subf

Download patch

ref: 541ab5adda7a3640fdaeccc8f1979dd5c742f52c
parent: b34c9b49cc2a88161e150c131950dc007474e69e
author: Werner Lemberg <[email protected]>
date: Sat Jun 20 03:31:44 EDT 2009

[cff] Revert last change.

* src/cff/cffgload.c (cff_decoder_parse_charstrings): Do it.
Next time, don't confuse Type 2 charstring opcodes with TOP DICT
values...

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2009-06-20  Werner Lemberg  <[email protected]>
 
+	[cff] Revert last change.
+
+	* src/cff/cffgload.c (cff_decoder_parse_charstrings): Do it.
+	Next time, don't confuse Type 2 charstring opcodes with TOP DICT
+	values...
+
+2009-06-20  Werner Lemberg  <[email protected]>
+
 	* src/autofit/aflatin.c (af_latin_metrics_check_digits): Fix
 	compiler warning.
 
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -938,9 +938,17 @@
             goto Syntax_Error;
           val = -( (FT_Long)v - 251 ) * 256 - *ip++ - 108;
         }
-        else /* 255 */
-          goto Syntax_Error;
-
+        else
+        {
+          if ( ip + 3 >= limit )
+            goto Syntax_Error;
+          val = ( (FT_Int32)ip[0] << 24 ) |
+                ( (FT_Int32)ip[1] << 16 ) |
+                ( (FT_Int32)ip[2] <<  8 ) |
+                            ip[3];
+          ip    += 4;
+          shift  = 0;
+        }
         if ( decoder->top - stack >= CFF_MAX_OPERANDS )
           goto Stack_Overflow;