ReactOS 0.4.16-dev-250-g3ecd236
otvbase.c File Reference
#include "otvalid.h"
#include "otvcommn.h"
Include dependency graph for otvbase.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FT_COMPONENT   trace_otvbase
 

Functions

static void otv_BaseCoord_validate (FT_Bytes table, OTV_Validator otvalid)
 
static void otv_BaseTagList_validate (FT_Bytes table, OTV_Validator otvalid)
 
static void otv_BaseValues_validate (FT_Bytes table, OTV_Validator otvalid)
 
static void otv_MinMax_validate (FT_Bytes table, OTV_Validator otvalid)
 
static void otv_BaseScript_validate (FT_Bytes table, OTV_Validator otvalid)
 
static void otv_BaseScriptList_validate (FT_Bytes table, OTV_Validator otvalid)
 
static void otv_Axis_validate (FT_Bytes table, OTV_Validator otvalid)
 
 otv_BASE_validate (FT_Bytes table, FT_Validator ftvalid)
 

Macro Definition Documentation

◆ FT_COMPONENT

#define FT_COMPONENT   trace_otvbase

Definition at line 30 of file otvbase.c.

Function Documentation

◆ otv_Axis_validate()

static void otv_Axis_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)
static

Definition at line 252 of file otvbase.c.

254 {
255 FT_Bytes p = table;
257
258 OTV_OPTIONAL_TABLE( BaseTagList );
259
260
261 OTV_NAME_ENTER( "Axis" );
262
263 OTV_LIMIT_CHECK( 4 );
264 OTV_OPTIONAL_OFFSET( BaseTagList );
265
266 table_size = 4;
267
268 OTV_SIZE_CHECK( BaseTagList );
269 if ( BaseTagList )
270 otv_BaseTagList_validate( table + BaseTagList, otvalid );
271
272 /* BaseScriptList */
274
275 OTV_EXIT;
276 }
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
unsigned int FT_UInt
Definition: fttypes.h:231
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
GLfloat GLfloat p
Definition: glext.h:8902
static void otv_BaseTagList_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvbase.c:73
static void otv_BaseScriptList_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvbase.c:222
#define OTV_SIZE_CHECK(_size)
Definition: otvcommn.h:97
#define OTV_OPTIONAL_OFFSET(_offset)
Definition: otvcommn.h:79
#define OTV_EXIT
Definition: otvcommn.h:228
#define OTV_NAME_ENTER(name)
Definition: otvcommn.h:227
#define OTV_LIMIT_CHECK(_count)
Definition: otvcommn.h:91
#define OTV_OPTIONAL_TABLE(_table)
Definition: otvcommn.h:73
LOCAL int table_size
Definition: write.c:65

Referenced by otv_BASE_validate().

◆ otv_BASE_validate()

otv_BASE_validate ( FT_Bytes  table,
FT_Validator  ftvalid 
)

Definition at line 280 of file otvbase.c.

282 {
283 OTV_ValidatorRec otvalidrec;
284 OTV_Validator otvalid = &otvalidrec;
285 FT_Bytes p = table;
288
289 OTV_OPTIONAL_TABLE( HorizAxis );
290 OTV_OPTIONAL_TABLE( VertAxis );
291
292 OTV_OPTIONAL_TABLE32( itemVarStore );
293
294
295 otvalid->root = ftvalid;
296
297 FT_TRACE3(( "validating BASE table\n" ));
298 OTV_INIT;
299
300 OTV_LIMIT_CHECK( 4 );
301
302 if ( FT_NEXT_USHORT( p ) != 1 ) /* majorVersion */
304
305 version = FT_NEXT_USHORT( p ); /* minorVersion */
306
307 table_size = 8;
308 switch ( version )
309 {
310 case 0:
311 OTV_LIMIT_CHECK( 4 );
312 break;
313
314 case 1:
315 OTV_LIMIT_CHECK( 8 );
316 table_size += 4;
317 break;
318
319 default:
321 }
322
323 OTV_OPTIONAL_OFFSET( HorizAxis );
324 OTV_SIZE_CHECK( HorizAxis );
325 if ( HorizAxis )
326 otv_Axis_validate( table + HorizAxis, otvalid );
327
328 OTV_OPTIONAL_OFFSET( VertAxis );
329 OTV_SIZE_CHECK( VertAxis );
330 if ( VertAxis )
331 otv_Axis_validate( table + VertAxis, otvalid );
332
333 if ( version > 0 )
334 {
335 OTV_OPTIONAL_OFFSET32( itemVarStore );
336 OTV_SIZE_CHECK32( itemVarStore );
337 if ( itemVarStore )
338 OTV_TRACE(( " [omitting itemVarStore validation]\n" )); /* XXX */
339 }
340
341 FT_TRACE4(( "\n" ));
342 }
static const WCHAR version[]
Definition: asmname.c:66
#define FT_TRACE3(varformat)
Definition: ftdebug.h:160
#define FT_TRACE4(varformat)
Definition: ftdebug.h:161
unsigned short FT_UShort
Definition: fttypes.h:209
#define FT_INVALID_FORMAT
Definition: ftvalid.h:142
static void otv_Axis_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvbase.c:252
#define OTV_TRACE(s)
Definition: otvcommn.h:230
typedefFT_BEGIN_HEADER struct OTV_ValidatorRec_ * OTV_Validator
Definition: otvcommn.h:39
#define OTV_SIZE_CHECK32(_size)
Definition: otvcommn.h:119
#define OTV_OPTIONAL_TABLE32(_table)
Definition: otvcommn.h:76
#define OTV_INIT
Definition: otvcommn.h:225
#define OTV_OPTIONAL_OFFSET32(_offset)
Definition: otvcommn.h:85

