1 --- freetype-2.0.4/src/type1/t1load.c.orig Tue Jun 19 10:28:23 2001
2 +++ freetype-2.0.4/src/type1/t1load.c Sat Jun 30 00:00:25 2001
5 #include <string.h> /* for strncmp(), strcmp() */
6 #include <ctype.h> /* for isalnum() */
10 /*************************************************************************/
13 for ( n = 0; n < loader->num_subrs; n++ )
17 + FT_Byte* base, *temp;
20 /* If the next token isn't `dup', we are also done. This */
21 @@ -1150,12 +1149,18 @@
23 if ( face->type1.private_dict.lenIV >= 0 )
25 - psaux->t1_decrypt( base, size, 4330 );
26 + /* decrypt writes to base - make temporary copy */
27 + if ( (temp=malloc( size )) == NULL )
29 + MEM_Copy( temp, base, size );
30 + psaux->t1_decrypt( temp, size, 4330 );
31 size -= face->type1.private_dict.lenIV;
32 base += face->type1.private_dict.lenIV;
33 + error = T1_Add_Table( table, index, temp+4, size );
38 error = T1_Add_Table( table, index, base, size );
44 PSAux_Interface* psaux = (PSAux_Interface*)face->psaux;
47 + FT_Byte* cur, *temp;
48 FT_Byte* limit = parser->root.limit;
50 FT_UInt notdef_index = 0;
51 @@ -1282,12 +1286,18 @@
53 if ( face->type1.private_dict.lenIV >= 0 )
55 - psaux->t1_decrypt( base, size, 4330 );
56 + /* decrypt writes to base - make temporary copy */
57 + if ( (temp = malloc( size )) == NULL )
59 + MEM_Copy( temp, base, size );
60 + psaux->t1_decrypt( temp, size, 4330 );
61 size -= face->type1.private_dict.lenIV;
62 base += face->type1.private_dict.lenIV;
63 + error = T1_Add_Table( code_table, n, temp+4, size );
68 error = T1_Add_Table( code_table, n, base, size );