ReactOS 0.4.15-dev-7834-g00c4b3d
otvcommn.c File Reference
#include "otvcommn.h"
Include dependency graph for otvcommn.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_otvcommon
 

Functions

 otv_Coverage_validate (FT_Bytes table, OTV_Validator otvalid, FT_Int expected_count)
 
 otv_Coverage_get_first (FT_Bytes table)
 
 otv_Coverage_get_last (FT_Bytes table)
 
 otv_Coverage_get_count (FT_Bytes table)
 
 otv_ClassDef_validate (FT_Bytes table, OTV_Validator otvalid)
 
 otv_Device_validate (FT_Bytes table, OTV_Validator otvalid)
 
 otv_Lookup_validate (FT_Bytes table, OTV_Validator otvalid)
 
 otv_LookupList_validate (FT_Bytes table, OTV_Validator otvalid)
 
static FT_UInt otv_LookupList_get_count (FT_Bytes table)
 
 otv_Feature_validate (FT_Bytes table, OTV_Validator otvalid)
 
static FT_UInt otv_Feature_get_count (FT_Bytes table)
 
 otv_FeatureList_validate (FT_Bytes table, FT_Bytes lookups, OTV_Validator otvalid)
 
 otv_LangSys_validate (FT_Bytes table, OTV_Validator otvalid)
 
 otv_Script_validate (FT_Bytes table, OTV_Validator otvalid)
 
 otv_ScriptList_validate (FT_Bytes table, FT_Bytes features, OTV_Validator otvalid)
 
 otv_x_Ox (FT_Bytes table, OTV_Validator otvalid)
 
 otv_u_C_x_Ox (FT_Bytes table, OTV_Validator otvalid)
 
 otv_x_ux (FT_Bytes table, OTV_Validator otvalid)
 
 otv_x_y_ux_sy (FT_Bytes table, OTV_Validator otvalid)
 
 otv_x_ux_y_uy_z_uz_p_sp (FT_Bytes table, OTV_Validator otvalid)
 
 otv_u_O_O_x_Onx (FT_Bytes table, OTV_Validator otvalid)
 
 otv_u_x_y_Ox_sy (FT_Bytes table, OTV_Validator otvalid)
 
 otv_u_O_O_O_O_x_Onx (FT_Bytes table, OTV_Validator otvalid)
 
 otv_u_x_Ox_y_Oy_z_Oz_p_sp (FT_Bytes table, OTV_Validator otvalid)
 
 otv_GSUBGPOS_get_Lookup_count (FT_Bytes table)
 
 otv_GSUBGPOS_have_MarkAttachmentType_flag (FT_Bytes table)
 

Macro Definition Documentation

◆ FT_COMPONENT

#define FT_COMPONENT   trace_otvcommon

Definition at line 29 of file otvcommn.c.

Function Documentation

◆ otv_ClassDef_validate()

otv_ClassDef_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 221 of file otvcommn.c.

223 {
224 FT_Bytes p = table;
225 FT_UInt ClassFormat;
226
227
228 OTV_NAME_ENTER( "ClassDef" );
229
230 OTV_LIMIT_CHECK( 4 );
231 ClassFormat = FT_NEXT_USHORT( p );
232
233 OTV_TRACE(( " (format %d)\n", ClassFormat ));
234
235 switch ( ClassFormat )
236 {
237 case 1: /* ClassDefFormat1 */
238 {
239 FT_UInt StartGlyph;
240 FT_UInt GlyphCount;
241
242
243 OTV_LIMIT_CHECK( 4 );
244
245 StartGlyph = FT_NEXT_USHORT( p );
246 GlyphCount = FT_NEXT_USHORT( p );
247
248 OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));
249
250 OTV_LIMIT_CHECK( GlyphCount * 2 ); /* ClassValueArray */
251
252 if ( StartGlyph + GlyphCount - 1 >= otvalid->glyph_count )
254 }
255 break;
256
257 case 2: /* ClassDefFormat2 */
258 {
259 FT_UInt n, ClassRangeCount;
260 FT_UInt Start, End, last = 0;
261
262
263 ClassRangeCount = FT_NEXT_USHORT( p );
264
265 OTV_TRACE(( " (ClassRangeCount = %d)\n", ClassRangeCount ));
266
267 OTV_LIMIT_CHECK( ClassRangeCount * 6 );
268
269 /* ClassRangeRecord */
270 for ( n = 0; n < ClassRangeCount; n++ )
271 {
273 End = FT_NEXT_USHORT( p );
274 p += 2; /* skip Class */
275
276 if ( Start > End || ( n > 0 && Start <= last ) )
278
279 if ( End >= otvalid->glyph_count )
281
282 last = End;
283 }
284 }
285 break;
286
287 default:
289 }
290
291 /* no need to check glyph indices used as input to class definition */
292 /* tables since even invalid glyph indices return a meaningful result */
293
294 OTV_EXIT;
295 }
#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
#define FT_INVALID_FORMAT
Definition: ftvalid.h:142
#define FT_INVALID_DATA
Definition: ftvalid.h:150
#define FT_INVALID_GLYPH_ID
Definition: ftvalid.h:146
GLdouble n
Definition: glext.h:7729
GLfloat GLfloat p
Definition: glext.h:8902
static UINT UINT last
Definition: font.c:45
#define OTV_TRACE(s)
Definition: otvcommn.h:230
#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
@ Start
Definition: partlist.h:33

