summaryrefslogtreecommitdiff
path: root/gs/src/zbfont.c
diff options
context:
space:
mode:
authorAlex Cherepanov <alex.cherepanov@artifex.com>2007-02-07 21:42:46 +0000
committerAlex Cherepanov <alex.cherepanov@artifex.com>2007-02-07 21:42:46 +0000
commit4c976f6fbe3c1794387ae480b48070797895f486 (patch)
treebea39ee0be5c284290ada56618d066213e218b44 /gs/src/zbfont.c
parentd083caa5d9bf54469f67ef66bd4d620ce07a1532 (diff)
Check the content of the /Encoding array when the font is created
to detect invalid fonts early and match CET test 16-04-01. DIFFERENCES: None git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@7686 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/zbfont.c')
-rw-r--r--gs/src/zbfont.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gs/src/zbfont.c b/gs/src/zbfont.c
index 7789bb77c..825e72dc0 100644
--- a/gs/src/zbfont.c
+++ b/gs/src/zbfont.c
@@ -636,6 +636,16 @@ build_gs_font(i_ctx_t *i_ctx_p, os_ptr op, gs_font ** ppfont, font_type ftype,
if (!r_is_array(pencoding))
return_error(e_invalidfont);
}
+ if (pencoding) { /* observed Adobe behavior */
+ int count = r_size(pencoding);
+ int type = ftype ? t_name : t_integer;
+ while (count--) {
+ ref r;
+ if (array_get(imemory, pencoding, count, &r) < 0 ||
+ !(r_has_type(&r, type) || r_has_type(&r, t_null)))
+ return_error(e_typecheck);
+ }
+ }
if ((code = dict_int_param(op, "WMode", 0, 1, 0, &wmode)) < 0 ||
(code = dict_bool_param(op, "BitmapWidths", false, &bitmapwidths)) < 0 ||
(code = dict_int_param(op, "ExactSize", 0, 2, fbit_use_bitmaps, &exactsize)) < 0 ||