ReactOS 0.4.15-dev-7788-g1ad9096
gxvalid.h File Reference
#include <ft2build.h>
#include "gxverror.h"
Include dependency graph for gxvalid.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

FT_BEGIN_HEADER gxv_feat_validate (FT_Bytes table, FT_Face face, FT_Validator valid)
 
 gxv_bsln_validate (FT_Bytes table, FT_Face face, FT_Validator valid)
 
 gxv_trak_validate (FT_Bytes table, FT_Face face, FT_Validator valid)
 
 gxv_just_validate (FT_Bytes table, FT_Face face, FT_Validator valid)
 
 gxv_mort_validate (FT_Bytes table, FT_Face face, FT_Validator valid)
 
 gxv_morx_validate (FT_Bytes table, FT_Face face, FT_Validator valid)
 
 gxv_kern_validate (FT_Bytes table, FT_Face face, FT_Validator valid)
 
 gxv_kern_validate_classic (FT_Bytes table, FT_Face face, FT_Int dialect_flags, FT_Validator valid)
 
 gxv_opbd_validate (FT_Bytes table, FT_Face face, FT_Validator valid)
 
 gxv_prop_validate (FT_Bytes table, FT_Face face, FT_Validator valid)
 
 gxv_lcar_validate (FT_Bytes table, FT_Face face, FT_Validator valid)
 

Function Documentation

◆ gxv_bsln_validate()

gxv_bsln_validate ( FT_Bytes  table,
FT_Face  face,
FT_Validator  valid 
)

Definition at line 271 of file gxvbsln.c.

