Commit 1a293d6c7331600d6acd219d183120ff7d96fdd7

Werner Lemberg 2005-11-18T08:23:06

* src/sfnt/ttload.c (tt_face_load_metrics): Ignore excess number of metrics instead of aborting. Patch suggested by Derek Noonburg.

diff --git a/ChangeLog b/ChangeLog
index b4fdf8a..0269a92 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-18  Werner Lemberg  <wl@gnu.org>
+
+	* src/sfnt/ttload.c (tt_face_load_metrics): Ignore excess number
+	of metrics instead of aborting.  Patch suggested by Derek Noonburg.
+
 2005-11-18  susuzki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 	* include/freetype/ftgxval.h, src/base/ftgxval.c
@@ -23,16 +28,15 @@
 
 2005-11-17  Detlef Würkner  <TetiSoft@apg.lahn.de>
 
-	* builds/amiga/makefile,
-	builds/amiga/makefile.os4,
+	* builds/amiga/makefile, builds/amiga/makefile.os4,
 	builds/amiga/smakefile.os4,
 	builds/amiga/include/freetype/config/ftmodule.h: Updated the Amiga
-	build files (added support for the gxvalid module)
+	build files (added support for the gxvalid module).
 
 2005-11-17  Werner Lemberg  <wl@gnu.org>
 
 	Add vertical metrics support to OpenType CFF outlines.  Based on a
-	patch from Mike Moening <MikeM@RetekSolutions.com>
+	patch from Mike Moening <MikeM@RetekSolutions.com>.
 
 	* src/cff/cffgload.c (cff_face_get_vertical_metrics): New function.
 	(cff_slot_load): Use cff_face_get_vertical_metrics.
diff --git a/builds/unix/ftsystem.c b/builds/unix/ftsystem.c
index 89212eb..81a45eb 100644
--- a/builds/unix/ftsystem.c
+++ b/builds/unix/ftsystem.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Unix-specific FreeType low-level system interface (body).            */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004 by                                     */
+/*  Copyright 1996-2001, 2002, 2004, 2005 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
diff --git a/builds/vms/ftsystem.c b/builds/vms/ftsystem.c
index 2cbb3aa..76bfae9 100644
--- a/builds/vms/ftsystem.c
+++ b/builds/vms/ftsystem.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    VMS-specific FreeType low-level system interface (body).             */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2005 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
diff --git a/builds/win32/ftdebug.c b/builds/win32/ftdebug.c
index 307bf29..420b008 100644
--- a/builds/win32/ftdebug.c
+++ b/builds/win32/ftdebug.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Debugging and logging component for Win32 (body).                    */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2005 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
diff --git a/include/freetype/ftgxval.h b/include/freetype/ftgxval.h
index fd999cc..2fdcdb4 100644
--- a/include/freetype/ftgxval.h
+++ b/include/freetype/ftgxval.h
@@ -206,10 +206,10 @@ FT_BEGIN_HEADER
   *   otherwise.
   *
   *   After use, the application should deallocate the buffers pointed to by
-  *   each tables' element, by calling FT_TrueTypeGX_Free(). A NULL value
-  *   indicates that the table either doesn't exist in the font,
-  *   the application hasn't asked for validation, or the validator doesn't
-  *   have the ability to validate the sfnt table.
+  *   each `tables' element, by calling FT_TrueTypeGX_Free().  A NULL value
+  *   indicates that the table either doesn't exist in the font, the
+  *   application hasn't asked for validation, or the validator doesn't have
+  *   the ability to validate the sfnt table.
   */
   FT_EXPORT( FT_Error )
   FT_TrueTypeGX_Validate( FT_Face   face,
@@ -310,8 +310,8 @@ FT_BEGIN_HEADER
   *
   * @note:
   *   After use, the application should deallocate the buffers pointed to by
-  *   ckern_table, by calling FT_ClassicKern_Free(). A NULL value indicates
-  *   that the table doesn't exist in the font.
+  *   `ckern_table', by calling FT_ClassicKern_Free().  A NULL value
+  *   indicates that the table doesn't exist in the font.
   */
   FT_EXPORT( FT_Error )
   FT_ClassicKern_Validate( FT_Face    face,
diff --git a/include/freetype/ftotval.h b/include/freetype/ftotval.h
index d9b92c1..5b31398 100644
--- a/include/freetype/ftotval.h
+++ b/include/freetype/ftotval.h
@@ -146,8 +146,8 @@ FT_BEGIN_HEADER
   *   This function only works with OpenType fonts, returning an error
   *   otherwise.
   *
-  *   After use, the application should deallocate the five tables by
-  *   FT_OpenType_Free(). A NULL value indicates that the table either
+  *   After use, the application should deallocate the five tables with
+  *   FT_OpenType_Free().  A NULL value indicates that the table either
   *   doesn't exist in the font, or the application hasn't asked for
   *   validation.
   */
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index 387c5b3..0c3d357 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -972,9 +972,14 @@
                  vertical ? "Vertical"
                           : "Horizontal" ));
 
+      /* Adobe simply ignores this problem.  So we shall do the same. */
+#if 0
       error = vertical ? SFNT_Err_Invalid_Vert_Metrics
                        : SFNT_Err_Invalid_Horiz_Metrics;
       goto Exit;
+#else
+      num_shorts = 0;
+#endif
     }
 
     if ( FT_QNEW_ARRAY( *longs,  num_longs  ) ||