Commit c9114b99269c9121e93f8c8d3684120f4c77c34c

Werner Lemberg 2005-02-10T08:18:27

* builds/unix/freetype-config.in: Add new flag `--ftversion' to return the FreeType version. Suggested by George Williams <gww@silcom.com>. * docs/CHANGES: Updated. * src/otvalid/otvmod.c (otv_validate): Deallocate arrays in case of error. Reported by YAMANO-UCHI Hidetoshi <mer@din.or.jp>. * src/psaux/t1decode.c (t1_decoder_parse_charstrings) <op_closepath>: Accept `T1_Parse_Have_Moveto' state also which can happen in empty glyphs. Reported by Ian Brown <ian.brown@printsoft.de>.

diff --git a/ChangeLog b/ChangeLog
index 462bfa8..e437a9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2005-02-10  Werner Lemberg  <wl@gnu.org>
+
+	* builds/unix/freetype-config.in: Add new flag `--ftversion' to
+	return the FreeType version.  Suggested by George Williams
+	<gww@silcom.com>.
+
+	* docs/CHANGES: Updated.
+
+2005-02-09  Werner Lemberg  <wl@gnu.org>
+
+	* src/otvalid/otvmod.c (otv_validate): Deallocate arrays in case
+	of error.  Reported by YAMANO-UCHI Hidetoshi <mer@din.or.jp>.
+
+2005-02-08  Werner Lemberg  <wl@gnu.org>
+
+	* src/psaux/t1decode.c (t1_decoder_parse_charstrings)
+	<op_closepath>: Accept `T1_Parse_Have_Moveto' state also which can
+	happen in empty glyphs.  Reported by Ian Brown
+	<ian.brown@printsoft.de>.
+
 2005-02-04  Werner Lemberg  <wl@gnu.org>
 
 	* src/otlayout/*: Removed.  Obsolete.
diff --git a/builds/unix/freetype-config.in b/builds/unix/freetype-config.in
index d92a877..c0783e2 100644
--- a/builds/unix/freetype-config.in
+++ b/builds/unix/freetype-config.in
@@ -23,6 +23,7 @@ Options:
                          the FreeType library
   --exec-prefix=EPREFIX  override \`--exec-prefix' value with EPREFIX
   --version              display libtool version of the FreeType library
+  --ftversion            display FreeType version number
   --libs                 display flags for linking with the FreeType library
   --libtool              display library name for linking with libtool
   --cflags               display flags for compiling with the FreeType
@@ -65,6 +66,19 @@ while test $# -gt 0 ; do
     echo @ft_version@
     exit 0
     ;;
+  --ftversion)
+    major=`grep define @prefix@/include/freetype2/freetype/freetype.h \
+           | grep FREETYPE_MAJOR \
+           | sed 's/.*[ 	]\([0-9][0-9]*\).*/\1/'`
+    minor=`grep define @prefix@/include/freetype2/freetype/freetype.h \
+           | grep FREETYPE_MINOR \
+           | sed 's/.*[ 	]\([0-9][0-9]*\).*/\1/'`
+    patch=`grep define @prefix@/include/freetype2/freetype/freetype.h \
+           | grep FREETYPE_PATCH \
+           | sed 's/.*[ 	]\([0-9][0-9]*\).*/\1/'`
+    echo $major.$minor.$patch
+    exit 0
+    ;;
   --cflags)
     echo_cflags=yes
     ;;
diff --git a/docs/CHANGES b/docs/CHANGES
index 24e4bf8..d64c675 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -17,6 +17,8 @@ LATEST CHANGES BETWEEN 2.1.10 and 2.1.9
       distortions.  It has been introduced in version 2.1.8, and it is
       highly recommended to upgrade.
 
+    - FreeType didn't properly parse empty Type 1 glyphs.
+
 
   II. IMPORTANT CHANGES
 
@@ -48,6 +50,9 @@ LATEST CHANGES BETWEEN 2.1.10 and 2.1.9
       not  mentioned  this  explicitly,  but  implementors  might have
       relied on this after looking into the source files.
 
+    - A new option `--ftversion' has been  added to freetype-config to
+      return the FreeType version.
+
 
 LATEST CHANGES BETWEEN 2.1.9 and 2.1.8
 
diff --git a/src/otvalid/otvmod.c b/src/otvalid/otvmod.c
index 146b58e..3572a3d 100644
--- a/src/otvalid/otvmod.c
+++ b/src/otvalid/otvmod.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType's OpenType validation module implementation (body).         */
 /*                                                                         */
-/*  Copyright 2004 by                                                      */
+/*  Copyright 2004, 2005 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -178,6 +178,17 @@
     *ot_jstf = (FT_Bytes)jstf;
 
   Exit:
+    if ( error ) {
+      FT_Memory  memory = FT_FACE_MEMORY( face );
+
+
+      FT_FREE( base );
+      FT_FREE( gdef );
+      FT_FREE( gpos );
+      FT_FREE( gsub );
+      FT_FREE( jstf );
+    }
+
     return error;
   }
 
diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c
index c2adf48..cf4bcc5 100644
--- 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 by                               */
+/*  Copyright 2000-2001, 2002, 2003, 2004, 2005 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -796,7 +796,8 @@
           FT_TRACE4(( " closepath" ));
 
           close_contour( builder );
-          if ( builder->parse_state != T1_Parse_Have_Path )
+          if ( !( builder->parse_state == T1_Parse_Have_Path   ||
+                  builder->parse_state == T1_Parse_Have_Moveto ) )
             goto Syntax_Error;
           builder->parse_state = T1_Parse_Have_Width;
           break;