ReactOS  0.4.15-dev-1054-gd029a62
otvcommn.h File Reference
#include <ft2build.h>
#include "otvalid.h"
Include dependency graph for otvcommn.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  OTV_ValidatorRec_
 

Macros

#define FT_INVALID_(_error)   ft_validator_error( otvalid->root, FT_THROW( _error ) )
 
#define OTV_OPTIONAL_TABLE(_table)
 
#define OTV_OPTIONAL_TABLE32(_table)
 
#define OTV_OPTIONAL_OFFSET(_offset)
 
#define OTV_OPTIONAL_OFFSET32(_offset)
 
#define OTV_LIMIT_CHECK(_count)
 
#define OTV_SIZE_CHECK(_size)
 
#define OTV_SIZE_CHECK32(_size)
 
#define OTV_NAME_(x)   #x
 
#define OTV_NAME(x)   OTV_NAME_(x)
 
#define OTV_FUNC_(x)   x##Func
 
#define OTV_FUNC(x)   OTV_FUNC_(x)
 
#define OTV_NEST1(x)
 
#define OTV_NEST2(x, y)
 
#define OTV_NEST3(x, y, z)
 
#define OTV_INIT   do { } while ( 0 )
 
#define OTV_ENTER   do { } while ( 0 )
 
#define OTV_NAME_ENTER(name)   do { } while ( 0 )
 
#define OTV_EXIT   do { } while ( 0 )
 
#define OTV_TRACE(s)   do { } while ( 0 )
 
#define OTV_RUN   otvalid->func[0]
 
#define ChainPosClassSetFunc   otv_x_Ox
 
#define ChainPosRuleSetFunc   otv_x_Ox
 
#define ChainSubClassSetFunc   otv_x_Ox
 
#define ChainSubRuleSetFunc   otv_x_Ox
 
#define JstfLangSysFunc   otv_x_Ox
 
#define JstfMaxFunc   otv_x_Ox
 
#define LigGlyphFunc   otv_x_Ox
 
#define LigatureArrayFunc   otv_x_Ox
 
#define LigatureSetFunc   otv_x_Ox
 
#define PosClassSetFunc   otv_x_Ox
 
#define PosRuleSetFunc   otv_x_Ox
 
#define SubClassSetFunc   otv_x_Ox
 
#define SubRuleSetFunc   otv_x_Ox
 
#define AlternateSubstFormat1Func   otv_u_C_x_Ox
 
#define ChainContextPosFormat1Func   otv_u_C_x_Ox
 
#define ChainContextSubstFormat1Func   otv_u_C_x_Ox
 
#define ContextPosFormat1Func   otv_u_C_x_Ox
 
#define ContextSubstFormat1Func   otv_u_C_x_Ox
 
#define LigatureSubstFormat1Func   otv_u_C_x_Ox
 
#define MultipleSubstFormat1Func   otv_u_C_x_Ox
 
#define AlternateSetFunc   otv_x_ux
 
#define AttachPointFunc   otv_x_ux
 
#define ExtenderGlyphFunc   otv_x_ux
 
#define JstfGPOSModListFunc   otv_x_ux
 
#define JstfGSUBModListFunc   otv_x_ux
 
#define SequenceFunc   otv_x_ux
 
#define PosClassRuleFunc   otv_x_y_ux_sy
 
#define PosRuleFunc   otv_x_y_ux_sy
 
#define SubClassRuleFunc   otv_x_y_ux_sy
 
#define SubRuleFunc   otv_x_y_ux_sy
 
#define ChainPosClassRuleFunc   otv_x_ux_y_uy_z_uz_p_sp
 
#define ChainPosRuleFunc   otv_x_ux_y_uy_z_uz_p_sp
 
#define ChainSubClassRuleFunc   otv_x_ux_y_uy_z_uz_p_sp
 
#define ChainSubRuleFunc   otv_x_ux_y_uy_z_uz_p_sp
 
#define ContextPosFormat2Func   otv_u_O_O_x_Onx
 
#define ContextSubstFormat2Func   otv_u_O_O_x_Onx
 
#define ContextPosFormat3Func   otv_u_x_y_Ox_sy
 
#define ContextSubstFormat3Func   otv_u_x_y_Ox_sy
 
#define ChainContextPosFormat2Func   otv_u_O_O_O_O_x_Onx
 
#define ChainContextSubstFormat2Func   otv_u_O_O_O_O_x_Onx
 
#define ChainContextPosFormat3Func   otv_u_x_Ox_y_Oy_z_Oz_p_sp
 
#define ChainContextSubstFormat3Func   otv_u_x_Ox_y_Oy_z_Oz_p_sp
 

Typedefs

typedef typedefFT_BEGIN_HEADER struct OTV_ValidatorRec_OTV_Validator
 
typedef void(* OTV_Validate_Func) (FT_Bytes table, OTV_Validator otvalid)
 
typedef struct OTV_ValidatorRec_ OTV_ValidatorRec
 

Functions

 otv_Coverage_validate (FT_Bytes table, OTV_Validator otvalid, FT_Int expected_count)
 
 otv_Coverage_get_first (FT_Bytes table)
 
 otv_Coverage_get_last (FT_Bytes table)
 
 otv_Coverage_get_count (FT_Bytes table)
 
 otv_ClassDef_validate (FT_Bytes table, OTV_Validator otvalid)
 
 otv_Device_validate (FT_Bytes table, OTV_Validator otvalid)
 
 otv_Lookup_validate (FT_Bytes table, OTV_Validator otvalid)
 
 otv_LookupList_validate (FT_Bytes table, OTV_Validator otvalid)
 
 otv_Feature_validate (FT_Bytes table, OTV_Validator otvalid)
 
 otv_FeatureList_validate (FT_Bytes table, FT_Bytes lookups, OTV_Validator otvalid)
 
 otv_LangSys_validate (FT_Bytes table, OTV_Validator otvalid)
 
 otv_Script_validate (FT_Bytes table, OTV_Validator otvalid)
 
 otv_ScriptList_validate (FT_Bytes table, FT_Bytes features, OTV_Validator otvalid)
 
 otv_x_Ox (FT_Bytes table, OTV_Validator otvalid)
 
 otv_u_C_x_Ox (FT_Bytes table, OTV_Validator otvalid)
 
 otv_x_ux (FT_Bytes table, OTV_Validator otvalid)
 
 otv_x_y_ux_sy (FT_Bytes table, OTV_Validator otvalid)
 
 otv_x_ux_y_uy_z_uz_p_sp (FT_Bytes table, OTV_Validator otvalid)
 
 otv_u_O_O_x_Onx (FT_Bytes table, OTV_Validator otvalid)
 
 otv_u_x_y_Ox_sy (FT_Bytes table, OTV_Validator otvalid)
 
 otv_u_O_O_O_O_x_Onx (FT_Bytes table, OTV_Validator otvalid)
 
 otv_u_x_Ox_y_Oy_z_Oz_p_sp (FT_Bytes table, OTV_Validator otvalid)
 
 otv_GSUBGPOS_get_Lookup_count (FT_Bytes table)
 
 otv_GSUBGPOS_have_MarkAttachmentType_flag (FT_Bytes table)
 

