From f48aec7b1ec398b01220ad137b7e8d4e0f7aa036 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 18 Jun 2007 07:07:55 +0000 Subject: [PATCH] * src/psaux/psobjs.c (ps_tofixedarray, ps_tocoordarray): Fix exit logic. (ps_parser_load_field) : Skip delimiters correctly. (ps_parser_load_field_table): Use `fields->array_max' instead of T1_MAX_TABLE_ELEMENTS to limit the number of arguments. --- ChangeLog | 9 +++++++++ src/psaux/psobjs.c | 18 +++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 21673950a..b21cb8d2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-06-18 Werner Lemberg + + * src/psaux/psobjs.c (ps_tofixedarray, ps_tocoordarray): Fix exit + logic. + (ps_parser_load_field) : Skip delimiters + correctly. + (ps_parser_load_field_table): Use `fields->array_max' instead of + T1_MAX_TABLE_ELEMENTS to limit the number of arguments. + 2006-06-17 Werner Lemberg * src/tools/ftrandom.c (font_size): New global variable. diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c index 8217fb92c..0ea81cd54 100644 --- a/src/psaux/psobjs.c +++ b/src/psaux/psobjs.c @@ -803,9 +803,6 @@ if ( cur >= limit ) goto Exit; - if ( coords != NULL && count >= max_coords ) - break; - if ( *cur == ender ) { cur++; @@ -814,6 +811,9 @@ old_cur = cur; + if ( coords != NULL && count >= max_coords ) + break; + /* call PS_Conv_ToFixed() even if coords == NULL */ /* to properly parse number at `cur' */ *( coords != NULL ? &coords[count] : &dummy ) = @@ -881,9 +881,6 @@ if ( cur >= limit ) goto Exit; - if ( values != NULL && count >= max_values ) - break; - if ( *cur == ender ) { cur++; @@ -892,6 +889,9 @@ old_cur = cur; + if ( values != NULL && count >= max_values ) + break; + /* call PS_Conv_ToFixed() even if coords == NULL */ /* to properly parse number at `cur' */ *( values != NULL ? &values[count] : &dummy ) = @@ -1182,7 +1182,7 @@ FT_Int result; - result = ps_tofixedarray( &token.start, token.limit, 4, temp, 0 ); + result = ps_tofixedarray( &cur, limit, 4, temp, 0 ); if ( result < 0 ) { @@ -1254,8 +1254,8 @@ error = PSaux_Err_Ignore; goto Exit; } - if ( num_elements > T1_MAX_TABLE_ELEMENTS ) - num_elements = T1_MAX_TABLE_ELEMENTS; + if ( (FT_UInt)num_elements > field->array_max ) + num_elements = field->array_max; old_cursor = parser->cursor; old_limit = parser->limit;