GDEF tables need `glyph_count' too for validation. Problem reported by Chi Nguyen <chint@necsv.com>. * src/otvalid/otvgdef.c (otv_GDEF_validate), src/otvalid/otvalid.h (otv_GDEF_validate), src/otvalid/otvmod.c (otv_validate): Pass `glyph_count'.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
diff --git a/ChangeLog b/ChangeLog
index 094cce8..43af8bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-12-01 Werner Lemberg <wl@gnu.org>
+
+ GDEF tables need `glyph_count' too for validation. Problem reported
+ by Chi Nguyen <chint@necsv.com>.
+
+ * 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 <wl@gnu.org>
* src/autofit/afcjk.c, src/base/ftoutln.c, src/base/ftrfork.c,
diff --git a/src/otvalid/otvalid.h b/src/otvalid/otvalid.h
index 90255cd..eb99b9c 100644
--- a/src/otvalid/otvalid.h
+++ b/src/otvalid/otvalid.h
@@ -42,6 +42,7 @@ FT_BEGIN_HEADER
otv_GDEF_validate( FT_Bytes table,
FT_Bytes gsub,
FT_Bytes gpos,
+ FT_UInt glyph_count,
FT_Validator valid );
FT_LOCAL( void )
diff --git a/src/otvalid/otvgdef.c b/src/otvalid/otvgdef.c
index 77bd651..3633ad0 100644
--- 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;
@@ -183,6 +186,8 @@
else
table_size = 10; /* OpenType < 1.2 */
+ valid->glyph_count = glyph_count;
+
OTV_OPTIONAL_OFFSET( GlyphClassDef );
OTV_SIZE_CHECK( GlyphClassDef );
if ( GlyphClassDef )
diff --git a/src/otvalid/otvmod.c b/src/otvalid/otvmod.c
index c280299..63c25f6 100644
--- 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;