Referenced by otv_GDEF_validate(), otv_PairPos_validate(), otv_u_O_O_O_O_x_Onx(), and otv_u_O_O_x_Onx().

◆ otv_Coverage_get_count()

otv_Coverage_get_count ( FT_Bytes  table)

Definition at line 175 of file otvcommn.c.

176 {
177 FT_Bytes p = table;
178 FT_UInt CoverageFormat = FT_NEXT_USHORT( p );
179 FT_UInt count = FT_NEXT_USHORT( p ); /* Glyph/RangeCount */
180 FT_UInt result = 0;
181
182
183 switch ( CoverageFormat )
184 {
185 case 1:
186 return count;
187
188 case 2:
189 {
190 FT_UInt Start, End;
191
192
193 for ( ; count > 0; count-- )
194 {
196 End = FT_NEXT_USHORT( p );
197 p += 2; /* skip StartCoverageIndex */
198
199 result += End - Start + 1;
200 }
201 }
202 break;
203
204 default:
205 ;
206 }
207
208 return result;
209 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint64EXT * result
Definition: glext.h:11304

Referenced by otv_O_x_Ox(), and otv_ReverseChainSingleSubst_validate().

◆ otv_Coverage_get_first()

otv_Coverage_get_first ( FT_Bytes  table)

Definition at line 134 of file otvcommn.c.

135 {
136 FT_Bytes p = table;
137
138
139 p += 4; /* skip CoverageFormat and Glyph/RangeCount */
140
141 return FT_NEXT_USHORT( p );
142 }

Referenced by otv_SingleSubst_validate().

◆ otv_Coverage_get_last()

otv_Coverage_get_last ( FT_Bytes  table)

Definition at line 146 of file otvcommn.c.

147 {
148 FT_Bytes p = table;
149 FT_UInt CoverageFormat = FT_NEXT_USHORT( p );
150 FT_UInt count = FT_NEXT_USHORT( p ); /* Glyph/RangeCount */
151 FT_UInt result = 0;
152
153
154 switch ( CoverageFormat )
155 {
156 case 1:
157 p += ( count - 1 ) * 2;
159 break;
160
161 case 2:
162 p += ( count - 1 ) * 6 + 2;
164 break;
165
166 default:
167 ;
168 }
169
170 return result;
171 }

Referenced by otv_SingleSubst_validate().

◆ otv_Coverage_validate()

otv_Coverage_validate ( FT_Bytes  table,
OTV_Validator  otvalid,
FT_Int  expected_count 
)

Definition at line 41 of file otvcommn.c.

44 {
46 FT_UInt CoverageFormat;
47 FT_UInt total = 0;
48
49
50 OTV_NAME_ENTER( "Coverage" );
51
52 OTV_LIMIT_CHECK( 4 );
53 CoverageFormat = FT_NEXT_USHORT( p );
54
55 OTV_TRACE(( " (format %d)\n", CoverageFormat ));
56
57 switch ( CoverageFormat )
58 {
59 case 1: /* CoverageFormat1 */
60 {
61 FT_UInt GlyphCount;
62 FT_UInt i;
63
64
65 GlyphCount = FT_NEXT_USHORT( p );
66
67 OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));
68
69 OTV_LIMIT_CHECK( GlyphCount * 2 ); /* GlyphArray */
70
71 for ( i = 0; i < GlyphCount; i++ )
72 {
73 FT_UInt gid;
74
75
76 gid = FT_NEXT_USHORT( p );
77 if ( gid >= otvalid->glyph_count )
79 }
80
81 total = GlyphCount;
82 }
83 break;
84
85 case 2: /* CoverageFormat2 */
86 {
87 FT_UInt n, RangeCount;
88 FT_UInt Start, End, StartCoverageIndex, last = 0;
89
90
91 RangeCount = FT_NEXT_USHORT( p );
92
93 OTV_TRACE(( " (RangeCount = %d)\n", RangeCount ));
94
95 OTV_LIMIT_CHECK( RangeCount * 6 );
96
97 /* RangeRecord */
98 for ( n = 0; n < RangeCount; n++ )
99 {
101 End = FT_NEXT_USHORT( p );
102 StartCoverageIndex = FT_NEXT_USHORT( p );
103
104 if ( Start > End || StartCoverageIndex != total )
106
107 if ( End >= otvalid->glyph_count )
109
110 if ( n > 0 && Start <= last )
112
113 total += End - Start + 1;
114 last = End;
115 }
116 }
117 break;
118
119 default:
121 }
122
123 /* Generally, a coverage table offset has an associated count field. */
124 /* The number of glyphs in the table should match this field. If */
125 /* there is no associated count, a value of -1 tells us not to check. */
126 if ( expected_count != -1 && (FT_UInt)expected_count != total )
128
129 OTV_EXIT;
130 }
size_t total
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
static int expected_count(int *sink)

