[otvalid] Update common table handling to OpenType 1.8.2.

* src/otvalid/otvcommn.c (otv_Device_validate): Handle
VariationIndex subtable.
(otv_Lookup_validate): Handle MarkFilteringSet.
This commit is contained in:
Werner Lemberg 2017-09-23 10:29:26 +02:00
parent e7ac8e40e8
commit 2b79d25f22
2 changed files with 27 additions and 9 deletions

View File

@ -5,6 +5,14 @@
* build/windows/ftver.rc: New VERSIONINFO resource.
* build/windows/vc2010/freetype.vcxproj: Further improvements.
2017-09-23 Werner Lemberg <wl@gnu.org>
[otvalid] Update common table handling to OpenType 1.8.2.
* src/otvalid/otvcommn.c (otv_Device_validate): Handle
VariationIndex subtable.
(otv_Lookup_validate): Handle MarkFilteringSet.
2017-09-23 Ben Wagner <bungeman@google.com>
[truetype] Really fix #52082.

View File

@ -313,19 +313,26 @@
OTV_NAME_ENTER( "Device" );
OTV_LIMIT_CHECK( 8 );
OTV_LIMIT_CHECK( 6 );
StartSize = FT_NEXT_USHORT( p );
EndSize = FT_NEXT_USHORT( p );
DeltaFormat = FT_NEXT_USHORT( p );
if ( DeltaFormat < 1 || DeltaFormat > 3 )
FT_INVALID_FORMAT;
if ( DeltaFormat == 0x8000U )
{
/* VariationIndex, nothing to do */
}
else
{
if ( DeltaFormat < 1 || DeltaFormat > 3 )
FT_INVALID_FORMAT;
if ( EndSize < StartSize )
FT_INVALID_DATA;
if ( EndSize < StartSize )
FT_INVALID_DATA;
count = EndSize - StartSize + 1;
OTV_LIMIT_CHECK( ( 1 << DeltaFormat ) * count / 8 ); /* DeltaValue */
count = EndSize - StartSize + 1;
OTV_LIMIT_CHECK( ( 1 << DeltaFormat ) * count / 8 ); /* DeltaValue */
}
OTV_EXIT;
}
@ -347,7 +354,7 @@
OTV_Validator otvalid )
{
FT_Bytes p = table;
FT_UInt LookupType, SubTableCount;
FT_UInt LookupType, LookupFlag, SubTableCount;
OTV_Validate_Func validate;
@ -355,7 +362,7 @@
OTV_LIMIT_CHECK( 6 );
LookupType = FT_NEXT_USHORT( p );
p += 2; /* skip LookupFlag */
LookupFlag = FT_NEXT_USHORT( p );
SubTableCount = FT_NEXT_USHORT( p );
OTV_TRACE(( " (type %d)\n", LookupType ));
@ -373,6 +380,9 @@
for ( ; SubTableCount > 0; SubTableCount-- )
validate( table + FT_NEXT_USHORT( p ), otvalid );
if ( LookupFlag & 0x10 )
OTV_LIMIT_CHECK( 2 ); /* MarkFilteringSet */
OTV_EXIT;
}