274 {
275 GXV_ValidatorRec gxvalidrec;
276 GXV_Validator gxvalid = &gxvalidrec;
277
278 GXV_bsln_DataRec bslnrec;
279 GXV_bsln_Data bsln = &bslnrec;
280
281 FT_Bytes p = table;
282 FT_Bytes limit = 0;
283
286 FT_UShort defaultBaseline;
287
288 GXV_Validate_Func fmt_funcs_table [] =
289 {
294 };
295
296
297 gxvalid->root = ftvalid;
298 gxvalid->table_data = bsln;
299 gxvalid->face = face;
300
301 FT_TRACE3(( "validating `bsln' table\n" ));
302 GXV_INIT;
303
304
305 GXV_LIMIT_CHECK( 4 + 2 + 2 );
308 defaultBaseline = FT_NEXT_USHORT( p );
309
310 /* only version 1.0 is defined (1996) */
311 if ( version != 0x00010000UL )
313
314 /* only format 1, 2, 3 are defined (1996) */
315 GXV_TRACE(( " (format = %d)\n", format ));
316 if ( format > 3 )
318
319 if ( defaultBaseline > 31 )
321
322 bsln->defaultBaseline = defaultBaseline;
323
324 fmt_funcs_table[format]( p, limit, gxvalid );
325
326 FT_TRACE4(( "\n" ));
327 }
WORD face[3]
Definition: mesh.c:4747
static const WCHAR version[]
Definition: asmname.c:66
#define FT_TRACE3(varformat)
Definition: ftdebug.h:160
#define FT_TRACE4(varformat)
Definition: ftdebug.h:161
#define FT_NEXT_USHORT(buffer)
Definition: ftstream.h:226
#define FT_NEXT_ULONG(buffer)
Definition: ftstream.h:238
unsigned long FT_ULong
Definition: fttypes.h:253
unsigned short FT_UShort
Definition: fttypes.h:209
const FT_Byte * FT_Bytes
Definition: fttypes.h:165
#define FT_INVALID_FORMAT
Definition: ftvalid.h:142
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLint limit
Definition: glext.h:10326
GLfloat GLfloat p
Definition: glext.h:8902
static void gxv_bsln_parts_fmt1_validate(FT_Bytes tables, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvbsln.c:169
static void gxv_bsln_parts_fmt2_validate(FT_Bytes tables, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvbsln.c:194
static void gxv_bsln_parts_fmt0_validate(FT_Bytes tables, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvbsln.c:150
static void gxv_bsln_parts_fmt3_validate(FT_Bytes tables, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvbsln.c:238
void(* GXV_Validate_Func)(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvcommn.h:82
#define GXV_TRACE(s)
Definition: gxvcommn.h:304
#define GXV_INIT
Definition: gxvcommn.h:300
#define GXV_LIMIT_CHECK(_count)
Definition: gxvcommn.h:272
FT_Validator root
Definition: gxvcommn.h:239
void * table_data
Definition: gxvcommn.h:242
FT_UShort defaultBaseline
Definition: gxvbsln.c:57

◆ gxv_feat_validate()

FT_BEGIN_HEADER gxv_feat_validate ( FT_Bytes  table,
FT_Face  face,
FT_Validator  valid 
)

Definition at line 273 of file gxvfeat.c.

276 {
277 GXV_ValidatorRec gxvalidrec;
278 GXV_Validator gxvalid = &gxvalidrec;
279
280 GXV_feat_DataRec featrec;
281 GXV_feat_Data feat = &featrec;
282
283 FT_Bytes p = table;
284 FT_Bytes limit = 0;
285
286 FT_UInt featureNameCount;
287
288 FT_UInt i;
289 FT_Int last_feature;
290
291
292 gxvalid->root = ftvalid;
293 gxvalid->table_data = feat;
294 gxvalid->face = face;
295
296 FT_TRACE3(( "validating `feat' table\n" ));
297 GXV_INIT;
298
299 feat->reserved_size = 0;
300
301 /* version + featureNameCount + none_0 + none_1 */
302 GXV_LIMIT_CHECK( 4 + 2 + 2 + 4 );
303 feat->reserved_size += 4 + 2 + 2 + 4;
304
305 if ( FT_NEXT_ULONG( p ) != 0x00010000UL ) /* Version */
307
308 featureNameCount = FT_NEXT_USHORT( p );
309 GXV_TRACE(( " (featureNameCount = %d)\n", featureNameCount ));
310
311 if ( !( IS_PARANOID_VALIDATION ) )
312 p += 6; /* skip (none) and (none) */
313 else
314 {
315 if ( FT_NEXT_USHORT( p ) != 0 )
317
318 if ( FT_NEXT_ULONG( p ) != 0 )
320 }
321
322 feat->reserved_size += featureNameCount * ( 2 + 2 + 4 + 2 + 2 );
323
324 for ( last_feature = -1, i = 0; i < featureNameCount; i++ )
325 {
326 gxv_feat_name_validate( p, limit, gxvalid );
327
328 if ( (FT_Int)GXV_FEAT_DATA( feature ) <= last_feature )
330
331 last_feature = GXV_FEAT_DATA( feature );
332 p += 2 + 2 + 4 + 2 + 2;
333 }
334
335 FT_TRACE4(( "\n" ));
336 }
unsigned int FT_UInt
Definition: fttypes.h:231
signed int FT_Int
Definition: fttypes.h:220
#define FT_INVALID_DATA
Definition: ftvalid.h:150
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 GXV_SET_ERR_IF_PARANOID(err)
Definition: gxvcommn.h:66
#define IS_PARANOID_VALIDATION
Definition: gxvcommn.h:65
static void gxv_feat_name_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvfeat.c:191
#define GXV_FEAT_DATA(field)
Definition: gxvfeat.c:60
INTERNETFEATURELIST feature
Definition: misc.c:1719
FT_UInt reserved_size
Definition: gxvfeat.c:53

◆ gxv_just_validate()

gxv_just_validate ( FT_Bytes  table,
FT_Face  face,
FT_Validator  valid 
)

Definition at line 644 of file gxvjust.c.

647 {
648 FT_Bytes p = table;
649 FT_Bytes limit = 0;
650
651 GXV_ValidatorRec gxvalidrec;
652 GXV_Validator gxvalid = &gxvalidrec;
653 GXV_just_DataRec justrec;
654 GXV_just_Data just = &justrec;
655
658 FT_UShort horizOffset;
659 FT_UShort vertOffset;
660
661 GXV_ODTECT( 3, odtect );
662
663
664 GXV_ODTECT_INIT( odtect );
665
666 gxvalid->root = ftvalid;
667 gxvalid->table_data = just;
668 gxvalid->face = face;
669
670 FT_TRACE3(( "validating `just' table\n" ));
671 GXV_INIT;
672
673 limit = gxvalid->root->limit;
674
675 GXV_LIMIT_CHECK( 4 + 2 + 2 + 2 );
678 horizOffset = FT_NEXT_USHORT( p );
679 vertOffset = FT_NEXT_USHORT( p );
681 "just header", odtect );
682
683
684 /* Version 1.0 (always:2000) */
685 GXV_TRACE(( " (version = 0x%08x)\n", version ));
686 if ( version != 0x00010000UL )
688
689 /* format 0 (always:2000) */
690 GXV_TRACE(( " (format = 0x%04x)\n", format ));
691 if ( format != 0x0000 )
693
694 GXV_TRACE(( " (horizOffset = %d)\n", horizOffset ));
695 GXV_TRACE(( " (vertOffset = %d)\n", vertOffset ));
696
697
698 /* validate justData */
699 if ( 0 < horizOffset )
700 {
701 gxv_just_justData_validate( table + horizOffset, limit, gxvalid );
702 gxv_odtect_add_range( table + horizOffset, gxvalid->subtable_length,
703 "horizJustData", odtect );
704 }
705
706 if ( 0 < vertOffset )
707 {
708 gxv_just_justData_validate( table + vertOffset, limit, gxvalid );
709 gxv_odtect_add_range( table + vertOffset, gxvalid->subtable_length,
710 "vertJustData", odtect );
711 }
712
713 gxv_odtect_validate( odtect, gxvalid );
714
715 FT_TRACE4(( "\n" ));
716 }
gxv_odtect_add_range(FT_Bytes start, FT_ULong length, const FT_String *name, GXV_odtect_Range odtect)
Definition: gxvcommn.c:1702
gxv_odtect_validate(GXV_odtect_Range odtect, GXV_Validator gxvalid)
Definition: gxvcommn.c:1715
#define GXV_ODTECT(n, odtect)
Definition: gxvcommn.h:562
#define GXV_ODTECT_INIT(odtect)
Definition: gxvcommn.h:567
static void gxv_just_justData_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvjust.c:580
FT_ULong subtable_length
Definition: gxvcommn.h:244

◆ gxv_kern_validate()

gxv_kern_validate ( FT_Bytes  table,
FT_Face  face,
FT_Validator  valid 
)

Definition at line 898 of file gxvkern.c.

901 {
903 }
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
@ KERN_DIALECT_ANY
Definition: gxvkern.c:66
static void gxv_kern_validate_generic(FT_Bytes table, FT_Face face, FT_Bool classic_only, GXV_kern_Dialect dialect_request, FT_Validator ftvalid)
Definition: gxvkern.c:834

◆ gxv_kern_validate_classic()

gxv_kern_validate_classic ( FT_Bytes  table,
FT_Face  face,
FT_Int  dialect_flags,
FT_Validator  valid 
)

Definition at line 907 of file gxvkern.c.

911 {
912 GXV_kern_Dialect dialect_request;
913
914
915 dialect_request = (GXV_kern_Dialect)dialect_flags;
916 gxv_kern_validate_generic( table, face, 1, dialect_request, ftvalid );
917 }
enum GXV_kern_Dialect_ GXV_kern_Dialect

Referenced by classic_kern_validate().

◆ gxv_lcar_validate()

gxv_lcar_validate ( FT_Bytes  table,
FT_Face  face,
FT_Validator  valid 
)

Definition at line 183 of file gxvlcar.c.

186 {
187 FT_Bytes p = table;
188 FT_Bytes limit = 0;
189 GXV_ValidatorRec gxvalidrec;
190 GXV_Validator gxvalid = &gxvalidrec;
191
192 GXV_lcar_DataRec lcarrec;
193 GXV_lcar_Data lcar = &lcarrec;
194
196
197
198 gxvalid->root = ftvalid;
199 gxvalid->table_data = lcar;
200 gxvalid->face = face;
201
202 FT_TRACE3(( "validating `lcar' table\n" ));
203 GXV_INIT;
204
205 GXV_LIMIT_CHECK( 4 + 2 );
208
209 if ( version != 0x00010000UL)
211
212 if ( GXV_LCAR_DATA( format ) > 1 )
214
218 gxv_LookupTable_validate( p, limit, gxvalid );
219
220 FT_TRACE4(( "\n" ));
221 }
#define FT_NEXT_LONG(buffer)
Definition: ftstream.h:235
signed long FT_Fixed
Definition: fttypes.h:288
gxv_LookupTable_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvcommn.c:755
@ GXV_LOOKUPVALUE_UNSIGNED
Definition: gxvcommn.h:100
static void gxv_lcar_LookupValue_validate(FT_UShort glyph, GXV_LookupValueCPtr value_p, GXV_Validator gxvalid)
Definition: gxvlcar.c:86
static GXV_LookupValueDesc gxv_lcar_LookupFmt4_transit(FT_UShort relative_gindex, GXV_LookupValueCPtr base_value_p, FT_Bytes lookuptbl_limit, GXV_Validator gxvalid)
Definition: gxvlcar.c:149
#define GXV_LCAR_DATA(FIELD)
Definition: gxvlcar.c:57
GXV_Lookup_Fmt4_Transit_Func lookupfmt4_trans
Definition: gxvcommn.h:248
GXV_Lookup_Value_Validate_Func lookupval_func
Definition: gxvcommn.h:247
GXV_LookupValue_SignSpec lookupval_sign
Definition: gxvcommn.h:246

◆ gxv_mort_validate()

gxv_mort_validate ( FT_Bytes  table,
FT_Face  face,
FT_Validator  valid 
)

Definition at line 261 of file gxvmort.c.

264 {
265 GXV_ValidatorRec gxvalidrec;
266 GXV_Validator gxvalid = &gxvalidrec;
267 FT_Bytes p = table;
268 FT_Bytes limit = 0;
270 FT_ULong nChains;
271 FT_ULong i;
272
273
274 gxvalid->root = ftvalid;
275 gxvalid->face = face;
276 limit = gxvalid->root->limit;
277
278 FT_TRACE3(( "validating `mort' table\n" ));
279 GXV_INIT;
280
281 GXV_LIMIT_CHECK( 4 + 4 );
283 nChains = FT_NEXT_ULONG( p );
284
285 if (version != 0x00010000UL)
287
288 for ( i = 0; i < nChains; i++ )
289 {
290 GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains ));
292 gxv_mort_chain_validate( p, limit, gxvalid );
293 p += gxvalid->subtable_length;
294 }
295
296 FT_TRACE4(( "\n" ));
297 }
#define GXV_32BIT_ALIGNMENT_VALIDATE(a)
Definition: gxvcommn.h:317
static void gxv_mort_chain_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvmort.c:224

◆ gxv_morx_validate()

gxv_morx_validate ( FT_Bytes  table,
FT_Face  face,
FT_Validator  valid 
)

Definition at line 161 of file gxvmorx.c.

164 {
165 GXV_ValidatorRec gxvalidrec;
166 GXV_Validator gxvalid = &gxvalidrec;
167 FT_Bytes p = table;
168 FT_Bytes limit = 0;
170 FT_ULong nChains;
171 FT_ULong i;
172
173
174 gxvalid->root = ftvalid;
175 gxvalid->face = face;
176
177 FT_TRACE3(( "validating `morx' table\n" ));
178 GXV_INIT;
179
180 GXV_LIMIT_CHECK( 4 + 4 );
182 nChains = FT_NEXT_ULONG( p );
183
184 if ( version != 0x00020000UL )
186
187 for ( i = 0; i < nChains; i++ )
188 {
189 GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains ));
191 gxv_morx_chain_validate( p, limit, gxvalid );
192 p += gxvalid->subtable_length;
193 }
194
195 FT_TRACE4(( "\n" ));
196 }
static void gxv_morx_chain_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvmorx.c:117