Macro Definition Documentation

◆ AlternateSetFunc

#define AlternateSetFunc   otv_x_ux

Definition at line 396 of file otvcommn.h.

◆ AlternateSubstFormat1Func

#define AlternateSubstFormat1Func   otv_u_C_x_Ox

Definition at line 384 of file otvcommn.h.

◆ AttachPointFunc

#define AttachPointFunc   otv_x_ux

Definition at line 397 of file otvcommn.h.

◆ ChainContextPosFormat1Func

#define ChainContextPosFormat1Func   otv_u_C_x_Ox

Definition at line 385 of file otvcommn.h.

◆ ChainContextPosFormat2Func

#define ChainContextPosFormat2Func   otv_u_O_O_O_O_x_Onx

Definition at line 439 of file otvcommn.h.

◆ ChainContextPosFormat3Func

#define ChainContextPosFormat3Func   otv_u_x_Ox_y_Oy_z_Oz_p_sp

Definition at line 446 of file otvcommn.h.

◆ ChainContextSubstFormat1Func

#define ChainContextSubstFormat1Func   otv_u_C_x_Ox

Definition at line 386 of file otvcommn.h.

◆ ChainContextSubstFormat2Func

#define ChainContextSubstFormat2Func   otv_u_O_O_O_O_x_Onx

Definition at line 440 of file otvcommn.h.

◆ ChainContextSubstFormat3Func

#define ChainContextSubstFormat3Func   otv_u_x_Ox_y_Oy_z_Oz_p_sp

Definition at line 447 of file otvcommn.h.

◆ ChainPosClassRuleFunc

#define ChainPosClassRuleFunc   otv_x_ux_y_uy_z_uz_p_sp

Definition at line 416 of file otvcommn.h.

◆ ChainPosClassSetFunc

#define ChainPosClassSetFunc   otv_x_Ox

Definition at line 366 of file otvcommn.h.

◆ ChainPosRuleFunc

#define ChainPosRuleFunc   otv_x_ux_y_uy_z_uz_p_sp

Definition at line 417 of file otvcommn.h.

◆ ChainPosRuleSetFunc

#define ChainPosRuleSetFunc   otv_x_Ox

Definition at line 367 of file otvcommn.h.

◆ ChainSubClassRuleFunc

#define ChainSubClassRuleFunc   otv_x_ux_y_uy_z_uz_p_sp

Definition at line 418 of file otvcommn.h.

◆ ChainSubClassSetFunc

#define ChainSubClassSetFunc   otv_x_Ox

Definition at line 368 of file otvcommn.h.

◆ ChainSubRuleFunc

#define ChainSubRuleFunc   otv_x_ux_y_uy_z_uz_p_sp

Definition at line 419 of file otvcommn.h.

◆ ChainSubRuleSetFunc

#define ChainSubRuleSetFunc   otv_x_Ox

Definition at line 369 of file otvcommn.h.

◆ ContextPosFormat1Func

#define ContextPosFormat1Func   otv_u_C_x_Ox

Definition at line 387 of file otvcommn.h.

◆ ContextPosFormat2Func

#define ContextPosFormat2Func   otv_u_O_O_x_Onx

Definition at line 425 of file otvcommn.h.

◆ ContextPosFormat3Func

#define ContextPosFormat3Func   otv_u_x_y_Ox_sy

Definition at line 432 of file otvcommn.h.

◆ ContextSubstFormat1Func

#define ContextSubstFormat1Func   otv_u_C_x_Ox

Definition at line 388 of file otvcommn.h.

◆ ContextSubstFormat2Func

#define ContextSubstFormat2Func   otv_u_O_O_x_Onx

Definition at line 426 of file otvcommn.h.

◆ ContextSubstFormat3Func

#define ContextSubstFormat3Func   otv_u_x_y_Ox_sy

Definition at line 433 of file otvcommn.h.

◆ ExtenderGlyphFunc

#define ExtenderGlyphFunc   otv_x_ux

Definition at line 398 of file otvcommn.h.

◆ FT_INVALID_

#define FT_INVALID_ (   _error)    ft_validator_error( otvalid->root, FT_THROW( _error ) )

Definition at line 70 of file otvcommn.h.

◆ JstfGPOSModListFunc

#define JstfGPOSModListFunc   otv_x_ux

Definition at line 399 of file otvcommn.h.

◆ JstfGSUBModListFunc

#define JstfGSUBModListFunc   otv_x_ux

Definition at line 400 of file otvcommn.h.

◆ JstfLangSysFunc

#define JstfLangSysFunc   otv_x_Ox

Definition at line 370 of file otvcommn.h.

◆ JstfMaxFunc

#define JstfMaxFunc   otv_x_Ox

Definition at line 371 of file otvcommn.h.

◆ LigatureArrayFunc

#define LigatureArrayFunc   otv_x_Ox

Definition at line 373 of file otvcommn.h.

◆ LigatureSetFunc

#define LigatureSetFunc   otv_x_Ox

Definition at line 374 of file otvcommn.h.

◆ LigatureSubstFormat1Func

#define LigatureSubstFormat1Func   otv_u_C_x_Ox

Definition at line 389 of file otvcommn.h.

◆ LigGlyphFunc

#define LigGlyphFunc   otv_x_Ox

Definition at line 372 of file otvcommn.h.

◆ MultipleSubstFormat1Func

#define MultipleSubstFormat1Func   otv_u_C_x_Ox

Definition at line 390 of file otvcommn.h.

◆ OTV_ENTER

#define OTV_ENTER   do { } while ( 0 )

Definition at line 226 of file otvcommn.h.

◆ OTV_EXIT

#define OTV_EXIT   do { } while ( 0 )

Definition at line 228 of file otvcommn.h.

◆ OTV_FUNC

#define OTV_FUNC (   x)    OTV_FUNC_(x)

Definition at line 146 of file otvcommn.h.

◆ OTV_FUNC_

#define OTV_FUNC_ (   x)    x##Func

Definition at line 145 of file otvcommn.h.

◆ OTV_INIT

#define OTV_INIT   do { } while ( 0 )

Definition at line 225 of file otvcommn.h.

◆ OTV_LIMIT_CHECK

#define OTV_LIMIT_CHECK (   _count)
Value:
if ( p + (_count) > otvalid->root->limit ) \
FT_INVALID_TOO_SHORT; \
FT_END_STMNT
if(!(yy_init))
Definition: macro.lex.yy.c:714
GLfloat GLfloat p
Definition: glext.h:8902

Definition at line 91 of file otvcommn.h.

◆ OTV_NAME

#define OTV_NAME (   x)    OTV_NAME_(x)

Definition at line 143 of file otvcommn.h.

◆ OTV_NAME_

#define OTV_NAME_ (   x)    #x

Definition at line 142 of file otvcommn.h.

◆ OTV_NAME_ENTER

#define OTV_NAME_ENTER (   name)    do { } while ( 0 )

Definition at line 227 of file otvcommn.h.

◆ OTV_NEST1