Referenced by otv_validate().

◆ otv_BaseCoord_validate()

static void otv_BaseCoord_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)
static

Definition at line 34 of file otvbase.c.

36 {
38 FT_UInt BaseCoordFormat;
39
40
41 OTV_NAME_ENTER( "BaseCoord" );
42
43 OTV_LIMIT_CHECK( 4 );
44 BaseCoordFormat = FT_NEXT_USHORT( p );
45 p += 2; /* skip Coordinate */
46
47 OTV_TRACE(( " (format %d)\n", BaseCoordFormat ));
48
49 switch ( BaseCoordFormat )
50 {
51 case 1: /* BaseCoordFormat1 */
52 break;
53
54 case 2: /* BaseCoordFormat2 */
55 OTV_LIMIT_CHECK( 4 ); /* ReferenceGlyph, BaseCoordPoint */
56 break;
57
58 case 3: /* BaseCoordFormat3 */
59 OTV_LIMIT_CHECK( 2 );
60 /* DeviceTable */
62 break;
63
64 default:
66 }
67
69 }
otv_Device_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.c:307

Referenced by otv_BaseValues_validate(), and otv_MinMax_validate().

◆ otv_BaseScript_validate()

static void otv_BaseScript_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)
static

Definition at line 177 of file otvbase.c.

179 {
180 FT_Bytes p = table;
182 FT_UInt BaseLangSysCount;
183
184 OTV_OPTIONAL_TABLE( BaseValues );
185 OTV_OPTIONAL_TABLE( DefaultMinMax );
186
187
188 OTV_NAME_ENTER( "BaseScript" );
189
190 OTV_LIMIT_CHECK( 6 );
191 OTV_OPTIONAL_OFFSET( BaseValues );
192 OTV_OPTIONAL_OFFSET( DefaultMinMax );
193 BaseLangSysCount = FT_NEXT_USHORT( p );
194
195 OTV_TRACE(( " (BaseLangSysCount = %d)\n", BaseLangSysCount ));
196
197 table_size = BaseLangSysCount * 6 + 6;
198
199 OTV_SIZE_CHECK( BaseValues );
200 if ( BaseValues )
201 otv_BaseValues_validate( table + BaseValues, otvalid );
202
203 OTV_SIZE_CHECK( DefaultMinMax );
204 if ( DefaultMinMax )
205 otv_MinMax_validate( table + DefaultMinMax, otvalid );
206
207 OTV_LIMIT_CHECK( BaseLangSysCount * 6 );
208
209 /* BaseLangSysRecord */
210 for ( ; BaseLangSysCount > 0; BaseLangSysCount-- )
211 {
212 p += 4; /* skip BaseLangSysTag */
213
214 otv_MinMax_validate( table + FT_NEXT_USHORT( p ), otvalid );
215 }
216
217 OTV_EXIT;
218 }
static void otv_BaseValues_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvbase.c:95
static void otv_MinMax_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvbase.c:122

Referenced by otv_BaseScriptList_validate().

◆ otv_BaseScriptList_validate()

static void otv_BaseScriptList_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)
static

Definition at line 222 of file otvbase.c.