◆ gxv_opbd_validate()

gxv_opbd_validate ( FT_Bytes  table,
FT_Face  face,
FT_Validator  valid 
)

Definition at line 162 of file gxvopbd.c.

165 {
166 GXV_ValidatorRec gxvalidrec;
167 GXV_Validator gxvalid = &gxvalidrec;
168 GXV_opbd_DataRec opbdrec;
169 GXV_opbd_Data opbd = &opbdrec;
170 FT_Bytes p = table;
171 FT_Bytes limit = 0;
172
174
175
176 gxvalid->root = ftvalid;
177 gxvalid->table_data = opbd;
178 gxvalid->face = face;
179
180 FT_TRACE3(( "validating `opbd' table\n" ));
181 GXV_INIT;
182 GXV_OPBD_DATA( valueOffset_min ) = 0xFFFFU;
183
184
185 GXV_LIMIT_CHECK( 4 + 2 );
188
189
190 /* only 0x00010000 is defined (1996) */
191 GXV_TRACE(( "(version=0x%08x)\n", version ));
192 if ( 0x00010000UL != version )
194
195 /* only values 0 and 1 are defined (1996) */
196 GXV_TRACE(( "(format=0x%04x)\n", GXV_OPBD_DATA( format ) ));
197 if ( 0x0001 < GXV_OPBD_DATA( format ) )
199
203
204 gxv_LookupTable_validate( p, limit, gxvalid );
205 p += gxvalid->subtable_length;
206
207 if ( p > table + GXV_OPBD_DATA( valueOffset_min ) )
208 {
209 GXV_TRACE((
210 "found overlap between LookupTable and opbd_value array\n" ));
212 }
213
214 FT_TRACE4(( "\n" ));
215 }
#define FT_INVALID_OFFSET
Definition: ftvalid.h:138
static GXV_LookupValueDesc gxv_opbd_LookupFmt4_transit(FT_UShort relative_gindex, GXV_LookupValueCPtr base_value_p, FT_Bytes lookuptbl_limit, GXV_Validator gxvalid)
Definition: gxvopbd.c:135
static void gxv_opbd_LookupValue_validate(FT_UShort glyph, GXV_LookupValueCPtr value_p, GXV_Validator gxvalid)
Definition: gxvopbd.c:70
#define GXV_OPBD_DATA(FIELD)
Definition: gxvopbd.c:58