#define OTV_NEST1 (   x)
Value:
FT_BEGIN_STMNT \
otvalid->nesting_level = 0; \
otvalid->func[0] = OTV_FUNC( x ); \
FT_END_STMNT
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define OTV_FUNC(x)
Definition: otvcommn.h:146

Definition at line 204 of file otvcommn.h.

◆ OTV_NEST2

#define OTV_NEST2 (   x,
  y 
)
Value:
FT_BEGIN_STMNT \
otvalid->nesting_level = 0; \
otvalid->func[0] = OTV_FUNC( x ); \
otvalid->func[1] = OTV_FUNC( y ); \
FT_END_STMNT
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define OTV_FUNC(x)
Definition: otvcommn.h:146

Definition at line 210 of file otvcommn.h.

◆ OTV_NEST3

#define OTV_NEST3 (   x,
  y,
  z 
)
Value:
FT_BEGIN_STMNT \
otvalid->nesting_level = 0; \
otvalid->func[0] = OTV_FUNC( x ); \
otvalid->func[1] = OTV_FUNC( y ); \
otvalid->func[2] = OTV_FUNC( z ); \
FT_END_STMNT
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLdouble GLdouble z
Definition: glext.h:5874
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define OTV_FUNC(x)
Definition: otvcommn.h:146

Definition at line 217 of file otvcommn.h.

◆ OTV_OPTIONAL_OFFSET

#define OTV_OPTIONAL_OFFSET (   _offset)
Value:
FT_BEGIN_STMNT \
_offset ## _p = p; \
_offset = FT_NEXT_USHORT( p ); \
FT_END_STMNT
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
GLfloat GLfloat p
Definition: glext.h:8902

Definition at line 79 of file otvcommn.h.

◆ OTV_OPTIONAL_OFFSET32

#define OTV_OPTIONAL_OFFSET32 (   _offset)
Value:
FT_BEGIN_STMNT \
_offset ## _p = p; \
_offset = FT_NEXT_ULONG( p ); \
FT_END_STMNT
#define FT_NEXT_ULONG(buffer)
Definition: ftstream.h:238
GLfloat GLfloat p
Definition: glext.h:8902

Definition at line 85 of file otvcommn.h.

◆ OTV_OPTIONAL_TABLE

#define OTV_OPTIONAL_TABLE (   _table)
Value:
FT_UShort _table; \
FT_Bytes _table ## _p
unsigned short FT_UShort
Definition: fttypes.h:209

Definition at line 73 of file otvcommn.h.

◆ OTV_OPTIONAL_TABLE32

#define OTV_OPTIONAL_TABLE32 (   _table)
Value:
FT_ULong _table; \
FT_Bytes _table ## _p
unsigned long FT_ULong
Definition: fttypes.h:253

Definition at line 76 of file otvcommn.h.

◆ OTV_RUN

#define OTV_RUN   otvalid->func[0]

Definition at line 235 of file otvcommn.h.

◆ OTV_SIZE_CHECK

