* src/cff/cffgload.c (CFF_Operator, cff_argument_counts,

cff_decoder_parse_charstrings): Handle (invalid)
`callothersubr' and `pop' instructions.
This commit is contained in:
Werner Lemberg 2008-09-22 11:28:46 +00:00
parent bd0f71aa96
commit b4c810e2b4
2 changed files with 40 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2008-09-22 Werner Lemberg <wl@gnu.org>
* src/cff/cffgload.c (CFF_Operator, cff_argument_counts,
cff_decoder_parse_charstrings): Handle (invalid)
`callothersubr' and `pop' instructions.
2008-09-22 John Tytgat <John.Tytgat@esko.com>
Fix Savannah bug #24307.

View File

@ -110,8 +110,11 @@
cff_op_callgsubr,
cff_op_return,
cff_op_hsbw, /* Type 1 opcode: invalid but seen in real life */
cff_op_closepath, /* ditto */
/* Type 1 opcodes: invalid but seen in real life */
cff_op_hsbw,
cff_op_closepath,
cff_op_callothersubr,
cff_op_pop,
/* do not remove */
cff_op_max
@ -198,6 +201,8 @@
0,
2, /* hsbw */
0,
0,
0
};
@ -1044,6 +1049,12 @@
case 15:
op = cff_op_eq;
break;
case 16:
op = cff_op_callothersubr;
break;
case 17:
op = cff_op_pop;
break;
case 18:
op = cff_op_drop;
break;
@ -2150,6 +2161,27 @@
args = stack;
break;
case cff_op_callothersubr:
/* this is an invalid Type 2 operator; however, there */
/* exist fonts which are incorrectly converted from probably */
/* Type 1 to CFF, and some parsers seem to accept it */
FT_TRACE4(( " callothersubr (invalid op)\n" ));
/* don't modify stack; handle the subr as `unknown' so that */
/* following `pop' operands use the arguments on stack */
break;
case cff_op_pop:
/* this is an invalid Type 2 operator; however, there */
/* exist fonts which are incorrectly converted from probably */
/* Type 1 to CFF, and some parsers seem to accept it */
FT_TRACE4(( " pop (invalid op)\n" ));
args++;
break;
case cff_op_and:
{
FT_Fixed cond = args[0] && args[1];