Referenced by otv_CursivePos_validate(), otv_MarkGlyphSets_validate(), otv_MathGlyphInfo_validate(), otv_MathItalicsCorrectionInfo_validate(), otv_MathKernInfo_validate(), otv_MathVariants_validate(), otv_O_x_Ox(), otv_PairPos_validate(), otv_ReverseChainSingleSubst_validate(), otv_SinglePos_validate(), otv_SingleSubst_validate(), otv_u_C_x_Ox(), otv_u_O_O_O_O_x_Onx(), otv_u_O_O_u_O_O(), otv_u_O_O_x_Onx(), otv_u_x_Ox_y_Oy_z_Oz_p_sp(), and otv_u_x_y_Ox_sy().

◆ otv_Device_validate()

otv_Device_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 307 of file otvcommn.c.

309 {
310 FT_Bytes p = table;
311 FT_UInt StartSize, EndSize, DeltaFormat, count;
312
313
314 OTV_NAME_ENTER( "Device" );
315
316 OTV_LIMIT_CHECK( 6 );
317 StartSize = FT_NEXT_USHORT( p );
318 EndSize = FT_NEXT_USHORT( p );
319 DeltaFormat = FT_NEXT_USHORT( p );
320
321 if ( DeltaFormat == 0x8000U )
322 {
323 /* VariationIndex, nothing to do */
324 }
325 else
326 {
327 if ( DeltaFormat < 1 || DeltaFormat > 3 )
329
330 if ( EndSize < StartSize )
332
333 count = EndSize - StartSize + 1;
334 OTV_LIMIT_CHECK( ( 1 << DeltaFormat ) * count / 8 ); /* DeltaValue */
335 }
336
337 OTV_EXIT;
338 }

Referenced by otv_Anchor_validate(), otv_BaseCoord_validate(), otv_CaretValue_validate(), otv_GlyphAssembly_validate(), otv_MathConstants_validate(), otv_MathItalicsCorrectionInfo_validate(), otv_MathKern_validate(), and otv_ValueRecord_validate().

◆ otv_Feature_get_count()

static FT_UInt otv_Feature_get_count ( FT_Bytes  table)
static

Definition at line 464 of file otvcommn.c.

465 {
466 return FT_NEXT_USHORT( table );
467 }

Referenced by otv_ScriptList_validate().

◆ otv_Feature_validate()

otv_Feature_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 437 of file otvcommn.c.

