Commit 6b440425fc0d2ba82068972e38e3e67ba5e88d6d

Werner Lemberg 2012-07-18T10:39:18

Fix Savannah bug #36833. * src/psaux/t1decode.c (t1operator_seac): `seac' is not a valid operator if we want metrics only.

diff --git a/ChangeLog b/ChangeLog
index 19ccf31..030bf63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-07-17  Werner Lemberg  <wl@gnu.org>
+
+	Fix Savannah bug #36833.
+
+	* src/psaux/t1decode.c (t1operator_seac): `seac' is not a valid
+	operator if we want metrics only.
+
 2012-07-16  Werner Lemberg  <wl@gnu.org>
 
 	Fix Savannah bug #36832.
@@ -20,7 +27,7 @@
 
 2012-07-11  Werner Lemberg  <wl@gnu.org>
 
-	[smooth] Avoid memory like in case of failure.
+	[smooth] Avoid memory leak in case of failure.
 
 	* src/smooth/ftsmooth.c (ft_smooth_render_generic): Use flags to
 	indicate what to clean up after finishing the function, with and
diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c
index ea67841..8afe021 100644
--- a/src/psaux/t1decode.c
+++ b/src/psaux/t1decode.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PostScript Type 1 decoding routines (body).                          */
 /*                                                                         */
-/*  Copyright 2000-2011 by                                                 */
+/*  Copyright 2000-2012 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -208,6 +208,12 @@
       return PSaux_Err_Syntax_Error;
     }
 
+    if ( decoder->builder.metrics_only )
+    {
+      FT_ERROR(( "t1operator_seac: unexpected seac\n" ));
+      return PSaux_Err_Syntax_Error;
+    }
+
     /* seac weirdness */
     adx += decoder->builder.left_bearing.x;