◆ gxv_prop_validate()

gxv_prop_validate ( FT_Bytes  table,
FT_Face  face,
FT_Validator  valid 
)

Definition at line 257 of file gxvprop.c.

260 {
261 FT_Bytes p = table;
262 FT_Bytes limit = 0;
263 GXV_ValidatorRec gxvalidrec;
264 GXV_Validator gxvalid = &gxvalidrec;
265
266 GXV_prop_DataRec proprec;
267 GXV_prop_Data prop = &proprec;
268
271 FT_UShort defaultProp;
272
273
274 gxvalid->root = ftvalid;
275 gxvalid->table_data = prop;
276 gxvalid->face = face;
277
278 FT_TRACE3(( "validating `prop' table\n" ));
279 GXV_INIT;
280
281 GXV_LIMIT_CHECK( 4 + 2 + 2 );
284 defaultProp = FT_NEXT_USHORT( p );
285
286 GXV_TRACE(( " version 0x%08x\n", version ));
287 GXV_TRACE(( " format 0x%04x\n", format ));
288 GXV_TRACE(( " defaultProp 0x%04x\n", defaultProp ));
289
290 /* only versions 1.0, 2.0, 3.0 are defined (1996) */
291 if ( version != 0x00010000UL &&
292 version != 0x00020000UL &&
293 version != 0x00030000UL )
294 {
295 GXV_TRACE(( " found unknown version\n" ));
297 }
298
299
300 /* only formats 0x0000, 0x0001 are defined (1996) */
301 if ( format > 1 )
302 {
303 GXV_TRACE(( " found unknown format\n" ));
305 }
306
307 gxv_prop_property_validate( defaultProp, 0, gxvalid );
308
309 if ( format == 0 )
310 {
311 FT_TRACE3(( "(format 0, no per-glyph properties, "
312 "remaining %d bytes are skipped)", limit - p ));
313 goto Exit;
314 }
315
316 /* format == 1 */
318
322
323 gxv_LookupTable_validate( p, limit, gxvalid );
324
325 Exit:
326 FT_TRACE4(( "\n" ));
327 }
static void gxv_prop_property_validate(FT_UShort property, FT_UShort glyph, GXV_Validator gxvalid)
Definition: gxvprop.c:111
static void gxv_prop_LookupValue_validate(FT_UShort glyph, GXV_LookupValueCPtr value_p, GXV_Validator gxvalid)
Definition: gxvprop.c:189
#define GXV_PROP_DATA(field)
Definition: gxvprop.c:59
static GXV_LookupValueDesc gxv_prop_LookupFmt4_transit(FT_UShort relative_gindex, GXV_LookupValueCPtr base_value_p, FT_Bytes lookuptbl_limit, GXV_Validator gxvalid)
Definition: gxvprop.c:225
static void Exit(void)
Definition: sock.c:1330

