diff options
Diffstat (limited to 'src/gxvalid/gxvopbd.c')
-rw-r--r-- | src/gxvalid/gxvopbd.c | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/src/gxvalid/gxvopbd.c b/src/gxvalid/gxvopbd.c index eb2d26121..12a21d46f 100644 --- a/src/gxvalid/gxvopbd.c +++ b/src/gxvalid/gxvopbd.c @@ -15,6 +15,15 @@ /* */ /***************************************************************************/ +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + #include "gxvalid.h" #include "gxvcommn.h" @@ -29,7 +38,6 @@ #define FT_COMPONENT trace_gxvopbd - /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -45,7 +53,8 @@ } GXV_opbd_DataRec, *GXV_opbd_Data; -#define GXV_OPBD_DATA(FIELD) GXV_TABLE_DATA( opbd, FIELD ) + +#define GXV_OPBD_DATA( FIELD ) GXV_TABLE_DATA( opbd, FIELD ) /*************************************************************************/ @@ -71,20 +80,19 @@ if ( value.u < GXV_OPBD_DATA( valueOffset_min ) ) GXV_OPBD_DATA( valueOffset_min ) = value.u; - for ( i = 0; i < 4; i++ ) { GXV_LIMIT_CHECK( 2 ); delta_value = FT_NEXT_SHORT( p ); - if ( GXV_OPBD_DATA( format ) ) /* format 1, value is ctrl pt. */ + if ( GXV_OPBD_DATA( format ) ) /* format 1, value is ctrl pt. */ { if ( delta_value == -1 ) continue; gxv_ctlPoint_validate( glyph, delta_value, valid ); } - else /* format 0, value is distance */ + else /* format 0, value is distance */ continue; } } @@ -130,12 +138,16 @@ { GXV_LookupValueDesc value; + FT_UNUSED( lookuptbl_limit ); + FT_UNUSED( valid ); + - value.u = base_value.u + ( relative_gindex * 4 * sizeof ( FT_Short ) ); + value.u = base_value.u + relative_gindex * 4 * sizeof ( FT_Short ); return value; } + /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -163,9 +175,9 @@ valid->table_data = opbd; valid->face = face; - FT_TRACE3(( "validation opbd table\n" )); + FT_TRACE3(( "validating `opbd' table\n" )); GXV_INIT; - GXV_OPBD_DATA( valueOffset_min ) = 0xFFFF; + GXV_OPBD_DATA( valueOffset_min ) = 0xFFFFU; GXV_LIMIT_CHECK( 4 + 2 ); @@ -173,31 +185,30 @@ GXV_OPBD_DATA( format ) = FT_NEXT_USHORT( p ); - /* 0x00010000 is only defined (1996) */ + /* only 0x00010000 is defined (1996) */ GXV_TRACE(( "(version=0x%08x)\n", version )); if ( 0x00010000UL != version ) FT_INVALID_FORMAT; - /* 0, 1 are only defined (1996) */ + /* only values 0 and 1 are defined (1996) */ GXV_TRACE(( "(format=0x%04x)\n", GXV_OPBD_DATA( format ) )); 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; + gxv_LookupTable_validate( p, limit, valid ); p += valid->subtable_length; - if ( p > table + GXV_OPBD_DATA( valueOffset_min ) ) { - GXV_TRACE(( "found overlap between LookupTable and opbd_value array\n" )); + GXV_TRACE(( + "found overlap between LookupTable and opbd_value array\n" )); FT_INVALID_OFFSET; } - FT_TRACE4(( "\n" )); } |