Fix handling of self-delimiting tokens.

This commit is contained in:
Werner Lemberg 2006-06-26 17:37:44 +00:00
parent c011f4cba1
commit e9a746674a
1 changed files with 12 additions and 2 deletions

View File

@ -563,8 +563,8 @@
/* anything else */
while ( cur < limit )
{
/* `*cur' might be invalid (e.g., `)' or `}'), but this is handled */
/* by the caller which will see this when it continues parsing */
/* *cur might be invalid (e.g., ')' or '}'), but this */
/* is handled by the test `cur == parser->cursor' below */
if ( IS_PS_DELIM( *cur ) )
break;
@ -572,6 +572,16 @@
}
Exit:
if ( cur == parser->cursor )
{
FT_ERROR(( "ps_parser_skip_PS_token: "
"current token is `%c', which is self-delimiting "
"but invalid at this point\n",
*cur ));
error = PSaux_Err_Invalid_File_Format;
}
FT_ASSERT( parser->error == PSaux_Err_Ok );
parser->error = error;
parser->cursor = cur;