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'.
This commit is contained in:
Werner Lemberg 2008-12-01 12:53:00 +00:00
parent 1a5d561dce
commit afe6016030
4 changed files with 17 additions and 2 deletions

View File

@ -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,

View File

@ -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 )

View File

@ -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 )

View File

@ -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;