* src/type1/t1load.c (parse_subrs): Use an endless loop. There are fonts (like HELVI.PFB version 003.001, used on OS/2) which define some `subrs' elements more than once. Problem reported by Peter Weilbacher <mozilla@weilbacher.org>.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
diff --git a/ChangeLog b/ChangeLog
index ec32424..4cbfd6b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-11-03 Werner Lemberg <wl@gnu.org>
+
+ * src/type1/t1load.c (parse_subrs): Use an endless loop. There are
+ fonts (like HELVI.PFB version 003.001, used on OS/2) which define
+ some `subrs' elements more than once. Problem reported by Peter
+ Weilbacher <mozilla@weilbacher.org>.
+
2008-10-15 Graham Asher <graham.asher@btinternet.com>
* src/sfnt/ttpost.c (tt_post_default_names): Add `const'.
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index f945b69..34a17cc 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -179,7 +179,7 @@
if ( table->cursor + length > table->capacity )
{
FT_Error error;
- FT_Offset new_size = table->capacity;
+ FT_Offset new_size = table->capacity;
FT_Long in_offset;
@@ -376,7 +376,7 @@
/* skip octal escape or ignore backslash */
for ( i = 0; i < 3 && cur < limit; ++i )
{
- if ( ! IS_OCTAL_DIGIT( *cur ) )
+ if ( !IS_OCTAL_DIGIT( *cur ) )
break;
++cur;
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index 284b7d7..411a2aa 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -1330,9 +1330,9 @@
PS_Table table = &loader->subrs;
FT_Memory memory = parser->root.memory;
FT_Error error;
- FT_Int n, num_subrs;
+ FT_Int num_subrs;
- PSAux_Service psaux = (PSAux_Service)face->psaux;
+ PSAux_Service psaux = (PSAux_Service)face->psaux;
T1_Skip_Spaces( parser );
@@ -1366,18 +1366,17 @@
goto Fail;
}
- /* the format is simple: */
- /* */
- /* `index' + binary data */
- /* */
- for ( n = 0; n < num_subrs; n++ )
+ /* the format is simple: */
+ /* */
+ /* `index' + binary data */
+ /* */
+ for (;;)
{
FT_Long idx, size;
FT_Byte* base;
- /* If the next token isn't `dup', we are also done. This */
- /* happens when there are `holes' in the Subrs array. */
+ /* If the next token isn't `dup' we are done. */
if ( ft_strncmp( (char*)parser->root.cursor, "dup", 3 ) != 0 )
break;