#define OTV_SIZE_CHECK (   _size)
Value:
if ( _size > 0 && _size < table_size ) \
{ \
if ( otvalid->root->level == FT_VALIDATE_PARANOID ) \
FT_INVALID_OFFSET; \
else \
{ \
/* strip off `const' */ \
FT_Byte* pp = (FT_Byte*)_size ## _p; \
FT_TRACE3(( "\n" \
"Invalid offset to optional table `%s'" \
" set to zero.\n" \
"\n", #_size )); \
\
_size = pp[0] = pp[1] = 0; \
} \
} \
FT_END_STMNT
unsigned char FT_Byte
Definition: fttypes.h:154
#define pp
Definition: hlsl.yy.c:1208
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define FT_TRACE3(varformat)
Definition: ftdebug.h:160
LOCAL int table_size
Definition: write.c:65

Definition at line 97 of file otvcommn.h.

◆ OTV_SIZE_CHECK32

#define OTV_SIZE_CHECK32 (   _size)
Value:
if ( _size > 0 && _size < table_size ) \
{ \
if ( otvalid->root->level == FT_VALIDATE_PARANOID ) \
FT_INVALID_OFFSET; \
else \
{ \
/* strip off `const' */ \
FT_Byte* pp = (FT_Byte*)_size ## _p; \
FT_TRACE3(( "\n" \
"Invalid offset to optional table `%s'" \
" set to zero.\n" \
"\n", #_size )); \
\
_size = pp[0] = pp[1] = pp[2] = pp[3] = 0; \
} \
} \
FT_END_STMNT
unsigned char FT_Byte
Definition: fttypes.h:154
#define pp
Definition: hlsl.yy.c:1208
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define FT_TRACE3(varformat)
Definition: ftdebug.h:160
LOCAL int table_size
Definition: write.c:65

Definition at line 119 of file otvcommn.h.

◆ OTV_TRACE

#define OTV_TRACE (   s)    do { } while ( 0 )

Definition at line 230 of file otvcommn.h.

◆ PosClassRuleFunc

#define PosClassRuleFunc   otv_x_y_ux_sy

Definition at line 407 of file otvcommn.h.

◆ PosClassSetFunc

#define PosClassSetFunc   otv_x_Ox

Definition at line 375 of file otvcommn.h.

◆ PosRuleFunc

#define PosRuleFunc   otv_x_y_ux_sy

Definition at line 408 of file otvcommn.h.

◆ PosRuleSetFunc

#define PosRuleSetFunc   otv_x_Ox

Definition at line 376 of file otvcommn.h.

◆ SequenceFunc

#define SequenceFunc   otv_x_ux

Definition at line 401 of file otvcommn.h.

◆ SubClassRuleFunc

#define SubClassRuleFunc   otv_x_y_ux_sy

Definition at line 409 of file otvcommn.h.

◆ SubClassSetFunc

#define SubClassSetFunc   otv_x_Ox

Definition at line 377 of file otvcommn.h.

◆ SubRuleFunc

#define SubRuleFunc   otv_x_y_ux_sy

Definition at line 410 of file otvcommn.h.

◆ SubRuleSetFunc

#define SubRuleSetFunc   otv_x_Ox

Definition at line 378 of file otvcommn.h.

Typedef Documentation

◆ OTV_Validate_Func

typedef void(* OTV_Validate_Func) (FT_Bytes table, OTV_Validator otvalid)

Definition at line 41 of file otvcommn.h.

◆ OTV_Validator

typedef typedefFT_BEGIN_HEADER struct OTV_ValidatorRec_* OTV_Validator

Definition at line 39 of file otvcommn.h.

◆ OTV_ValidatorRec

Function Documentation

◆ otv_ClassDef_validate()

otv_ClassDef_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 221 of file otvcommn.c.

223  {
224  FT_Bytes p = table;
225  FT_UInt ClassFormat;
226 
227 
228  OTV_NAME_ENTER( "ClassDef" );
229 
230  OTV_LIMIT_CHECK( 4 );
231  ClassFormat = FT_NEXT_USHORT( p );
232 
233  OTV_TRACE(( " (format %d)\n", ClassFormat ));
234 
235  switch ( ClassFormat )
236  {
237  case 1: /* ClassDefFormat1 */
238  {
239  FT_UInt StartGlyph;
240  FT_UInt GlyphCount;
241 
242 
243  OTV_LIMIT_CHECK( 4 );
244 
245  StartGlyph = FT_NEXT_USHORT( p );
246  GlyphCount = FT_NEXT_USHORT( p );
247 
248  OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));
249 
250  OTV_LIMIT_CHECK( GlyphCount * 2 ); /* ClassValueArray */
251 
252  if ( StartGlyph + GlyphCount - 1 >= otvalid->glyph_count )
254  }
255  break;
256 
257  case 2: /* ClassDefFormat2 */
258  {
259  FT_UInt n, ClassRangeCount;
260  FT_UInt Start, End, last = 0;
261 
262 
263  ClassRangeCount = FT_NEXT_USHORT( p );
264 
265  OTV_TRACE(( " (ClassRangeCount = %d)\n", ClassRangeCount ));
266 
267  OTV_LIMIT_CHECK( ClassRangeCount * 6 );
268 
269  /* ClassRangeRecord */
270  for ( n = 0; n < ClassRangeCount; n++ )
271  {
272  Start = FT_NEXT_USHORT( p );
273  End = FT_NEXT_USHORT( p );
274  p += 2; /* skip Class */
275 
276  if ( Start > End || ( n > 0 && Start <= last ) )
278 
279  if ( End >= otvalid->glyph_count )
281 
282  last = End;
283  }
284  }
285  break;
286 
287  default:
289  }
290 
291  /* no need to check glyph indices used as input to class definition */
292  /* tables since even invalid glyph indices return a meaningful result */
293 
294  OTV_EXIT;
295  }
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
POINT last
Definition: font.c:46
#define FT_INVALID_FORMAT
Definition: ftvalid.h:142
GLdouble n
Definition: glext.h:7729
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
#define OTV_NAME_ENTER(name)
Definition: otvcommn.h:227
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
Definition: partlist.h:33
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
#define FT_INVALID_DATA
Definition: ftvalid.h:150
#define FT_INVALID_GLYPH_ID
Definition: ftvalid.h:146
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by otv_GDEF_validate(), otv_PairPos_validate(), otv_u_O_O_O_O_x_Onx(), and otv_u_O_O_x_Onx().

◆ otv_Coverage_get_count()

otv_Coverage_get_count ( FT_Bytes  table)

Definition at line 175 of file otvcommn.c.

176  {
177  FT_Bytes p = table;
178  FT_UInt CoverageFormat = FT_NEXT_USHORT( p );
179  FT_UInt count = FT_NEXT_USHORT( p ); /* Glyph/RangeCount */
180  FT_UInt result = 0;
181 
182 
183  switch ( CoverageFormat )
184  {
185  case 1:
186  return count;
187 
188  case 2:
189  {
190  FT_UInt Start, End;
191 
192 
193  for ( ; count > 0; count-- )
194  {
195  Start = FT_NEXT_USHORT( p );
196  End = FT_NEXT_USHORT( p );
197  p += 2; /* skip StartCoverageIndex */
198 
199  result += End - Start + 1;
200  }
201  }
202  break;
203 
204  default:
205  ;
206  }
207 
208  return result;
209  }
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
Definition: partlist.h:33
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
GLfloat GLfloat p
Definition: glext.h:8902
GLuint64EXT * result
Definition: glext.h:11304

Referenced by otv_O_x_Ox(), and otv_ReverseChainSingleSubst_validate().

◆ otv_Coverage_get_first()

otv_Coverage_get_first ( FT_Bytes  table)

Definition at line 134 of file otvcommn.c.

135  {
136  FT_Bytes p = table;
137 
138 
139  p += 4; /* skip CoverageFormat and Glyph/RangeCount */
140 
141  return FT_NEXT_USHORT( p );
142  }
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by otv_SingleSubst_validate().

◆ otv_Coverage_get_last()

otv_Coverage_get_last ( FT_Bytes  table)

Definition at line 146 of file otvcommn.c.

147  {
148  FT_Bytes p = table;
149  FT_UInt CoverageFormat = FT_NEXT_USHORT( p );
150  FT_UInt count = FT_NEXT_USHORT( p ); /* Glyph/RangeCount */
151  FT_UInt result = 0;
152 
153 
154  switch ( CoverageFormat )
155  {
156  case 1:
157  p += ( count - 1 ) * 2;
158  result = FT_NEXT_USHORT( p );
159  break;
160 
161  case 2:
162  p += ( count - 1 ) * 6 + 2;
163  result = FT_NEXT_USHORT( p );
164  break;
165 
166  default:
167  ;
168  }
169 
170  return result;
171  }
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
GLfloat GLfloat p
Definition: glext.h:8902
GLuint64EXT * result
Definition: glext.h:11304

Referenced by otv_SingleSubst_validate().

◆ otv_Coverage_validate()

otv_Coverage_validate ( FT_Bytes  table,
OTV_Validator  otvalid,
FT_Int  expected_count 
)

Definition at line 41 of file otvcommn.c.

44  {
45  FT_Bytes p = table;
46  FT_UInt CoverageFormat;
47  FT_UInt total = 0;
48 
49 
50  OTV_NAME_ENTER( "Coverage" );
51 
52  OTV_LIMIT_CHECK( 4 );
53  CoverageFormat = FT_NEXT_USHORT( p );
54 
55  OTV_TRACE(( " (format %d)\n", CoverageFormat ));
56 
57  switch ( CoverageFormat )
58  {
59  case 1: /* CoverageFormat1 */
60  {
61  FT_UInt GlyphCount;
62  FT_UInt i;
63 
64 
65  GlyphCount = FT_NEXT_USHORT( p );
66 
67  OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));
68 
69  OTV_LIMIT_CHECK( GlyphCount * 2 ); /* GlyphArray */
70 
71  for ( i = 0; i < GlyphCount; i++ )
72  {
73  FT_UInt gid;
74 
75 
76  gid = FT_NEXT_USHORT( p );
77  if ( gid >= otvalid->glyph_count )
79  }
80 
81  total = GlyphCount;
82  }
83  break;
84 
85  case 2: /* CoverageFormat2 */
86  {
87  FT_UInt n, RangeCount;
88  FT_UInt Start, End, StartCoverageIndex, last = 0;
89 
90 
91  RangeCount = FT_NEXT_USHORT( p );
92 
93  OTV_TRACE(( " (RangeCount = %d)\n", RangeCount ));
94 
95  OTV_LIMIT_CHECK( RangeCount * 6 );
96 
97  /* RangeRecord */
98  for ( n = 0; n < RangeCount; n++ )
99  {
100  Start = FT_NEXT_USHORT( p );
101  End = FT_NEXT_USHORT( p );
102  StartCoverageIndex = FT_NEXT_USHORT( p );
103 
104  if ( Start > End || StartCoverageIndex != total )
106 
107  if ( End >= otvalid->glyph_count )
109 
110  if ( n > 0 && Start <= last )
112 
113  total += End - Start + 1;
114  last = End;
115  }
116  }
117  break;
118 
119  default:
121  }
122 
123  /* Generally, a coverage table offset has an associated count field. */
124  /* The number of glyphs in the table should match this field. If */
125  /* there is no associated count, a value of -1 tells us not to check. */
126  if ( expected_count != -1 && (FT_UInt)expected_count != total )
128 
129  OTV_EXIT;
130  }
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
POINT last
Definition: font.c:46
#define FT_INVALID_FORMAT
Definition: ftvalid.h:142
GLdouble n
Definition: glext.h:7729
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define OTV_NAME_ENTER(name)
Definition: otvcommn.h:227
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
Definition: partlist.h:33
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
static int expected_count(int *sink)
#define FT_INVALID_DATA
Definition: ftvalid.h:150
#define FT_INVALID_GLYPH_ID
Definition: ftvalid.h:146
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by otv_CursivePos_validate(), otv_MarkGlyphSets_validate(), otv_MathGlyphInfo_validate(), otv_MathItalicsCorrectionInfo_validate(), otv_MathKernInfo_validate(), otv_MathVariants_validate(), otv_O_x_Ox(), otv_PairPos_validate(), otv_ReverseChainSingleSubst_validate(), otv_SinglePos_validate(), otv_SingleSubst_validate(), otv_u_C_x_Ox(), otv_u_O_O_O_O_x_Onx(), otv_u_O_O_u_O_O(), otv_u_O_O_x_Onx(), otv_u_x_Ox_y_Oy_z_Oz_p_sp(), and otv_u_x_y_Ox_sy().

