Merge pull request #502 from grissiom/fix-freetype

Fix freetype
This commit is contained in:
Bernard Xiong
2015-06-12 15:17:13 +08:00
66 changed files with 1356 additions and 1295 deletions
@@ -895,7 +895,7 @@ rt_uint32_t gb2312tounicode(const rt_uint16_t key)
if (key < 0x80)
return key;
if (key < 0xA1A1)
return -1;
return (rt_uint32_t)-1;
sec = (lc >> 8) - 0xA0;
@@ -911,11 +911,11 @@ rt_uint32_t gb2312tounicode(const rt_uint16_t key)
return gb2312uni_table[key - ps->range[i].start + ps->range[i].offset];
}
}
return -1;
return (rt_uint32_t)-1;
}
else if (sec < 16) /* No code in section 10~15. */
{
return -1;
return (rt_uint32_t)-1;
}
else if (sec < 88) /* Section 16~87. */
{
@@ -926,7 +926,7 @@ rt_uint32_t gb2312tounicode(const rt_uint16_t key)
{
/* Section 55 only have chars up to 0xD7F9. */
if (sec == 55 && key > 0xD7F9)
return -1;
return (rt_uint32_t)-1;
/* There are 682 chars before section 16 in GB2312(not GBK). And all
* these sections are full(no wholes). */
code += 682;
@@ -941,6 +941,6 @@ rt_uint32_t gb2312tounicode(const rt_uint16_t key)
}
else
{
return -1;
return (rt_uint32_t)-1;
}
}
+11 -13
View File
@@ -4,7 +4,7 @@
/* */
/* FreeType validation support (specification). */
/* */
/* Copyright 2004, 2013 by */
/* Copyright 2004, 2013, 2014 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -87,13 +87,13 @@ FT_BEGIN_HEADER
/* validator structure */
typedef struct FT_ValidatorRec_
{
ft_jmp_buf jump_buffer; /* used for exception handling */
const FT_Byte* base; /* address of table in memory */
const FT_Byte* limit; /* `base' + sizeof(table) in memory */
FT_ValidationLevel level; /* validation level */
FT_Error error; /* error returned. 0 means success */
ft_jmp_buf jump_buffer; /* used for exception handling */
} FT_ValidatorRec;
#if defined( _MSC_VER )
@@ -126,31 +126,29 @@ FT_BEGIN_HEADER
/* Calls ft_validate_error. Assumes that the `valid' local variable */
/* holds a pointer to the current validator object. */
/* */
/* Use preprocessor prescan to pass FT_ERR_PREFIX. */
/* */
#define FT_INVALID( _prefix, _error ) FT_INVALID_( _prefix, _error )
#define FT_INVALID_( _prefix, _error ) \
ft_validator_error( valid, _prefix ## _error )
#define FT_INVALID( _error ) FT_INVALID_( _error )
#define FT_INVALID_( _error ) \
ft_validator_error( valid, FT_THROW( _error ) )
/* called when a broken table is detected */
#define FT_INVALID_TOO_SHORT \
FT_INVALID( FT_ERR_PREFIX, Invalid_Table )
FT_INVALID( Invalid_Table )
/* called when an invalid offset is detected */
#define FT_INVALID_OFFSET \
FT_INVALID( FT_ERR_PREFIX, Invalid_Offset )
FT_INVALID( Invalid_Offset )
/* called when an invalid format/value is detected */
#define FT_INVALID_FORMAT \
FT_INVALID( FT_ERR_PREFIX, Invalid_Table )
FT_INVALID( Invalid_Table )
/* called when an invalid glyph index is detected */
#define FT_INVALID_GLYPH_ID \
FT_INVALID( FT_ERR_PREFIX, Invalid_Glyph_Index )
FT_INVALID( Invalid_Glyph_Index )
/* called when an invalid field value is detected */
#define FT_INVALID_DATA \
FT_INVALID( FT_ERR_PREFIX, Invalid_Table )
FT_INVALID( Invalid_Table )
FT_END_HEADER
+1 -1
View File
@@ -226,7 +226,7 @@
af_get_interface( FT_Module module,
const char* module_interface )
{
/* AF_SERVICES_GET derefers `library' in PIC mode */
/* AF_SERVICES_GET dereferences `library' in PIC mode */
#ifdef FT_CONFIG_OPTION_PIC
FT_Library library;
+19 -15
View File
@@ -42,22 +42,22 @@
} TBBox_Rec;
#define FT_UPDATE_BBOX(p, bbox) \
FT_BEGIN_STMNT \
if ( p->x < bbox.xMin ) \
bbox.xMin = p->x; \
if ( p->x > bbox.xMax ) \
bbox.xMax = p->x; \
if ( p->y < bbox.yMin ) \
bbox.yMin = p->y; \
if ( p->y > bbox.yMax ) \
bbox.yMax = p->y; \
#define FT_UPDATE_BBOX( p, bbox ) \
FT_BEGIN_STMNT \
if ( p->x < bbox.xMin ) \
bbox.xMin = p->x; \
if ( p->x > bbox.xMax ) \
bbox.xMax = p->x; \
if ( p->y < bbox.yMin ) \
bbox.yMin = p->y; \
if ( p->y > bbox.yMax ) \
bbox.yMax = p->y; \
FT_END_STMNT
#define CHECK_X( p, bbox ) \
#define CHECK_X( p, bbox ) \
( p->x < bbox.xMin || p->x > bbox.xMax )
#define CHECK_Y( p, bbox ) \
#define CHECK_Y( p, bbox ) \
( p->y < bbox.yMin || p->y > bbox.yMax )
@@ -419,7 +419,8 @@
return 0;
}
FT_DEFINE_OUTLINE_FUNCS(bbox_interface,
FT_DEFINE_OUTLINE_FUNCS(bbox_interface,
(FT_Outline_MoveTo_Func) BBox_Move_To,
(FT_Outline_LineTo_Func) BBox_Line_To,
(FT_Outline_ConicTo_Func)BBox_Conic_To,
@@ -427,14 +428,17 @@ FT_DEFINE_OUTLINE_FUNCS(bbox_interface,
0, 0
)
/* documentation is in ftbbox.h */
FT_EXPORT_DEF( FT_Error )
FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox *abbox )
{
FT_BBox cbox = { 0x7FFFFFFF, 0x7FFFFFFF, -0x7FFFFFFF, -0x7FFFFFFF };
FT_BBox bbox = { 0x7FFFFFFF, 0x7FFFFFFF, -0x7FFFFFFF, -0x7FFFFFFF };
FT_BBox cbox = { 0x7FFFFFFFL, 0x7FFFFFFFL,
-0x7FFFFFFFL, -0x7FFFFFFFL };
FT_BBox bbox = { 0x7FFFFFFFL, 0x7FFFFFFFL,
-0x7FFFFFFFL, -0x7FFFFFFFL };
FT_Vector* vec;
FT_UShort n;
+1 -1
View File
@@ -363,7 +363,7 @@
p[x] |= p[x - 1] << ( 8 - i );
#if 0
if ( p[x] == 0xff )
if ( p[x] == 0xFF )
break;
#endif
}
+21 -20
View File
@@ -86,8 +86,8 @@
FT_EXPORT_DEF( FT_Fixed )
FT_RoundFix( FT_Fixed a )
{
return ( a >= 0 ) ? ( a + 0x8000L ) & ~0xFFFFL
: -((-a + 0x8000L ) & ~0xFFFFL );
return a >= 0 ? ( a + 0x8000L ) & ~0xFFFFL
: -((-a + 0x8000L ) & ~0xFFFFL );
}
@@ -96,8 +96,8 @@
FT_EXPORT_DEF( FT_Fixed )
FT_CeilFix( FT_Fixed a )
{
return ( a >= 0 ) ? ( a + 0xFFFFL ) & ~0xFFFFL
: -((-a + 0xFFFFL ) & ~0xFFFFL );
return a >= 0 ? ( a + 0xFFFFL ) & ~0xFFFFL
: -((-a + 0xFFFFL ) & ~0xFFFFL );
}
@@ -106,8 +106,8 @@
FT_EXPORT_DEF( FT_Fixed )
FT_FloorFix( FT_Fixed a )
{
return ( a >= 0 ) ? a & ~0xFFFFL
: -((-a) & ~0xFFFFL );
return a >= 0 ? a & ~0xFFFFL
: -((-a) & ~0xFFFFL );
}
#ifndef FT_MSB
@@ -115,30 +115,31 @@
FT_BASE_DEF ( FT_Int )
FT_MSB( FT_UInt32 z )
{
FT_Int shift = 0;
FT_Int shift = 0;
/* determine msb bit index in `shift' */
if ( z & 0xFFFF0000U )
if ( z & 0xFFFF0000UL )
{
z >>= 16;
shift += 16;
}
if ( z & 0x0000FF00U )
if ( z & 0x0000FF00UL )
{
z >>= 8;
shift += 8;
}
if ( z & 0x000000F0U )
if ( z & 0x000000F0UL )
{
z >>= 4;
shift += 4;
}
if ( z & 0x0000000CU )
if ( z & 0x0000000CUL )
{
z >>= 2;
shift += 2;
}
if ( z & 0x00000002U )
if ( z & 0x00000002UL )
{
/* z >>= 1; */
shift += 1;
@@ -187,7 +188,7 @@
d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c
: 0x7FFFFFFFL );
return ( s > 0 ) ? d : -d;
return s < 0 ? -d : d;
}
@@ -209,7 +210,7 @@
d = (FT_Long)( c > 0 ? (FT_Int64)a * b / c
: 0x7FFFFFFFL );
return ( s > 0 ) ? d : -d;
return s < 0 ? -d : d;
}
@@ -234,7 +235,7 @@
c = (FT_Long)( ( (FT_Int64)a * b + 0x8000L ) >> 16 );
return ( s > 0 ) ? c : -c;
return s < 0 ? -c : c;
#endif /* FT_MULFIX_ASSEMBLER */
}
@@ -256,7 +257,7 @@
q = (FT_Long)( b > 0 ? ( ( (FT_UInt64)a << 16 ) + ( b >> 1 ) ) / b
: 0x7FFFFFFFL );
return ( s < 0 ? -q : q );
return s < 0 ? -q : q;
}
@@ -438,7 +439,7 @@
: ft_div64by32( temp.hi, temp.lo, c );
}
return ( s < 0 ? -a : a );
return s < 0 ? -a : a;
}
@@ -475,7 +476,7 @@
: ft_div64by32( temp.hi, temp.lo, c );
}
return ( s < 0 ? -a : a );
return s < 0 ? -a : a;
}
@@ -573,7 +574,7 @@
( ( al * ( ub & 0xFFFFUL ) + 0x8000UL ) >> 16 );
}
return ( s < 0 ? -(FT_Long)ua : (FT_Long)ua );
return s < 0 ? -(FT_Long)ua : (FT_Long)ua;
#endif /* 0 */
@@ -620,7 +621,7 @@
q = (FT_Long)ft_div64by32( temp.hi, temp.lo, b );
}
return ( s < 0 ? -q : q );
return s < 0 ? -q : q;
}
+5 -3
View File
@@ -1910,7 +1910,7 @@
rlen = ( header[0x57] << 24 ) |
( header[0x58] << 16 ) |
( header[0x59] << 8 ) |
header[0x5a];
header[0x5A];
#endif /* 0 */
offset = 128 + ( ( dlen + 127 ) & ~127 );
@@ -3648,8 +3648,10 @@
/* clean up buffer */
((FT_Byte*)buffer)[0] = '\0';
if ( (FT_Long)glyph_index > face->num_glyphs ||
!FT_HAS_GLYPH_NAMES( face ) )
if ( (FT_Long)glyph_index >= face->num_glyphs )
return FT_THROW( Invalid_Glyph_Index );
if ( !FT_HAS_GLYPH_NAMES( face ) )
return FT_THROW( Invalid_Argument );
FT_FACE_LOOKUP_SERVICE( face, service, GLYPH_DICT );
+4 -4
View File
@@ -182,10 +182,10 @@
return error;
FT_TRACE2(( "Resource tags: %c%c%c%c\n",
(char)( 0xff & ( tag_internal >> 24 ) ),
(char)( 0xff & ( tag_internal >> 16 ) ),
(char)( 0xff & ( tag_internal >> 8 ) ),
(char)( 0xff & ( tag_internal >> 0 ) ) ));
(char)( 0xFF & ( tag_internal >> 24 ) ),
(char)( 0xFF & ( tag_internal >> 16 ) ),
(char)( 0xFF & ( tag_internal >> 8 ) ),
(char)( 0xFF & ( tag_internal >> 0 ) ) ));
FT_TRACE3(( " : subcount=%d, suboffset=0x%04x\n",
subcnt, rpos ));
+2 -2
View File
@@ -834,8 +834,8 @@
stroker->miter_limit = miter_limit;
/* ensure miter limit has sensible value */
if ( stroker->miter_limit < 0x10000 )
stroker->miter_limit = 0x10000;
if ( stroker->miter_limit < 0x10000L )
stroker->miter_limit = 0x10000L;
/* save line join style: */
/* line join style can be temporarily changed when stroking curves */
+6 -6
View File
@@ -73,7 +73,7 @@
/* and CORDIC hypotenuse, so it minimizes the error */
val = (FT_Fixed)( ( (FT_Int64)val * FT_TRIG_SCALE + 0x40000000UL ) >> 32 );
return ( s >= 0 ) ? val : -val;
return s < 0 ? -val : val;
}
#else /* !FT_LONG64 */
@@ -117,12 +117,12 @@
/* and CORDIC hypotenuse, so it minimizes the error */
/* Check carry overflow of lo + 0x40000000 */
lo += 0x40000000U;
hi += ( lo < 0x40000000U );
lo += 0x40000000UL;
hi += ( lo < 0x40000000UL );
val = (FT_Fixed)hi;
return ( s >= 0 ) ? val : -val;
return s < 0 ? -val : val;
}
#endif /* !FT_LONG64 */
@@ -480,8 +480,8 @@
v.x = ft_trig_downscale( v.x );
*length = ( shift >= 0 ) ? ( v.x >> shift )
: (FT_Fixed)( (FT_UInt32)v.x << -shift );
*length = shift >= 0 ? ( v.x >> shift )
: (FT_Fixed)( (FT_UInt32)v.x << -shift );
*angle = v.y;
}
+8 -8
View File
@@ -781,8 +781,8 @@
hold = buf[end];
buf[end] = 0;
/* XXX: Use encoding independent value for 0x1a */
if ( buf[start] != '#' && buf[start] != 0x1a && end > start )
/* XXX: Use encoding independent value for 0x1A */
if ( buf[start] != '#' && buf[start] != 0x1A && end > start )
{
error = (*cb)( buf + start, (unsigned long)( end - start ), lineno,
(void*)&cb, client_data );
@@ -823,17 +823,17 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
static const unsigned char odigits[32] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -841,7 +841,7 @@
static const unsigned char ddigits[32] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -849,8 +849,8 @@
static const unsigned char hdigits[32] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03,
0x7e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03,
0x7E, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
+1 -1
View File
@@ -131,7 +131,7 @@
/* head[0] && head[1] are the magic numbers; */
/* head[2] is the version, and head[3] the blocksize */
if ( head[0] != 0x42 ||
head[1] != 0x5a ||
head[1] != 0x5A ||
head[2] != 0x68 ) /* only support bzip2 (huffman) */
{
error = FT_THROW( Invalid_File_Format );
+2 -2
View File
@@ -150,8 +150,8 @@
/* logarithms; remembering that the 16 lowest bits of the fraction */
/* are dropped this is correct to within a factor of almost 4. */
/* For example, 0x80.0000 * 0x80.0000 = 0x4000.0000 is 23+23 and */
/* is flagged as possible overflow because 0xff.ffff * 0xff.ffff = */
/* 0xffff.fe00 is also 23+23. */
/* is flagged as possible overflow because 0xFF.FFFF * 0xFF.FFFF = */
/* 0xFFFF.FE00 is also 23+23. */
logBase2 = FT_MSB( (FT_UInt32)stemWidthPer1000 ) +
FT_MSB( (FT_UInt32)ppem );
+2 -2
View File
@@ -4,7 +4,7 @@
/* */
/* OpenType font driver implementation (body). */
/* */
/* Copyright 1996-2013 by */
/* Copyright 1996-2014 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -753,7 +753,7 @@
FT_Module_Interface result;
/* CFF_SERVICES_GET derefers `library' in PIC mode */
/* CFF_SERVICES_GET dereferences `library' in PIC mode */
#ifdef FT_CONFIG_OPTION_PIC
if ( !driver )
return NULL;
+1 -1
View File
@@ -188,7 +188,7 @@
}
/* Read fraction part, if any. */
if ( nib == 0xa )
if ( nib == 0xA )
for (;;)
{
/* If we entered this iteration with phase == 4, we need */
+28 -28
View File
@@ -72,10 +72,10 @@
static void
gxv_bsln_LookupValue_validate( FT_UShort glyph,
GXV_LookupValueCPtr value_p,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_UShort v = value_p->u;
FT_UShort* ctlPoints;
FT_UShort v = value_p->u;
FT_UShort* ctlPoints;
FT_UNUSED( glyph );
@@ -124,7 +124,7 @@
gxv_bsln_LookupFmt4_transit( FT_UShort relative_gindex,
GXV_LookupValueCPtr base_value_p,
FT_Bytes lookuptbl_limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p;
FT_Bytes limit;
@@ -135,7 +135,7 @@
offset = (FT_UShort)( base_value_p->u +
( relative_gindex * sizeof ( FT_UShort ) ) );
p = valid->lookuptbl_head + offset;
p = gxvalid->lookuptbl_head + offset;
limit = lookuptbl_limit;
GXV_LIMIT_CHECK( 2 );
@@ -148,7 +148,7 @@
static void
gxv_bsln_parts_fmt0_validate( FT_Bytes tables,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = tables;
@@ -158,7 +158,7 @@
/* deltas */
GXV_LIMIT_CHECK( 2 * GXV_BSLN_VALUE_COUNT );
valid->table_data = NULL; /* No ctlPoints here. */
gxvalid->table_data = NULL; /* No ctlPoints here. */
GXV_EXIT;
}
@@ -167,7 +167,7 @@
static void
gxv_bsln_parts_fmt1_validate( FT_Bytes tables,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = tables;
@@ -175,15 +175,15 @@
GXV_NAME_ENTER( "parts format 1" );
/* deltas */
gxv_bsln_parts_fmt0_validate( p, limit, valid );
gxv_bsln_parts_fmt0_validate( p, limit, gxvalid );
/* mappingData */
valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
valid->lookupval_func = gxv_bsln_LookupValue_validate;
valid->lookupfmt4_trans = gxv_bsln_LookupFmt4_transit;
gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
gxvalid->lookupval_func = gxv_bsln_LookupValue_validate;
gxvalid->lookupfmt4_trans = gxv_bsln_LookupFmt4_transit;
gxv_LookupTable_validate( p + 2 * GXV_BSLN_VALUE_COUNT,
limit,
valid );
gxvalid );
GXV_EXIT;
}
@@ -192,7 +192,7 @@
static void
gxv_bsln_parts_fmt2_validate( FT_Bytes tables,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = tables;
@@ -211,7 +211,7 @@
stdGlyph = FT_NEXT_USHORT( p );
GXV_TRACE(( " (stdGlyph = %u)\n", stdGlyph ));
gxv_glyphid_validate( stdGlyph, valid );
gxv_glyphid_validate( stdGlyph, gxvalid );
/* Record the position of ctlPoints */
GXV_BSLN_DATA( ctlPoints_p ) = p;
@@ -226,7 +226,7 @@
FT_INVALID_DATA;
}
else
gxv_ctlPoint_validate( stdGlyph, (FT_Short)ctlPoint, valid );
gxv_ctlPoint_validate( stdGlyph, (FT_Short)ctlPoint, gxvalid );
}
GXV_EXIT;
@@ -236,7 +236,7 @@
static void
gxv_bsln_parts_fmt3_validate( FT_Bytes tables,
FT_Bytes limit,
GXV_Validator valid)
GXV_Validator gxvalid)
{
FT_Bytes p = tables;
@@ -244,15 +244,15 @@
GXV_NAME_ENTER( "parts format 3" );
/* stdGlyph + ctlPoints */
gxv_bsln_parts_fmt2_validate( p, limit, valid );
gxv_bsln_parts_fmt2_validate( p, limit, gxvalid );
/* mappingData */
valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
valid->lookupval_func = gxv_bsln_LookupValue_validate;
valid->lookupfmt4_trans = gxv_bsln_LookupFmt4_transit;
gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
gxvalid->lookupval_func = gxv_bsln_LookupValue_validate;
gxvalid->lookupfmt4_trans = gxv_bsln_LookupFmt4_transit;
gxv_LookupTable_validate( p + ( 2 + 2 * GXV_BSLN_VALUE_COUNT ),
limit,
valid );
gxvalid );
GXV_EXIT;
}
@@ -271,8 +271,8 @@
FT_Face face,
FT_Validator ftvalid )
{
GXV_ValidatorRec validrec;
GXV_Validator valid = &validrec;
GXV_ValidatorRec gxvalidrec;
GXV_Validator gxvalid = &gxvalidrec;
GXV_bsln_DataRec bslnrec;
GXV_bsln_Data bsln = &bslnrec;
@@ -293,9 +293,9 @@
};
valid->root = ftvalid;
valid->table_data = bsln;
valid->face = face;
gxvalid->root = ftvalid;
gxvalid->table_data = bsln;
gxvalid->face = face;
FT_TRACE3(( "validating `bsln' table\n" ));
GXV_INIT;
@@ -320,7 +320,7 @@
bsln->defaultBaseline = defaultBaseline;
fmt_funcs_table[format]( p, limit, valid );
fmt_funcs_table[format]( p, limit, gxvalid );
FT_TRACE4(( "\n" ));
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+19 -19
View File
@@ -82,7 +82,7 @@
gxv_feat_registry_validate( FT_UShort feature,
FT_UShort nSettings,
FT_Bool exclusive,
GXV_Validator valid )
GXV_Validator gxvalid )
{
GXV_NAME_ENTER( "feature in registry" );
@@ -108,7 +108,7 @@
{
/* Don't use here. Apple is reserved. */
GXV_TRACE(( "feature number %d is reserved by Apple\n", feature ));
if ( valid->root->level >= FT_VALIDATE_TIGHT )
if ( gxvalid->root->level >= FT_VALIDATE_TIGHT )
FT_INVALID_DATA;
}
@@ -117,7 +117,7 @@
GXV_TRACE(( "feature %d: nSettings %d != defined nSettings %d\n",
feature, nSettings,
gxv_feat_registry[feature].nSettings ));
if ( valid->root->level >= FT_VALIDATE_TIGHT )
if ( gxvalid->root->level >= FT_VALIDATE_TIGHT )
FT_INVALID_DATA;
}
@@ -125,7 +125,7 @@
{
GXV_TRACE(( "exclusive flag %d differs from predefined value\n",
exclusive ));
if ( valid->root->level >= FT_VALIDATE_TIGHT )
if ( gxvalid->root->level >= FT_VALIDATE_TIGHT )
FT_INVALID_DATA;
}
@@ -137,7 +137,7 @@
static void
gxv_feat_name_index_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
@@ -153,7 +153,7 @@
gxv_sfntName_validate( (FT_UShort)nameIndex,
255,
32768U,
valid );
gxvalid );
GXV_EXIT;
}
@@ -163,7 +163,7 @@
gxv_feat_setting_validate( FT_Bytes table,
FT_Bytes limit,
FT_Bool exclusive,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
FT_UShort setting;
@@ -179,7 +179,7 @@
if ( exclusive && ( setting & 1 ) == 0 )
FT_INVALID_DATA;
gxv_feat_name_index_validate( p, limit, valid );
gxv_feat_name_index_validate( p, limit, gxvalid );
GXV_FEAT_DATA( setting ) = setting;
@@ -190,7 +190,7 @@
static void
gxv_feat_name_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
FT_UInt reserved_size = GXV_FEAT_DATA( reserved_size );
@@ -240,14 +240,14 @@
FT_INVALID_FORMAT;
}
gxv_feat_registry_validate( feature, nSettings, exclusive, valid );
gxv_feat_registry_validate( feature, nSettings, exclusive, gxvalid );
gxv_feat_name_index_validate( p, limit, valid );
gxv_feat_name_index_validate( p, limit, gxvalid );
p = valid->root->base + settingTable;
p = gxvalid->root->base + settingTable;
for ( last_setting = -1, i = 0; i < nSettings; i++ )
{
gxv_feat_setting_validate( p, limit, exclusive, valid );
gxv_feat_setting_validate( p, limit, exclusive, gxvalid );
if ( (FT_Int)GXV_FEAT_DATA( setting ) <= last_setting )
GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT );
@@ -274,8 +274,8 @@
FT_Face face,
FT_Validator ftvalid )
{
GXV_ValidatorRec validrec;
GXV_Validator valid = &validrec;
GXV_ValidatorRec gxvalidrec;
GXV_Validator gxvalid = &gxvalidrec;
GXV_feat_DataRec featrec;
GXV_feat_Data feat = &featrec;
@@ -289,9 +289,9 @@
FT_Int last_feature;
valid->root = ftvalid;
valid->table_data = feat;
valid->face = face;
gxvalid->root = ftvalid;
gxvalid->table_data = feat;
gxvalid->face = face;
FT_TRACE3(( "validating `feat' table\n" ));
GXV_INIT;
@@ -323,7 +323,7 @@
for ( last_feature = -1, i = 0; i < featureNameCount; i++ )
{
gxv_feat_name_validate( p, limit, valid );
gxv_feat_name_validate( p, limit, gxvalid );
if ( (FT_Int)GXV_FEAT_DATA( feature ) <= last_feature )
GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT );
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+18 -18
View File
@@ -67,14 +67,14 @@
static void
gxv_lcar_partial_validate( FT_UShort partial,
FT_UShort glyph,
GXV_Validator valid )
GXV_Validator gxvalid )
{
GXV_NAME_ENTER( "partial" );
if ( GXV_LCAR_DATA( format ) != 1 )
goto Exit;
gxv_ctlPoint_validate( glyph, partial, valid );
gxv_ctlPoint_validate( glyph, partial, gxvalid );
Exit:
GXV_EXIT;
@@ -84,10 +84,10 @@
static void
gxv_lcar_LookupValue_validate( FT_UShort glyph,
GXV_LookupValueCPtr value_p,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = valid->root->base + value_p->u;
FT_Bytes limit = valid->root->limit;
FT_Bytes p = gxvalid->root->base + value_p->u;
FT_Bytes limit = gxvalid->root->limit;
FT_UShort count;
FT_Short partial;
FT_UShort i;
@@ -102,7 +102,7 @@
for ( i = 0; i < count; i++ )
{
partial = FT_NEXT_SHORT( p );
gxv_lcar_partial_validate( partial, glyph, valid );
gxv_lcar_partial_validate( partial, glyph, gxvalid );
}
GXV_EXIT;
@@ -148,7 +148,7 @@
gxv_lcar_LookupFmt4_transit( FT_UShort relative_gindex,
GXV_LookupValueCPtr base_value_p,
FT_Bytes lookuptbl_limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p;
FT_Bytes limit;
@@ -160,8 +160,8 @@
/* XXX: check range? */
offset = (FT_UShort)( base_value_p->u +
relative_gindex * sizeof ( FT_UShort ) );
p = valid->root->base + offset;
limit = valid->root->limit;
p = gxvalid->root->base + offset;
limit = gxvalid->root->limit;
GXV_LIMIT_CHECK ( 2 );
value.u = FT_NEXT_USHORT( p );
@@ -185,8 +185,8 @@
{
FT_Bytes p = table;
FT_Bytes limit = 0;
GXV_ValidatorRec validrec;
GXV_Validator valid = &validrec;
GXV_ValidatorRec gxvalidrec;
GXV_Validator gxvalid = &gxvalidrec;
GXV_lcar_DataRec lcarrec;
GXV_lcar_Data lcar = &lcarrec;
@@ -194,9 +194,9 @@
FT_Fixed version;
valid->root = ftvalid;
valid->table_data = lcar;
valid->face = face;
gxvalid->root = ftvalid;
gxvalid->table_data = lcar;
gxvalid->face = face;
FT_TRACE3(( "validating `lcar' table\n" ));
GXV_INIT;
@@ -211,10 +211,10 @@
if ( GXV_LCAR_DATA( format ) > 1 )
FT_INVALID_FORMAT;
valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
valid->lookupval_func = gxv_lcar_LookupValue_validate;
valid->lookupfmt4_trans = gxv_lcar_LookupFmt4_transit;
gxv_LookupTable_validate( p, limit, valid );
gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
gxvalid->lookupval_func = gxv_lcar_LookupValue_validate;
gxvalid->lookupfmt4_trans = gxv_lcar_LookupFmt4_transit;
gxv_LookupTable_validate( p, limit, gxvalid );
FT_TRACE4(( "\n" ));
}
+22 -22
View File
@@ -40,7 +40,7 @@
static void
gxv_mort_feature_validate( GXV_mort_feature f,
GXV_Validator valid )
GXV_Validator gxvalid )
{
if ( f->featureType >= gxv_feat_registry_length )
{
@@ -89,7 +89,7 @@
gxv_mort_featurearray_validate( FT_Bytes table,
FT_Bytes limit,
FT_ULong nFeatureFlags,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
FT_ULong i;
@@ -106,22 +106,22 @@
f.enableFlags = FT_NEXT_ULONG( p );
f.disableFlags = FT_NEXT_ULONG( p );
gxv_mort_feature_validate( &f, valid );
gxv_mort_feature_validate( &f, gxvalid );
}
if ( !IS_GXV_MORT_FEATURE_OFF( f ) )
FT_INVALID_DATA;
valid->subtable_length = p - table;
gxvalid->subtable_length = p - table;
GXV_EXIT;
}
FT_LOCAL_DEF( void )
gxv_mort_coverage_validate( FT_UShort coverage,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_UNUSED( valid );
FT_UNUSED( gxvalid );
#ifdef FT_DEBUG_LEVEL_TRACE
if ( coverage & 0x8000U )
@@ -150,7 +150,7 @@
gxv_mort_subtables_validate( FT_Bytes table,
FT_Bytes limit,
FT_UShort nSubtables,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
@@ -198,7 +198,7 @@
rest = length - ( 2 + 2 + 4 );
GXV_LIMIT_CHECK( rest );
gxv_mort_coverage_validate( coverage, valid );
gxv_mort_coverage_validate( coverage, gxvalid );
if ( type > 5 )
FT_INVALID_FORMAT;
@@ -207,13 +207,13 @@
if ( func == NULL )
GXV_TRACE(( "morx type %d is reserved\n", type ));
func( p, p + rest, valid );
func( p, p + rest, gxvalid );
p += rest;
/* TODO: validate subFeatureFlags */
}
valid->subtable_length = p - table;
gxvalid->subtable_length = p - table;
GXV_EXIT;
}
@@ -222,7 +222,7 @@
static void
gxv_mort_chain_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
#ifdef GXV_LOAD_UNUSED_VARS
@@ -246,10 +246,10 @@
nSubtables = FT_NEXT_USHORT( p );
gxv_mort_featurearray_validate( p, table + chainLength,
nFeatureFlags, valid );
p += valid->subtable_length;
gxv_mort_subtables_validate( p, table + chainLength, nSubtables, valid );
valid->subtable_length = chainLength;
nFeatureFlags, gxvalid );
p += gxvalid->subtable_length;
gxv_mort_subtables_validate( p, table + chainLength, nSubtables, gxvalid );
gxvalid->subtable_length = chainLength;
/* TODO: validate defaultFlags */
GXV_EXIT;
@@ -261,8 +261,8 @@
FT_Face face,
FT_Validator ftvalid )
{
GXV_ValidatorRec validrec;
GXV_Validator valid = &validrec;
GXV_ValidatorRec gxvalidrec;
GXV_Validator gxvalid = &gxvalidrec;
FT_Bytes p = table;
FT_Bytes limit = 0;
FT_ULong version;
@@ -270,9 +270,9 @@
FT_ULong i;
valid->root = ftvalid;
valid->face = face;
limit = valid->root->limit;
gxvalid->root = ftvalid;
gxvalid->face = face;
limit = gxvalid->root->limit;
FT_TRACE3(( "validating `mort' table\n" ));
GXV_INIT;
@@ -288,8 +288,8 @@
{
GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains ));
GXV_32BIT_ALIGNMENT_VALIDATE( p - table );
gxv_mort_chain_validate( p, limit, valid );
p += valid->subtable_length;
gxv_mort_chain_validate( p, limit, gxvalid );
p += gxvalid->subtable_length;
}
FT_TRACE4(( "\n" ));
+7 -7
View File
@@ -55,36 +55,36 @@
gxv_mort_featurearray_validate( FT_Bytes table,
FT_Bytes limit,
FT_ULong nFeatureFlags,
GXV_Validator valid );
GXV_Validator gxvalid );
FT_LOCAL( void )
gxv_mort_coverage_validate( FT_UShort coverage,
GXV_Validator valid );
GXV_Validator gxvalid );
FT_LOCAL( void )
gxv_mort_subtable_type0_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid );
GXV_Validator gxvalid );
FT_LOCAL( void )
gxv_mort_subtable_type1_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid );
GXV_Validator gxvalid );
FT_LOCAL( void )
gxv_mort_subtable_type2_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid );
GXV_Validator gxvalid );
FT_LOCAL( void )
gxv_mort_subtable_type4_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid );
GXV_Validator gxvalid );
FT_LOCAL( void )
gxv_mort_subtable_type5_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid );
GXV_Validator gxvalid );
#endif /* __GXVMORT_H__ */
+8 -8
View File
@@ -67,7 +67,7 @@
GXV_StateTable_GlyphOffsetCPtr glyphOffset_p,
FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_UShort markFirst;
FT_UShort dontAdvance;
@@ -125,7 +125,7 @@
FT_LOCAL_DEF( void )
gxv_mort_subtable_type0_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
@@ -135,14 +135,14 @@
GXV_LIMIT_CHECK( GXV_STATETABLE_HEADER_SIZE );
valid->statetable.optdata = NULL;
valid->statetable.optdata_load_func = NULL;
valid->statetable.subtable_setup_func = NULL;
valid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE;
valid->statetable.entry_validate_func =
gxvalid->statetable.optdata = NULL;
gxvalid->statetable.optdata_load_func = NULL;
gxvalid->statetable.subtable_setup_func = NULL;
gxvalid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE;
gxvalid->statetable.entry_validate_func =
gxv_mort_subtable_type0_entry_validate;
gxv_StateTable_validate( p, limit, valid );
gxv_StateTable_validate( p, limit, gxvalid );
GXV_EXIT;
}
+27 -27
View File
@@ -53,12 +53,12 @@
static void
gxv_mort_subtable_type1_substitutionTable_load( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
GXV_mort_subtable_type1_StateOptRecData optdata =
(GXV_mort_subtable_type1_StateOptRecData)valid->statetable.optdata;
(GXV_mort_subtable_type1_StateOptRecData)gxvalid->statetable.optdata;
GXV_LIMIT_CHECK( 2 );
@@ -74,14 +74,14 @@
FT_UShort* classTable_length_p,
FT_UShort* stateArray_length_p,
FT_UShort* entryTable_length_p,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_UShort o[4];
FT_UShort *l[4];
FT_UShort buff[5];
GXV_mort_subtable_type1_StateOptRecData optdata =
(GXV_mort_subtable_type1_StateOptRecData)valid->statetable.optdata;
(GXV_mort_subtable_type1_StateOptRecData)gxvalid->statetable.optdata;
o[0] = classTable;
@@ -93,7 +93,7 @@
l[2] = entryTable_length_p;
l[3] = &( optdata->substitutionTable_length );
gxv_set_length_by_ushort_offset( o, l, buff, 4, table_size, valid );
gxv_set_length_by_ushort_offset( o, l, buff, 4, table_size, gxvalid );
}
@@ -102,7 +102,7 @@
FT_Short wordOffset,
const FT_String* tag,
FT_Byte state,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_UShort substTable;
FT_UShort substTable_limit;
@@ -113,16 +113,16 @@
substTable =
((GXV_mort_subtable_type1_StateOptRec *)
(valid->statetable.optdata))->substitutionTable;
(gxvalid->statetable.optdata))->substitutionTable;
substTable_limit =
(FT_UShort)( substTable +
((GXV_mort_subtable_type1_StateOptRec *)
(valid->statetable.optdata))->substitutionTable_length );
(gxvalid->statetable.optdata))->substitutionTable_length );
valid->min_gid = (FT_UShort)( ( substTable - wordOffset * 2 ) / 2 );
valid->max_gid = (FT_UShort)( ( substTable_limit - wordOffset * 2 ) / 2 );
valid->max_gid = (FT_UShort)( FT_MAX( valid->max_gid,
valid->face->num_glyphs ) );
gxvalid->min_gid = (FT_UShort)( ( substTable - wordOffset * 2 ) / 2 );
gxvalid->max_gid = (FT_UShort)( ( substTable_limit - wordOffset * 2 ) / 2 );
gxvalid->max_gid = (FT_UShort)( FT_MAX( gxvalid->max_gid,
gxvalid->face->num_glyphs ) );
/* XXX: check range? */
@@ -137,7 +137,7 @@
GXV_StateTable_GlyphOffsetCPtr glyphOffset_p,
FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
#ifdef GXV_LOAD_UNUSED_VARS
FT_UShort setMark;
@@ -169,24 +169,24 @@
gxv_mort_subtable_type1_offset_to_subst_validate( markOffset,
"markOffset",
state,
valid );
gxvalid );
gxv_mort_subtable_type1_offset_to_subst_validate( currentOffset,
"currentOffset",
state,
valid );
gxvalid );
}
static void
gxv_mort_subtable_type1_substTable_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
FT_UShort num_gids = (FT_UShort)(
((GXV_mort_subtable_type1_StateOptRec *)
(valid->statetable.optdata))->substitutionTable_length / 2 );
(gxvalid->statetable.optdata))->substitutionTable_length / 2 );
FT_UShort i;
@@ -202,11 +202,11 @@
if ( dst_gid >= 0xFFFFU )
continue;
if ( dst_gid < valid->min_gid || valid->max_gid < dst_gid )
if ( dst_gid < gxvalid->min_gid || gxvalid->max_gid < dst_gid )
{
GXV_TRACE(( "substTable include a strange gid[%d]=%d >"
" out of define range (%d..%d)\n",
i, dst_gid, valid->min_gid, valid->max_gid ));
i, dst_gid, gxvalid->min_gid, gxvalid->max_gid ));
GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
}
}
@@ -223,7 +223,7 @@
FT_LOCAL_DEF( void )
gxv_mort_subtable_type1_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
@@ -234,23 +234,23 @@
GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE );
valid->statetable.optdata =
gxvalid->statetable.optdata =
&st_rec;
valid->statetable.optdata_load_func =
gxvalid->statetable.optdata_load_func =
gxv_mort_subtable_type1_substitutionTable_load;
valid->statetable.subtable_setup_func =
gxvalid->statetable.subtable_setup_func =
gxv_mort_subtable_type1_subtable_setup;
valid->statetable.entry_glyphoffset_fmt =
gxvalid->statetable.entry_glyphoffset_fmt =
GXV_GLYPHOFFSET_ULONG;
valid->statetable.entry_validate_func =
gxvalid->statetable.entry_validate_func =
gxv_mort_subtable_type1_entry_validate;
gxv_StateTable_validate( p, limit, valid );
gxv_StateTable_validate( p, limit, gxvalid );
gxv_mort_subtable_type1_substTable_validate(
table + st_rec.substitutionTable,
table + st_rec.substitutionTable + st_rec.substitutionTable_length,
valid );
gxvalid );
GXV_EXIT;
}
+23 -23
View File
@@ -57,11 +57,11 @@
static void
gxv_mort_subtable_type2_opttable_load( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
FT_Bytes p = table;
GXV_mort_subtable_type2_StateOptRecData optdata =
(GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata;
(GXV_mort_subtable_type2_StateOptRecData)gxvalid->statetable.optdata;
GXV_LIMIT_CHECK( 2 + 2 + 2 );
@@ -86,14 +86,14 @@
FT_UShort *classTable_length_p,
FT_UShort *stateArray_length_p,
FT_UShort *entryTable_length_p,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_UShort o[6];
FT_UShort *l[6];
FT_UShort buff[7];
GXV_mort_subtable_type2_StateOptRecData optdata =
(GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata;
(GXV_mort_subtable_type2_StateOptRecData)gxvalid->statetable.optdata;
GXV_NAME_ENTER( "subtable boundaries setup" );
@@ -111,7 +111,7 @@
l[4] = &(optdata->componentTable_length);
l[5] = &(optdata->ligatureTable_length);
gxv_set_length_by_ushort_offset( o, l, buff, 6, table_size, valid );
gxv_set_length_by_ushort_offset( o, l, buff, 6, table_size, gxvalid );
GXV_TRACE(( "classTable: offset=0x%04x length=0x%04x\n",
classTable, *classTable_length_p ));
@@ -137,11 +137,11 @@
gxv_mort_subtable_type2_ligActionOffset_validate(
FT_Bytes table,
FT_UShort ligActionOffset,
GXV_Validator valid )
GXV_Validator gxvalid )
{
/* access ligActionTable */
GXV_mort_subtable_type2_StateOptRecData optdata =
(GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata;
(GXV_mort_subtable_type2_StateOptRecData)gxvalid->statetable.optdata;
FT_Bytes lat_base = table + optdata->ligActionTable;
FT_Bytes p = table + ligActionOffset;
@@ -214,7 +214,7 @@
GXV_StateTable_GlyphOffsetCPtr glyphOffset_p,
FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
#ifdef GXV_LOAD_UNUSED_VARS
FT_UShort setComponent;
@@ -236,16 +236,16 @@
if ( 0 < offset )
gxv_mort_subtable_type2_ligActionOffset_validate( table, offset,
valid );
gxvalid );
}
static void
gxv_mort_subtable_type2_ligatureTable_validate( FT_Bytes table,
GXV_Validator valid )
GXV_Validator gxvalid )
{
GXV_mort_subtable_type2_StateOptRecData optdata =
(GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata;
(GXV_mort_subtable_type2_StateOptRecData)gxvalid->statetable.optdata;
FT_Bytes p = table + optdata->ligatureTable;
FT_Bytes limit = table + optdata->ligatureTable
@@ -264,7 +264,7 @@
GXV_LIMIT_CHECK( 2 );
lig_gid = FT_NEXT_USHORT( p );
if ( valid->face->num_glyphs < lig_gid )
if ( gxvalid->face->num_glyphs < lig_gid )
GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
}
}
@@ -275,7 +275,7 @@
FT_LOCAL_DEF( void )
gxv_mort_subtable_type2_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
@@ -286,23 +286,23 @@
GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE2_HEADER_SIZE );
valid->statetable.optdata =
gxvalid->statetable.optdata =
&lig_rec;
valid->statetable.optdata_load_func =
gxvalid->statetable.optdata_load_func =
gxv_mort_subtable_type2_opttable_load;
valid->statetable.subtable_setup_func =
gxvalid->statetable.subtable_setup_func =
gxv_mort_subtable_type2_subtable_setup;
valid->statetable.entry_glyphoffset_fmt =
gxvalid->statetable.entry_glyphoffset_fmt =
GXV_GLYPHOFFSET_NONE;
valid->statetable.entry_validate_func =
gxvalid->statetable.entry_validate_func =
gxv_mort_subtable_type2_entry_validate;
gxv_StateTable_validate( p, limit, valid );
gxv_StateTable_validate( p, limit, gxvalid );
p += valid->subtable_length;
gxv_mort_subtable_type2_ligatureTable_validate( table, valid );
p += gxvalid->subtable_length;
gxv_mort_subtable_type2_ligatureTable_validate( table, gxvalid );
valid->subtable_length = p - table;
gxvalid->subtable_length = p - table;
GXV_EXIT;
}
+9 -9
View File
@@ -41,11 +41,11 @@
static void
gxv_mort_subtable_type4_lookupval_validate( FT_UShort glyph,
GXV_LookupValueCPtr value_p,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_UNUSED( glyph );
gxv_glyphid_validate( value_p->u, valid );
gxv_glyphid_validate( value_p->u, gxvalid );
}
/*
@@ -80,7 +80,7 @@
FT_UShort relative_gindex,
GXV_LookupValueCPtr base_value_p,
FT_Bytes lookuptbl_limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p;
FT_Bytes limit;
@@ -91,7 +91,7 @@
offset = (FT_UShort)( base_value_p->u +
relative_gindex * sizeof ( FT_UShort ) );
p = valid->lookuptbl_head + offset;
p = gxvalid->lookuptbl_head + offset;
limit = lookuptbl_limit;
GXV_LIMIT_CHECK( 2 );
@@ -104,7 +104,7 @@
FT_LOCAL_DEF( void )
gxv_mort_subtable_type4_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
@@ -112,11 +112,11 @@
GXV_NAME_ENTER( "mort chain subtable type4 "
"(Non-Contextual Glyph Substitution)" );
valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
valid->lookupval_func = gxv_mort_subtable_type4_lookupval_validate;
valid->lookupfmt4_trans = gxv_mort_subtable_type4_lookupfmt4_transit;
gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
gxvalid->lookupval_func = gxv_mort_subtable_type4_lookupval_validate;
gxvalid->lookupfmt4_trans = gxv_mort_subtable_type4_lookupfmt4_transit;
gxv_LookupTable_validate( p, limit, valid );
gxv_LookupTable_validate( p, limit, gxvalid );
GXV_EXIT;
}
+15 -15
View File
@@ -70,10 +70,10 @@
FT_UShort* classTable_length_p,
FT_UShort* stateArray_length_p,
FT_UShort* entryTable_length_p,
GXV_Validator valid )
GXV_Validator gxvalid )
{
GXV_mort_subtable_type5_StateOptRecData optdata =
(GXV_mort_subtable_type5_StateOptRecData)valid->statetable.optdata;
(GXV_mort_subtable_type5_StateOptRecData)gxvalid->statetable.optdata;
gxv_StateTable_subtable_setup( table_size,
@@ -83,7 +83,7 @@
classTable_length_p,
stateArray_length_p,
entryTable_length_p,
valid );
gxvalid );
optdata->classTable = classTable;
optdata->stateArray = stateArray;
@@ -100,7 +100,7 @@
FT_UShort count,
FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
/*
* We don't know the range of insertion-glyph-list.
@@ -109,7 +109,7 @@
FT_Bytes p = table + offset;
GXV_mort_subtable_type5_StateOptRecData optdata =
(GXV_mort_subtable_type5_StateOptRecData)valid->statetable.optdata;
(GXV_mort_subtable_type5_StateOptRecData)gxvalid->statetable.optdata;
if ( optdata->classTable < offset &&
offset < optdata->classTable + *(optdata->classTable_length_p) )
@@ -145,7 +145,7 @@
GXV_StateTable_GlyphOffsetCPtr glyphOffset,
FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
#ifdef GXV_LOAD_UNUSED_VARS
FT_Bool setMark;
@@ -184,7 +184,7 @@
currentInsertCount,
table,
limit,
valid );
gxvalid );
}
if ( 0 != markedInsertList && 0 != markedInsertCount )
@@ -193,7 +193,7 @@
markedInsertCount,
table,
limit,
valid );
gxvalid );
}
}
@@ -201,7 +201,7 @@
FT_LOCAL_DEF( void )
gxv_mort_subtable_type5_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
@@ -213,18 +213,18 @@
GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE5_HEADER_SIZE );
valid->statetable.optdata =
gxvalid->statetable.optdata =
et;
valid->statetable.optdata_load_func =
gxvalid->statetable.optdata_load_func =
NULL;
valid->statetable.subtable_setup_func =
gxvalid->statetable.subtable_setup_func =
gxv_mort_subtable_type5_subtable_setup;
valid->statetable.entry_glyphoffset_fmt =
gxvalid->statetable.entry_glyphoffset_fmt =
GXV_GLYPHOFFSET_ULONG;
valid->statetable.entry_validate_func =
gxvalid->statetable.entry_validate_func =
gxv_mort_subtable_type5_entry_validate;
gxv_StateTable_validate( p, limit, valid );
gxv_StateTable_validate( p, limit, gxvalid );
GXV_EXIT;
}
+15 -15
View File
@@ -42,7 +42,7 @@
gxv_morx_subtables_validate( FT_Bytes table,
FT_Bytes limit,
FT_UShort nSubtables,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
@@ -93,7 +93,7 @@
/* morx coverage consists of mort_coverage & 16bit padding */
gxv_mort_coverage_validate( (FT_UShort)( ( coverage >> 16 ) | coverage ),
valid );
gxvalid );
if ( type > 5 )
FT_INVALID_FORMAT;
@@ -101,13 +101,13 @@
if ( func == NULL )
GXV_TRACE(( "morx type %d is reserved\n", type ));
func( p, p + rest, valid );
func( p, p + rest, gxvalid );
/* TODO: subFeatureFlags should be unique in a table? */
p += rest;
}
valid->subtable_length = p - table;
gxvalid->subtable_length = p - table;
GXV_EXIT;
}
@@ -116,7 +116,7 @@
static void
gxv_morx_chain_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
#ifdef GXV_LOAD_UNUSED_VARS
@@ -140,16 +140,16 @@
nSubtables = FT_NEXT_ULONG( p );
/* feature-array of morx is same with that of mort */
gxv_mort_featurearray_validate( p, limit, nFeatureFlags, valid );
p += valid->subtable_length;
gxv_mort_featurearray_validate( p, limit, nFeatureFlags, gxvalid );
p += gxvalid->subtable_length;
if ( nSubtables >= 0x10000L )
FT_INVALID_DATA;
gxv_morx_subtables_validate( p, table + chainLength,
(FT_UShort)nSubtables, valid );
(FT_UShort)nSubtables, gxvalid );
valid->subtable_length = chainLength;
gxvalid->subtable_length = chainLength;
/* TODO: defaultFlags should be compared with the flags in tables */
@@ -162,8 +162,8 @@
FT_Face face,
FT_Validator ftvalid )
{
GXV_ValidatorRec validrec;
GXV_Validator valid = &validrec;
GXV_ValidatorRec gxvalidrec;
GXV_Validator gxvalid = &gxvalidrec;
FT_Bytes p = table;
FT_Bytes limit = 0;
FT_ULong version;
@@ -171,8 +171,8 @@
FT_ULong i;
valid->root = ftvalid;
valid->face = face;
gxvalid->root = ftvalid;
gxvalid->face = face;
FT_TRACE3(( "validating `morx' table\n" ));
GXV_INIT;
@@ -188,8 +188,8 @@
{
GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains ));
GXV_32BIT_ALIGNMENT_VALIDATE( p - table );
gxv_morx_chain_validate( p, limit, valid );
p += valid->subtable_length;
gxv_morx_chain_validate( p, limit, gxvalid );
p += gxvalid->subtable_length;
}
FT_TRACE4(( "\n" ));
+5 -5
View File
@@ -38,27 +38,27 @@
FT_LOCAL( void )
gxv_morx_subtable_type0_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid );
GXV_Validator gxvalid );
FT_LOCAL( void )
gxv_morx_subtable_type1_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid );
GXV_Validator gxvalid );
FT_LOCAL( void )
gxv_morx_subtable_type2_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid );
GXV_Validator gxvalid );
FT_LOCAL( void )
gxv_morx_subtable_type4_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid );
GXV_Validator gxvalid );
FT_LOCAL( void )
gxv_morx_subtable_type5_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid );
GXV_Validator gxvalid );
#endif /* __GXVMORX_H__ */
+8 -8
View File
@@ -45,7 +45,7 @@
GXV_XStateTable_GlyphOffsetCPtr glyphOffset_p,
FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
#ifdef GXV_LOAD_UNUSED_VARS
FT_UShort markFirst;
@@ -85,7 +85,7 @@
FT_LOCAL_DEF( void )
gxv_morx_subtable_type0_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
@@ -95,14 +95,14 @@
GXV_LIMIT_CHECK( GXV_STATETABLE_HEADER_SIZE );
valid->xstatetable.optdata = NULL;
valid->xstatetable.optdata_load_func = NULL;
valid->xstatetable.subtable_setup_func = NULL;
valid->xstatetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE;
valid->xstatetable.entry_validate_func =
gxvalid->xstatetable.optdata = NULL;
gxvalid->xstatetable.optdata_load_func = NULL;
gxvalid->xstatetable.subtable_setup_func = NULL;
gxvalid->xstatetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE;
gxvalid->xstatetable.entry_validate_func =
gxv_morx_subtable_type0_entry_validate;
gxv_XStateTable_validate( p, limit, valid );
gxv_XStateTable_validate( p, limit, gxvalid );
GXV_EXIT;
}
+25 -25
View File
@@ -55,12 +55,12 @@
static void
gxv_morx_subtable_type1_substitutionTable_load( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
GXV_morx_subtable_type1_StateOptRecData optdata =
(GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata;
(GXV_morx_subtable_type1_StateOptRecData)gxvalid->xstatetable.optdata;
GXV_LIMIT_CHECK( 2 );
@@ -76,14 +76,14 @@
FT_ULong* classTable_length_p,
FT_ULong* stateArray_length_p,
FT_ULong* entryTable_length_p,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_ULong o[4];
FT_ULong *l[4];
FT_ULong buff[5];
GXV_morx_subtable_type1_StateOptRecData optdata =
(GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata;
(GXV_morx_subtable_type1_StateOptRecData)gxvalid->xstatetable.optdata;
o[0] = classTable;
@@ -95,7 +95,7 @@
l[2] = entryTable_length_p;
l[3] = &(optdata->substitutionTable_length);
gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, valid );
gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, gxvalid );
}
@@ -106,7 +106,7 @@
GXV_StateTable_GlyphOffsetCPtr glyphOffset_p,
FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
#ifdef GXV_LOAD_TRACE_VARS
FT_UShort setMark;
@@ -117,7 +117,7 @@
FT_Short currentIndex;
GXV_morx_subtable_type1_StateOptRecData optdata =
(GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata;
(GXV_morx_subtable_type1_StateOptRecData)gxvalid->xstatetable.optdata;
FT_UNUSED( state );
FT_UNUSED( table );
@@ -159,13 +159,13 @@
static void
gxv_morx_subtable_type1_LookupValue_validate( FT_UShort glyph,
GXV_LookupValueCPtr value_p,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_UNUSED( glyph ); /* for the non-debugging case */
GXV_TRACE(( "morx subtable type1 subst.: %d -> %d\n", glyph, value_p->u ));
if ( value_p->u > valid->face->num_glyphs )
if ( value_p->u > gxvalid->face->num_glyphs )
FT_INVALID_GLYPH_ID;
}
@@ -175,7 +175,7 @@
FT_UShort relative_gindex,
GXV_LookupValueCPtr base_value_p,
FT_Bytes lookuptbl_limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p;
FT_Bytes limit;
@@ -186,7 +186,7 @@
offset = (FT_UShort)( base_value_p->u +
relative_gindex * sizeof ( FT_UShort ) );
p = valid->lookuptbl_head + offset;
p = gxvalid->lookuptbl_head + offset;
limit = lookuptbl_limit;
GXV_LIMIT_CHECK ( 2 );
@@ -202,19 +202,19 @@
static void
gxv_morx_subtable_type1_substitutionTable_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
FT_UShort i;
GXV_morx_subtable_type1_StateOptRecData optdata =
(GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata;
(GXV_morx_subtable_type1_StateOptRecData)gxvalid->xstatetable.optdata;
/* TODO: calculate offset/length for each lookupTables */
valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
valid->lookupval_func = gxv_morx_subtable_type1_LookupValue_validate;
valid->lookupfmt4_trans = gxv_morx_subtable_type1_LookupFmt4_transit;
gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
gxvalid->lookupval_func = gxv_morx_subtable_type1_LookupValue_validate;
gxvalid->lookupfmt4_trans = gxv_morx_subtable_type1_LookupFmt4_transit;
for ( i = 0; i < optdata->substitutionTable_num_lookupTables; i++ )
{
@@ -224,7 +224,7 @@
GXV_LIMIT_CHECK( 4 );
offset = FT_NEXT_ULONG( p );
gxv_LookupTable_validate( table + offset, limit, valid );
gxv_LookupTable_validate( table + offset, limit, gxvalid );
}
/* TODO: overlapping of lookupTables in substitutionTable */
@@ -239,7 +239,7 @@
FT_LOCAL_DEF( void )
gxv_morx_subtable_type1_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
@@ -252,23 +252,23 @@
st_rec.substitutionTable_num_lookupTables = 0;
valid->xstatetable.optdata =
gxvalid->xstatetable.optdata =
&st_rec;
valid->xstatetable.optdata_load_func =
gxvalid->xstatetable.optdata_load_func =
gxv_morx_subtable_type1_substitutionTable_load;
valid->xstatetable.subtable_setup_func =
gxvalid->xstatetable.subtable_setup_func =
gxv_morx_subtable_type1_subtable_setup;
valid->xstatetable.entry_glyphoffset_fmt =
gxvalid->xstatetable.entry_glyphoffset_fmt =
GXV_GLYPHOFFSET_ULONG;
valid->xstatetable.entry_validate_func =
gxvalid->xstatetable.entry_validate_func =
gxv_morx_subtable_type1_entry_validate;
gxv_XStateTable_validate( p, limit, valid );
gxv_XStateTable_validate( p, limit, gxvalid );
gxv_morx_subtable_type1_substitutionTable_validate(
table + st_rec.substitutionTable,
table + st_rec.substitutionTable + st_rec.substitutionTable_length,
valid );
gxvalid );
GXV_EXIT;
}
+24 -24
View File
@@ -58,12 +58,12 @@
static void
gxv_morx_subtable_type2_opttable_load( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
GXV_morx_subtable_type2_StateOptRecData optdata =
(GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata;
(GXV_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata;
GXV_LIMIT_CHECK( 4 + 4 + 4 );
@@ -88,14 +88,14 @@
FT_ULong* classTable_length_p,
FT_ULong* stateArray_length_p,
FT_ULong* entryTable_length_p,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_ULong o[6];
FT_ULong* l[6];
FT_ULong buff[7];
GXV_morx_subtable_type2_StateOptRecData optdata =
(GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata;
(GXV_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata;
GXV_NAME_ENTER( "subtable boundaries setup" );
@@ -113,7 +113,7 @@
l[4] = &(optdata->componentTable_length);
l[5] = &(optdata->ligatureTable_length);
gxv_set_length_by_ulong_offset( o, l, buff, 6, table_size, valid );
gxv_set_length_by_ulong_offset( o, l, buff, 6, table_size, gxvalid );
GXV_TRACE(( "classTable: offset=0x%08x length=0x%08x\n",
classTable, *classTable_length_p ));
@@ -142,11 +142,11 @@
gxv_morx_subtable_type2_ligActionIndex_validate(
FT_Bytes table,
FT_UShort ligActionIndex,
GXV_Validator valid )
GXV_Validator gxvalid )
{
/* access ligActionTable */
GXV_morx_subtable_type2_StateOptRecData optdata =
(GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata;
(GXV_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata;
FT_Bytes lat_base = table + optdata->ligActionTable;
FT_Bytes p = lat_base +
@@ -188,7 +188,7 @@
/* it is different from the location offset in mort */
if ( ( offset & 0x3FFF0000UL ) == 0x3FFF0000UL )
{ /* negative offset */
gid_limit = valid->face->num_glyphs - ( offset & 0x0000FFFFUL );
gid_limit = gxvalid->face->num_glyphs - ( offset & 0x0000FFFFUL );
if ( gid_limit > 0 )
return;
@@ -198,9 +198,9 @@
offset & 0xFFFFU ));
GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
}
else if ( ( offset & 0x3FFF0000UL ) == 0x0000000UL )
else if ( ( offset & 0x3FFF0000UL ) == 0x00000000UL )
{ /* positive offset */
if ( (FT_Long)offset < valid->face->num_glyphs )
if ( (FT_Long)offset < gxvalid->face->num_glyphs )
return;
GXV_TRACE(( "ligature action table includes"
@@ -225,7 +225,7 @@
GXV_StateTable_GlyphOffsetCPtr glyphOffset_p,
FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
#ifdef GXV_LOAD_UNUSED_VARS
FT_UShort setComponent;
@@ -253,16 +253,16 @@
if ( 0 < ligActionIndex )
gxv_morx_subtable_type2_ligActionIndex_validate(
table, ligActionIndex, valid );
table, ligActionIndex, gxvalid );
}
static void
gxv_morx_subtable_type2_ligatureTable_validate( FT_Bytes table,
GXV_Validator valid )
GXV_Validator gxvalid )
{
GXV_morx_subtable_type2_StateOptRecData optdata =
(GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata;
(GXV_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata;
FT_Bytes p = table + optdata->ligatureTable;
FT_Bytes limit = table + optdata->ligatureTable
@@ -281,7 +281,7 @@
GXV_LIMIT_CHECK( 2 );
lig_gid = FT_NEXT_USHORT( p );
if ( lig_gid < valid->face->num_glyphs )
if ( lig_gid < gxvalid->face->num_glyphs )
GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );
}
}
@@ -293,7 +293,7 @@
FT_LOCAL_DEF( void )
gxv_morx_subtable_type2_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
@@ -304,23 +304,23 @@
GXV_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE2_HEADER_SIZE );
valid->xstatetable.optdata =
gxvalid->xstatetable.optdata =
&lig_rec;
valid->xstatetable.optdata_load_func =
gxvalid->xstatetable.optdata_load_func =
gxv_morx_subtable_type2_opttable_load;
valid->xstatetable.subtable_setup_func =
gxvalid->xstatetable.subtable_setup_func =
gxv_morx_subtable_type2_subtable_setup;
valid->xstatetable.entry_glyphoffset_fmt =
gxvalid->xstatetable.entry_glyphoffset_fmt =
GXV_GLYPHOFFSET_USHORT;
valid->xstatetable.entry_validate_func =
gxvalid->xstatetable.entry_validate_func =
gxv_morx_subtable_type2_entry_validate;
gxv_XStateTable_validate( p, limit, valid );
gxv_XStateTable_validate( p, limit, gxvalid );
#if 0
p += valid->subtable_length;
p += gxvalid->subtable_length;
#endif
gxv_morx_subtable_type2_ligatureTable_validate( table, valid );
gxv_morx_subtable_type2_ligatureTable_validate( table, gxvalid );
GXV_EXIT;
}
+2 -2
View File
@@ -41,12 +41,12 @@
FT_LOCAL_DEF( void )
gxv_morx_subtable_type4_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
GXV_NAME_ENTER( "morx chain subtable type4 "
"(Non-Contextual Glyph Substitution)" );
gxv_mort_subtable_type4_validate( table, limit, valid );
gxv_mort_subtable_type4_validate( table, limit, gxvalid );
GXV_EXIT;
}
+17 -17
View File
@@ -64,12 +64,12 @@
static void
gxv_morx_subtable_type5_insertionGlyphList_load( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
GXV_morx_subtable_type5_StateOptRecData optdata =
(GXV_morx_subtable_type5_StateOptRecData)valid->xstatetable.optdata;
(GXV_morx_subtable_type5_StateOptRecData)gxvalid->xstatetable.optdata;
GXV_LIMIT_CHECK( 4 );
@@ -85,14 +85,14 @@
FT_ULong* classTable_length_p,
FT_ULong* stateArray_length_p,
FT_ULong* entryTable_length_p,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_ULong o[4];
FT_ULong* l[4];
FT_ULong buff[5];
GXV_morx_subtable_type5_StateOptRecData optdata =
(GXV_morx_subtable_type5_StateOptRecData)valid->xstatetable.optdata;
(GXV_morx_subtable_type5_StateOptRecData)gxvalid->xstatetable.optdata;
o[0] = classTable;
@@ -104,7 +104,7 @@
l[2] = entryTable_length_p;
l[3] = &(optdata->insertionGlyphList_length);
gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, valid );
gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, gxvalid );
}
@@ -113,9 +113,9 @@
FT_UShort count,
FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table + table_index * 2;
FT_Bytes p = table + table_index * 2;
#ifndef GXV_LOAD_TRACE_VARS
@@ -143,7 +143,7 @@
GXV_StateTable_GlyphOffsetCPtr glyphOffset_p,
FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
#ifdef GXV_LOAD_UNUSED_VARS
FT_Bool setMark;
@@ -180,20 +180,20 @@
gxv_morx_subtable_type5_InsertList_validate( currentInsertList,
currentInsertCount,
table, limit,
valid );
gxvalid );
if ( markedInsertList && 0 != markedInsertCount )
gxv_morx_subtable_type5_InsertList_validate( markedInsertList,
markedInsertCount,
table, limit,
valid );
gxvalid );
}
FT_LOCAL_DEF( void )
gxv_morx_subtable_type5_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
@@ -205,18 +205,18 @@
GXV_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE5_HEADER_SIZE );
valid->xstatetable.optdata =
gxvalid->xstatetable.optdata =
et;
valid->xstatetable.optdata_load_func =
gxvalid->xstatetable.optdata_load_func =
gxv_morx_subtable_type5_insertionGlyphList_load;
valid->xstatetable.subtable_setup_func =
gxvalid->xstatetable.subtable_setup_func =
gxv_morx_subtable_type5_subtable_setup;
valid->xstatetable.entry_glyphoffset_fmt =
gxvalid->xstatetable.entry_glyphoffset_fmt =
GXV_GLYPHOFFSET_ULONG;
valid->xstatetable.entry_validate_func =
gxvalid->xstatetable.entry_validate_func =
gxv_morx_subtable_type5_entry_validate;
gxv_XStateTable_validate( p, limit, valid );
gxv_XStateTable_validate( p, limit, gxvalid );
GXV_EXIT;
}
+16 -16
View File
@@ -68,11 +68,11 @@
static void
gxv_opbd_LookupValue_validate( FT_UShort glyph,
GXV_LookupValueCPtr value_p,
GXV_Validator valid )
GXV_Validator gxvalid )
{
/* offset in LookupTable is measured from the head of opbd table */
FT_Bytes p = valid->root->base + value_p->u;
FT_Bytes limit = valid->root->limit;
FT_Bytes p = gxvalid->root->base + value_p->u;
FT_Bytes limit = gxvalid->root->limit;
FT_Short delta_value;
int i;
@@ -90,7 +90,7 @@
if ( delta_value == -1 )
continue;
gxv_ctlPoint_validate( glyph, delta_value, valid );
gxv_ctlPoint_validate( glyph, delta_value, gxvalid );
}
else /* format 0, value is distance */
continue;
@@ -134,12 +134,12 @@
gxv_opbd_LookupFmt4_transit( FT_UShort relative_gindex,
GXV_LookupValueCPtr base_value_p,
FT_Bytes lookuptbl_limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
GXV_LookupValueDesc value;
FT_UNUSED( lookuptbl_limit );
FT_UNUSED( valid );
FT_UNUSED( gxvalid );
/* XXX: check range? */
value.u = (FT_UShort)( base_value_p->u +
@@ -162,8 +162,8 @@
FT_Face face,
FT_Validator ftvalid )
{
GXV_ValidatorRec validrec;
GXV_Validator valid = &validrec;
GXV_ValidatorRec gxvalidrec;
GXV_Validator gxvalid = &gxvalidrec;
GXV_opbd_DataRec opbdrec;
GXV_opbd_Data opbd = &opbdrec;
FT_Bytes p = table;
@@ -172,9 +172,9 @@
FT_ULong version;
valid->root = ftvalid;
valid->table_data = opbd;
valid->face = face;
gxvalid->root = ftvalid;
gxvalid->table_data = opbd;
gxvalid->face = face;
FT_TRACE3(( "validating `opbd' table\n" ));
GXV_INIT;
@@ -196,12 +196,12 @@
if ( 0x0001 < GXV_OPBD_DATA( format ) )
FT_INVALID_FORMAT;
valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
valid->lookupval_func = gxv_opbd_LookupValue_validate;
valid->lookupfmt4_trans = gxv_opbd_LookupFmt4_transit;
gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
gxvalid->lookupval_func = gxv_opbd_LookupValue_validate;
gxvalid->lookupfmt4_trans = gxv_opbd_LookupFmt4_transit;
gxv_LookupTable_validate( p, limit, valid );
p += valid->subtable_length;
gxv_LookupTable_validate( p, limit, gxvalid );
p += gxvalid->subtable_length;
if ( p > table + GXV_OPBD_DATA( valueOffset_min ) )
{
+19 -19
View File
@@ -75,7 +75,7 @@
static void
gxv_prop_zero_advance_validate( FT_UShort gid,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Face face;
FT_Error error;
@@ -84,7 +84,7 @@
GXV_NAME_ENTER( "zero advance" );
face = valid->face;
face = gxvalid->face;
error = FT_Load_Glyph( face,
gid,
@@ -109,10 +109,10 @@
static void
gxv_prop_property_validate( FT_UShort property,
FT_UShort glyph,
GXV_Validator valid )
GXV_Validator gxvalid )
{
if ( glyph != 0 && ( property & GXV_PROP_FLOATER ) )
gxv_prop_zero_advance_validate( glyph, valid );
gxv_prop_zero_advance_validate( glyph, gxvalid );
if ( property & GXV_PROP_USE_COMPLEMENTARY_BRACKET )
{
@@ -145,7 +145,7 @@
else
{
/* The gid for complement must be the face. */
gxv_glyphid_validate( (FT_UShort)( glyph + complement ), valid );
gxv_glyphid_validate( (FT_UShort)( glyph + complement ), gxvalid );
}
}
else
@@ -187,9 +187,9 @@
static void
gxv_prop_LookupValue_validate( FT_UShort glyph,
GXV_LookupValueCPtr value_p,
GXV_Validator valid )
GXV_Validator gxvalid )
{
gxv_prop_property_validate( value_p->u, glyph, valid );
gxv_prop_property_validate( value_p->u, glyph, gxvalid );
}
@@ -224,7 +224,7 @@
gxv_prop_LookupFmt4_transit( FT_UShort relative_gindex,
GXV_LookupValueCPtr base_value_p,
FT_Bytes lookuptbl_limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p;
FT_Bytes limit;
@@ -234,7 +234,7 @@
/* XXX: check range? */
offset = (FT_UShort)( base_value_p->u +
relative_gindex * sizeof ( FT_UShort ) );
p = valid->lookuptbl_head + offset;
p = gxvalid->lookuptbl_head + offset;
limit = lookuptbl_limit;
GXV_LIMIT_CHECK ( 2 );
@@ -259,8 +259,8 @@
{
FT_Bytes p = table;
FT_Bytes limit = 0;
GXV_ValidatorRec validrec;
GXV_Validator valid = &validrec;
GXV_ValidatorRec gxvalidrec;
GXV_Validator gxvalid = &gxvalidrec;
GXV_prop_DataRec proprec;
GXV_prop_Data prop = &proprec;
@@ -270,9 +270,9 @@
FT_UShort defaultProp;
valid->root = ftvalid;
valid->table_data = prop;
valid->face = face;
gxvalid->root = ftvalid;
gxvalid->table_data = prop;
gxvalid->face = face;
FT_TRACE3(( "validating `prop' table\n" ));
GXV_INIT;
@@ -303,7 +303,7 @@
FT_INVALID_FORMAT;
}
gxv_prop_property_validate( defaultProp, 0, valid );
gxv_prop_property_validate( defaultProp, 0, gxvalid );
if ( format == 0 )
{
@@ -315,11 +315,11 @@
/* format == 1 */
GXV_PROP_DATA( version ) = version;
valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
valid->lookupval_func = gxv_prop_LookupValue_validate;
valid->lookupfmt4_trans = gxv_prop_LookupFmt4_transit;
gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
gxvalid->lookupval_func = gxv_prop_LookupValue_validate;
gxvalid->lookupfmt4_trans = gxv_prop_LookupFmt4_transit;
gxv_LookupTable_validate( p, limit, valid );
gxv_LookupTable_validate( p, limit, gxvalid );
Exit:
FT_TRACE4(( "\n" ));
+23 -23
View File
@@ -93,9 +93,9 @@
gxv_trak_trackTable_validate( FT_Bytes table,
FT_Bytes limit,
FT_UShort nTracks,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
FT_Bytes p = table;
FT_Fixed track, t;
FT_UShort nameIndex;
@@ -122,7 +122,7 @@
if ( offset > GXV_TRAK_DATA( trackValueOffset_max ) )
GXV_TRAK_DATA( trackValueOffset_max ) = offset;
gxv_sfntName_validate( nameIndex, 256, 32767, valid );
gxv_sfntName_validate( nameIndex, 256, 32767, gxvalid );
for ( j = i; j < nTracks; j ++ )
{
@@ -134,7 +134,7 @@
}
}
valid->subtable_length = p - table;
gxvalid->subtable_length = p - table;
GXV_EXIT;
}
@@ -142,7 +142,7 @@
static void
gxv_trak_trackData_validate( FT_Bytes table,
FT_Bytes limit,
GXV_Validator valid )
GXV_Validator gxvalid )
{
FT_Bytes p = table;
FT_UShort nTracks;
@@ -164,31 +164,31 @@
gxv_odtect_add_range( table, p - table, "trackData header", odtect );
/* validate trackTable */
gxv_trak_trackTable_validate( p, limit, nTracks, valid );
gxv_odtect_add_range( p, valid->subtable_length,
gxv_trak_trackTable_validate( p, limit, nTracks, gxvalid );
gxv_odtect_add_range( p, gxvalid->subtable_length,
"trackTable", odtect );
/* sizeTable is array of FT_Fixed, don't check contents */
p = valid->root->base + sizeTableOffset;
p = gxvalid->root->base + sizeTableOffset;
GXV_LIMIT_CHECK( nSizes * 4 );
gxv_odtect_add_range( p, nSizes * 4, "sizeTable", odtect );
/* validate trackValueOffet */
p = valid->root->base + GXV_TRAK_DATA( trackValueOffset_min );
p = gxvalid->root->base + GXV_TRAK_DATA( trackValueOffset_min );
if ( limit - p < nTracks * nSizes * 2 )
GXV_TRACE(( "too short trackValue array\n" ));
p = valid->root->base + GXV_TRAK_DATA( trackValueOffset_max );
p = gxvalid->root->base + GXV_TRAK_DATA( trackValueOffset_max );
GXV_LIMIT_CHECK( nSizes * 2 );
gxv_odtect_add_range( valid->root->base
gxv_odtect_add_range( gxvalid->root->base
+ GXV_TRAK_DATA( trackValueOffset_min ),
GXV_TRAK_DATA( trackValueOffset_max )
- GXV_TRAK_DATA( trackValueOffset_min )
+ nSizes * 2,
"trackValue array", odtect );
gxv_odtect_validate( odtect, valid );
gxv_odtect_validate( odtect, gxvalid );
GXV_EXIT;
}
@@ -210,8 +210,8 @@
FT_Bytes p = table;
FT_Bytes limit = 0;
GXV_ValidatorRec validrec;
GXV_Validator valid = &validrec;
GXV_ValidatorRec gxvalidrec;
GXV_Validator gxvalid = &gxvalidrec;
GXV_trak_DataRec trakrec;
GXV_trak_Data trak = &trakrec;
@@ -225,11 +225,11 @@
GXV_ODTECT( 3, odtect );
GXV_ODTECT_INIT( odtect );
valid->root = ftvalid;
valid->table_data = trak;
valid->face = face;
gxvalid->root = ftvalid;
gxvalid->table_data = trak;
gxvalid->face = face;
limit = valid->root->limit;
limit = gxvalid->root->limit;
FT_TRACE3(( "validating `trak' table\n" ));
GXV_INIT;
@@ -265,19 +265,19 @@
/* validate trackData */
if ( 0 < horizOffset )
{
gxv_trak_trackData_validate( table + horizOffset, limit, valid );
gxv_odtect_add_range( table + horizOffset, valid->subtable_length,
gxv_trak_trackData_validate( table + horizOffset, limit, gxvalid );
gxv_odtect_add_range( table + horizOffset, gxvalid->subtable_length,
"horizJustData", odtect );
}
if ( 0 < vertOffset )
{
gxv_trak_trackData_validate( table + vertOffset, limit, valid );
gxv_odtect_add_range( table + vertOffset, valid->subtable_length,
gxv_trak_trackData_validate( table + vertOffset, limit, gxvalid );
gxv_odtect_add_range( table + vertOffset, gxvalid->subtable_length,
"vertJustData", odtect );
}
gxv_odtect_validate( odtect, valid );
gxv_odtect_validate( odtect, gxvalid );
FT_TRACE4(( "\n" ));
}
+2 -2
View File
@@ -208,8 +208,8 @@
/* head[0] && head[1] are the magic numbers; */
/* head[2] is the method, and head[3] the flags */
if ( head[0] != 0x1f ||
head[1] != 0x8b ||
if ( head[0] != 0x1F ||
head[1] != 0x8B ||
head[2] != Z_DEFLATED ||
(head[3] & FT_GZIP_RESERVED) )
{
+2 -2
View File
@@ -96,8 +96,8 @@
goto Exit;
/* head[0] && head[1] are the magic numbers */
if ( head[0] != 0x1f ||
head[1] != 0x9d )
if ( head[0] != 0x1F ||
head[1] != 0x9D )
error = FT_THROW( Invalid_File_Format );
Exit:
+1 -1
View File
@@ -41,7 +41,7 @@
#define LZW_CLEAR 256
#define LZW_FIRST 257
#define LZW_BIT_MASK 0x1f
#define LZW_BIT_MASK 0x1F
#define LZW_BLOCK_MASK 0x80
#define LZW_MASK( n ) ( ( 1U << (n) ) - 1U )
+25 -25
View File
@@ -32,7 +32,7 @@
static void
otv_BaseCoord_validate( FT_Bytes table,
OTV_Validator valid )
OTV_Validator otvalid )
{
FT_Bytes p = table;
FT_UInt BaseCoordFormat;
@@ -58,7 +58,7 @@
case 3: /* BaseCoordFormat3 */
OTV_LIMIT_CHECK( 2 );
/* DeviceTable */
otv_Device_validate( table + FT_NEXT_USHORT( p ), valid );
otv_Device_validate( table + FT_NEXT_USHORT( p ), otvalid );
break;
default:
@@ -71,7 +71,7 @@
static void
otv_BaseTagList_validate( FT_Bytes table,
OTV_Validator valid )
OTV_Validator otvalid )
{
FT_Bytes p = table;
FT_UInt BaseTagCount;
@@ -93,7 +93,7 @@
static void
otv_BaseValues_validate( FT_Bytes table,
OTV_Validator valid )
OTV_Validator otvalid )
{
FT_Bytes p = table;
FT_UInt BaseCoordCount;
@@ -112,7 +112,7 @@
/* BaseCoord */
for ( ; BaseCoordCount > 0; BaseCoordCount-- )
otv_BaseCoord_validate( table + FT_NEXT_USHORT( p ), valid );
otv_BaseCoord_validate( table + FT_NEXT_USHORT( p ), otvalid );
OTV_EXIT;
}
@@ -120,7 +120,7 @@
static void
otv_MinMax_validate( FT_Bytes table,
OTV_Validator valid )
OTV_Validator otvalid )
{
FT_Bytes p = table;
FT_UInt table_size;
@@ -144,11 +144,11 @@
OTV_SIZE_CHECK( MinCoord );
if ( MinCoord )
otv_BaseCoord_validate( table + MinCoord, valid );
otv_BaseCoord_validate( table + MinCoord, otvalid );
OTV_SIZE_CHECK( MaxCoord );
if ( MaxCoord )
otv_BaseCoord_validate( table + MaxCoord, valid );
otv_BaseCoord_validate( table + MaxCoord, otvalid );
OTV_LIMIT_CHECK( FeatMinMaxCount * 8 );
@@ -162,11 +162,11 @@
OTV_SIZE_CHECK( MinCoord );
if ( MinCoord )
otv_BaseCoord_validate( table + MinCoord, valid );
otv_BaseCoord_validate( table + MinCoord, otvalid );
OTV_SIZE_CHECK( MaxCoord );
if ( MaxCoord )
otv_BaseCoord_validate( table + MaxCoord, valid );
otv_BaseCoord_validate( table + MaxCoord, otvalid );
}
OTV_EXIT;
@@ -175,7 +175,7 @@
static void
otv_BaseScript_validate( FT_Bytes table,
OTV_Validator valid )
OTV_Validator otvalid )
{
FT_Bytes p = table;
FT_UInt table_size;
@@ -198,11 +198,11 @@
OTV_SIZE_CHECK( BaseValues );
if ( BaseValues )
otv_BaseValues_validate( table + BaseValues, valid );
otv_BaseValues_validate( table + BaseValues, otvalid );
OTV_SIZE_CHECK( DefaultMinMax );
if ( DefaultMinMax )
otv_MinMax_validate( table + DefaultMinMax, valid );
otv_MinMax_validate( table + DefaultMinMax, otvalid );
OTV_LIMIT_CHECK( BaseLangSysCount * 6 );
@@ -211,7 +211,7 @@
{
p += 4; /* skip BaseLangSysTag */
otv_MinMax_validate( table + FT_NEXT_USHORT( p ), valid );
otv_MinMax_validate( table + FT_NEXT_USHORT( p ), otvalid );
}
OTV_EXIT;
@@ -220,7 +220,7 @@
static void
otv_BaseScriptList_validate( FT_Bytes table,
OTV_Validator valid )
OTV_Validator otvalid )
{
FT_Bytes p = table;
FT_UInt BaseScriptCount;
@@ -241,7 +241,7 @@
p += 4; /* skip BaseScriptTag */
/* BaseScript */
otv_BaseScript_validate( table + FT_NEXT_USHORT( p ), valid );
otv_BaseScript_validate( table + FT_NEXT_USHORT( p ), otvalid );
}
OTV_EXIT;
@@ -250,7 +250,7 @@
static void
otv_Axis_validate( FT_Bytes table,
OTV_Validator valid )
OTV_Validator otvalid )
{
FT_Bytes p = table;
FT_UInt table_size;
@@ -267,10 +267,10 @@
OTV_SIZE_CHECK( BaseTagList );
if ( BaseTagList )
otv_BaseTagList_validate( table + BaseTagList, valid );
otv_BaseTagList_validate( table + BaseTagList, otvalid );
/* BaseScriptList */
otv_BaseScriptList_validate( table + FT_NEXT_USHORT( p ), valid );
otv_BaseScriptList_validate( table + FT_NEXT_USHORT( p ), otvalid );
OTV_EXIT;
}
@@ -280,16 +280,16 @@
otv_BASE_validate( FT_Bytes table,
FT_Validator ftvalid )
{
OTV_ValidatorRec validrec;
OTV_Validator valid = &validrec;
FT_Bytes p = table;
OTV_ValidatorRec otvalidrec;
OTV_Validator otvalid = &otvalidrec;
FT_Bytes p = table;
FT_UInt table_size;
OTV_OPTIONAL_TABLE( HorizAxis );
OTV_OPTIONAL_TABLE( VertAxis );
valid->root = ftvalid;
otvalid->root = ftvalid;
FT_TRACE3(( "validating BASE table\n" ));
OTV_INIT;
@@ -304,12 +304,12 @@
OTV_OPTIONAL_OFFSET( HorizAxis );
OTV_SIZE_CHECK( HorizAxis );
if ( HorizAxis )
otv_Axis_validate( table + HorizAxis, valid );
otv_Axis_validate( table + HorizAxis, otvalid );
OTV_OPTIONAL_OFFSET( VertAxis );
OTV_SIZE_CHECK( VertAxis );
if ( VertAxis )
otv_Axis_validate( table + VertAxis, valid );
otv_Axis_validate( table + VertAxis, otvalid );
FT_TRACE4(( "\n" ));
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+18 -18
View File
@@ -45,7 +45,7 @@
static void
otv_O_x_Ox( FT_Bytes table,
OTV_Validator valid )
OTV_Validator otvalid )
{
FT_Bytes p = table;
FT_Bytes Coverage;
@@ -61,20 +61,20 @@
OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount ));
otv_Coverage_validate( Coverage, valid, GlyphCount );
otv_Coverage_validate( Coverage, otvalid, GlyphCount );
if ( GlyphCount != otv_Coverage_get_count( Coverage ) )
FT_INVALID_DATA;
OTV_LIMIT_CHECK( GlyphCount * 2 );
valid->nesting_level++;
func = valid->func[valid->nesting_level];
valid->extra1 = 0;
otvalid->nesting_level++;
func = otvalid->func[otvalid->nesting_level];
otvalid->extra1 = 0;
for ( ; GlyphCount > 0; GlyphCount-- )
func( table + FT_NEXT_USHORT( p ), valid );
func( table + FT_NEXT_USHORT( p ), otvalid );
valid->nesting_level--;
otvalid->nesting_level--;
OTV_EXIT;
}
@@ -92,7 +92,7 @@
static void
otv_CaretValue_validate( FT_Bytes table,
OTV_Validator valid )
OTV_Validator otvalid )
{
FT_Bytes p = table;
FT_UInt CaretValueFormat;
@@ -122,7 +122,7 @@
OTV_LIMIT_CHECK( 2 );
/* DeviceTable */
otv_Device_validate( table + FT_NEXT_USHORT( p ), valid );
otv_Device_validate( table + FT_NEXT_USHORT( p ), otvalid );
break;
default:
@@ -141,7 +141,7 @@
/*************************************************************************/
/*************************************************************************/
/* sets valid->glyph_count */
/* sets otvalid->glyph_count */
FT_LOCAL_DEF( void )
otv_GDEF_validate( FT_Bytes table,
@@ -150,8 +150,8 @@
FT_UInt glyph_count,
FT_Validator ftvalid )
{
OTV_ValidatorRec validrec;
OTV_Validator valid = &validrec;
OTV_ValidatorRec otvalidrec;
OTV_Validator otvalid = &otvalidrec;
FT_Bytes p = table;
FT_UInt table_size;
FT_Bool need_MarkAttachClassDef;
@@ -162,7 +162,7 @@
OTV_OPTIONAL_TABLE( MarkAttachClassDef );
valid->root = ftvalid;
otvalid->root = ftvalid;
FT_TRACE3(( "validating GDEF table\n" ));
OTV_INIT;
@@ -186,19 +186,19 @@
else
table_size = 10; /* OpenType < 1.2 */
valid->glyph_count = glyph_count;
otvalid->glyph_count = glyph_count;
OTV_OPTIONAL_OFFSET( GlyphClassDef );
OTV_SIZE_CHECK( GlyphClassDef );
if ( GlyphClassDef )
otv_ClassDef_validate( table + GlyphClassDef, valid );
otv_ClassDef_validate( table + GlyphClassDef, otvalid );
OTV_OPTIONAL_OFFSET( AttachListOffset );
OTV_SIZE_CHECK( AttachListOffset );
if ( AttachListOffset )
{
OTV_NEST2( AttachList, AttachPoint );
OTV_RUN( table + AttachListOffset, valid );
OTV_RUN( table + AttachListOffset, otvalid );
}
OTV_OPTIONAL_OFFSET( LigCaretListOffset );
@@ -206,7 +206,7 @@
if ( LigCaretListOffset )
{
OTV_NEST3( LigCaretList, LigGlyph, CaretValue );
OTV_RUN( table + LigCaretListOffset, valid );
OTV_RUN( table + LigCaretListOffset, otvalid );
}
if ( need_MarkAttachClassDef )
@@ -214,7 +214,7 @@
OTV_OPTIONAL_OFFSET( MarkAttachClassDef );
OTV_SIZE_CHECK( MarkAttachClassDef );
if ( MarkAttachClassDef )
otv_ClassDef_validate( table + MarkAttachClassDef, valid );
otv_ClassDef_validate( table + MarkAttachClassDef, otvalid );
}
FT_TRACE4(( "\n" ));
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+44 -11
View File
@@ -2,7 +2,7 @@
FreeType font driver for pcf fonts
Copyright 2000-2010, 2012, 2013 by
Copyright 2000-2010, 2012-2014 by
Francesco Zappa Nardelli
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -78,7 +78,7 @@ THE SOFTWARE.
FT_FRAME_START( 16 ),
FT_FRAME_ULONG_LE( type ),
FT_FRAME_ULONG_LE( format ),
FT_FRAME_ULONG_LE( size ),
FT_FRAME_ULONG_LE( size ), /* rounded up to a multiple of 4 */
FT_FRAME_ULONG_LE( offset ),
FT_FRAME_END
};
@@ -95,9 +95,11 @@ THE SOFTWARE.
FT_Memory memory = FT_FACE( face )->memory;
FT_UInt n;
FT_ULong size;
if ( FT_STREAM_SEEK ( 0 ) ||
FT_STREAM_READ_FIELDS ( pcf_toc_header, toc ) )
if ( FT_STREAM_SEEK( 0 ) ||
FT_STREAM_READ_FIELDS( pcf_toc_header, toc ) )
return FT_THROW( Cannot_Open_Resource );
if ( toc->version != PCF_FILE_VERSION ||
@@ -154,14 +156,35 @@ THE SOFTWARE.
break;
}
/* we now check whether the `size' and `offset' values are reasonable: */
/* `offset' + `size' must not exceed the stream size */
/*
* We now check whether the `size' and `offset' values are reasonable:
* `offset' + `size' must not exceed the stream size.
*
* Note, however, that X11's `pcfWriteFont' routine (used by the
* `bdftopcf' program to create PDF font files) has two special
* features.
*
* - It always assigns the accelerator table a size of 100 bytes in the
* TOC, regardless of its real size, which can vary between 34 and 72
* bytes.
*
* - Due to the way the routine is designed, it ships out the last font
* table with its real size, ignoring the TOC's size value. Since
* the TOC size values are always rounded up to a multiple of 4, the
* difference can be up to three bytes for all tables except the
* accelerator table, for which the difference can be as large as 66
* bytes.
*
*/
tables = face->toc.tables;
for ( n = 0; n < toc->count; n++ )
size = stream->size;
for ( n = 0; n < toc->count - 1; n++ )
{
/* we need two checks to avoid overflow */
if ( ( tables->size > stream->size ) ||
( tables->offset > stream->size - tables->size ) )
if ( ( tables->size > size ) ||
( tables->offset > size - tables->size ) )
{
error = FT_THROW( Invalid_Table );
goto Exit;
@@ -169,6 +192,16 @@ THE SOFTWARE.
tables++;
}
/* only check `tables->offset' for last table element ... */
if ( ( tables->offset > size ) )
{
error = FT_THROW( Invalid_Table );
goto Exit;
}
/* ... and adjust `tables->size' to the real value if necessary */
if ( tables->size > size - tables->offset )
tables->size = size - tables->offset;
#ifdef FT_DEBUG_LEVEL_TRACE
{
@@ -733,8 +766,8 @@ THE SOFTWARE.
FT_TRACE4(( " number of bitmaps: %d\n", nbitmaps ));
/* XXX: PCF_Face->nmetrics is singed FT_Long, see pcf.h */
if ( face->nmetrics < 0 || nbitmaps != ( FT_ULong )face->nmetrics )
/* XXX: PCF_Face->nmetrics is signed FT_Long, see pcf.h */
if ( face->nmetrics < 0 || nbitmaps != (FT_ULong)face->nmetrics )
return FT_THROW( Invalid_File_Format );
if ( FT_NEW_ARRAY( offsets, nbitmaps ) )
+1 -1
View File
@@ -179,7 +179,7 @@
if ( header->signature != 0x50465230L || /* "PFR0" */
header->version > 4 ||
header->header_size < 58 ||
header->signature2 != 0x0d0a ) /* CR/LF */
header->signature2 != 0x0D0A ) /* CR/LF */
{
result = 0;
}
+3 -3
View File
@@ -124,7 +124,7 @@
if ( IS_PS_SPACE( *p ) || *p OP 0x80 )
break;
c = ft_char_table[*p & 0x7f];
c = ft_char_table[*p & 0x7F];
if ( c < 0 || c >= base )
break;
@@ -245,7 +245,7 @@
if ( IS_PS_SPACE( *p ) || *p OP 0x80 )
break;
c = ft_char_table[*p & 0x7f];
c = ft_char_table[*p & 0x7F];
if ( c < 0 || c >= 10 )
break;
@@ -521,7 +521,7 @@
if ( *p OP 0x80 )
break;
c = ft_char_table[*p & 0x7f];
c = ft_char_table[*p & 0x7F];
if ( (unsigned)c >= 16 )
break;
+2 -2
View File
@@ -4,7 +4,7 @@
/* */
/* PSNames module implementation (body). */
/* */
/* Copyright 1996-2003, 2005-2008, 2012, 2013 by */
/* Copyright 1996-2003, 2005-2008, 2012-2014 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -563,7 +563,7 @@
psnames_get_service( FT_Module module,
const char* service_id )
{
/* PSCMAPS_SERVICES_GET derefers `library' in PIC mode */
/* PSCMAPS_SERVICES_GET dereferences `library' in PIC mode */
#ifdef FT_CONFIG_OPTION_PIC
FT_Library library;
+1 -1
View File
@@ -427,7 +427,7 @@
sfnt_get_interface( FT_Module module,
const char* module_interface )
{
/* SFNT_SERVICES_GET derefers `library' in PIC mode */
/* SFNT_SERVICES_GET dereferences `library' in PIC mode */
#ifdef FT_CONFIG_OPTION_PIC
FT_Library library;
+1 -1
View File
@@ -3496,7 +3496,7 @@
{
FT_ERROR(( "tt_face_build_cmaps:"
" unsupported `cmap' table format = %d\n",
TT_PEEK_USHORT( p - 2) ));
TT_PEEK_USHORT( p - 2 ) ));
return FT_THROW( Invalid_Table );
}
+2 -2
View File
@@ -405,6 +405,8 @@ typedef ptrdiff_t FT_PtrDist;
typedef struct gray_TWorker_
{
ft_jmp_buf jump_buffer;
TCoord ex, ey;
TPos min_ex, max_ex;
TPos min_ey, max_ey;
@@ -440,8 +442,6 @@ typedef ptrdiff_t FT_PtrDist;
int band_size;
int band_shoot;
ft_jmp_buf jump_buffer;
void* buffer;
long buffer_size;
@@ -196,7 +196,7 @@ class Formatter:
skip_entry = 1 # this happens e.g. for `/empty/' entries
if skip_entry:
continue;
continue
self.block_enter( block )
+1 -1
View File
@@ -628,7 +628,7 @@ class HtmlFormatter( Formatter ):
for f in self.headers.keys():
if block.source.filename.find( f ) >= 0:
header = self.headers[f] + ' (' + f + ')'
break;
break
# if not header:
# sys.stderr.write(
+2 -2
View File
@@ -449,9 +449,9 @@
fseek( new, getRandom( 0, item->len - 1 ), SEEK_SET );
if ( item->isbinary )
putc( getRandom( 0, 0xff ), new );
putc( getRandom( 0, 0xFF ), new );
else if ( item->isascii )
putc( getRandom( 0x20, 0x7e ), new );
putc( getRandom( 0x20, 0x7E ), new );
else
{
int hex = getRandom( 0, 15 );
+8 -8
View File
@@ -20,7 +20,7 @@
int i;
for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L )
{
FT_Fixed f1, f2;
double d2;
@@ -46,7 +46,7 @@
int i;
for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L )
{
FT_Fixed f1, f2;
double d2;
@@ -72,7 +72,7 @@
int i;
for ( i = 0; i < FT_ANGLE_PI2-0x2000000; i += 0x10000 )
for ( i = 0; i < FT_ANGLE_PI2 - 0x2000000L; i += 0x10000L )
{
FT_Fixed f1, f2;
double d2;
@@ -98,7 +98,7 @@
int i;
for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L )
{
FT_Fixed c2, s2;
double l, a, c1, s1;
@@ -133,7 +133,7 @@
int i;
for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L )
{
FT_Vector v;
double a, c1, s1;
@@ -166,7 +166,7 @@
int i;
for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L )
{
FT_Vector v;
FT_Fixed l, l2;
@@ -193,7 +193,7 @@
int rotate;
for ( rotate = 0; rotate < FT_ANGLE_2PI; rotate += 0x10000 )
for ( rotate = 0; rotate < FT_ANGLE_2PI; rotate += 0x10000L )
{
double ra, cra, sra;
int i;
@@ -203,7 +203,7 @@
cra = cos( ra );
sra = sin( ra );
for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 )
for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L )
{
FT_Fixed c2, s2, c4, s4;
FT_Vector v;
+1 -1
View File
@@ -481,7 +481,7 @@
SFNT_Service sfnt;
/* TT_SERVICES_GET derefers `library' in PIC mode */
/* TT_SERVICES_GET dereferences `library' in PIC mode */
#ifdef FT_CONFIG_OPTION_PIC
if ( !driver )
return NULL;
+7 -7
View File
@@ -3059,7 +3059,7 @@
#define DO_MD /* nothing */
#define DO_MPPEM \
#define DO_MPPEM \
args[0] = CUR_Func_cur_ppem();
@@ -3072,7 +3072,7 @@
#else
#define DO_MPS \
#define DO_MPS \
args[0] = CUR_Func_cur_ppem();
#endif /* 0 */
@@ -5625,7 +5625,7 @@
/*************************************************************************/
/* */
/* INSTCTRL[]: INSTruction ConTRoL */
/* Opcode range: 0x8e */
/* Opcode range: 0x8E */
/* Stack: int32 int32 --> */
/* */
static void
@@ -7654,7 +7654,7 @@
}
#endif
P = (FT_ULong)CUR_Func_cur_ppem();
P = (FT_ULong)CUR_Func_cur_ppem();
nump = (FT_ULong)args[0];
for ( k = 1; k <= nump; k++ )
@@ -9004,9 +9004,9 @@
/* If any errors have occurred, function tables may be broken. */
/* Force a re-execution of `prep' and `fpgm' tables if no */
/* bytecode debugger is run. */
if ( CUR.error
&& !CUR.instruction_trap
&& CUR.curRange == tt_coderange_glyph )
if ( CUR.error &&
!CUR.instruction_trap &&
CUR.curRange == tt_coderange_glyph )
{
FT_TRACE1(( " The interpreter returned error 0x%x\n", CUR.error ));
exc->size->bytecode_ready = -1;
+62 -53
View File
@@ -256,89 +256,89 @@
#define TRICK_SFNT_ID_prep 2
{ /* MingLiU 1995 */
{ 0x05bcf058, 0x000002e4 }, /* cvt */
{ 0x28233bf1, 0x000087c4 }, /* fpgm */
{ 0xa344a1ea, 0x000001e1 } /* prep */
{ 0x05BCF058UL, 0x000002E4UL }, /* cvt */
{ 0x28233BF1UL, 0x000087C4UL }, /* fpgm */
{ 0xA344A1EAUL, 0x000001E1UL } /* prep */
},
{ /* MingLiU 1996- */
{ 0x05bcf058, 0x000002e4 }, /* cvt */
{ 0x28233bf1, 0x000087c4 }, /* fpgm */
{ 0xa344a1eb, 0x000001e1 } /* prep */
{ 0x05BCF058UL, 0x000002E4UL }, /* cvt */
{ 0x28233BF1UL, 0x000087C4UL }, /* fpgm */
{ 0xA344A1EBUL, 0x000001E1UL } /* prep */
},
{ /* DFKaiShu */
{ 0x11e5ead4, 0x00000350 }, /* cvt */
{ 0x5a30ca3b, 0x00009063 }, /* fpgm */
{ 0x13a42602, 0x0000007e } /* prep */
{ 0x11E5EAD4UL, 0x00000350UL }, /* cvt */
{ 0x5A30CA3BUL, 0x00009063UL }, /* fpgm */
{ 0x13A42602UL, 0x0000007EUL } /* prep */
},
{ /* HuaTianKaiTi */
{ 0xfffbfffc, 0x00000008 }, /* cvt */
{ 0x9c9e48b8, 0x0000bea2 }, /* fpgm */
{ 0x70020112, 0x00000008 } /* prep */
{ 0xFFFBFFFCUL, 0x00000008UL }, /* cvt */
{ 0x9C9E48B8UL, 0x0000BEA2UL }, /* fpgm */
{ 0x70020112UL, 0x00000008UL } /* prep */
},
{ /* HuaTianSongTi */
{ 0xfffbfffc, 0x00000008 }, /* cvt */
{ 0x0a5a0483, 0x00017c39 }, /* fpgm */
{ 0x70020112, 0x00000008 } /* prep */
{ 0xFFFBFFFCUL, 0x00000008UL }, /* cvt */
{ 0x0A5A0483UL, 0x00017C39UL }, /* fpgm */
{ 0x70020112UL, 0x00000008UL } /* prep */
},
{ /* NEC fadpop7.ttf */
{ 0x00000000, 0x00000000 }, /* cvt */
{ 0x40c92555, 0x000000e5 }, /* fpgm */
{ 0xa39b58e3, 0x0000117c } /* prep */
{ 0x00000000UL, 0x00000000UL }, /* cvt */
{ 0x40C92555UL, 0x000000E5UL }, /* fpgm */
{ 0xA39B58E3UL, 0x0000117CUL } /* prep */
},
{ /* NEC fadrei5.ttf */
{ 0x00000000, 0x00000000 }, /* cvt */
{ 0x33c41652, 0x000000e5 }, /* fpgm */
{ 0x26d6c52a, 0x00000f6a } /* prep */
{ 0x00000000UL, 0x00000000UL }, /* cvt */
{ 0x33C41652UL, 0x000000E5UL }, /* fpgm */
{ 0x26D6C52AUL, 0x00000F6AUL } /* prep */
},
{ /* NEC fangot7.ttf */
{ 0x00000000, 0x00000000 }, /* cvt */
{ 0x6db1651d, 0x0000019d }, /* fpgm */
{ 0x6c6e4b03, 0x00002492 } /* prep */
{ 0x00000000UL, 0x00000000UL }, /* cvt */
{ 0x6DB1651DUL, 0x0000019DUL }, /* fpgm */
{ 0x6C6E4B03UL, 0x00002492UL } /* prep */
},
{ /* NEC fangyo5.ttf */
{ 0x00000000, 0x00000000 }, /* cvt */
{ 0x40c92555, 0x000000e5 }, /* fpgm */
{ 0xde51fad0, 0x0000117c } /* prep */
{ 0x00000000UL, 0x00000000UL }, /* cvt */
{ 0x40C92555UL, 0x000000E5UL }, /* fpgm */
{ 0xDE51FAD0UL, 0x0000117CUL } /* prep */
},
{ /* NEC fankyo5.ttf */
{ 0x00000000, 0x00000000 }, /* cvt */
{ 0x85e47664, 0x000000e5 }, /* fpgm */
{ 0xa6c62831, 0x00001caa } /* prep */
{ 0x00000000UL, 0x00000000UL }, /* cvt */
{ 0x85E47664UL, 0x000000E5UL }, /* fpgm */
{ 0xA6C62831UL, 0x00001CAAUL } /* prep */
},
{ /* NEC fanrgo5.ttf */
{ 0x00000000, 0x00000000 }, /* cvt */
{ 0x2d891cfd, 0x0000019d }, /* fpgm */
{ 0xa0604633, 0x00001de8 } /* prep */
{ 0x00000000UL, 0x00000000UL }, /* cvt */
{ 0x2D891CFDUL, 0x0000019DUL }, /* fpgm */
{ 0xA0604633UL, 0x00001DE8UL } /* prep */
},
{ /* NEC fangot5.ttc */
{ 0x00000000, 0x00000000 }, /* cvt */
{ 0x40aa774c, 0x000001cb }, /* fpgm */
{ 0x9b5caa96, 0x00001f9a } /* prep */
{ 0x00000000UL, 0x00000000UL }, /* cvt */
{ 0x40AA774CUL, 0x000001CBUL }, /* fpgm */
{ 0x9B5CAA96UL, 0x00001F9AUL } /* prep */
},
{ /* NEC fanmin3.ttc */
{ 0x00000000, 0x00000000 }, /* cvt */
{ 0x0d3de9cb, 0x00000141 }, /* fpgm */
{ 0xd4127766, 0x00002280 } /* prep */
{ 0x00000000UL, 0x00000000UL }, /* cvt */
{ 0x0D3DE9CBUL, 0x00000141UL }, /* fpgm */
{ 0xD4127766UL, 0x00002280UL } /* prep */
},
{ /* NEC FA-Gothic, 1996 */
{ 0x00000000, 0x00000000 }, /* cvt */
{ 0x4a692698, 0x000001f0 }, /* fpgm */
{ 0x340d4346, 0x00001fca } /* prep */
{ 0x00000000UL, 0x00000000UL }, /* cvt */
{ 0x4A692698UL, 0x000001F0UL }, /* fpgm */
{ 0x340D4346UL, 0x00001FCAUL } /* prep */
},
{ /* NEC FA-Minchou, 1996 */
{ 0x00000000, 0x00000000 }, /* cvt */
{ 0xcd34c604, 0x00000166 }, /* fpgm */
{ 0x6cf31046, 0x000022b0 } /* prep */
{ 0x00000000UL, 0x00000000UL }, /* cvt */
{ 0xCD34C604UL, 0x00000166UL }, /* fpgm */
{ 0x6CF31046UL, 0x000022B0UL } /* prep */
},
{ /* NEC FA-RoundGothicB, 1996 */
{ 0x00000000, 0x00000000 }, /* cvt */
{ 0x5da75315, 0x0000019d }, /* fpgm */
{ 0x40745a5f, 0x000022e0 } /* prep */
{ 0x00000000UL, 0x00000000UL }, /* cvt */
{ 0x5DA75315UL, 0x0000019DUL }, /* fpgm */
{ 0x40745A5FUL, 0x000022E0UL } /* prep */
},
{ /* NEC FA-RoundGothicM, 1996 */
{ 0x00000000, 0x00000000 }, /* cvt */
{ 0xf055fc48, 0x000001c2 }, /* fpgm */
{ 0x3900ded3, 0x00001e18 } /* prep */
{ 0x00000000UL, 0x00000000UL }, /* cvt */
{ 0xF055FC48UL, 0x000001C2UL }, /* fpgm */
{ 0x3900DED3UL, 0x00001E18UL } /* prep */
}
};
@@ -972,6 +972,15 @@
FT_UShort n_twilight;
TT_MaxProfile* maxp = &face->max_profile;
/* clean up bytecode related data */
FT_FREE( size->function_defs );
FT_FREE( size->instruction_defs );
FT_FREE( size->cvt );
FT_FREE( size->storage );
if ( size->context )
TT_Done_Context( size->context );
tt_glyphzone_done( &size->twilight );
size->bytecode_ready = -1;
size->cvt_ready = -1;
@@ -1116,6 +1125,7 @@
TT_Size size = (TT_Size)ttsize;
FT_Error error = FT_Err_Ok;
#ifdef TT_USE_BYTECODE_INTERPRETER
size->bytecode_ready = -1;
size->cvt_ready = -1;
@@ -1146,8 +1156,7 @@
#ifdef TT_USE_BYTECODE_INTERPRETER
if ( size->bytecode_ready >= 0 )
tt_size_done_bytecode( ttsize );
tt_size_done_bytecode( ttsize );
#endif
size->ttmetrics.valid = FALSE;
+13
View File
@@ -580,6 +580,12 @@
/* don't include delimiters */
string_size = (FT_Long)( ( parser->root.cursor - cur - 2 + 1 ) / 2 );
if ( !string_size )
{
FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" ));
error = FT_THROW( Invalid_File_Format );
goto Fail;
}
if ( FT_REALLOC( string_buf, old_string_size, string_size ) )
goto Fail;
@@ -661,6 +667,13 @@
status = BEFORE_TABLE_DIR;
face->ttf_size = 12 + 16 * num_tables;
if ( (FT_ULong)( limit - parser->root.cursor ) < face->ttf_size )
{
FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" ));
error = FT_THROW( Invalid_File_Format );
goto Fail;
}
if ( FT_REALLOC( face->ttf_data, 12, face->ttf_size ) )
goto Fail;
}
+5 -5
View File
@@ -72,12 +72,12 @@
FT_FRAME_START( 248 ),
FT_FRAME_ULONG_LE ( magic ), /* PE00 */
FT_FRAME_USHORT_LE ( machine ), /* 0x014c - i386 */
FT_FRAME_USHORT_LE ( machine ), /* 0x014C - i386 */
FT_FRAME_USHORT_LE ( number_of_sections ),
FT_FRAME_SKIP_BYTES( 12 ),
FT_FRAME_USHORT_LE ( size_of_optional_header ),
FT_FRAME_SKIP_BYTES( 2 ),
FT_FRAME_USHORT_LE ( magic32 ), /* 0x10b */
FT_FRAME_USHORT_LE ( magic32 ), /* 0x10B */
FT_FRAME_SKIP_BYTES( 110 ),
FT_FRAME_ULONG_LE ( rsrc_virtual_address ),
FT_FRAME_ULONG_LE ( rsrc_size ),
@@ -412,9 +412,9 @@
pe32_header.rsrc_size ));
if ( pe32_header.magic != WINFNT_PE_MAGIC /* check full signature */ ||
pe32_header.machine != 0x014c /* i386 */ ||
pe32_header.size_of_optional_header != 0xe0 /* FIXME */ ||
pe32_header.magic32 != 0x10b )
pe32_header.machine != 0x014C /* i386 */ ||
pe32_header.size_of_optional_header != 0xE0 /* FIXME */ ||
pe32_header.magic32 != 0x10B )
{
FT_TRACE2(( "this file has an invalid PE header\n" ));
error = FT_THROW( Invalid_File_Format );