From afe6016030f72685d2d618c78ecf9a45d831f487 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 1 Dec 2008 12:53:00 +0000 Subject: [PATCH] GDEF tables need `glyph_count' too for validation. Problem reported by Chi Nguyen . * src/otvalid/otvgdef.c (otv_GDEF_validate), src/otvalid/otvalid.h (otv_GDEF_validate), src/otvalid/otvmod.c (otv_validate): Pass `glyph_count'. --- ChangeLog | 9 +++++++++ src/otvalid/otvalid.h | 1 + src/otvalid/otvgdef.c | 5 +++++ src/otvalid/otvmod.c | 4 ++-- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 094cce852..43af8bc14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-12-01 Werner Lemberg + + GDEF tables need `glyph_count' too for validation. Problem reported + by Chi Nguyen . + + * 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 * 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 90255cdba..eb99b9cc4 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 77bd65165..3633ad0de 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 c28029915..63c25f690 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;