48#include FT_INTERNAL_DEBUG_H
49#include FT_SFNT_NAMES_H
57#ifdef FT_DEBUG_LEVEL_TRACE
58#define GXV_LOAD_TRACE_VARS
60#undef GXV_LOAD_TRACE_VARS
63#undef GXV_LOAD_UNUSED_VARS
65#define IS_PARANOID_VALIDATION ( gxvalid->root->level >= FT_VALIDATE_PARANOID )
66#define GXV_SET_ERR_IF_PARANOID( err ) { if ( IS_PARANOID_VALIDATION ) ( err ); }
133#define GXV_GLYPHOFFSET_FMT( table ) \
134 ( gxvalid->table.entry_glyphoffset_fmt )
136#define GXV_GLYPHOFFSET_SIZE( table ) \
137 ( gxvalid->table.entry_glyphoffset_fmt / 2 )
257#ifdef FT_DEBUG_LEVEL_TRACE
265#define GXV_TABLE_DATA( tag, field ) \
266 ( ( (GXV_ ## tag ## _Data)gxvalid->table_data )->field )
269#define FT_INVALID_( _error ) \
270 ft_validator_error( gxvalid->root, FT_THROW( _error ) )
272#define GXV_LIMIT_CHECK( _count ) \
274 if ( p + _count > ( limit? limit : gxvalid->root->limit ) ) \
275 FT_INVALID_TOO_SHORT; \
279#ifdef FT_DEBUG_LEVEL_TRACE
281#define GXV_INIT gxvalid->debug_indent = 0
283#define GXV_NAME_ENTER( name ) \
285 gxvalid->debug_indent += 2; \
286 FT_TRACE4(( "%*.s", gxvalid->debug_indent, 0 )); \
287 FT_TRACE4(( "%s table\n", name )); \
290#define GXV_EXIT gxvalid->debug_indent -= 2
292#define GXV_TRACE( s ) \
294 FT_TRACE4(( "%*.s", gxvalid->debug_indent, 0 )); \
300#define GXV_INIT do { } while ( 0 )
301#define GXV_NAME_ENTER( name ) do { } while ( 0 )
302#define GXV_EXIT do { } while ( 0 )
304#define GXV_TRACE( s ) do { } while ( 0 )
317#define GXV_32BIT_ALIGNMENT_VALIDATE( a ) \
334#define GXV_TRACE_HEXDUMP( p, len ) \
340 for ( b = p; b < (FT_Bytes)p + len; b++ ) \
341 FT_TRACE1(("\\x%02x", *b)); \
345#define GXV_TRACE_HEXDUMP_C( p, len ) \
351 for ( b = p; b < (FT_Bytes)p + len; b++ ) \
352 if ( 0x40 < *b && *b < 0x7E ) \
353 FT_TRACE1(("%c", *b)); \
355 FT_TRACE1(("\\x%02x", *b)); \
359#define GXV_TRACE_HEXDUMP_SFNTNAME( n ) \
360 GXV_TRACE_HEXDUMP( n.string, n.string_len )
504#define GXV_SUBTABLE_OFFSET_CHECK( _offset ) \
506 if ( (_offset) > gxvalid->subtable_length ) \
510#define GXV_SUBTABLE_LIMIT_CHECK( _count ) \
512 if ( ( p + (_count) - gxvalid->subtable_start ) > \
513 gxvalid->subtable_length ) \
514 FT_INVALID_TOO_SHORT; \
517#define GXV_USHORT_TO_SHORT( _us ) \
518 ( ( 0x8000U < ( _us ) ) ? ( ( _us ) - 0x8000U ) : ( _us ) )
520#define GXV_STATETABLE_HEADER_SIZE ( 2 + 2 + 2 + 2 )
521#define GXV_STATEHEADER_SIZE GXV_STATETABLE_HEADER_SIZE
523#define GXV_XSTATETABLE_HEADER_SIZE ( 4 + 4 + 4 + 4 )
524#define GXV_XSTATEHEADER_SIZE GXV_XSTATETABLE_HEADER_SIZE
562#define GXV_ODTECT( n, odtect ) \
563 GXV_odtect_DataRec odtect ## _range[n]; \
564 GXV_odtect_RangeRec odtect ## _rec = { 0, NULL }; \
565 GXV_odtect_Range odtect = NULL
567#define GXV_ODTECT_INIT( odtect ) \
569 odtect ## _rec.nRanges = 0; \
570 odtect ## _rec.range = odtect ## _range; \
571 odtect = & odtect ## _rec; \
static unsigned char buff[32768]
typedefFT_BEGIN_HEADER struct FT_ValidatorRec_ volatile * FT_Validator
GLuint GLsizei GLsizei * length
void(* GXV_StateTable_OptData_Load_Func)(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
void(* GXV_Validate_Func)(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
gxv_array_getlimits_byte(FT_Bytes table, FT_Bytes limit, FT_Byte *min, FT_Byte *max, GXV_Validator gxvalid)
struct GXV_ValidatorRec_ GXV_ValidatorRec
struct GXV_StateTable_ValidatorRec_ GXV_StateTable_ValidatorRec
void(* GXV_XStateTable_Subtable_Setup_Func)(FT_ULong table_size, FT_ULong classTable, FT_ULong stateArray, FT_ULong entryTable, FT_ULong *classTable_length_p, FT_ULong *stateArray_length_p, FT_ULong *entryTable_length_p, GXV_Validator gxvalid)
struct GXV_odtect_DataRec_ * GXV_odtect_Data
enum GXV_GlyphOffset_Format_ GXV_GlyphOffset_Format
struct GXV_ValidatorRec_ * GXV_Validator
gxv_ctlPoint_validate(FT_UShort gid, FT_UShort ctl_point, GXV_Validator gxvalid)
const GXV_XStateTable_GlyphOffsetDesc * GXV_XStateTable_GlyphOffsetCPtr
const GXV_StateTable_GlyphOffsetDesc * GXV_StateTable_GlyphOffsetCPtr
void(* GXV_StateTable_Entry_Validate_Func)(FT_Byte state, FT_UShort flags, GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes statetable_table, FT_Bytes statetable_limit, GXV_Validator gxvalid)
GXV_StateTable_GlyphOffsetDesc GXV_XStateTable_GlyphOffsetDesc
gxv_BinSrchHeader_validate(FT_Bytes p, FT_Bytes limit, FT_UShort *unitSize_p, FT_UShort *nUnits_p, GXV_Validator gxvalid)
const GXV_LookupValueDesc * GXV_LookupValueCPtr
gxv_array_getlimits_ushort(FT_Bytes table, FT_Bytes limit, FT_UShort *min, FT_UShort *max, GXV_Validator gxvalid)
GXV_LookupValueDesc(* GXV_Lookup_Fmt4_Transit_Func)(FT_UShort relative_gindex, GXV_LookupValueCPtr base_value_p, FT_Bytes lookuptbl_limit, GXV_Validator gxvalid)
gxv_StateTable_subtable_setup(FT_UShort table_size, FT_UShort classTable, FT_UShort stateArray, FT_UShort entryTable, FT_UShort *classTable_length_p, FT_UShort *stateArray_length_p, FT_UShort *entryTable_length_p, GXV_Validator gxvalid)
gxv_set_length_by_ushort_offset(FT_UShort *offset, FT_UShort **length, FT_UShort *buff, FT_UInt nmemb, FT_UShort limit, GXV_Validator gxvalid)
gxv_StateTable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
GXV_LookupValue_SignSpec_
@ GXV_LOOKUPVALUE_UNSIGNED
struct GXV_XStateTable_ValidatorRec_ * GXV_XStateTable_ValidatorRecData
gxv_LookupTable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
enum GXV_LookupValue_SignSpec_ GXV_LookupValue_SignSpec
struct GXV_StateTable_ValidatorRec_ * GXV_StateTable_ValidatorRecData
union GXV_LookupValueDesc_ GXV_LookupValueDesc
gxv_odtect_add_range(FT_Bytes start, FT_ULong length, const FT_String *name, GXV_odtect_Range odtect)
struct GXV_odtect_DataRec_ GXV_odtect_DataRec
gxv_glyphid_validate(FT_UShort gid, GXV_Validator gxvalid)
gxv_XStateTable_subtable_setup(FT_ULong table_size, FT_ULong classTable, FT_ULong stateArray, FT_ULong entryTable, FT_ULong *classTable_length_p, FT_ULong *stateArray_length_p, FT_ULong *entryTable_length_p, GXV_Validator gxvalid)
gxv_odtect_validate(GXV_odtect_Range odtect, GXV_Validator gxvalid)
void(* GXV_Lookup_Value_Validate_Func)(FT_UShort glyph, GXV_LookupValueCPtr value_p, GXV_Validator gxvalid)
union GXV_StateTable_GlyphOffsetDesc_ GXV_StateTable_GlyphOffsetDesc
struct GXV_XStateTable_ValidatorRec_ GXV_XStateTable_ValidatorRec
void(* GXV_StateTable_Subtable_Setup_Func)(FT_UShort table_size, FT_UShort classTable, FT_UShort stateArray, FT_UShort entryTable, FT_UShort *classTable_length_p, FT_UShort *stateArray_length_p, FT_UShort *entryTable_length_p, GXV_Validator gxvalid)
gxv_sfntName_validate(FT_UShort name_index, FT_UShort min_index, FT_UShort max_index, GXV_Validator gxvalid)
GXV_StateTable_OptData_Load_Func GXV_XStateTable_OptData_Load_Func
gxv_set_length_by_ulong_offset(FT_ULong *offset, FT_ULong **length, FT_ULong *buff, FT_UInt nmemb, FT_ULong limit, GXV_Validator gxvalid)
gxv_XStateTable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
void(* GXV_XStateTable_Entry_Validate_Func)(FT_UShort state, FT_UShort flags, GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes xstatetable_table, FT_Bytes xstatetable_limit, GXV_Validator gxvalid)
struct GXV_odtect_RangeRec_ GXV_odtect_RangeRec
struct GXV_odtect_RangeRec_ * GXV_odtect_Range
GXV_StateTable_Entry_Validate_Func entry_validate_func
GXV_StateTable_Subtable_Setup_Func subtable_setup_func
GXV_GlyphOffset_Format entry_glyphoffset_fmt
GXV_StateTable_OptData_Load_Func optdata_load_func
GXV_StateTable_ValidatorRec statetable
GXV_XStateTable_ValidatorRec xstatetable
GXV_Lookup_Fmt4_Transit_Func lookupfmt4_trans
GXV_Lookup_Value_Validate_Func lookupval_func
GXV_LookupValue_SignSpec lookupval_sign
GXV_XStateTable_OptData_Load_Func optdata_load_func
int entry_glyphoffset_fmt
GXV_XStateTable_Entry_Validate_Func entry_validate_func
GXV_XStateTable_Subtable_Setup_Func subtable_setup_func