shithub: freetype+ttf2subf

Download patch

ref: afe6016030f72685d2d618c78ecf9a45d831f487
parent: 1a5d561dce3731a5691a27a8b0a04c664bca7add
author: Werner Lemberg <[email protected]>
date: Mon Dec 1 07:53:00 EST 2008

GDEF tables need `glyph_count' too for validation.  Problem reported
by Chi Nguyen <[email protected]>.

* src/otvalid/otvgdef.c (otv_GDEF_validate), src/otvalid/otvalid.h
(otv_GDEF_validate), src/otvalid/otvmod.c (otv_validate): Pass
`glyph_count'.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-12-01  Werner Lemberg  <[email protected]>
+
+	GDEF tables need `glyph_count' too for validation.  Problem reported
+	by Chi Nguyen <[email protected]>.
+
+	* src/otvalid/otvgdef.c (otv_GDEF_validate), src/otvalid/otvalid.h
+	(otv_GDEF_validate), src/otvalid/otvmod.c (otv_validate): Pass
+	`glyph_count'.
+
 2008-11-29  Werner Lemberg  <[email protected]>
 
 	* src/autofit/afcjk.c, src/base/ftoutln.c, src/base/ftrfork.c,
--- a/src/otvalid/otvalid.h
+++ b/src/otvalid/otvalid.h
@@ -42,6 +42,7 @@
   otv_GDEF_validate( FT_Bytes      table,
                      FT_Bytes      gsub,
                      FT_Bytes      gpos,
+                     FT_UInt       glyph_count,
                      FT_Validator  valid );
 
   FT_LOCAL( void )
--- a/src/otvalid/otvgdef.c
+++ b/src/otvalid/otvgdef.c
@@ -141,10 +141,13 @@
   /*************************************************************************/
   /*************************************************************************/
 
+  /* sets valid->glyph_count */
+
   FT_LOCAL_DEF( void )
   otv_GDEF_validate( FT_Bytes      table,
                      FT_Bytes      gsub,
                      FT_Bytes      gpos,
+                     FT_UInt       glyph_count,
                      FT_Validator  ftvalid )
   {
     OTV_ValidatorRec  validrec;
@@ -182,6 +185,8 @@
       table_size = 12;              /* OpenType >= 1.2 */
     else
       table_size = 10;              /* OpenType < 1.2  */
+
+    valid->glyph_count = glyph_count;
 
     OTV_OPTIONAL_OFFSET( GlyphClassDef );
     OTV_SIZE_CHECK( GlyphClassDef );
--- a/src/otvalid/otvmod.c
+++ b/src/otvalid/otvmod.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType's OpenType validation module implementation (body).         */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2007 by                                    */
+/*  Copyright 2004, 2005, 2006, 2007, 2008 by                              */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -168,7 +168,7 @@
     {
       ft_validator_init( &valid, gdef, gdef + len_gdef, FT_VALIDATE_DEFAULT );
       if ( ft_setjmp( valid.jump_buffer ) == 0 )
-        otv_GDEF_validate( gdef, gsub, gpos, &valid );
+        otv_GDEF_validate( gdef, gsub, gpos, face->num_glyphs, &valid );
       error = valid.error;
       if ( error )
         goto Exit;