439 {
440 FT_Bytes p = table;
441 FT_UInt LookupCount;
442
443
444 OTV_NAME_ENTER( "Feature" );
445
446 OTV_LIMIT_CHECK( 4 );
447 p += 2; /* skip FeatureParams (unused) */
448 LookupCount = FT_NEXT_USHORT( p );
449
450 OTV_TRACE(( " (LookupCount = %d)\n", LookupCount ));
451
452 OTV_LIMIT_CHECK( LookupCount * 2 );
453
454 /* LookupListIndex */
455 for ( ; LookupCount > 0; LookupCount-- )
456 if ( FT_NEXT_USHORT( p ) >= otvalid->lookup_count )
458
459 OTV_EXIT;
460 }

Referenced by otv_FeatureList_validate().

◆ otv_FeatureList_validate()

otv_FeatureList_validate ( FT_Bytes  table,
FT_Bytes  lookups,
OTV_Validator  otvalid 
)

Definition at line 473 of file otvcommn.c.

476 {
477 FT_Bytes p = table;
478 FT_UInt FeatureCount;
479
480
481 OTV_NAME_ENTER( "FeatureList" );
482
483 OTV_LIMIT_CHECK( 2 );
484 FeatureCount = FT_NEXT_USHORT( p );
485
486 OTV_TRACE(( " (FeatureCount = %d)\n", FeatureCount ));
487
488 OTV_LIMIT_CHECK( FeatureCount * 2 );
489
490 otvalid->lookup_count = otv_LookupList_get_count( lookups );
491
492 /* FeatureRecord */
493 for ( ; FeatureCount > 0; FeatureCount-- )
494 {
495 p += 4; /* skip FeatureTag */
496
497 /* Feature */
499 }
500
501 OTV_EXIT;
502 }
static FT_UInt otv_LookupList_get_count(FT_Bytes table)
Definition: otvcommn.c:420
otv_Feature_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.c:437

Referenced by otv_GPOS_validate(), and otv_GSUB_validate().

◆ otv_GSUBGPOS_get_Lookup_count()

otv_GSUBGPOS_get_Lookup_count ( FT_Bytes  table)

Definition at line 1047 of file otvcommn.c.

1048 {
1049 FT_Bytes p = table + 8;
1050
1051
1053 }

Referenced by otv_JSTF_validate().

◆ otv_GSUBGPOS_have_MarkAttachmentType_flag()

otv_GSUBGPOS_have_MarkAttachmentType_flag ( FT_Bytes  table)

Definition at line 1057 of file otvcommn.c.

1058 {
1059 FT_Bytes p, lookup;
1060 FT_UInt count;
1061
1062
1063 if ( !table )
1064 return 0;
1065
1066 /* LookupList */
1067 p = table + 8;
1068 table += FT_NEXT_USHORT( p );
1069
1070 /* LookupCount */
1071 p = table;
1072 count = FT_NEXT_USHORT( p );
1073
1074 for ( ; count > 0; count-- )
1075 {
1076 FT_Bytes oldp;
1077
1078
1079 /* Lookup */
1081
1082 oldp = p;
1083
1084 /* LookupFlag */
1085 p = lookup + 2;
1086 if ( FT_NEXT_USHORT( p ) & 0xFF00U )
1087 return 1;
1088
1089 p = oldp;
1090 }
1091
1092 return 0;
1093 }
static ULONG lookup[16]
Definition: vga.c:48

Referenced by otv_GDEF_validate().

◆ otv_LangSys_validate()

otv_LangSys_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 517 of file otvcommn.c.

519 {
520 FT_Bytes p = table;
521 FT_UInt ReqFeatureIndex;
522 FT_UInt FeatureCount;
523
524
525 OTV_NAME_ENTER( "LangSys" );
526
527 OTV_LIMIT_CHECK( 6 );
528 p += 2; /* skip LookupOrder (unused) */
529 ReqFeatureIndex = FT_NEXT_USHORT( p );
530 FeatureCount = FT_NEXT_USHORT( p );
531
532 OTV_TRACE(( " (ReqFeatureIndex = %d)\n", ReqFeatureIndex ));
533 OTV_TRACE(( " (FeatureCount = %d)\n", FeatureCount ));
534
535 if ( ReqFeatureIndex != 0xFFFFU && ReqFeatureIndex >= otvalid->extra1 )
537
538 OTV_LIMIT_CHECK( FeatureCount * 2 );
539
540 /* FeatureIndex */
541 for ( ; FeatureCount > 0; FeatureCount-- )
542 if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 )
544
545 OTV_EXIT;
546 }

