static void otl_gsub_lookup7_validate( OTL_Bytes table, OTL_Validator valid ) { OTL_Bytes p = table; OTL_UInt format, coverage; OTL_CHECK( 2 ); format = OTL_NEXT_USHORT( p ); switch ( format ) { case 1: { OTL_UInt lookup_type, lookup_offset; OTL_ValidateFunc validate; OTL_CHECK( 6 ); lookup_type = OTL_NEXT_USHORT( p ); lookup_offset = OTL_NEXT_ULONG( p ); if ( lookup_type == 0 || lookup_type >= 7 ) OTL_INVALID_DATA; validate = otl_gsub_validate_funcs[ lookup_type-1 ]; validate( table + lookup_offset, valid ); } break; default: OTL_INVALID_DATA; } }
otl_gdef_validate( OTL_Bytes table, OTL_Validator valid ) { OTL_Bytes p = table; if ( p + 12 > valid->limit ) OTL_INVALID_TOO_SHORT; /* check format */ if ( OTL_NEXT_ULONG( p ) != 0x00010000UL ) OTL_INVALID_FORMAT; /* validate class definition table */ otl_class_definition_validate( table + OTL_NEXT_USHORT( p ) ); /* validate attachment point list */ otl_attach_list_validate( table + OTL_NEXT_USHORT( p ) ); /* validate ligature caret list */ otl_ligature_caret_list_validate( table + OTL_NEXT_USHORT( p ) ); /* validate mark attach class */ otl_class_definition_validate( table + OTL_NEXT_USHORT( p ) ); }