Commit 52cd0fc8b9a76b4bee8d4fab7aa0409a85900970

Werner Lemberg 2008-11-24T08:15:05

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'.

diff --git a/ChangeLog b/ChangeLog
index f2214e7..fc3a166 100644
--- 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
diff --git a/src/base/ftlcdfil.c b/src/base/ftlcdfil.c
index 5f1fa0b..a9b2060 100644
--- 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 )
   {
diff --git a/src/base/ftotval.c b/src/base/ftotval.c
index b6de6db..20ed686 100644
--- 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 */
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index 34a17cc..6812ac7 100644
--- 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 )
     {