[cff] Ignore unknown operators in charstrings.

Patch suggested by Miles.Lau <sunliang_liu@foxitsoftware.com>.

* src/cff/cffgload.c (cff_decoder_parse_charstrings): Emit tracing
message for unknown operators and continue instead of exiting with a
syntax error.
This commit is contained in:
Werner Lemberg 2011-02-01 07:36:27 +01:00
parent 18931a5a5d
commit 75df70600f
2 changed files with 14 additions and 5 deletions

View File

@ -1,3 +1,12 @@
2011-02-01 Werner Lemberg <wl@gnu.org>
[cff] Ignore unknown operators in charstrings.
Patch suggested by Miles.Lau <sunliang_liu@foxitsoftware.com>.
* src/cff/cffgload.c (cff_decoder_parse_charstrings): Emit tracing
message for unknown operators and continue instead of exiting with a
syntax error.
2011-02-01 Werner Lemberg <wl@gnu.org> 2011-02-01 Werner Lemberg <wl@gnu.org>
[truetype] FT_LOAD_PEDANTIC now affects `prep' and `fpgm' also. [truetype] FT_LOAD_PEDANTIC now affects `prep' and `fpgm' also.

View File

@ -4,8 +4,7 @@
/* */ /* */
/* OpenType Glyph Loader (body). */ /* OpenType Glyph Loader (body). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ /* Copyright 1996-2011 by */
/* 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -1159,8 +1158,8 @@
op = cff_op_flex1; op = cff_op_flex1;
break; break;
default: default:
/* decrement ip for syntax error message */ FT_TRACE4(( " unknown op (12, %d)\n", v ));
ip--; break;
} }
} }
break; break;
@ -1213,11 +1212,12 @@
op = cff_op_hvcurveto; op = cff_op_hvcurveto;
break; break;
default: default:
FT_TRACE4(( " unknown op (%d)\n", v ));
break; break;
} }
if ( op == cff_op_unknown ) if ( op == cff_op_unknown )
goto Syntax_Error; continue;
/* check arguments */ /* check arguments */
req_args = cff_argument_counts[op]; req_args = cff_argument_counts[op];