|
|
|
@ -94,7 +94,7 @@ |
|
|
|
|
if ( j == nmemb ) |
|
|
|
|
FT_INVALID_OFFSET; |
|
|
|
|
|
|
|
|
|
*(length[i]) = (FT_UShort)(buff[j + 1] - buff[j]); |
|
|
|
|
*(length[i]) = (FT_UShort)( buff[j + 1] - buff[j] ); |
|
|
|
|
|
|
|
|
|
if ( 0 != offset[i] && 0 == *(length[i]) ) |
|
|
|
|
FT_INVALID_OFFSET; |
|
|
|
@ -226,8 +226,8 @@ |
|
|
|
|
GXV_LIMIT_CHECK( 2 ); |
|
|
|
|
val = FT_NEXT_USHORT( p ); |
|
|
|
|
|
|
|
|
|
*min = (FT_Byte) FT_MIN( *min, val ); |
|
|
|
|
*max = (FT_Byte) FT_MAX( *max, val ); |
|
|
|
|
*min = (FT_Byte)FT_MIN( *min, val ); |
|
|
|
|
*max = (FT_Byte)FT_MAX( *max, val ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
valid->subtable_length = p - table; |
|
|
|
@ -629,7 +629,7 @@ |
|
|
|
|
|
|
|
|
|
for ( gid = firstGlyph; gid <= lastGlyph; gid++ ) |
|
|
|
|
{ |
|
|
|
|
value = valid->lookupfmt4_trans( (FT_UShort)(gid - firstGlyph), |
|
|
|
|
value = valid->lookupfmt4_trans( (FT_UShort)( gid - firstGlyph ), |
|
|
|
|
base_value, |
|
|
|
|
limit, |
|
|
|
|
valid ); |
|
|
|
@ -742,14 +742,14 @@ |
|
|
|
|
glyphCount = FT_NEXT_USHORT( p ); |
|
|
|
|
|
|
|
|
|
gxv_glyphid_validate( firstGlyph, valid ); |
|
|
|
|
gxv_glyphid_validate( (FT_UShort)(firstGlyph + glyphCount), valid ); |
|
|
|
|
gxv_glyphid_validate( (FT_UShort)( firstGlyph + glyphCount ), valid ); |
|
|
|
|
|
|
|
|
|
/* valueArray */ |
|
|
|
|
for ( i = 0; i < glyphCount; i++ ) |
|
|
|
|
{ |
|
|
|
|
GXV_LIMIT_CHECK( 2 ); |
|
|
|
|
value = GXV_LOOKUP_VALUE_LOAD( p, valid->lookupval_sign ); |
|
|
|
|
valid->lookupval_func( (FT_UShort)(firstGlyph + i), value, valid ); |
|
|
|
|
valid->lookupval_func( (FT_UShort)( firstGlyph + i ), value, valid ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
valid->subtable_length = p - table; |
|
|
|
@ -915,7 +915,7 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
GXV_TRACE(( " nameIndex = %d (UNTITLED)\n", name_index )); |
|
|
|
|
FT_INVALID_DATA; |
|
|
|
|
FT_INVALID_DATA; |
|
|
|
|
goto Exit; /* make compiler happy */ |
|
|
|
|
|
|
|
|
|
Out: |
|
|
|
@ -972,7 +972,7 @@ |
|
|
|
|
if ( !nGlyphs ) |
|
|
|
|
goto Out; |
|
|
|
|
|
|
|
|
|
gxv_glyphid_validate( (FT_UShort)(firstGlyph + nGlyphs), valid ); |
|
|
|
|
gxv_glyphid_validate( (FT_UShort)( firstGlyph + nGlyphs ), valid ); |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
FT_Byte nGlyphInClass[256]; |
|
|
|
@ -1005,12 +1005,12 @@ |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
*length_p = (FT_UShort)(p - table); |
|
|
|
|
*length_p = (FT_UShort)( p - table ); |
|
|
|
|
|
|
|
|
|
/* scan max ClassID in use */ |
|
|
|
|
for ( i = 0; i < stateSize; i++ ) |
|
|
|
|
if ( ( 3 < i ) && ( nGlyphInClass[i] > 0 ) ) |
|
|
|
|
*maxClassID_p = (FT_Byte)i; /* XXX: Check Range ? */ |
|
|
|
|
*maxClassID_p = (FT_Byte)i; /* XXX: Check Range? */ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Out: |
|
|
|
@ -1036,14 +1036,14 @@ |
|
|
|
|
FT_Byte clazz; |
|
|
|
|
FT_Byte entry; |
|
|
|
|
|
|
|
|
|
FT_UNUSED( stateSize ); /* for the non-debugging case */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GXV_NAME_ENTER( "StateArray" ); |
|
|
|
|
|
|
|
|
|
GXV_TRACE(( "parse %d bytes by stateSize=%d maxClassID=%d\n", |
|
|
|
|
(int)(*length_p), stateSize, (int)(maxClassID) )); |
|
|
|
|
|
|
|
|
|
FT_UNUSED( stateSize ); |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 2 states are predefined and must be described in StateArray: |
|
|
|
|
* state 0 (start of text), 1 (start of line) |
|
|
|
@ -1060,13 +1060,13 @@ |
|
|
|
|
for ( clazz = 0; clazz <= maxClassID; clazz++ ) |
|
|
|
|
{ |
|
|
|
|
entry = FT_NEXT_BYTE( p ); |
|
|
|
|
*maxEntry_p = (FT_Byte) FT_MAX( *maxEntry_p, entry ); |
|
|
|
|
*maxEntry_p = (FT_Byte)FT_MAX( *maxEntry_p, entry ); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
GXV_TRACE(( "parsed: maxState=%d, maxEntry=%d\n", |
|
|
|
|
*maxState_p, *maxEntry_p )); |
|
|
|
|
|
|
|
|
|
*length_p = (FT_UShort)(p - table); |
|
|
|
|
*length_p = (FT_UShort)( p - table ); |
|
|
|
|
|
|
|
|
|
GXV_EXIT; |
|
|
|
|
} |
|
|
|
@ -1104,7 +1104,7 @@ |
|
|
|
|
FT_INVALID_TOO_SHORT; |
|
|
|
|
|
|
|
|
|
/* ftxvalidator and FontValidator both warn and continue */ |
|
|
|
|
maxEntry = (FT_Byte)(*length_p / entrySize - 1); |
|
|
|
|
maxEntry = (FT_Byte)( *length_p / entrySize - 1 ); |
|
|
|
|
GXV_TRACE(( "too large maxEntry, shrinking to %d fit EntryTable length\n", |
|
|
|
|
maxEntry )); |
|
|
|
|
} |
|
|
|
@ -1139,12 +1139,12 @@ |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
state = (FT_Byte)(( newState - stateArray ) / ( 1 + maxClassID )); |
|
|
|
|
state = (FT_Byte)( ( newState - stateArray ) / ( 1 + maxClassID ) ); |
|
|
|
|
|
|
|
|
|
switch ( GXV_GLYPHOFFSET_FMT( statetable ) ) |
|
|
|
|
{ |
|
|
|
|
case GXV_GLYPHOFFSET_NONE: |
|
|
|
|
glyphOffset.uc = 0; /* make compiler happy !! */ |
|
|
|
|
glyphOffset.uc = 0; /* make compiler happy */ |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case GXV_GLYPHOFFSET_UCHAR: |
|
|
|
@ -1174,7 +1174,6 @@ |
|
|
|
|
default: |
|
|
|
|
if ( valid->root->level >= FT_VALIDATE_PARANOID ) |
|
|
|
|
FT_INVALID_FORMAT; |
|
|
|
|
|
|
|
|
|
goto Exit; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1186,8 +1185,9 @@ |
|
|
|
|
statetable_limit, |
|
|
|
|
valid ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Exit: |
|
|
|
|
*length_p = (FT_UShort)(p - table); |
|
|
|
|
*length_p = (FT_UShort)( p - table ); |
|
|
|
|
|
|
|
|
|
GXV_EXIT; |
|
|
|
|
} |
|
|
|
@ -1269,7 +1269,7 @@ |
|
|
|
|
else |
|
|
|
|
setup_func = gxv_StateTable_subtable_setup; |
|
|
|
|
|
|
|
|
|
setup_func( (FT_UShort)(limit - table), |
|
|
|
|
setup_func( (FT_UShort)( limit - table ), |
|
|
|
|
classTable, |
|
|
|
|
stateArray, |
|
|
|
|
entryTable, |
|
|
|
@ -1287,7 +1287,7 @@ |
|
|
|
|
&maxClassID, |
|
|
|
|
valid ); |
|
|
|
|
else |
|
|
|
|
maxClassID = (FT_Byte)(stateSize - 1); |
|
|
|
|
maxClassID = (FT_Byte)( stateSize - 1 ); |
|
|
|
|
|
|
|
|
|
if ( stateArray != 0 ) |
|
|
|
|
gxv_StateArray_validate( table + stateArray, |
|
|
|
@ -1400,8 +1400,9 @@ |
|
|
|
|
FT_UShort offset; |
|
|
|
|
GXV_LookupValueDesc value; |
|
|
|
|
|
|
|
|
|
/* XXX: check range ? */ |
|
|
|
|
offset = (FT_UShort)(base_value.u + relative_gindex * sizeof ( FT_UShort )); |
|
|
|
|
/* XXX: check range? */ |
|
|
|
|
offset = (FT_UShort)( base_value.u + |
|
|
|
|
relative_gindex * sizeof ( FT_UShort ) ); |
|
|
|
|
|
|
|
|
|
p = valid->lookuptbl_head + offset; |
|
|
|
|
limit = lookuptbl_limit; |
|
|
|
@ -1427,14 +1428,14 @@ |
|
|
|
|
FT_UShort clazz; |
|
|
|
|
FT_UShort entry; |
|
|
|
|
|
|
|
|
|
FT_UNUSED( stateSize ); /* for the non-debugging case */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GXV_NAME_ENTER( "XStateArray" ); |
|
|
|
|
|
|
|
|
|
GXV_TRACE(( "parse % 3d bytes by stateSize=% 3d maxClassID=% 3d\n", |
|
|
|
|
(int)(*length_p), stateSize, (int)(maxClassID) )); |
|
|
|
|
|
|
|
|
|
FT_UNUSED( stateSize ); |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 2 states are predefined and must be described: |
|
|
|
|
* state 0 (start of text), 1 (start of line) |
|
|
|
@ -1451,7 +1452,7 @@ |
|
|
|
|
for ( clazz = 0; clazz <= maxClassID; clazz++ ) |
|
|
|
|
{ |
|
|
|
|
entry = FT_NEXT_USHORT( p ); |
|
|
|
|
*maxEntry_p = (FT_UShort) FT_MAX( *maxEntry_p, entry ); |
|
|
|
|
*maxEntry_p = (FT_UShort)FT_MAX( *maxEntry_p, entry ); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
GXV_TRACE(( "parsed: maxState=%d, maxEntry=%d\n", |
|
|
|
@ -1505,7 +1506,7 @@ |
|
|
|
|
FT_INVALID_OFFSET; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
state = (FT_UShort)(newState_idx / ( 1 + maxClassID )); |
|
|
|
|
state = (FT_UShort)( newState_idx / ( 1 + maxClassID ) ); |
|
|
|
|
if ( 0 != ( newState_idx % ( 1 + maxClassID ) ) ) |
|
|
|
|
{ |
|
|
|
|
FT_TRACE4(( "-> new state = %d (supposed)\n" |
|
|
|
@ -1639,9 +1640,9 @@ |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
/* XXX: check range ? */ |
|
|
|
|
/* XXX: check range? */ |
|
|
|
|
valid->xstatetable.maxClassID = |
|
|
|
|
(FT_UShort)(valid->xstatetable.nClasses - 1); |
|
|
|
|
(FT_UShort)( valid->xstatetable.nClasses - 1 ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ( stateArray != 0 ) |
|
|
|
|