shithub: freetype+ttf2subf

Download patch

ref: bcc750e511a5f7c6f4284fed6cfbaf458cff8f37
parent: bcfcc71d299c01137cdc4c6522c3645e197cab36
author: Werner Lemberg <[email protected]>
date: Fri May 16 00:50:00 EDT 2008

* src/psaux/t1decode.c (t1_decoder_parse_charstrings)
<op_closepath>: `closepath' without a path is a no-op, not an error
(cf. the PS reference manual).

Reported by Martin McBride.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2008-05-15  Werner Lemberg  <[email protected]>
 
+	* src/psaux/t1decode.c (t1_decoder_parse_charstrings)
+	<op_closepath>: `closepath' without a path is a no-op, not an error
+	(cf. the PS reference manual).
+
+	Reported by Martin McBride.
+
+2008-05-15  Werner Lemberg  <[email protected]>
+
 	* builds/toplevel.mk (CONFIG_GUESS, CONFIG_SUB): Updated.
 
 2008-05-15  Werner Lemberg  <[email protected]>
--- a/src/psaux/t1decode.c
+++ b/src/psaux/t1decode.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PostScript Type 1 decoding routines (body).                          */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */
+/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -1062,10 +1062,11 @@
         case op_closepath:
           FT_TRACE4(( " closepath" ));
 
-          close_contour( builder );
-          if ( !( builder->parse_state == T1_Parse_Have_Path   ||
-                  builder->parse_state == T1_Parse_Have_Moveto ) )
-            goto Syntax_Error;
+          /* if there is no path, `closepath' is a no-op */
+          if ( builder->parse_state == T1_Parse_Have_Path   ||
+               builder->parse_state == T1_Parse_Have_Moveto )
+            close_contour( builder );
+
           builder->parse_state = T1_Parse_Have_Width;
           break;