◆ otv_Device_validate()

otv_Device_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 307 of file otvcommn.c.

309  {
310  FT_Bytes p = table;
311  FT_UInt StartSize, EndSize, DeltaFormat, count;
312 
313 
314  OTV_NAME_ENTER( "Device" );
315 
316  OTV_LIMIT_CHECK( 6 );
317  StartSize = FT_NEXT_USHORT( p );
318  EndSize = FT_NEXT_USHORT( p );
319  DeltaFormat = FT_NEXT_USHORT( p );
320 
321  if ( DeltaFormat == 0x8000U )
322  {
323  /* VariationIndex, nothing to do */
324  }
325  else
326  {
327  if ( DeltaFormat < 1 || DeltaFormat > 3 )
329 
330  if ( EndSize < StartSize )
332 
333  count = EndSize - StartSize + 1;
334  OTV_LIMIT_CHECK( ( 1 << DeltaFormat ) * count / 8 ); /* DeltaValue */
335  }
336 
337  OTV_EXIT;
338  }
#define OTV_EXIT
Definition: otvcommn.h:228
#define FT_INVALID_FORMAT
Definition: ftvalid.h:142
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
#define OTV_NAME_ENTER(name)
Definition: otvcommn.h:227
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
#define FT_INVALID_DATA
Definition: ftvalid.h:150
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by otv_Anchor_validate(), otv_BaseCoord_validate(), otv_CaretValue_validate(), otv_GlyphAssembly_validate(), otv_MathConstants_validate(), otv_MathItalicsCorrectionInfo_validate(), otv_MathKern_validate(), and otv_ValueRecord_validate().

◆ otv_Feature_validate()

otv_Feature_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 437 of file otvcommn.c.

439  {
440  FT_Bytes p = table;
441  FT_UInt LookupCount;
442 
443 
444  OTV_NAME_ENTER( "Feature" );
445 
446  OTV_LIMIT_CHECK( 4 );
447  p += 2; /* skip FeatureParams (unused) */
448  LookupCount = FT_NEXT_USHORT( p );
449 
450  OTV_TRACE(( " (LookupCount = %d)\n", LookupCount ));
451 
452  OTV_LIMIT_CHECK( LookupCount * 2 );
453 
454  /* LookupListIndex */
455  for ( ; LookupCount > 0; LookupCount-- )
456  if ( FT_NEXT_USHORT( p ) >= otvalid->lookup_count )
458 
459  OTV_EXIT;
460  }
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
#define OTV_NAME_ENTER(name)
Definition: otvcommn.h:227
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
#define FT_INVALID_DATA
Definition: ftvalid.h:150
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by otv_FeatureList_validate().

◆ otv_FeatureList_validate()

otv_FeatureList_validate ( FT_Bytes  table,
FT_Bytes  lookups,
OTV_Validator  otvalid 
)

Definition at line 473 of file otvcommn.c.

476  {
477  FT_Bytes p = table;
478  FT_UInt FeatureCount;
479 
480 
481  OTV_NAME_ENTER( "FeatureList" );
482 
483  OTV_LIMIT_CHECK( 2 );
484  FeatureCount = FT_NEXT_USHORT( p );
485 
486  OTV_TRACE(( " (FeatureCount = %d)\n", FeatureCount ));
487 
488  OTV_LIMIT_CHECK( FeatureCount * 2 );
489 
490  otvalid->lookup_count = otv_LookupList_get_count( lookups );
491 
492  /* FeatureRecord */
493  for ( ; FeatureCount > 0; FeatureCount-- )
494  {
495  p += 4; /* skip FeatureTag */
496 
497  /* Feature */
498  otv_Feature_validate( table + FT_NEXT_USHORT( p ), otvalid );
499  }
500 
501  OTV_EXIT;
502  }
otv_Feature_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.c:437
#define OTV_EXIT
Definition: otvcommn.h:228
static FT_UInt otv_LookupList_get_count(FT_Bytes table)
Definition: otvcommn.c:420
#define OTV_TRACE(s)
Definition: otvcommn.h:230
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
#define OTV_NAME_ENTER(name)
Definition: otvcommn.h:227
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by otv_GPOS_validate(), and otv_GSUB_validate().

◆ otv_GSUBGPOS_get_Lookup_count()

otv_GSUBGPOS_get_Lookup_count ( FT_Bytes  table)

Definition at line 1047 of file otvcommn.c.

1048  {
1049  FT_Bytes p = table + 8;
1050 
1051 
1053  }
static FT_UInt otv_LookupList_get_count(FT_Bytes table)
Definition: otvcommn.c:420
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by otv_JSTF_validate().

◆ otv_GSUBGPOS_have_MarkAttachmentType_flag()

otv_GSUBGPOS_have_MarkAttachmentType_flag ( FT_Bytes  table)

Definition at line 1057 of file otvcommn.c.

1058  {
1059  FT_Bytes p, lookup;
1060  FT_UInt count;
1061 
1062 
1063  if ( !table )
1064  return 0;
1065 
1066  /* LookupList */
1067  p = table + 8;
1068  table += FT_NEXT_USHORT( p );
1069 
1070  /* LookupCount */
1071  p = table;
1072  count = FT_NEXT_USHORT( p );
1073 
1074  for ( ; count > 0; count-- )
1075  {
1076  FT_Bytes oldp;
1077 
1078 
1079  /* Lookup */
1080  lookup = table + FT_NEXT_USHORT( p );
1081 
1082  oldp = p;
1083 
1084  /* LookupFlag */
1085  p = lookup + 2;
1086  if ( FT_NEXT_USHORT( p ) & 0xFF00U )
1087  return 1;
1088 
1089  p = oldp;
1090  }
1091 
1092  return 0;
1093  }
GLuint GLuint GLsizei count
Definition: gl.h:1545
static ULONG lookup[16]
Definition: vga.c:38
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by otv_GDEF_validate().