◆ gxv_trak_validate()

gxv_trak_validate ( FT_Bytes  table,
FT_Face  face,
FT_Validator  valid 
)

Definition at line 208 of file gxvtrak.c.

211 {
212 FT_Bytes p = table;
213 FT_Bytes limit = 0;
214
215 GXV_ValidatorRec gxvalidrec;
216 GXV_Validator gxvalid = &gxvalidrec;
217 GXV_trak_DataRec trakrec;
218 GXV_trak_Data trak = &trakrec;
219
222 FT_UShort horizOffset;
223 FT_UShort vertOffset;
225
226
227 GXV_ODTECT( 3, odtect );
228
229 GXV_ODTECT_INIT( odtect );
230 gxvalid->root = ftvalid;
231 gxvalid->table_data = trak;
232 gxvalid->face = face;
233
234 limit = gxvalid->root->limit;
235
236 FT_TRACE3(( "validating `trak' table\n" ));
237 GXV_INIT;
238
239 GXV_LIMIT_CHECK( 4 + 2 + 2 + 2 + 2 );
242 horizOffset = FT_NEXT_USHORT( p );
243 vertOffset = FT_NEXT_USHORT( p );
245
246 GXV_TRACE(( " (version = 0x%08x)\n", version ));
247 GXV_TRACE(( " (format = 0x%04x)\n", format ));
248 GXV_TRACE(( " (horizOffset = 0x%04x)\n", horizOffset ));
249 GXV_TRACE(( " (vertOffset = 0x%04x)\n", vertOffset ));
250 GXV_TRACE(( " (reserved = 0x%04x)\n", reserved ));
251
252 /* Version 1.0 (always:1996) */
253 if ( version != 0x00010000UL )
255
256 /* format 0 (always:1996) */
257 if ( format != 0x0000 )
259
260 GXV_32BIT_ALIGNMENT_VALIDATE( horizOffset );
261 GXV_32BIT_ALIGNMENT_VALIDATE( vertOffset );
262
263 /* Reserved Fixed Value (always) */
264 if ( reserved != 0x0000 )
266
267 /* validate trackData */
268 if ( 0 < horizOffset )
269 {
270 gxv_trak_trackData_validate( table + horizOffset, limit, gxvalid );
271 gxv_odtect_add_range( table + horizOffset, gxvalid->subtable_length,
272 "horizJustData", odtect );
273 }
274
275 if ( 0 < vertOffset )
276 {
277 gxv_trak_trackData_validate( table + vertOffset, limit, gxvalid );
278 gxv_odtect_add_range( table + vertOffset, gxvalid->subtable_length,
279 "vertJustData", odtect );
280 }
281
282 gxv_odtect_validate( odtect, gxvalid );
283
284 FT_TRACE4(( "\n" ));
285 }
r reserved
Definition: btrfs.c:3006
static void gxv_trak_trackData_validate(FT_Bytes table, FT_Bytes limit, GXV_Validator gxvalid)
Definition: gxvtrak.c:144