Referenced by otv_Script_validate().

◆ otv_Lookup_validate()

otv_Lookup_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 353 of file otvcommn.c.

355 {
356 FT_Bytes p = table;
357 FT_UInt LookupType, LookupFlag, SubTableCount;
359
360
361 OTV_NAME_ENTER( "Lookup" );
362
363 OTV_LIMIT_CHECK( 6 );
364 LookupType = FT_NEXT_USHORT( p );
365 LookupFlag = FT_NEXT_USHORT( p );
366 SubTableCount = FT_NEXT_USHORT( p );
367
368 OTV_TRACE(( " (type %d)\n", LookupType ));
369
370 if ( LookupType == 0 || LookupType > otvalid->type_count )
372
373 validate = otvalid->type_funcs[LookupType - 1];
374
375 OTV_TRACE(( " (SubTableCount = %d)\n", SubTableCount ));
376
377 OTV_LIMIT_CHECK( SubTableCount * 2 );
378
379 /* SubTable */
380 for ( ; SubTableCount > 0; SubTableCount-- )
381 validate( table + FT_NEXT_USHORT( p ), otvalid );
382
383 if ( LookupFlag & 0x10 )
384 OTV_LIMIT_CHECK( 2 ); /* MarkFilteringSet */
385
386 OTV_EXIT;
387 }
static FRESULT validate(void *obj)
Definition: ff.c:2372
void(* OTV_Validate_Func)(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.h:41

Referenced by otv_GPOS_subtable_validate(), and otv_LookupList_validate().

◆ otv_LookupList_get_count()

static FT_UInt otv_LookupList_get_count ( FT_Bytes  table)
static

Definition at line 420 of file otvcommn.c.

421 {
422 return FT_NEXT_USHORT( table );
423 }

Referenced by otv_FeatureList_validate(), and otv_GSUBGPOS_get_Lookup_count().

◆ otv_LookupList_validate()

otv_LookupList_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 393 of file otvcommn.c.

395 {
396 FT_Bytes p = table;
397 FT_UInt LookupCount;
398
399
400 OTV_NAME_ENTER( "LookupList" );
401
402 OTV_LIMIT_CHECK( 2 );
403 LookupCount = FT_NEXT_USHORT( p );
404
405 OTV_TRACE(( " (LookupCount = %d)\n", LookupCount ));
406
407 OTV_LIMIT_CHECK( LookupCount * 2 );
408
409 otvalid->lookup_count = LookupCount;
410
411 /* Lookup */
412 for ( ; LookupCount > 0; LookupCount-- )
413 otv_Lookup_validate( table + FT_NEXT_USHORT( p ), otvalid );
414
415 OTV_EXIT;
416 }
otv_Lookup_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.c:353

Referenced by otv_GPOS_validate(), and otv_GSUB_validate().

◆ otv_Script_validate()

otv_Script_validate ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 558 of file otvcommn.c.

560 {
561 FT_UInt DefaultLangSys, LangSysCount;
562 FT_Bytes p = table;
563
564
565 OTV_NAME_ENTER( "Script" );
566
567 OTV_LIMIT_CHECK( 4 );
568 DefaultLangSys = FT_NEXT_USHORT( p );
569 LangSysCount = FT_NEXT_USHORT( p );
570
571 OTV_TRACE(( " (LangSysCount = %d)\n", LangSysCount ));
572
573 if ( DefaultLangSys != 0 )
574 otv_LangSys_validate( table + DefaultLangSys, otvalid );
575
576 OTV_LIMIT_CHECK( LangSysCount * 6 );
577
578 /* LangSysRecord */
579 for ( ; LangSysCount > 0; LangSysCount-- )
580 {
581 p += 4; /* skip LangSysTag */
582
583 /* LangSys */
585 }
586
587 OTV_EXIT;
588 }
otv_LangSys_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.c:517

Referenced by otv_ScriptList_validate().

◆ otv_ScriptList_validate()

otv_ScriptList_validate ( FT_Bytes  table,
FT_Bytes  features,
OTV_Validator  otvalid 
)

Definition at line 594 of file otvcommn.c.

597 {
598 FT_UInt ScriptCount;
599 FT_Bytes p = table;
600
601
602 OTV_NAME_ENTER( "ScriptList" );
603
604 OTV_LIMIT_CHECK( 2 );
605 ScriptCount = FT_NEXT_USHORT( p );
606
607 OTV_TRACE(( " (ScriptCount = %d)\n", ScriptCount ));
608
609 OTV_LIMIT_CHECK( ScriptCount * 6 );
610
611 otvalid->extra1 = otv_Feature_get_count( features );
612
613 /* ScriptRecord */
614 for ( ; ScriptCount > 0; ScriptCount-- )
615 {
616 p += 4; /* skip ScriptTag */
617
618 otv_Script_validate( table + FT_NEXT_USHORT( p ), otvalid ); /* Script */
619 }
620
621 OTV_EXIT;
622 }
otv_Script_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.c:558
static FT_UInt otv_Feature_get_count(FT_Bytes table)
Definition: otvcommn.c:464

Referenced by otv_GPOS_validate(), and otv_GSUB_validate().

◆ otv_u_C_x_Ox()

otv_u_C_x_Ox ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 682 of file otvcommn.c.

684 {
685 FT_Bytes p = table;
686 FT_UInt Count, Coverage;
688
689
690 OTV_ENTER;
691
692 p += 2; /* skip Format */
693
694 OTV_LIMIT_CHECK( 4 );
695 Coverage = FT_NEXT_USHORT( p );
697
698 OTV_TRACE(( " (Count = %d)\n", Count ));
699
700 otv_Coverage_validate( table + Coverage, otvalid, (FT_Int)Count );
701
702 OTV_LIMIT_CHECK( Count * 2 );
703
704 otvalid->nesting_level++;
705 func = otvalid->func[otvalid->nesting_level];
706
707 for ( ; Count > 0; Count-- )
708 func( table + FT_NEXT_USHORT( p ), otvalid );
709
710 otvalid->nesting_level--;
711
712 OTV_EXIT;
713 }
signed int FT_Int
Definition: fttypes.h:220
GLenum func
Definition: glext.h:6028
int Count
Definition: noreturn.cpp:7
otv_Coverage_validate(FT_Bytes table, OTV_Validator otvalid, FT_Int expected_count)
Definition: otvcommn.c:41
#define OTV_ENTER
Definition: otvcommn.h:226

◆ otv_u_O_O_O_O_x_Onx()

otv_u_O_O_O_O_x_Onx ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 934 of file otvcommn.c.

936 {
937 FT_Bytes p = table;
938 FT_UInt Coverage;
939 FT_UInt BacktrackClassDef, InputClassDef, LookaheadClassDef;
940 FT_UInt ChainClassSetCount;
942
943
944 OTV_ENTER;
945
946 p += 2; /* skip Format */
947
948 OTV_LIMIT_CHECK( 10 );
949 Coverage = FT_NEXT_USHORT( p );
950 BacktrackClassDef = FT_NEXT_USHORT( p );
951 InputClassDef = FT_NEXT_USHORT( p );
952 LookaheadClassDef = FT_NEXT_USHORT( p );
953 ChainClassSetCount = FT_NEXT_USHORT( p );
954
955 OTV_TRACE(( " (ChainClassSetCount = %d)\n", ChainClassSetCount ));
956
957 otv_Coverage_validate( table + Coverage, otvalid, -1 );
958
959 otv_ClassDef_validate( table + BacktrackClassDef, otvalid );
960 otv_ClassDef_validate( table + InputClassDef, otvalid );
961 otv_ClassDef_validate( table + LookaheadClassDef, otvalid );
962
963 OTV_LIMIT_CHECK( ChainClassSetCount * 2 );
964
965 otvalid->nesting_level++;
966 func = otvalid->func[otvalid->nesting_level];
967 otvalid->extra1 = otvalid->lookup_count;
968
969 for ( ; ChainClassSetCount > 0; ChainClassSetCount-- )
970 {
972
973
974 if ( offset )
975 func( table + offset, otvalid );
976 }
977
978 otvalid->nesting_level--;
979
980 OTV_EXIT;
981 }
GLintptr offset
Definition: glext.h:5920
otv_ClassDef_validate(FT_Bytes table, OTV_Validator otvalid)
Definition: otvcommn.c:221

◆ otv_u_O_O_x_Onx()

otv_u_O_O_x_Onx ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 849 of file otvcommn.c.

851 {
852 FT_Bytes p = table;
853 FT_UInt Coverage, ClassDef, ClassSetCount;
855
856
857 OTV_ENTER;
858
859 p += 2; /* skip Format */
860
861 OTV_LIMIT_CHECK( 6 );
862 Coverage = FT_NEXT_USHORT( p );
863 ClassDef = FT_NEXT_USHORT( p );
864 ClassSetCount = FT_NEXT_USHORT( p );
865
866 OTV_TRACE(( " (ClassSetCount = %d)\n", ClassSetCount ));
867
868 otv_Coverage_validate( table + Coverage, otvalid, -1 );
869 otv_ClassDef_validate( table + ClassDef, otvalid );
870
871 OTV_LIMIT_CHECK( ClassSetCount * 2 );
872
873 otvalid->nesting_level++;
874 func = otvalid->func[otvalid->nesting_level];
875 otvalid->extra1 = otvalid->lookup_count;
876
877 for ( ; ClassSetCount > 0; ClassSetCount-- )
878 {
880
881
882 if ( offset )
883 func( table + offset, otvalid );
884 }
885
886 otvalid->nesting_level--;
887
888 OTV_EXIT;
889 }

◆ otv_u_x_Ox_y_Oy_z_Oz_p_sp()

otv_u_x_Ox_y_Oy_z_Oz_p_sp ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 987 of file otvcommn.c.

989 {
990 FT_Bytes p = table;
991 FT_UInt BacktrackGlyphCount, InputGlyphCount, LookaheadGlyphCount;
992 FT_UInt count1, count2;
993
994
995 OTV_ENTER;
996
997 p += 2; /* skip Format */
998
999 OTV_LIMIT_CHECK( 2 );
1000 BacktrackGlyphCount = FT_NEXT_USHORT( p );
1001
1002 OTV_TRACE(( " (BacktrackGlyphCount = %d)\n", BacktrackGlyphCount ));
1003
1004 OTV_LIMIT_CHECK( BacktrackGlyphCount * 2 + 2 );
1005
1006 for ( ; BacktrackGlyphCount > 0; BacktrackGlyphCount-- )
1007 otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );
1008
1009 InputGlyphCount = FT_NEXT_USHORT( p );
1010
1011 OTV_TRACE(( " (InputGlyphCount = %d)\n", InputGlyphCount ));
1012
1013 OTV_LIMIT_CHECK( InputGlyphCount * 2 + 2 );
1014
1015 for ( count1 = InputGlyphCount; count1 > 0; count1-- )
1016 otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );
1017
1018 LookaheadGlyphCount = FT_NEXT_USHORT( p );
1019
1020 OTV_TRACE(( " (LookaheadGlyphCount = %d)\n", LookaheadGlyphCount ));
1021
1022 OTV_LIMIT_CHECK( LookaheadGlyphCount * 2 + 2 );
1023
1024 for ( ; LookaheadGlyphCount > 0; LookaheadGlyphCount-- )
1025 otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );
1026
1027 count2 = FT_NEXT_USHORT( p );
1028
1029 OTV_TRACE(( " (Count = %d)\n", count2 ));
1030
1031 OTV_LIMIT_CHECK( count2 * 4 );
1032
1033 for ( ; count2 > 0; count2-- )
1034 {
1035 if ( FT_NEXT_USHORT( p ) >= InputGlyphCount )
1037
1038 if ( FT_NEXT_USHORT( p ) >= otvalid->lookup_count )
1040 }
1041
1042 OTV_EXIT;
1043 }