◆ otv_LangSys_validate()

otv_LangSys_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 517 of file otvcommn.c.

519  {
520  FT_Bytes p = table;
521  FT_UInt ReqFeatureIndex;
522  FT_UInt FeatureCount;
523 
524 
525  OTV_NAME_ENTER( "LangSys" );
526 
527  OTV_LIMIT_CHECK( 6 );
528  p += 2; /* skip LookupOrder (unused) */
529  ReqFeatureIndex = FT_NEXT_USHORT( p );
530  FeatureCount = FT_NEXT_USHORT( p );
531 
532  OTV_TRACE(( " (ReqFeatureIndex = %d)\n", ReqFeatureIndex ));
533  OTV_TRACE(( " (FeatureCount = %d)\n", FeatureCount ));
534 
535  if ( ReqFeatureIndex != 0xFFFFU && ReqFeatureIndex >= otvalid->extra1 )
537 
538  OTV_LIMIT_CHECK( FeatureCount * 2 );
539 
540  /* FeatureIndex */
541  for ( ; FeatureCount > 0; FeatureCount-- )
542  if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 )
544 
545  OTV_EXIT;
546  }
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
#define OTV_NAME_ENTER(name)
Definition: otvcommn.h:227
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
#define FT_INVALID_DATA
Definition: ftvalid.h:150
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by otv_Script_validate().

◆ otv_Lookup_validate()

otv_Lookup_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 353 of file otvcommn.c.

