shithub: freetype+ttf2subf

Download patch

ref: 52cd0fc8b9a76b4bee8d4fab7aa0409a85900970
parent: 105721a5a61718ab43de8f7e7e277077668b0eae
author: Werner Lemberg <wl@gnu.org>
date: Mon Nov 24 03:15:05 EST 2008

Fixes from the gnuwin32 port.

* src/base/ftlcdfil.c: s/EXPORT/EXPORT_DEF/.

* src/base/ftotval.c: Include FT_OPENTYPE_VALIDATE_H.

* src/psaux/psobjs.c (ps_table_add): Check `length'.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-11-24  Werner Lemberg  <wl@gnu.org>
+
+	Fixes from the gnuwin32 port.
+
+	* src/base/ftlcdfil.c: s/EXPORT/EXPORT_DEF/.
+
+	* src/base/ftotval.c: Include FT_OPENTYPE_VALIDATE_H.
+
+	* src/psaux/psobjs.c (ps_table_add): Check `length'.
+
 2008-11-15  Werner Lemberg  <wl@gnu.org>
 
 	* src/truetype/ttinterp.c (tt_default_graphics_state): The default
--- a/src/base/ftlcdfil.c
+++ b/src/base/ftlcdfil.c
@@ -266,7 +266,7 @@
 #endif /* USE_LEGACY */
 
 
-  FT_EXPORT( FT_Error )
+  FT_EXPORT_DEF( FT_Error )
   FT_Library_SetLcdFilter( FT_Library     library,
                            FT_LcdFilter   filter )
   {
@@ -335,7 +335,7 @@
 
 #else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
 
-  FT_EXPORT( FT_Error )
+  FT_EXPORT_DEF( FT_Error )
   FT_Library_SetLcdFilter( FT_Library    library,
                            FT_LcdFilter  filter )
   {
--- a/src/base/ftotval.c
+++ b/src/base/ftotval.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType API for validating OpenType tables (body).                  */
 /*                                                                         */
-/*  Copyright 2004, 2006 by                                                */
+/*  Copyright 2004, 2006, 2008 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -18,6 +18,7 @@
 #include <ft2build.h>
 #include FT_INTERNAL_OBJECTS_H
 #include FT_SERVICE_OPENTYPE_VALIDATE_H
+#include FT_OPENTYPE_VALIDATE_H
 
 
   /* documentation is in ftotval.h */
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -175,6 +175,12 @@
       return PSaux_Err_Invalid_Argument;
     }
 
+    if ( length < 0 )
+    {
+      FT_ERROR(( "ps_table_add: invalid length\n" ));
+      return PSaux_Err_Invalid_Argument;
+    }
+
     /* grow the base block if needed */
     if ( table->cursor + length > table->capacity )
     {