224 {
225 FT_Bytes p = table;
226 FT_UInt BaseScriptCount;
227
228
229 OTV_NAME_ENTER( "BaseScriptList" );
230
231 OTV_LIMIT_CHECK( 2 );
232 BaseScriptCount = FT_NEXT_USHORT( p );
233
234 OTV_TRACE(( " (BaseScriptCount = %d)\n", BaseScriptCount ));
235
236 OTV_LIMIT_CHECK( BaseScriptCount * 6 );
237
238 /* BaseScriptRecord */
239 for ( ; BaseScriptCount > 0; BaseScriptCount-- )
240 {
241 p += 4; /* skip BaseScriptTag */
242
243 /* BaseScript */
245 }
246
247 OTV_EXIT;
248 }
static void otv_BaseScript_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvbase.c:177

Referenced by otv_Axis_validate().

◆ otv_BaseTagList_validate()

static void otv_BaseTagList_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)
static

Definition at line 73 of file otvbase.c.

75 {
77 FT_UInt BaseTagCount;
78
79
80 OTV_NAME_ENTER( "BaseTagList" );
81
82 OTV_LIMIT_CHECK( 2 );
83
84 BaseTagCount = FT_NEXT_USHORT( p );
85
86 OTV_TRACE(( " (BaseTagCount = %d)\n", BaseTagCount ));
87
88 OTV_LIMIT_CHECK( BaseTagCount * 4 ); /* BaselineTag */
89
91 }

Referenced by otv_Axis_validate().

◆ otv_BaseValues_validate()

static void otv_BaseValues_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)
static

Definition at line 95 of file otvbase.c.

97 {
99 FT_UInt BaseCoordCount;
100
101
102 OTV_NAME_ENTER( "BaseValues" );
103
104 OTV_LIMIT_CHECK( 4 );
105
106 p += 2; /* skip DefaultIndex */
107 BaseCoordCount = FT_NEXT_USHORT( p );
108
109 OTV_TRACE(( " (BaseCoordCount = %d)\n", BaseCoordCount ));
110
111 OTV_LIMIT_CHECK( BaseCoordCount * 2 );
112
113 /* BaseCoord */
114 for ( ; BaseCoordCount > 0; BaseCoordCount-- )
116
117 OTV_EXIT;
118 }
static void otv_BaseCoord_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvbase.c:34

Referenced by otv_BaseScript_validate().

◆ otv_MinMax_validate()

static void otv_MinMax_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)
static

Definition at line 122 of file otvbase.c.

124 {
125 FT_Bytes p = table;
127 FT_UInt FeatMinMaxCount;
128
129 OTV_OPTIONAL_TABLE( MinCoord );
130 OTV_OPTIONAL_TABLE( MaxCoord );
131
132
133 OTV_NAME_ENTER( "MinMax" );
134
135 OTV_LIMIT_CHECK( 6 );
136
137 OTV_OPTIONAL_OFFSET( MinCoord );
138 OTV_OPTIONAL_OFFSET( MaxCoord );
139 FeatMinMaxCount = FT_NEXT_USHORT( p );
140
141 OTV_TRACE(( " (FeatMinMaxCount = %d)\n", FeatMinMaxCount ));
142
143 table_size = FeatMinMaxCount * 8 + 6;
144
145 OTV_SIZE_CHECK( MinCoord );
146 if ( MinCoord )
147 otv_BaseCoord_validate( table + MinCoord, otvalid );
148
149 OTV_SIZE_CHECK( MaxCoord );
150 if ( MaxCoord )
151 otv_BaseCoord_validate( table + MaxCoord, otvalid );
152
153 OTV_LIMIT_CHECK( FeatMinMaxCount * 8 );
154
155 /* FeatMinMaxRecord */
156 for ( ; FeatMinMaxCount > 0; FeatMinMaxCount-- )
157 {
158 p += 4; /* skip FeatureTableTag */
159
160 OTV_OPTIONAL_OFFSET( MinCoord );
161 OTV_OPTIONAL_OFFSET( MaxCoord );
162
163 OTV_SIZE_CHECK( MinCoord );
164 if ( MinCoord )
165 otv_BaseCoord_validate( table + MinCoord, otvalid );
166
167 OTV_SIZE_CHECK( MaxCoord );
168 if ( MaxCoord )
169 otv_BaseCoord_validate( table + MaxCoord, otvalid );
170 }
171
172 OTV_EXIT;
173 }

Referenced by otv_BaseScript_validate().