◆ otv_u_x_y_Ox_sy()

otv_u_x_y_Ox_sy ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 895 of file otvcommn.c.

897 {
898 FT_Bytes p = table;
899 FT_UInt GlyphCount, Count, count1;
900
901
902 OTV_ENTER;
903
904 p += 2; /* skip Format */
905
906 OTV_LIMIT_CHECK( 4 );
907 GlyphCount = FT_NEXT_USHORT( p );
909
910 OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));
911 OTV_TRACE(( " (Count = %d)\n", Count ));
912
913 OTV_LIMIT_CHECK( GlyphCount * 2 + Count * 4 );
914
915 for ( count1 = GlyphCount; count1 > 0; count1-- )
916 otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );
917
918 for ( ; Count > 0; Count-- )
919 {
920 if ( FT_NEXT_USHORT( p ) >= GlyphCount )
922
923 if ( FT_NEXT_USHORT( p ) >= otvalid->lookup_count )
925 }
926
927 OTV_EXIT;
928 }

◆ otv_x_Ox()

otv_x_Ox ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 652 of file otvcommn.c.

654 {
655 FT_Bytes p = table;
658
659
660 OTV_ENTER;
661
662 OTV_LIMIT_CHECK( 2 );
664
665 OTV_TRACE(( " (Count = %d)\n", Count ));
666
667 OTV_LIMIT_CHECK( Count * 2 );
668
669 otvalid->nesting_level++;
670 func = otvalid->func[otvalid->nesting_level];
671
672 for ( ; Count > 0; Count-- )
673 func( table + FT_NEXT_USHORT( p ), otvalid );
674
675 otvalid->nesting_level--;
676
677 OTV_EXIT;
678 }

