4 /************************************************************************/
5 /************************************************************************/
7 /***** ATTACHMENTS LIST *****/
9 /************************************************************************/
10 /************************************************************************/
13 otl_attach_point_validate( OTL_Bytes table,
19 if ( p + 2 > valid->limit )
20 OTL_INVALID_TOO_SHORT;
22 count = OTL_NEXT_USHORT( p );
23 if ( table + count*2 > valid->limit )
24 OTL_INVALID_TOO_SHORT;
29 otl_attach_list_validate( OTL_Bytes table,
36 if ( p + 4 > valid->limit )
37 OTL_INVALID_TOO_SHORT;
39 coverage = table + OTL_NEXT_USHORT( p );
40 count = OTL_NEXT_USHORT( p );
42 otl_coverage_validate( coverage, valid );
43 if ( count != otl_coverage_get_count( coverage ) )
46 if ( p + count*2 > valid->limit )
47 OTL_INVALID_TOO_SHORT;
49 for ( ; count > 0; count-- )
50 otl_attach_point_validate( table + OTL_NEXT_USHORT( p ) );
54 /************************************************************************/
55 /************************************************************************/
57 /***** LIGATURE CARETS *****/
59 /************************************************************************/
60 /************************************************************************/
63 otl_caret_value_validate( OTL_Bytes table,
68 if ( p + 4 > valid->limit )
69 OTL_INVALID_TOO_SHORT;
71 format = OTL_NEXT_USHORT( p );
83 if ( p + 2 > valid->limit )
84 OTL_INVALID_TOO_SHORT;
86 otl_device_table_validate( table + OTL_PEEK_USHORT( p ) );
97 otl_ligature_glyph_validate( OTL_Bytes table,
103 if ( p + 2 > valid->limit )
104 OTL_INVALID_TOO_SHORT;
106 count = OTL_NEXT_USHORT( p );
108 if ( p + count*2 > valid->limit )
109 OTL_INVALID_TOO_SHORT;
111 for ( ; count > 0; count-- )
112 otl_caret_value_validate( table + OTL_NEXT_USHORT( p ) );
117 otl_ligature_caret_list_validate( OTL_Bytes table,
118 OTL_Validator valid )
124 if ( p + 4 > valid->limit )
125 OTL_INVALID_TOO_SHORT;
127 coverage = table + OTL_NEXT_USHORT( p );
128 count = OTL_NEXT_USHORT( p );
130 otl_coverage_validate( coverage, valid );
131 if ( count != otl_coverage_get_count( coverage ) )
134 if ( p + count*2 > valid->limit )
135 OTL_INVALID_TOO_SHORT;
137 for ( ; count > 0; count-- )
138 otl_ligature_glyph_validate( table + OTL_NEXT_USHORT( p ) );
142 /************************************************************************/
143 /************************************************************************/
145 /***** GDEF TABLE *****/
147 /************************************************************************/
148 /************************************************************************/
151 otl_gdef_validate( OTL_Bytes table,
152 OTL_Validator valid )
156 if ( p + 12 > valid->limit )
157 OTL_INVALID_TOO_SHORT;
160 if ( OTL_NEXT_ULONG( p ) != 0x00010000UL )
163 /* validate class definition table */
164 otl_class_definition_validate( table + OTL_NEXT_USHORT( p ) );
166 /* validate attachment point list */
167 otl_attach_list_validate( table + OTL_NEXT_USHORT( p ) );
169 /* validate ligature caret list */
170 otl_ligature_caret_list_validate( table + OTL_NEXT_USHORT( p ) );
172 /* validate mark attach class */
173 otl_class_definition_validate( table + OTL_NEXT_USHORT( p ) );