355  {
356  FT_Bytes p = table;
357  FT_UInt LookupType, LookupFlag, SubTableCount;
359 
360 
361  OTV_NAME_ENTER( "Lookup" );
362 
363  OTV_LIMIT_CHECK( 6 );
364  LookupType = FT_NEXT_USHORT( p );
365  LookupFlag = FT_NEXT_USHORT( p );
366  SubTableCount = FT_NEXT_USHORT( p );
367 
368  OTV_TRACE(( " (type %d)\n", LookupType ));
369 
370  if ( LookupType == 0 || LookupType > otvalid->type_count )
372 
373  validate = otvalid->type_funcs[LookupType - 1];
374 
375  OTV_TRACE(( " (SubTableCount = %d)\n", SubTableCount ));
376 
377  OTV_LIMIT_CHECK( SubTableCount * 2 );
378 
379  /* SubTable */
380  for ( ; SubTableCount > 0; SubTableCount-- )
381  validate( table + FT_NEXT_USHORT( p ), otvalid );
382 
383  if ( LookupFlag & 0x10 )
384  OTV_LIMIT_CHECK( 2 ); /* MarkFilteringSet */
385 
386  OTV_EXIT;
387  }
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
void(* OTV_Validate_Func)(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.h:41
#define OTV_NAME_ENTER(name)
Definition: otvcommn.h:227
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
static FRESULT validate(void *obj)
Definition: ff.c:2372
#define FT_INVALID_DATA
Definition: ftvalid.h:150
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by otv_GPOS_subtable_validate(), and otv_LookupList_validate().

◆ otv_LookupList_validate()

otv_LookupList_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 393 of file otvcommn.c.

395  {
396  FT_Bytes p = table;
397  FT_UInt LookupCount;
398 
399 
400  OTV_NAME_ENTER( "LookupList" );
401 
402  OTV_LIMIT_CHECK( 2 );
403  LookupCount = FT_NEXT_USHORT( p );
404 
405  OTV_TRACE(( " (LookupCount = %d)\n", LookupCount ));
406 
407  OTV_LIMIT_CHECK( LookupCount * 2 );
408 
409  otvalid->lookup_count = LookupCount;
410 
411  /* Lookup */
412  for ( ; LookupCount > 0; LookupCount-- )
413  otv_Lookup_validate( table + FT_NEXT_USHORT( p ), otvalid );
414 
415  OTV_EXIT;
416  }
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
otv_Lookup_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.c:353
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
#define OTV_NAME_ENTER(name)
Definition: otvcommn.h:227
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by otv_GPOS_validate(), and otv_GSUB_validate().

◆ otv_Script_validate()

otv_Script_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 558 of file otvcommn.c.

560  {
561  FT_UInt DefaultLangSys, LangSysCount;
562  FT_Bytes p = table;
563 
564 
565  OTV_NAME_ENTER( "Script" );
566 
567  OTV_LIMIT_CHECK( 4 );
568  DefaultLangSys = FT_NEXT_USHORT( p );
569  LangSysCount = FT_NEXT_USHORT( p );
570 
571  OTV_TRACE(( " (LangSysCount = %d)\n", LangSysCount ));
572 
573  if ( DefaultLangSys != 0 )
574  otv_LangSys_validate( table + DefaultLangSys, otvalid );
575 
576  OTV_LIMIT_CHECK( LangSysCount * 6 );
577 
578  /* LangSysRecord */
579  for ( ; LangSysCount > 0; LangSysCount-- )
580  {
581  p += 4; /* skip LangSysTag */
582 
583  /* LangSys */
584  otv_LangSys_validate( table + FT_NEXT_USHORT( p ), otvalid );
585  }
586 
587  OTV_EXIT;
588  }
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
otv_LangSys_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.c:517
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
#define OTV_NAME_ENTER(name)
Definition: otvcommn.h:227
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by otv_ScriptList_validate().

◆ otv_ScriptList_validate()

otv_ScriptList_validate ( FT_Bytes  table,
FT_Bytes  features,
OTV_Validator  otvalid 
)

Definition at line 594 of file otvcommn.c.

597  {
598  FT_UInt ScriptCount;
599  FT_Bytes p = table;
600 
601 
602  OTV_NAME_ENTER( "ScriptList" );
603 
604  OTV_LIMIT_CHECK( 2 );
605  ScriptCount = FT_NEXT_USHORT( p );
606 
607  OTV_TRACE(( " (ScriptCount = %d)\n", ScriptCount ));
608 
609  OTV_LIMIT_CHECK( ScriptCount * 6 );
610 
611  otvalid->extra1 = otv_Feature_get_count( features );
612 
613  /* ScriptRecord */
614  for ( ; ScriptCount > 0; ScriptCount-- )
615  {
616  p += 4; /* skip ScriptTag */
617 
618  otv_Script_validate( table + FT_NEXT_USHORT( p ), otvalid ); /* Script */
619  }
620 
621  OTV_EXIT;
622  }
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
otv_Script_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.c:558
#define OTV_NAME_ENTER(name)
Definition: otvcommn.h:227
static FT_UInt otv_Feature_get_count(FT_Bytes table)
Definition: otvcommn.c:464
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by otv_GPOS_validate(), and otv_GSUB_validate().

◆ otv_u_C_x_Ox()

otv_u_C_x_Ox ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 682 of file otvcommn.c.

684  {
685  FT_Bytes p = table;
686  FT_UInt Count, Coverage;
688 
689 
690  OTV_ENTER;
691 
692  p += 2; /* skip Format */
693 
694  OTV_LIMIT_CHECK( 4 );
695  Coverage = FT_NEXT_USHORT( p );
696  Count = FT_NEXT_USHORT( p );
697 
698  OTV_TRACE(( " (Count = %d)\n", Count ));
699 
700  otv_Coverage_validate( table + Coverage, otvalid, (FT_Int)Count );
701 
702  OTV_LIMIT_CHECK( Count * 2 );
703 
704  otvalid->nesting_level++;
705  func = otvalid->func[otvalid->nesting_level];
706 
707  for ( ; Count > 0; Count-- )
708  func( table + FT_NEXT_USHORT( p ), otvalid );
709 
710  otvalid->nesting_level--;
711 
712  OTV_EXIT;
713  }
otv_Coverage_validate(FT_Bytes table, OTV_Validator otvalid, FT_Int expected_count)
Definition: otvcommn.c:41
GLenum func
Definition: glext.h:6028
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
signed int FT_Int
Definition: fttypes.h:220
#define OTV_ENTER
Definition: otvcommn.h:226
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1223
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
void(* OTV_Validate_Func)(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.h:41
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
GLfloat GLfloat p
Definition: glext.h:8902

◆ otv_u_O_O_O_O_x_Onx()

otv_u_O_O_O_O_x_Onx ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 934 of file otvcommn.c.

936  {
937  FT_Bytes p = table;
938  FT_UInt Coverage;
939  FT_UInt BacktrackClassDef, InputClassDef, LookaheadClassDef;
940  FT_UInt ChainClassSetCount;
942 
943 
944  OTV_ENTER;
945 
946  p += 2; /* skip Format */
947 
948  OTV_LIMIT_CHECK( 10 );
949  Coverage = FT_NEXT_USHORT( p );
950  BacktrackClassDef = FT_NEXT_USHORT( p );
951  InputClassDef = FT_NEXT_USHORT( p );
952  LookaheadClassDef = FT_NEXT_USHORT( p );
953  ChainClassSetCount = FT_NEXT_USHORT( p );
954 
955  OTV_TRACE(( " (ChainClassSetCount = %d)\n", ChainClassSetCount ));
956 
957  otv_Coverage_validate( table + Coverage, otvalid, -1 );
958 
959  otv_ClassDef_validate( table + BacktrackClassDef, otvalid );
960  otv_ClassDef_validate( table + InputClassDef, otvalid );
961  otv_ClassDef_validate( table + LookaheadClassDef, otvalid );
962 
963  OTV_LIMIT_CHECK( ChainClassSetCount * 2 );
964 
965  otvalid->nesting_level++;
966  func = otvalid->func[otvalid->nesting_level];
967  otvalid->extra1 = otvalid->lookup_count;
968 
969  for ( ; ChainClassSetCount > 0; ChainClassSetCount-- )
970  {
972 
973 
974  if ( offset )
975  func( table + offset, otvalid );
976  }
977 
978  otvalid->nesting_level--;
979 
980  OTV_EXIT;
981  }
otv_Coverage_validate(FT_Bytes table, OTV_Validator otvalid, FT_Int expected_count)
Definition: otvcommn.c:41
GLenum func
Definition: glext.h:6028
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
#define OTV_ENTER
Definition: otvcommn.h:226
GLintptr offset
Definition: glext.h:5920
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
void(* OTV_Validate_Func)(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.h:41
otv_ClassDef_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.c:221
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
GLfloat GLfloat p
Definition: glext.h:8902

◆ otv_u_O_O_x_Onx()

otv_u_O_O_x_Onx ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 849 of file otvcommn.c.

851  {
852  FT_Bytes p = table;
853  FT_UInt Coverage, ClassDef, ClassSetCount;
855 
856 
857  OTV_ENTER;
858 
859  p += 2; /* skip Format */
860 
861  OTV_LIMIT_CHECK( 6 );
862  Coverage = FT_NEXT_USHORT( p );
863  ClassDef = FT_NEXT_USHORT( p );
864  ClassSetCount = FT_NEXT_USHORT( p );
865 
866  OTV_TRACE(( " (ClassSetCount = %d)\n", ClassSetCount ));
867 
868  otv_Coverage_validate( table + Coverage, otvalid, -1 );
869  otv_ClassDef_validate( table + ClassDef, otvalid );
870 
871  OTV_LIMIT_CHECK( ClassSetCount * 2 );
872 
873  otvalid->nesting_level++;
874  func = otvalid->func[otvalid->nesting_level];
875  otvalid->extra1 = otvalid->lookup_count;
876 
877  for ( ; ClassSetCount > 0; ClassSetCount-- )
878  {
880 
881 
882  if ( offset )
883  func( table + offset, otvalid );
884  }
885 
886  otvalid->nesting_level--;
887 
888  OTV_EXIT;
889  }
otv_Coverage_validate(FT_Bytes table, OTV_Validator otvalid, FT_Int expected_count)
Definition: otvcommn.c:41
GLenum func
Definition: glext.h:6028
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
#define OTV_ENTER
Definition: otvcommn.h:226
GLintptr offset
Definition: glext.h:5920
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
void(* OTV_Validate_Func)(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.h:41
otv_ClassDef_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.c:221
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
GLfloat GLfloat p
Definition: glext.h:8902

◆ otv_u_x_Ox_y_Oy_z_Oz_p_sp()

otv_u_x_Ox_y_Oy_z_Oz_p_sp ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 987 of file otvcommn.c.

989  {
990  FT_Bytes p = table;
991  FT_UInt BacktrackGlyphCount, InputGlyphCount, LookaheadGlyphCount;
992  FT_UInt count1, count2;
993 
994 
995  OTV_ENTER;
996 
997  p += 2; /* skip Format */
998 
999  OTV_LIMIT_CHECK( 2 );
1000  BacktrackGlyphCount = FT_NEXT_USHORT( p );
1001 
1002  OTV_TRACE(( " (BacktrackGlyphCount = %d)\n", BacktrackGlyphCount ));
1003 
1004  OTV_LIMIT_CHECK( BacktrackGlyphCount * 2 + 2 );
1005 
1006  for ( ; BacktrackGlyphCount > 0; BacktrackGlyphCount-- )
1007  otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );
1008 
1009  InputGlyphCount = FT_NEXT_USHORT( p );
1010 
1011  OTV_TRACE(( " (InputGlyphCount = %d)\n", InputGlyphCount ));
1012 
1013  OTV_LIMIT_CHECK( InputGlyphCount * 2 + 2 );
1014 
1015  for ( count1 = InputGlyphCount; count1 > 0; count1-- )
1016  otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );
1017 
1018  LookaheadGlyphCount = FT_NEXT_USHORT( p );
1019 
1020  OTV_TRACE(( " (LookaheadGlyphCount = %d)\n", LookaheadGlyphCount ));
1021 
1022  OTV_LIMIT_CHECK( LookaheadGlyphCount * 2 + 2 );
1023 
1024  for ( ; LookaheadGlyphCount > 0; LookaheadGlyphCount-- )
1025  otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );
1026 
1027  count2 = FT_NEXT_USHORT( p );
1028 
1029  OTV_TRACE(( " (Count = %d)\n", count2 ));
1030 
1031  OTV_LIMIT_CHECK( count2 * 4 );
1032 
1033  for ( ; count2 > 0; count2-- )
1034  {
1035  if ( FT_NEXT_USHORT( p ) >= InputGlyphCount )
1037 
1038  if ( FT_NEXT_USHORT( p ) >= otvalid->lookup_count )
1040  }
1041 
1042  OTV_EXIT;
1043  }
otv_Coverage_validate(FT_Bytes table, OTV_Validator otvalid, FT_Int expected_count)
Definition: otvcommn.c:41
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
#define OTV_ENTER
Definition: otvcommn.h:226
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
#define FT_INVALID_DATA
Definition: ftvalid.h:150
GLfloat GLfloat p
Definition: glext.h:8902

◆ otv_u_x_y_Ox_sy()

otv_u_x_y_Ox_sy ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 895 of file otvcommn.c.

897  {
898  FT_Bytes p = table;
899  FT_UInt GlyphCount, Count, count1;
900 
901 
902  OTV_ENTER;
903 
904  p += 2; /* skip Format */
905 
906  OTV_LIMIT_CHECK( 4 );
907  GlyphCount = FT_NEXT_USHORT( p );
908  Count = FT_NEXT_USHORT( p );
909 
910  OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));
911  OTV_TRACE(( " (Count = %d)\n", Count ));
912 
913  OTV_LIMIT_CHECK( GlyphCount * 2 + Count * 4 );
914 
915  for ( count1 = GlyphCount; count1 > 0; count1-- )
916  otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );
917 
918  for ( ; Count > 0; Count-- )
919  {
920  if ( FT_NEXT_USHORT( p ) >= GlyphCount )
922 
923  if ( FT_NEXT_USHORT( p ) >= otvalid->lookup_count )
925  }
926 
927  OTV_EXIT;
928  }
otv_Coverage_validate(FT_Bytes table, OTV_Validator otvalid, FT_Int expected_count)
Definition: otvcommn.c:41
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
#define OTV_ENTER
Definition: otvcommn.h:226
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1223
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
#define FT_INVALID_DATA
Definition: ftvalid.h:150
GLfloat GLfloat p
Definition: glext.h:8902