◆ otv_x_ux()

otv_x_ux ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 719 of file otvcommn.c.

721 {
722 FT_Bytes p = table;
724
725
726 OTV_ENTER;
727
728 OTV_LIMIT_CHECK( 2 );
730
731 OTV_TRACE(( " (Count = %d)\n", Count ));
732
733 OTV_LIMIT_CHECK( Count * 2 );
734
735 if ( otvalid->extra1 )
736 {
737 for ( ; Count > 0; Count-- )
738 if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 )
740 }
741
742 OTV_EXIT;
743 }

Referenced by otv_JstfPriority_validate().

◆ otv_x_ux_y_uy_z_uz_p_sp()

otv_x_ux_y_uy_z_uz_p_sp ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 793 of file otvcommn.c.

795 {
796 FT_Bytes p = table;
797 FT_UInt BacktrackCount, InputCount, LookaheadCount;
799
800
801 OTV_ENTER;
802
803 OTV_LIMIT_CHECK( 2 );
804 BacktrackCount = FT_NEXT_USHORT( p );
805
806 OTV_TRACE(( " (BacktrackCount = %d)\n", BacktrackCount ));
807
808 OTV_LIMIT_CHECK( BacktrackCount * 2 + 2 );
809 p += BacktrackCount * 2;
810
811 InputCount = FT_NEXT_USHORT( p );
812 if ( InputCount == 0 )
814
815 OTV_TRACE(( " (InputCount = %d)\n", InputCount ));
816
817 OTV_LIMIT_CHECK( InputCount * 2 );
818 p += ( InputCount - 1 ) * 2;
819
820 LookaheadCount = FT_NEXT_USHORT( p );
821
822 OTV_TRACE(( " (LookaheadCount = %d)\n", LookaheadCount ));
823
824 OTV_LIMIT_CHECK( LookaheadCount * 2 + 2 );
825 p += LookaheadCount * 2;
826
828
829 OTV_TRACE(( " (Count = %d)\n", Count ));
830
831 OTV_LIMIT_CHECK( Count * 4 );
832
833 for ( ; Count > 0; Count-- )
834 {
835 if ( FT_NEXT_USHORT( p ) >= InputCount )
837
838 if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 )
840 }
841
842 OTV_EXIT;
843 }

◆ otv_x_y_ux_sy()

otv_x_y_ux_sy ( FT_Bytes  table,
OTV_Validator  otvalid 
)

Definition at line 752 of file otvcommn.c.

754 {
755 FT_Bytes p = table;
756 FT_UInt Count1, Count2;
757
758
759 OTV_ENTER;
760
761 OTV_LIMIT_CHECK( 4 );
762 Count1 = FT_NEXT_USHORT( p );
763 Count2 = FT_NEXT_USHORT( p );
764
765 OTV_TRACE(( " (Count1 = %d)\n", Count1 ));
766 OTV_TRACE(( " (Count2 = %d)\n", Count2 ));
767
768 if ( Count1 == 0 )
770
771 OTV_LIMIT_CHECK( ( Count1 - 1 ) * 2 + Count2 * 4 );
772 p += ( Count1 - 1 ) * 2;
773
774 for ( ; Count2 > 0; Count2-- )
775 {
776 if ( FT_NEXT_USHORT( p ) >= Count1 )
778
779 if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 )
781 }
782
783 OTV_EXIT;
784 }