summaryrefslogtreecommitdiff
path: root/src/type42
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2005-02-13 21:42:42 +0000
committerWerner Lemberg <wl@gnu.org>2005-02-13 21:42:42 +0000
commit1d565fb01bfe2cc02955b675230a600bb8bb1b56 (patch)
tree8f0fd8b24c512033033fcc81ae3b761405d4aea3 /src/type42
parenta33bd861d7866579953c990949831d8353c15a8e (diff)
* src/type1/t1load.c (read_binary_data): Return more meaningful
value. (parse_encoding, parse_subrs, parse_charstrings, parse_dict): Check parser error value after call to T1_Skip_PS_Token (where necessary). * src/type1/t1parse.c (T1_Get_Private_Dict): Check parser error value after call to T1_Skip_PS_Token. * src/cid/cidparse.c (cid_parser_new): Check parser error value after call to cid_parser_skip_PS_token. * src/type42/t42parse.c (t42_parse_encoding, t42_parse_sfnts, t42_parse_charstrings, t42_parse_dict): Check parser error value after call to T1_Skip_PS_Token (where necessary). * src/psaux/psobjc.c (skip_string, ps_parser_skip_PS_token, ps_tobytes): Add error messages.
Diffstat (limited to 'src/type42')
-rw-r--r--src/type42/t42parse.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/type42/t42parse.c b/src/type42/t42parse.c
index 30846c07..b5139e53 100644
--- a/src/type42/t42parse.c
+++ b/src/type42/t42parse.c
@@ -4,7 +4,7 @@
/* */
/* Type 42 font parser (body). */
/* */
-/* Copyright 2002, 2003, 2004 by Roberto Alameda. */
+/* Copyright 2002, 2003, 2004, 2005 by Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@@ -412,14 +412,16 @@
parser->root.cursor = cur;
T1_Skip_PS_Token( parser );
+ if ( parser->root.error )
+ return;
len = parser->root.cursor - cur;
parser->root.error = T1_Add_Table( char_table, charcode,
cur, len + 1 );
- char_table->elements[charcode][len] = '\0';
if ( parser->root.error )
return;
+ char_table->elements[charcode][len] = '\0';
n++;
}
@@ -550,6 +552,8 @@
string_size = T1_ToInt( parser );
T1_Skip_PS_Token( parser ); /* `RD' */
+ if ( parser->root.error )
+ return;
string_buf = parser->root.cursor + 1; /* one space after `RD' */
@@ -691,6 +695,8 @@
T1_Skip_PS_Token( parser );
+ if ( parser->root.error )
+ return;
T1_Skip_Spaces( parser );
cur = parser->root.cursor;
@@ -705,6 +711,8 @@
break;
}
T1_Skip_PS_Token( parser );
+ if ( parser->root.error )
+ return;
T1_Skip_Spaces( parser );
}
}
@@ -767,6 +775,8 @@
break;
T1_Skip_PS_Token( parser );
+ if ( parser->root.error )
+ return;
if ( *cur == '/' )
{
@@ -1003,6 +1013,8 @@
break;
T1_Skip_PS_Token( parser );
+ if ( parser->root.error )
+ goto Exit;
T1_Skip_Spaces ( parser );
cur = parser->root.cursor;
}
@@ -1033,6 +1045,8 @@
parser->root.cursor = cur;
T1_Skip_PS_Token( parser );
+ if ( parser->root.error )
+ goto Exit;
len = parser->root.cursor - cur;
@@ -1069,11 +1083,16 @@
}
}
else
+ {
T1_Skip_PS_Token( parser );
+ if ( parser->root.error )
+ goto Exit;
+ }
T1_Skip_Spaces( parser );
}
+ Exit:
return parser->root.error;
}