◆ otv_x_Ox()

otv_x_Ox ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 652 of file otvcommn.c.

654  {
655  FT_Bytes p = table;
656  FT_UInt Count;
658 
659 
660  OTV_ENTER;
661 
662  OTV_LIMIT_CHECK( 2 );
663  Count = FT_NEXT_USHORT( p );
664 
665  OTV_TRACE(( " (Count = %d)\n", Count ));
666 
667  OTV_LIMIT_CHECK( Count * 2 );
668 
669  otvalid->nesting_level++;
670  func = otvalid->func[otvalid->nesting_level];
671 
672  for ( ; Count > 0; Count-- )
673  func( table + FT_NEXT_USHORT( p ), otvalid );
674 
675  otvalid->nesting_level--;
676 
677  OTV_EXIT;
678  }
GLenum func
Definition: glext.h:6028
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
#define OTV_ENTER
Definition: otvcommn.h:226
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1223
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
void(* OTV_Validate_Func)(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.h:41
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
GLfloat GLfloat p
Definition: glext.h:8902

◆ otv_x_ux()

otv_x_ux ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 719 of file otvcommn.c.

721  {
722  FT_Bytes p = table;
723  FT_UInt Count;
724 
725 
726  OTV_ENTER;
727 
728  OTV_LIMIT_CHECK( 2 );
729  Count = FT_NEXT_USHORT( p );
730 
731  OTV_TRACE(( " (Count = %d)\n", Count ));
732 
733  OTV_LIMIT_CHECK( Count * 2 );
734 
735  if ( otvalid->extra1 )
736  {
737  for ( ; Count > 0; Count-- )
738  if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 )
740  }
741 
742  OTV_EXIT;
743  }
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
#define OTV_ENTER
Definition: otvcommn.h:226
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1223
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
#define FT_INVALID_DATA
Definition: ftvalid.h:150
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by otv_JstfPriority_validate().

◆ otv_x_ux_y_uy_z_uz_p_sp()

otv_x_ux_y_uy_z_uz_p_sp ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 793 of file otvcommn.c.

795  {
796  FT_Bytes p = table;
797  FT_UInt BacktrackCount, InputCount, LookaheadCount;
798  FT_UInt Count;
799 
800 
801  OTV_ENTER;
802 
803  OTV_LIMIT_CHECK( 2 );
804  BacktrackCount = FT_NEXT_USHORT( p );
805 
806  OTV_TRACE(( " (BacktrackCount = %d)\n", BacktrackCount ));
807 
808  OTV_LIMIT_CHECK( BacktrackCount * 2 + 2 );
809  p += BacktrackCount * 2;
810 
811  InputCount = FT_NEXT_USHORT( p );
812  if ( InputCount == 0 )
814 
815  OTV_TRACE(( " (InputCount = %d)\n", InputCount ));
816 
817  OTV_LIMIT_CHECK( InputCount * 2 );
818  p += ( InputCount - 1 ) * 2;
819 
820  LookaheadCount = FT_NEXT_USHORT( p );
821 
822  OTV_TRACE(( " (LookaheadCount = %d)\n", LookaheadCount ));
823 
824  OTV_LIMIT_CHECK( LookaheadCount * 2 + 2 );
825  p += LookaheadCount * 2;
826 
827  Count = FT_NEXT_USHORT( p );
828 
829  OTV_TRACE(( " (Count = %d)\n", Count ));
830 
831  OTV_LIMIT_CHECK( Count * 4 );
832 
833  for ( ; Count > 0; Count-- )
834  {
835  if ( FT_NEXT_USHORT( p ) >= InputCount )
837 
838  if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 )
840  }
841 
842  OTV_EXIT;
843  }
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
#define OTV_ENTER
Definition: otvcommn.h:226
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1223
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
#define FT_INVALID_DATA
Definition: ftvalid.h:150
GLfloat GLfloat p
Definition: glext.h:8902

◆ otv_x_y_ux_sy()

otv_x_y_ux_sy ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 752 of file otvcommn.c.

754  {
755  FT_Bytes p = table;
756  FT_UInt Count1, Count2;
757 
758 
759  OTV_ENTER;
760 
761  OTV_LIMIT_CHECK( 4 );
762  Count1 = FT_NEXT_USHORT( p );
763  Count2 = FT_NEXT_USHORT( p );
764 
765  OTV_TRACE(( " (Count1 = %d)\n", Count1 ));
766  OTV_TRACE(( " (Count2 = %d)\n", Count2 ));
767 
768  if ( Count1 == 0 )
770 
771  OTV_LIMIT_CHECK( ( Count1 - 1 ) * 2 + Count2 * 4 );
772  p += ( Count1 - 1 ) * 2;
773 
774  for ( ; Count2 > 0; Count2-- )
775  {
776  if ( FT_NEXT_USHORT( p ) >= Count1 )
778 
779  if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 )
781  }
782 
783  OTV_EXIT;
784  }
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_TRACE(s)
Definition: otvcommn.h:230
#define OTV_ENTER
Definition: otvcommn.h:226
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
#define FT_INVALID_DATA
Definition: ftvalid.h:150
GLfloat GLfloat p
Definition: glext.h:8902