summaryrefslogtreecommitdiff
path: root/psi
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2021-03-30 10:59:39 +0200
committerThomas Deutschmann <whissi@gentoo.org>2021-04-01 00:04:14 +0200
commit5ff1d6955496b3cf9a35042c9ac35db43bc336b1 (patch)
tree6d470f7eb448f59f53e8df1010aec9dad8ce1f72 /psi
parentImport Ghostscript 9.53.1 (diff)
downloadghostscript-gpl-patches-5ff1d6955496b3cf9a35042c9ac35db43bc336b1.tar.gz
ghostscript-gpl-patches-5ff1d6955496b3cf9a35042c9ac35db43bc336b1.tar.bz2
ghostscript-gpl-patches-5ff1d6955496b3cf9a35042c9ac35db43bc336b1.zip
Import Ghostscript 9.54ghostscript-9.54
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'psi')
-rw-r--r--psi/apitest.c6
-rw-r--r--psi/bfont.h2
-rw-r--r--psi/btoken.h2
-rw-r--r--psi/dmmain.c2
-rw-r--r--psi/dmmain.r2
-rw-r--r--psi/dpmain.c2
-rw-r--r--psi/dscparse.c2
-rw-r--r--psi/dscparse.h2
-rw-r--r--psi/dstack.h2
-rw-r--r--psi/dwdll.c2
-rw-r--r--psi/dwdll.h2
-rw-r--r--psi/dwimg.c2
-rw-r--r--psi/dwimg.h2
-rw-r--r--psi/dwmain.c2
-rw-r--r--psi/dwmain.rc2
-rw-r--r--psi/dwmainc.c4
-rw-r--r--psi/dwnodll.c2
-rw-r--r--psi/dwreg.c2
-rw-r--r--psi/dwreg.h2
-rw-r--r--psi/dwres.h2
-rw-r--r--psi/dwtext.c2
-rw-r--r--psi/dwtext.h2
-rw-r--r--psi/dwtrace.c2
-rw-r--r--psi/dwtrace.h2
-rw-r--r--psi/dxmain.c4
-rw-r--r--psi/dxmainc.c2
-rw-r--r--psi/estack.h2
-rw-r--r--psi/files.h2
-rw-r--r--psi/ghost.h2
-rw-r--r--psi/gs.c2
-rw-r--r--psi/gsdll.c2
-rw-r--r--psi/gsdll2.rc2
-rw-r--r--psi/gsdll32.rc2
-rw-r--r--psi/gserver.c2
-rw-r--r--psi/gsos2.rc2
-rw-r--r--psi/ialloc.c2
-rw-r--r--psi/ialloc.h2
-rw-r--r--psi/iapi.c2
-rw-r--r--psi/iapi.h2
-rw-r--r--psi/iastate.h2
-rw-r--r--psi/iastruct.h2
-rw-r--r--psi/ibnum.c2
-rw-r--r--psi/ibnum.h2
-rw-r--r--psi/ichar.h2
-rw-r--r--psi/ichar1.h2
-rw-r--r--psi/icharout.h2
-rw-r--r--psi/icid.h2
-rw-r--r--psi/icie.h2
-rw-r--r--psi/icolor.h2
-rw-r--r--psi/iconf.c2
-rw-r--r--psi/iconf.h2
-rw-r--r--psi/icontext.c2
-rw-r--r--psi/icontext.h2
-rw-r--r--psi/icremap.h2
-rw-r--r--psi/icsmap.h2
-rw-r--r--psi/icstate.h2
-rw-r--r--psi/iddict.h2
-rw-r--r--psi/iddstack.h2
-rw-r--r--psi/idebug.c2
-rw-r--r--psi/idebug.h2
-rw-r--r--psi/idict.c16
-rw-r--r--psi/idict.h2
-rw-r--r--psi/idictdef.h2
-rw-r--r--psi/idicttpl.h2
-rw-r--r--psi/idisp.c2
-rw-r--r--psi/idisp.h2
-rw-r--r--psi/idosave.h2
-rw-r--r--psi/idparam.c2
-rw-r--r--psi/idparam.h2
-rw-r--r--psi/idsdata.h2
-rw-r--r--psi/idstack.c2
-rw-r--r--psi/idstack.h2
-rw-r--r--psi/ierrors.h2
-rw-r--r--psi/iesdata.h2
-rw-r--r--psi/iestack.h2
-rw-r--r--psi/ifapi.h2
-rw-r--r--psi/ifcid.h2
-rw-r--r--psi/ifilter.h2
-rw-r--r--psi/ifilter2.h2
-rw-r--r--psi/ifont.h2
-rw-r--r--psi/ifont1.h2
-rw-r--r--psi/ifont2.h2
-rw-r--r--psi/ifont42.h2
-rw-r--r--psi/ifrpred.h2
-rw-r--r--psi/ifunc.h2
-rw-r--r--psi/ifwpred.h2
-rw-r--r--psi/igc.c2
-rw-r--r--psi/igc.h2
-rw-r--r--psi/igcref.c2
-rw-r--r--psi/igcstr.c2
-rw-r--r--psi/igcstr.h2
-rw-r--r--psi/igstate.h2
-rw-r--r--psi/iht.h2
-rw-r--r--psi/iimage.h2
-rw-r--r--psi/iinit.c2
-rw-r--r--psi/iinit.h2
-rw-r--r--psi/ilevel.h2
-rw-r--r--psi/ilocate.c2
-rw-r--r--psi/imain.c20
-rw-r--r--psi/imain.h2
-rw-r--r--psi/imainarg.c2
-rw-r--r--psi/imainarg.h2
-rw-r--r--psi/imemory.h2
-rw-r--r--psi/iminst.h2
-rw-r--r--psi/iname.c2
-rw-r--r--psi/iname.h2
-rw-r--r--psi/inamedef.h2
-rw-r--r--psi/inameidx.h2
-rw-r--r--psi/inames.h2
-rw-r--r--psi/inamestr.h2
-rw-r--r--psi/inobtokn.c2
-rw-r--r--psi/inouparm.c2
-rw-r--r--psi/int.mak33
-rw-r--r--psi/interp.c61
-rw-r--r--psi/interp.h2
-rw-r--r--psi/iosdata.h2
-rw-r--r--psi/iostack.h2
-rw-r--r--psi/ipacked.h2
-rw-r--r--psi/iparam.c2
-rw-r--r--psi/iparam.h2
-rw-r--r--psi/iparray.h2
-rw-r--r--psi/ipcolor.h2
-rw-r--r--psi/iplugin.c2
-rw-r--r--psi/iplugin.h2
-rw-r--r--psi/ireclaim.c2
-rw-r--r--psi/iref.h2
-rw-r--r--psi/isave.c2
-rw-r--r--psi/isave.h2
-rw-r--r--psi/iscan.c21
-rw-r--r--psi/iscan.h2
-rw-r--r--psi/iscanbin.c2
-rw-r--r--psi/iscanbin.h2
-rw-r--r--psi/iscannum.c2
-rw-r--r--psi/iscannum.h2
-rw-r--r--psi/isdata.h2
-rw-r--r--psi/isstate.h2
-rw-r--r--psi/istack.c2
-rw-r--r--psi/istack.h2
-rw-r--r--psi/istkparm.h2
-rw-r--r--psi/istream.h2
-rw-r--r--psi/istruct.h2
-rw-r--r--psi/itoken.h2
-rw-r--r--psi/iutil.c24
-rw-r--r--psi/iutil.h2
-rw-r--r--psi/iutil2.c2
-rw-r--r--psi/iutil2.h2
-rw-r--r--psi/ivmem2.h2
-rw-r--r--psi/ivmspace.h2
-rw-r--r--psi/main.h2
-rw-r--r--psi/mkfilelt.cpp2
-rw-r--r--psi/msvc.mak217
-rw-r--r--psi/msvc32.mak2
-rw-r--r--psi/msvc64.mak2
-rw-r--r--psi/nsisinst.nsi2
-rw-r--r--psi/oparc.h2
-rw-r--r--psi/opcheck.h2
-rw-r--r--psi/opdef.h2
-rw-r--r--psi/oper.h2
-rw-r--r--psi/opextern.h2
-rw-r--r--psi/os2.mak2
-rw-r--r--psi/ostack.h2
-rw-r--r--psi/psapi.c2
-rw-r--r--psi/psapi.h2
-rw-r--r--psi/psromfs.mak2
-rw-r--r--psi/store.h2
-rw-r--r--psi/winint.mak6
-rw-r--r--psi/zalg.c80
-rw-r--r--psi/zarith.c2
-rw-r--r--psi/zarray.c2
-rw-r--r--psi/zbfont.c2
-rw-r--r--psi/zbseq.c2
-rw-r--r--psi/zcfont.c2
-rw-r--r--psi/zchar.c13
-rw-r--r--psi/zchar1.c2
-rw-r--r--psi/zchar2.c2
-rw-r--r--psi/zchar32.c2
-rw-r--r--psi/zchar42.c18
-rw-r--r--psi/zchar42.h2
-rw-r--r--psi/zcharout.c2
-rw-r--r--psi/zcharx.c2
-rw-r--r--psi/zcid.c2
-rw-r--r--psi/zcie.c2
-rw-r--r--psi/zcie.h2
-rw-r--r--psi/zcolor.c4
-rw-r--r--psi/zcolor.h2
-rw-r--r--psi/zcolor1.c2
-rw-r--r--psi/zcolor2.c2
-rw-r--r--psi/zcolor3.c2
-rw-r--r--psi/zcontrol.c2
-rw-r--r--psi/zcrd.c2
-rw-r--r--psi/zcsindex.c2
-rw-r--r--psi/zcspixel.c2
-rw-r--r--psi/zcssepr.c2
-rw-r--r--psi/zdevcal.c2
-rw-r--r--psi/zdevice.c20
-rw-r--r--psi/zdevice2.c2
-rw-r--r--psi/zdfilter.c2
-rw-r--r--psi/zdict.c2
-rw-r--r--psi/zdouble.c2
-rw-r--r--psi/zdps1.c2
-rw-r--r--psi/zdscpars.c2
-rw-r--r--psi/zfaes.c2
-rw-r--r--psi/zfapi.c20
-rw-r--r--psi/zfarc4.c15
-rw-r--r--psi/zfbcp.c2
-rw-r--r--psi/zfcid.c2
-rw-r--r--psi/zfcid0.c2
-rw-r--r--psi/zfcid1.c2
-rw-r--r--psi/zfcmap.c2
-rw-r--r--psi/zfdctd.c2
-rw-r--r--psi/zfdcte.c2
-rw-r--r--psi/zfdecode.c2
-rw-r--r--psi/zfile.c2
-rw-r--r--psi/zfile.h2
-rw-r--r--psi/zfile1.c2
-rw-r--r--psi/zfileio.c2
-rw-r--r--psi/zfilter.c2
-rw-r--r--psi/zfilter2.c2
-rw-r--r--psi/zfimscale.c6
-rw-r--r--psi/zfjbig2.c6
-rw-r--r--psi/zfjpx.c6
-rw-r--r--psi/zfmd5.c2
-rw-r--r--psi/zfont.c8
-rw-r--r--psi/zfont0.c2
-rw-r--r--psi/zfont1.c22
-rw-r--r--psi/zfont2.c12
-rw-r--r--psi/zfont32.c2
-rw-r--r--psi/zfont42.c2
-rw-r--r--psi/zfontenum.c48
-rw-r--r--psi/zform.c4
-rw-r--r--psi/zfproc.c2
-rw-r--r--psi/zfrsd.c2
-rw-r--r--psi/zfrsd.h2
-rw-r--r--psi/zfsample.c16
-rw-r--r--psi/zfsha2.c2
-rw-r--r--psi/zfunc.c2
-rw-r--r--psi/zfunc.h2
-rw-r--r--psi/zfunc0.c2
-rw-r--r--psi/zfunc3.c2
-rw-r--r--psi/zfunc4.c2
-rw-r--r--psi/zfzlib.c2
-rw-r--r--psi/zgeneric.c2
-rw-r--r--psi/zgstate.c2
-rw-r--r--psi/zht.c2
-rw-r--r--psi/zht1.c2
-rw-r--r--psi/zht2.c24
-rw-r--r--psi/zht2.h2
-rw-r--r--psi/zicc.c2
-rw-r--r--psi/zicc.h2
-rw-r--r--psi/zimage.c2
-rw-r--r--psi/zimage3.c2
-rw-r--r--psi/ziodev.c2
-rw-r--r--psi/ziodev2.c2
-rw-r--r--psi/ziodevsc.c2
-rw-r--r--psi/zmath.c2
-rw-r--r--psi/zmatrix.c2
-rw-r--r--psi/zmedia2.c2
-rw-r--r--psi/zmisc.c2
-rw-r--r--psi/zmisc1.c2
-rw-r--r--psi/zmisc2.c2
-rw-r--r--psi/zmisc3.c2
-rw-r--r--psi/zncdummy.c2
-rw-r--r--psi/zpacked.c2
-rw-r--r--psi/zpaint.c2
-rw-r--r--psi/zpath.c2
-rw-r--r--psi/zpath1.c2
-rw-r--r--psi/zpcolor.c4
-rw-r--r--psi/zpdf_r6.c4
-rw-r--r--psi/zpdfops.c2
-rw-r--r--psi/zrelbit.c2
-rw-r--r--psi/zshade.c6
-rw-r--r--psi/zstack.c2
-rw-r--r--psi/zstring.c2
-rw-r--r--psi/zsysvm.c2
-rw-r--r--psi/ztoken.c2
-rw-r--r--psi/ztrans.c21
-rw-r--r--psi/ztrap.c2
-rw-r--r--psi/ztype.c2
-rw-r--r--psi/zupath.c2
-rw-r--r--psi/zusparam.c2
-rw-r--r--psi/zutf8.c2
-rw-r--r--psi/zvmem.c37
-rw-r--r--psi/zvmem2.c2
-rw-r--r--psi/zwinutf8.c2
284 files changed, 797 insertions, 511 deletions
diff --git a/psi/apitest.c b/psi/apitest.c
index 6f5bc41d..fbd12f50 100644
--- a/psi/apitest.c
+++ b/psi/apitest.c
@@ -72,7 +72,7 @@ static void *gs_main(void *arg)
gsargv[i] = my_argv[i];
gsargv[my_argv_file] = text;
gsargc = my_argc;
-
+
strncpy(text, my_argv[my_argv_file], sizeof(text));
text[sizeof(text)-1]=0;
pos = strlen(text);
@@ -111,11 +111,11 @@ int main(int argc, char *argv[])
my_argc = argc;
my_argv = argv;
-
+
for (i=0; i < argc; i++)
if (!strcmp(argv[i], "-o"))
break;
-
+
if (i >= argc-1)
{
fprintf(stderr, "Expected a -o argument to rewrite!\n");
diff --git a/psi/bfont.h b/psi/bfont.h
index 94748f34..06110f47 100644
--- a/psi/bfont.h
+++ b/psi/bfont.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/btoken.h b/psi/btoken.h
index a93f2a57..71e7918c 100644
--- a/psi/btoken.h
+++ b/psi/btoken.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dmmain.c b/psi/dmmain.c
index 24801a99..1af0d787 100644
--- a/psi/dmmain.c
+++ b/psi/dmmain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dmmain.r b/psi/dmmain.r
index 1a7f2a7a..b8fdafcd 100644
--- a/psi/dmmain.r
+++ b/psi/dmmain.r
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dpmain.c b/psi/dpmain.c
index 0184892d..e862f378 100644
--- a/psi/dpmain.c
+++ b/psi/dpmain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dscparse.c b/psi/dscparse.c
index f7c28fc8..630ab415 100644
--- a/psi/dscparse.c
+++ b/psi/dscparse.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dscparse.h b/psi/dscparse.h
index d6af4d45..3c3a5484 100644
--- a/psi/dscparse.h
+++ b/psi/dscparse.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dstack.h b/psi/dstack.h
index e827197f..20b6a59f 100644
--- a/psi/dstack.h
+++ b/psi/dstack.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dwdll.c b/psi/dwdll.c
index f8594f8c..0d5740c2 100644
--- a/psi/dwdll.c
+++ b/psi/dwdll.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dwdll.h b/psi/dwdll.h
index 5422f06c..fad7d6b2 100644
--- a/psi/dwdll.h
+++ b/psi/dwdll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dwimg.c b/psi/dwimg.c
index e31bf8b2..c76a0665 100644
--- a/psi/dwimg.c
+++ b/psi/dwimg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dwimg.h b/psi/dwimg.h
index aff75b78..48f0cbf2 100644
--- a/psi/dwimg.h
+++ b/psi/dwimg.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dwmain.c b/psi/dwmain.c
index 2fe1e9d1..8c301963 100644
--- a/psi/dwmain.c
+++ b/psi/dwmain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dwmain.rc b/psi/dwmain.rc
index 4b473d7b..3e81c9d2 100644
--- a/psi/dwmain.rc
+++ b/psi/dwmain.rc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dwmainc.c b/psi/dwmainc.c
index 7fd21b91..7f3790ce 100644
--- a/psi/dwmainc.c
+++ b/psi/dwmainc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -168,7 +168,7 @@ gsdll_stdin_utf8(void *instance, char *buf, int len)
/* Previously the code here has always just checked for whether
* _read returns <= 0 to see whether we should exit. According
* to the docs -1 means error, 0 means EOF. Unfortunately,
- * building using VS2015 there appears to be a bug in the
+ * building using VS2015 there appears to be a bug in the
* runtime, whereby a line with a single return on it (on an
* ANSI encoded Text file at least) causes a 0 return value.
* We hack around this by second guessing the code. We clear
diff --git a/psi/dwnodll.c b/psi/dwnodll.c
index 382803c7..b6530bbd 100644
--- a/psi/dwnodll.c
+++ b/psi/dwnodll.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dwreg.c b/psi/dwreg.c
index c9debca7..cf25dbba 100644
--- a/psi/dwreg.c
+++ b/psi/dwreg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dwreg.h b/psi/dwreg.h
index bb59db68..87f6f672 100644
--- a/psi/dwreg.h
+++ b/psi/dwreg.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dwres.h b/psi/dwres.h
index ff6b5ed8..23e7da6e 100644
--- a/psi/dwres.h
+++ b/psi/dwres.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dwtext.c b/psi/dwtext.c
index 39c9d9bb..e3ffe225 100644
--- a/psi/dwtext.c
+++ b/psi/dwtext.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dwtext.h b/psi/dwtext.h
index e2457c8b..4fbc6e72 100644
--- a/psi/dwtext.h
+++ b/psi/dwtext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dwtrace.c b/psi/dwtrace.c
index 77b4d464..5905209c 100644
--- a/psi/dwtrace.c
+++ b/psi/dwtrace.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dwtrace.h b/psi/dwtrace.h
index 30612792..934b475c 100644
--- a/psi/dwtrace.h
+++ b/psi/dwtrace.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/dxmain.c b/psi/dxmain.c
index 728effd5..cbfd630c 100644
--- a/psi/dxmain.c
+++ b/psi/dxmain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1232,7 +1232,7 @@ int main(int argc, char *argv[])
code = 0;
}
}
-
+
if (code == 0)
code = gsapi_init_with_args(instance, nargc, nargv);
diff --git a/psi/dxmainc.c b/psi/dxmainc.c
index 396484ab..cff4d1cd 100644
--- a/psi/dxmainc.c
+++ b/psi/dxmainc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/estack.h b/psi/estack.h
index 706ca4be..42a5c0a8 100644
--- a/psi/estack.h
+++ b/psi/estack.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/files.h b/psi/files.h
index 2ce9c306..68d3395c 100644
--- a/psi/files.h
+++ b/psi/files.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ghost.h b/psi/ghost.h
index d25601cb..0f905b42 100644
--- a/psi/ghost.h
+++ b/psi/ghost.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/gs.c b/psi/gs.c
index 28fa6fce..9f48d12b 100644
--- a/psi/gs.c
+++ b/psi/gs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/gsdll.c b/psi/gsdll.c
index 670bdeef..841d3ee9 100644
--- a/psi/gsdll.c
+++ b/psi/gsdll.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/gsdll2.rc b/psi/gsdll2.rc
index 8712aedf..269dd04d 100644
--- a/psi/gsdll2.rc
+++ b/psi/gsdll2.rc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/gsdll32.rc b/psi/gsdll32.rc
index ecbea88c..a03540ac 100644
--- a/psi/gsdll32.rc
+++ b/psi/gsdll32.rc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/gserver.c b/psi/gserver.c
index ca3a3d02..6fbedc77 100644
--- a/psi/gserver.c
+++ b/psi/gserver.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/gsos2.rc b/psi/gsos2.rc
index aa6c9c95..b0bfb9fe 100644
--- a/psi/gsos2.rc
+++ b/psi/gsos2.rc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ialloc.c b/psi/ialloc.c
index f99398d4..d84ec000 100644
--- a/psi/ialloc.c
+++ b/psi/ialloc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ialloc.h b/psi/ialloc.h
index 7887cfa9..957a3b4f 100644
--- a/psi/ialloc.h
+++ b/psi/ialloc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iapi.c b/psi/iapi.c
index 25d2235f..a172a6c7 100644
--- a/psi/iapi.c
+++ b/psi/iapi.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iapi.h b/psi/iapi.h
index 862d631d..70033fa3 100644
--- a/psi/iapi.h
+++ b/psi/iapi.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iastate.h b/psi/iastate.h
index 98cdd3fd..46f95845 100644
--- a/psi/iastate.h
+++ b/psi/iastate.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iastruct.h b/psi/iastruct.h
index 211aa564..17fc9a89 100644
--- a/psi/iastruct.h
+++ b/psi/iastruct.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ibnum.c b/psi/ibnum.c
index 96230360..eb3cb007 100644
--- a/psi/ibnum.c
+++ b/psi/ibnum.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ibnum.h b/psi/ibnum.h
index 42607895..0aba1d4d 100644
--- a/psi/ibnum.h
+++ b/psi/ibnum.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ichar.h b/psi/ichar.h
index 18ecb005..55492987 100644
--- a/psi/ichar.h
+++ b/psi/ichar.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ichar1.h b/psi/ichar1.h
index f516c166..b4620c37 100644
--- a/psi/ichar1.h
+++ b/psi/ichar1.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/icharout.h b/psi/icharout.h
index 0c9a24d9..4d6d7c07 100644
--- a/psi/icharout.h
+++ b/psi/icharout.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/icid.h b/psi/icid.h
index 3e54e846..2d7c1d96 100644
--- a/psi/icid.h
+++ b/psi/icid.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/icie.h b/psi/icie.h
index e2b9e97b..9bcfbfec 100644
--- a/psi/icie.h
+++ b/psi/icie.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/icolor.h b/psi/icolor.h
index acea9234..0322b407 100644
--- a/psi/icolor.h
+++ b/psi/icolor.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iconf.c b/psi/iconf.c
index 18031142..eeeff2cb 100644
--- a/psi/iconf.c
+++ b/psi/iconf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iconf.h b/psi/iconf.h
index 3273de40..1de40872 100644
--- a/psi/iconf.h
+++ b/psi/iconf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/icontext.c b/psi/icontext.c
index 032522fa..c00aca05 100644
--- a/psi/icontext.c
+++ b/psi/icontext.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/icontext.h b/psi/icontext.h
index 1ba03bc5..5cba03d2 100644
--- a/psi/icontext.h
+++ b/psi/icontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/icremap.h b/psi/icremap.h
index e36d13f1..7af985fb 100644
--- a/psi/icremap.h
+++ b/psi/icremap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/icsmap.h b/psi/icsmap.h
index 72b91446..20f4682d 100644
--- a/psi/icsmap.h
+++ b/psi/icsmap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/icstate.h b/psi/icstate.h
index 2e66f6b5..1c90148a 100644
--- a/psi/icstate.h
+++ b/psi/icstate.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iddict.h b/psi/iddict.h
index e6e41cdc..fab826cd 100644
--- a/psi/iddict.h
+++ b/psi/iddict.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iddstack.h b/psi/iddstack.h
index 58d306fb..d0383d3b 100644
--- a/psi/iddstack.h
+++ b/psi/iddstack.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/idebug.c b/psi/idebug.c
index 02c4265a..fb6ce0c7 100644
--- a/psi/idebug.c
+++ b/psi/idebug.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/idebug.h b/psi/idebug.h
index ebfb74ef..8ffd5ccd 100644
--- a/psi/idebug.h
+++ b/psi/idebug.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/idict.c b/psi/idict.c
index b698a9fe..1078dff7 100644
--- a/psi/idict.c
+++ b/psi/idict.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -289,13 +289,6 @@ dict_find(const ref * pdref, const ref * pkey,
/* Compute hash. The only types we bother with are strings, */
/* names, and (unlikely, but worth checking for) integers. */
switch (r_type(pkey)) {
- case t_name:
- nidx = name_index(mem, pkey);
- nh:
- hash = dict_name_index_hash(nidx);
- kpack = packed_name_key(nidx);
- ktype = t_name;
- break;
case t_string: /* convert to a name first */
{
ref nref;
@@ -309,6 +302,13 @@ dict_find(const ref * pdref, const ref * pkey,
nidx = name_index(mem, &nref);
}
goto nh;
+ case t_name:
+ nidx = name_index(mem, pkey);
+ nh:
+ hash = dict_name_index_hash(nidx);
+ kpack = packed_name_key(nidx);
+ ktype = t_name;
+ break;
case t_real:
/*
* Make sure that equal reals and integers hash the same.
diff --git a/psi/idict.h b/psi/idict.h
index d5c19f28..d57b56a2 100644
--- a/psi/idict.h
+++ b/psi/idict.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/idictdef.h b/psi/idictdef.h
index e6417a54..5c85ded7 100644
--- a/psi/idictdef.h
+++ b/psi/idictdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/idicttpl.h b/psi/idicttpl.h
index c48330a9..b672a303 100644
--- a/psi/idicttpl.h
+++ b/psi/idicttpl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/idisp.c b/psi/idisp.c
index ab8d070c..ba855636 100644
--- a/psi/idisp.c
+++ b/psi/idisp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/idisp.h b/psi/idisp.h
index 215d915b..bb6d77a2 100644
--- a/psi/idisp.h
+++ b/psi/idisp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/idosave.h b/psi/idosave.h
index ea161b23..96fd631f 100644
--- a/psi/idosave.h
+++ b/psi/idosave.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/idparam.c b/psi/idparam.c
index 0fc0d9e6..dcb26ade 100644
--- a/psi/idparam.c
+++ b/psi/idparam.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/idparam.h b/psi/idparam.h
index 40983680..babc992b 100644
--- a/psi/idparam.h
+++ b/psi/idparam.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/idsdata.h b/psi/idsdata.h
index db1c956a..2171adf9 100644
--- a/psi/idsdata.h
+++ b/psi/idsdata.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/idstack.c b/psi/idstack.c
index 0e8615ab..e43673c3 100644
--- a/psi/idstack.c
+++ b/psi/idstack.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/idstack.h b/psi/idstack.h
index 111bcc6e..0dd6e9e2 100644
--- a/psi/idstack.h
+++ b/psi/idstack.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ierrors.h b/psi/ierrors.h
index 3f955b08..50f32128 100644
--- a/psi/ierrors.h
+++ b/psi/ierrors.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iesdata.h b/psi/iesdata.h
index 0ee0fb05..bc9019dc 100644
--- a/psi/iesdata.h
+++ b/psi/iesdata.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iestack.h b/psi/iestack.h
index 6ec64b47..2c857c15 100644
--- a/psi/iestack.h
+++ b/psi/iestack.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ifapi.h b/psi/ifapi.h
index a536ea43..21d53fb4 100644
--- a/psi/ifapi.h
+++ b/psi/ifapi.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ifcid.h b/psi/ifcid.h
index 65b4e991..e0e23859 100644
--- a/psi/ifcid.h
+++ b/psi/ifcid.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ifilter.h b/psi/ifilter.h
index fcc6009f..c15ae516 100644
--- a/psi/ifilter.h
+++ b/psi/ifilter.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ifilter2.h b/psi/ifilter2.h
index d9e4b922..82ea146c 100644
--- a/psi/ifilter2.h
+++ b/psi/ifilter2.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ifont.h b/psi/ifont.h
index 54581e96..6b54e9cb 100644
--- a/psi/ifont.h
+++ b/psi/ifont.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ifont1.h b/psi/ifont1.h
index c35c904e..10a83bc4 100644
--- a/psi/ifont1.h
+++ b/psi/ifont1.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ifont2.h b/psi/ifont2.h
index 4fa50c3a..3731b435 100644
--- a/psi/ifont2.h
+++ b/psi/ifont2.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ifont42.h b/psi/ifont42.h
index 6c764f44..1552d86a 100644
--- a/psi/ifont42.h
+++ b/psi/ifont42.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ifrpred.h b/psi/ifrpred.h
index de6397c6..84741147 100644
--- a/psi/ifrpred.h
+++ b/psi/ifrpred.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ifunc.h b/psi/ifunc.h
index 63e7349a..ccb4e3e0 100644
--- a/psi/ifunc.h
+++ b/psi/ifunc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ifwpred.h b/psi/ifwpred.h
index 0bc348bf..25ffcad7 100644
--- a/psi/ifwpred.h
+++ b/psi/ifwpred.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/igc.c b/psi/igc.c
index 4eafc0d3..5a841ebd 100644
--- a/psi/igc.c
+++ b/psi/igc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/igc.h b/psi/igc.h
index 20d66556..cb8a4b73 100644
--- a/psi/igc.h
+++ b/psi/igc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/igcref.c b/psi/igcref.c
index 9c6c11d4..35fdc758 100644
--- a/psi/igcref.c
+++ b/psi/igcref.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/igcstr.c b/psi/igcstr.c
index bfa8ace3..4c4baf3c 100644
--- a/psi/igcstr.c
+++ b/psi/igcstr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/igcstr.h b/psi/igcstr.h
index 8d5cc783..1e322c28 100644
--- a/psi/igcstr.h
+++ b/psi/igcstr.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/igstate.h b/psi/igstate.h
index a6bbb63e..704e745d 100644
--- a/psi/igstate.h
+++ b/psi/igstate.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iht.h b/psi/iht.h
index ce56d816..6a322427 100644
--- a/psi/iht.h
+++ b/psi/iht.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iimage.h b/psi/iimage.h
index 36914b9b..bb6c2cb1 100644
--- a/psi/iimage.h
+++ b/psi/iimage.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iinit.c b/psi/iinit.c
index 41ff8b09..e3471292 100644
--- a/psi/iinit.c
+++ b/psi/iinit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iinit.h b/psi/iinit.h
index f4e4255f..40245a28 100644
--- a/psi/iinit.h
+++ b/psi/iinit.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ilevel.h b/psi/ilevel.h
index 90d222ce..f20e0956 100644
--- a/psi/ilevel.h
+++ b/psi/ilevel.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ilocate.c b/psi/ilocate.c
index f86cc5b2..035e23ce 100644
--- a/psi/ilocate.c
+++ b/psi/ilocate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/imain.c b/psi/imain.c
index c45119c7..72064aba 100644
--- a/psi/imain.c
+++ b/psi/imain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -335,6 +335,15 @@ gs_main_set_language_param(gs_main_instance *minst,
gs_param_enumerator_t enumerator;
gs_param_key_t key;
gs_lib_ctx_t *ctx = minst->heap->gs_lib_ctx;
+ ref error_object;
+
+ /* If we're up and running as a jobserver, exit encapsulation. */
+ if (minst->init_done > 1) {
+ code = gs_main_run_string(minst,
+ "JOBSERVER {true 0 startjob pop} if",
+ 0, &code, &error_object);
+ if (code < 0) return code;
+ }
ialloc_set_space(idmemory, avm_system);
@@ -423,6 +432,15 @@ gs_main_set_language_param(gs_main_instance *minst,
i_initial_enter_name_copy(minst->i_ctx_p, string_key, &value);
}
+ if (minst->init_done > 1) {
+ int code2 = 0;
+ code2 = gs_main_run_string(minst,
+ "JOBSERVER {false 0 startjob pop} if",
+ 0, &code2, &error_object);
+ if (code >= 0)
+ code = code2;
+ }
+
return code;
}
diff --git a/psi/imain.h b/psi/imain.h
index 5d3c8e19..768c10ea 100644
--- a/psi/imain.h
+++ b/psi/imain.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/imainarg.c b/psi/imainarg.c
index 30ee6cca..f5fe1f3e 100644
--- a/psi/imainarg.c
+++ b/psi/imainarg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/imainarg.h b/psi/imainarg.h
index f9a40379..7e330b90 100644
--- a/psi/imainarg.h
+++ b/psi/imainarg.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/imemory.h b/psi/imemory.h
index 9aed79bf..d5752aba 100644
--- a/psi/imemory.h
+++ b/psi/imemory.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iminst.h b/psi/iminst.h
index b8a472a2..4e71056d 100644
--- a/psi/iminst.h
+++ b/psi/iminst.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iname.c b/psi/iname.c
index e6b68d12..74614310 100644
--- a/psi/iname.c
+++ b/psi/iname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iname.h b/psi/iname.h
index b06efbad..d4dc7ab1 100644
--- a/psi/iname.h
+++ b/psi/iname.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/inamedef.h b/psi/inamedef.h
index b8a1621c..f44dc7ed 100644
--- a/psi/inamedef.h
+++ b/psi/inamedef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/inameidx.h b/psi/inameidx.h
index bf831c8f..97044dc8 100644
--- a/psi/inameidx.h
+++ b/psi/inameidx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/inames.h b/psi/inames.h
index 3080a3f2..e52250de 100644
--- a/psi/inames.h
+++ b/psi/inames.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/inamestr.h b/psi/inamestr.h
index 6b8b035a..1b19d9ea 100644
--- a/psi/inamestr.h
+++ b/psi/inamestr.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/inobtokn.c b/psi/inobtokn.c
index 11cbde5d..fc5ecc8b 100644
--- a/psi/inobtokn.c
+++ b/psi/inobtokn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/inouparm.c b/psi/inouparm.c
index c4ec30f4..7dbca107 100644
--- a/psi/inouparm.c
+++ b/psi/inouparm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/int.mak b/psi/int.mak
index 1a40d202..4efdc768 100644
--- a/psi/int.mak
+++ b/psi/int.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -1066,7 +1066,7 @@ $(PSOBJ)zcsindex.$(OBJ) : $(PSSRC)zcsindex.c $(OP) $(memory__h)\
$(PSOBJ)zht2.$(OBJ) : $(PSSRC)zht2.c $(OP)\
$(memory__h) $(gsstruct_h) $(gxdevice_h) $(gzht_h) $(gen_ordered_h)\
$(estack_h) $(ialloc_h) $(icolor_h) $(iddict_h) $(idparam_h) $(igstate_h)\
- $(iht_h) $(store_h) $(iname_h) $(zht2_h) $(gxgstate_h) $(INT_MAK) $(MAKEDIRS)
+ $(iht_h) $(store_h) $(iname_h) $(zht2_h) $(gxgstate_h) $(gp_h) $(INT_MAK) $(MAKEDIRS)
$(PSCC) $(PSO_)zht2.$(OBJ) $(II)$(GENORDERED_SRCDIR) $(C_) $(PSSRC)zht2.c
# ---------------- setpagedevice ---------------- #
@@ -1211,12 +1211,6 @@ $(PSD)jbig2_jbig2dec.dev : $(ECHOGS_XE) $(fjbig2_) $(GLD)sjbig2.dev\
$(ADDMOD) $(PSD)jbig2_jbig2dec -include $(GLD)sjbig2
$(ADDMOD) $(PSD)jbig2_jbig2dec -oper zfjbig2
-$(PSD)jbig2_luratech.dev : $(ECHOGS_XE) $(fjbig2_) $(GLD)sjbig2.dev\
- $(INT_MAK) $(MAKEDIRS)
- $(SETMOD) $(PSD)jbig2_luratech $(fjbig2_)
- $(ADDMOD) $(PSD)jbig2_luratech -include $(GLD)sjbig2
- $(ADDMOD) $(PSD)jbig2_luratech -oper zfjbig2
-
$(PSD)jbig2_.dev : $(ECHOGS_XE) $(INT_MAK) $(MAKEDIRS)
$(SETMOD) $(PSD)jbig2_
@@ -1229,11 +1223,6 @@ $(PSOBJ)zfjbig2_jbig2dec.$(OBJ) : $(PSSRC)zfjbig2.c $(OP) $(memory__h)\
$(store_h) $(stream_h) $(strimpl_h) $(sjbig2_h) $(INT_MAK) $(MAKEDIRS)
$(PSJBIG2CC) $(PSO_)zfjbig2_jbig2dec.$(OBJ) $(C_) $(PSSRC)zfjbig2.c
-$(PSOBJ)zfjbig2_luratech.$(OBJ) : $(PSSRC)zfjbig2.c $(OP) $(memory__h)\
- $(gsstruct_h) $(gstypes_h) $(ialloc_h) $(idict_h) $(ifilter_h)\
- $(store_h) $(stream_h) $(strimpl_h) $(sjbig2_h) $(INT_MAK) $(MAKEDIRS)
- $(PSLDFJB2CC) $(PSO_)zfjbig2_luratech.$(OBJ) $(C_) $(PSSRC)zfjbig2.c
-
# JPX (jpeg 2000) compression filter
# this can be turned on and off with a FEATURE_DEV
@@ -1244,28 +1233,12 @@ $(PSD)jpx.dev : $(ECHOGS_XE) $(PSD)jpx_$(JPX_LIB).dev\
$(PSD)jpx_.dev : $(ECHOGS_XE) $(INT_MAK) $(MAKEDIRS)
$(SETMOD) $(PSD)jpx_
-fjpx_luratech=$(PSOBJ)zfjpx_luratech.$(OBJ)
-
$(PSOBJ)zfjpx.$(OBJ) : $(PSSRC)zfjpx.c $(OP) $(memory__h)\
$(gsstruct_h) $(gstypes_h) $(ialloc_h) $(idict_h) $(ifilter_h)\
$(store_h) $(stream_h) $(strimpl_h) $(ialloc_h) $(iname_h)\
$(gdebug_h) $(sjpx_h) $(INT_MAK) $(MAKEDIRS)
$(PSJASCC) $(PSO_)zfjpx.$(OBJ) $(C_) $(PSSRC)zfjpx.c
-$(PSD)jpx_luratech.dev : $(ECHOGS_XE) $(fjpx_luratech)\
- $(GLD)sjpx.dev $(INT_MAK) $(MAKEDIRS)
- $(SETMOD) $(PSD)jpx_luratech $(fjpx_luratech)
- $(ADDMOD) $(PSD)jpx_luratech -include $(GLD)sjpx
- $(ADDMOD) $(PSD)jpx_luratech -include $(GLD)lwf_jp2
- $(ADDMOD) $(PSD)jpx_luratech -oper zfjpx
-
-$(PSOBJ)zfjpx_luratech.$(OBJ) : $(PSSRC)zfjpx.c $(OP) $(memory__h)\
- $(gsstruct_h) $(gstypes_h) $(ialloc_h) $(idict_h) $(ifilter_h)\
- $(store_h) $(stream_h) $(strimpl_h) $(sjpx_luratech_h)\
- $(INT_MAK) $(MAKEDIRS)
- $(PSLWFJPXCC) $(PSO_)zfjpx_luratech.$(OBJ) \
- $(C_) $(PSSRC)zfjpx.c
-
fjpx_openjpeg=$(PSOBJ)zfjpx_openjpeg.$(OBJ)
$(PSD)jpx_openjpeg.dev : $(ECHOGS_XE) $(fjpx_openjpeg)\
@@ -1709,7 +1682,7 @@ $(PSD)transpar.dev : $(ECHOGS_XE)\
$(PSOBJ)ztrans.$(OBJ) : $(PSSRC)ztrans.c $(OP) $(memory__h) $(string__h)\
$(ghost_h) $(oper_h) $(gscspace_h) $(gscolor2_h) $(gsipar3x_h) $(gstrans_h)\
$(gxiparam_h) $(gxcspace_h)\
- $(idict_h) $(idparam_h) $(ifunc_h) $(igstate_h) $(iimage_h) $(iname_h)\
+ $(idict_h) $(idstack_h) $(idparam_h) $(ifunc_h) $(igstate_h) $(iimage_h) $(iname_h)\
$(store_h) $(gdevdevn_h) $(gxdevsop_h) $(gxblend_h) $(gdevp14_h)\
$(gsicc_cms_h) $(INT_MAK) $(MAKEDIRS)
$(PSCC) $(PSO_)ztrans.$(OBJ) $(C_) $(PSSRC)ztrans.c
diff --git a/psi/interp.c b/psi/interp.c
index 730ddf16..40f94fe9 100644
--- a/psi/interp.c
+++ b/psi/interp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -670,11 +670,12 @@ again:
* so we'll always find the default one. If not SAFERERRORS, only gs specific
* errors are in gserrordict.
*/
- if (dict_find_string(systemdict, "gserrordict", &perrordict) <= 0 ||
- (dict_find(perrordict, &error_name, &epref) <= 0 &&
- (dict_find_string(systemdict, "errordict", &perrordict) <= 0 ||
- dict_find(perrordict, &error_name, &epref) <= 0))
- )
+ if ((dict_find_string(systemdict, "gserrordict", &perrordict) <= 0 ||
+ !r_has_type(perrordict, t_dictionary) ||
+ dict_find(perrordict, &error_name, &epref) <= 0) &&
+ (dict_find_string(systemdict, "errordict", &perrordict) <= 0 ||
+ !r_has_type(perrordict, t_dictionary) ||
+ dict_find(perrordict, &error_name, &epref) <= 0))
return code; /* error name not in errordict??? */
doref = *epref;
@@ -788,6 +789,41 @@ set_gc_signal(i_ctx_t *i_ctx_p, int value)
}
}
+/* Create a printable string ref (or null) from an arbitrary ref.
+ * For the purpose this is used here, it cannot fail, any
+ * error in the process results in a null object, instead
+ * of the string.
+ */
+static void obj_cvs_ref(i_ctx_t *i_ctx_p, const ref *in, ref *out)
+{
+ uint rlen;
+ int code;
+ byte sbuf[65], *buf = sbuf;
+ uint len = sizeof(sbuf) - 1;
+
+ code = obj_cvs(imemory, in, buf, len, &rlen, NULL);
+ if (code == gs_error_rangecheck) {
+ len = rlen;
+ buf = gs_alloc_bytes(imemory, len + 1, "obj_cvs_ref");
+ if (!buf)
+ code = -1;
+ else
+ code = obj_cvs(imemory, in, buf, len, &rlen, NULL);
+ }
+ if (code < 0) {
+ make_null(out);
+ }
+ else {
+ buf[rlen] = '\0';
+ code = string_to_ref((const char *)buf, out, iimemory, "obj_cvs_ref");
+ if (code < 0)
+ make_null(out);
+ }
+ if (buf != sbuf)
+ gs_free_object(imemory, buf, "obj_cvs_ref");
+ return;
+}
+
/* Copy top elements of an overflowed stack into a (local) array. */
/* Adobe copies only 500 top elements, we copy up to 65535 top elements */
/* for better debugging, PLRM compliance, and backward compatibility. */
@@ -807,12 +843,23 @@ copy_stack(i_ctx_t *i_ctx_p, const ref_stack_t * pstack, int skip, ref * arr)
code = ref_stack_store(pstack, arr, size, 0, 1, true, idmemory,
"copy_stack");
/* If we are copying the exec stack, try to replace any oparrays with
- * with the operator than references them
+ * the operator that references them
+ * We also replace any internal objects (t_struct and t_astruct) with
+ * string representations, since these can contain references to objects
+ * with uncertain lifespans, it is safer not to risk them persisting.
+ * Since we basically did this later on for the error handler, it isn't
+ * a significant speed hit.
*/
if (pstack == &e_stack) {
for (i = 0; i < size; i++) {
if (errorexec_find(i_ctx_p, &arr->value.refs[i]) < 0)
make_null(&arr->value.refs[i]);
+ else if (r_has_type(&arr->value.refs[i], t_struct)
+ || r_has_type(&arr->value.refs[i], t_astruct)) {
+ ref r;
+ obj_cvs_ref(i_ctx_p, (const ref *)&arr->value.refs[i], &r);
+ ref_assign(&arr->value.refs[i], &r);
+ }
}
}
if (pstack == &o_stack && dict_find_string(systemdict, "SAFETY", &safety) > 0 &&
diff --git a/psi/interp.h b/psi/interp.h
index ba552eb4..09b99afc 100644
--- a/psi/interp.h
+++ b/psi/interp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iosdata.h b/psi/iosdata.h
index e171a0b1..ff53d67a 100644
--- a/psi/iosdata.h
+++ b/psi/iosdata.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iostack.h b/psi/iostack.h
index ebf4ff5a..14e4917c 100644
--- a/psi/iostack.h
+++ b/psi/iostack.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ipacked.h b/psi/ipacked.h
index e0ff8878..03f08553 100644
--- a/psi/ipacked.h
+++ b/psi/ipacked.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iparam.c b/psi/iparam.c
index 0a7651b7..269b6661 100644
--- a/psi/iparam.c
+++ b/psi/iparam.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iparam.h b/psi/iparam.h
index 5050ab44..1af4d324 100644
--- a/psi/iparam.h
+++ b/psi/iparam.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iparray.h b/psi/iparray.h
index 35c43db7..987fff70 100644
--- a/psi/iparray.h
+++ b/psi/iparray.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ipcolor.h b/psi/ipcolor.h
index 7ed8590b..21cbc067 100644
--- a/psi/ipcolor.h
+++ b/psi/ipcolor.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iplugin.c b/psi/iplugin.c
index fa2b8cc5..67cea872 100644
--- a/psi/iplugin.c
+++ b/psi/iplugin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iplugin.h b/psi/iplugin.h
index d6e7a6aa..a4395ce7 100644
--- a/psi/iplugin.h
+++ b/psi/iplugin.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ireclaim.c b/psi/ireclaim.c
index 8a3aedc8..f167b75f 100644
--- a/psi/ireclaim.c
+++ b/psi/ireclaim.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iref.h b/psi/iref.h
index a9765a1a..955cff31 100644
--- a/psi/iref.h
+++ b/psi/iref.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/isave.c b/psi/isave.c
index 8f67cc71..f0f3db03 100644
--- a/psi/isave.c
+++ b/psi/isave.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/isave.h b/psi/isave.h
index beb40ba8..a0c18ac5 100644
--- a/psi/isave.h
+++ b/psi/isave.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iscan.c b/psi/iscan.c
index dc14072e..11947354 100644
--- a/psi/iscan.c
+++ b/psi/iscan.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -445,7 +445,7 @@ gs_scan_string_token_options(i_ctx_t *i_ctx_p, ref * pstr, ref * pref,
* as well as for scan_Refill.
*/
int
-gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
+gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate) /* lgtm [cpp/use-of-goto] */
{
stream *const s = pstate->s_file.value.pfile;
ref *myref = pref;
@@ -934,7 +934,24 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
case '-':
sign = -1;
if(i_ctx_p->scanner_options & SCAN_PDF_INV_NUM) {
+ const byte *osptr = sptr;
do {
+ /* This is slightly unpleasant: we have to bounds check the buffer,
+ rather than just incrementing the point until we find a non '-' character.
+ But we cannot differentiate between multiple '-' characters that
+ straddle a buffer boundary, or a token that is only one or more '-' characters.
+ Handling this relies on the fact that the Postscript-based PDF interpreter
+ always uses the "token" operator to tokenize a stream, thus we can assume
+ here that the current buffer contains the entire token. So if we reach
+ the end of the buffer without hitting a character taht is not a '-', we'll reset
+ the buffer pointer, and retry, treating it as a name object.
+ */
+ if (sptr + 1 > endptr) {
+ sptr = osptr;
+ sstate.s_ss.s_name.s_name_type = 0;
+ sstate.s_ss.s_name.s_try_number = true;
+ goto do_name;
+ }
if (*(sptr + 1) == '-') {
sptr++;
} else
diff --git a/psi/iscan.h b/psi/iscan.h
index f05266a7..343239df 100644
--- a/psi/iscan.h
+++ b/psi/iscan.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iscanbin.c b/psi/iscanbin.c
index 5d1802c7..60cc9044 100644
--- a/psi/iscanbin.c
+++ b/psi/iscanbin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iscanbin.h b/psi/iscanbin.h
index 08bc9f7e..348bc528 100644
--- a/psi/iscanbin.h
+++ b/psi/iscanbin.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iscannum.c b/psi/iscannum.c
index 71081b8f..e2d40f72 100644
--- a/psi/iscannum.c
+++ b/psi/iscannum.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iscannum.h b/psi/iscannum.h
index b4a88299..9d7f65f5 100644
--- a/psi/iscannum.h
+++ b/psi/iscannum.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/isdata.h b/psi/isdata.h
index f4687da9..1e3e560c 100644
--- a/psi/isdata.h
+++ b/psi/isdata.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/isstate.h b/psi/isstate.h
index 222cc8a8..49ca2456 100644
--- a/psi/isstate.h
+++ b/psi/isstate.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/istack.c b/psi/istack.c
index 9ec6be0d..f10ff25f 100644
--- a/psi/istack.c
+++ b/psi/istack.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/istack.h b/psi/istack.h
index 813ed777..5093466d 100644
--- a/psi/istack.h
+++ b/psi/istack.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/istkparm.h b/psi/istkparm.h
index e254bda0..7a9599e4 100644
--- a/psi/istkparm.h
+++ b/psi/istkparm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/istream.h b/psi/istream.h
index 0604728e..6157d290 100644
--- a/psi/istream.h
+++ b/psi/istream.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/istruct.h b/psi/istruct.h
index 3fe8f545..92771b90 100644
--- a/psi/istruct.h
+++ b/psi/istruct.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/itoken.h b/psi/itoken.h
index 40f1c40e..f99564a3 100644
--- a/psi/itoken.h
+++ b/psi/itoken.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iutil.c b/psi/iutil.c
index b7de0536..b51abbc9 100644
--- a/psi/iutil.c
+++ b/psi/iutil.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -339,9 +339,12 @@ obj_cvp(const ref * op, byte * str, uint len, uint * prlen,
*/
float value = op->value.realval;
float scanned;
-
- gs_sprintf(buf, "%g", value);
- (void)sscanf(buf, "%f", &scanned);
+ code = gs_sprintf(buf, "%g", value);
+ if (code <= 0)
+ return_error(gs_error_undefinedresult);
+ code = sscanf(buf, "%f", &scanned);
+ if (code <= 0)
+ return_error(gs_error_undefinedresult);
if (scanned != value)
gs_sprintf(buf, "%.9g", value);
ensure_dot(buf);
@@ -399,15 +402,15 @@ obj_cvp(const ref * op, byte * str, uint len, uint * prlen,
wstr = str;
}
len1 = len + (str - wstr);
- r.ptr = op->value.const_bytes - 1;
- r.limit = r.ptr + (truncate ? CVP_MAX_STRING : size);
+ stream_cursor_read_init(&r, op->value.const_bytes, truncate ? CVP_MAX_STRING : size);
+
while (skip && status == 1) {
uint written;
- w.ptr = (byte *)buf - 1;
- w.limit = w.ptr + min(skip + len1, sizeof(buf));
+ stream_cursor_write_init(&w, (byte *)buf, min(skip + len1, sizeof(buf)));
status = s_PSSE_template.process(NULL, &r, &w, false);
- written = w.ptr - ((byte *)buf - 1);
+ /* +1 accounts for crazy w.ptr initialisation - see stream_cursor_write_init() */
+ written = (w.ptr - ((byte *)buf)) + 1;
if (written > skip) {
written -= skip;
memcpy(wstr, buf + skip, written);
@@ -428,8 +431,7 @@ obj_cvp(const ref * op, byte * str, uint len, uint * prlen,
}
#endif
}
- w.ptr = wstr - 1;
- w.limit = str - 1 + len;
+ stream_cursor_write_init(&w, (byte *)wstr, (size_t)((str + len) - wstr));
if (status == 1)
status = s_PSSE_template.process(NULL, &r, &w, false);
*prlen = w.ptr - (str - 1);
diff --git a/psi/iutil.h b/psi/iutil.h
index 2253c8f5..5272d507 100644
--- a/psi/iutil.h
+++ b/psi/iutil.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iutil2.c b/psi/iutil2.c
index 276a73aa..77b09918 100644
--- a/psi/iutil2.c
+++ b/psi/iutil2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/iutil2.h b/psi/iutil2.h
index 7326106f..7c7df041 100644
--- a/psi/iutil2.h
+++ b/psi/iutil2.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ivmem2.h b/psi/ivmem2.h
index 4b1f43e5..872e4d20 100644
--- a/psi/ivmem2.h
+++ b/psi/ivmem2.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ivmspace.h b/psi/ivmspace.h
index 7faf247e..c7952c9a 100644
--- a/psi/ivmspace.h
+++ b/psi/ivmspace.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/main.h b/psi/main.h
index 00f08e36..dc3786e9 100644
--- a/psi/main.h
+++ b/psi/main.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/mkfilelt.cpp b/psi/mkfilelt.cpp
index 31b632bf..8647fbb3 100644
--- a/psi/mkfilelt.cpp
+++ b/psi/mkfilelt.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/msvc.mak b/psi/msvc.mak
index a66f85f6..8697b76f 100644
--- a/psi/msvc.mak
+++ b/psi/msvc.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -87,10 +87,14 @@ DEFAULT_OBJ_DIR=.\$(PRODUCT_PREFIX)profobj
!if "$(DEBUG)"=="1"
DEFAULT_OBJ_DIR=.\$(PRODUCT_PREFIX)debugobj
!else
+!if "$(SANITIZE)"=="1"
+DEFAULT_OBJ_DIR=.\$(PRODUCT_PREFIX)sanobj
+!else
DEFAULT_OBJ_DIR=.\$(PRODUCT_PREFIX)obj
!endif
!endif
!endif
+!endif
!ifdef METRO
DEFAULT_OBJ_DIR=$(DEFAULT_OBJ_DIR)rt
!endif
@@ -114,6 +118,9 @@ BINDIR=.\membin
!if "$(DEBUG)"=="1"
BINDIR=.\debugbin
!else
+!if "$(SANITIZE)"=="1"
+BINDIR=.\sanbin
+!else
!if "$(DEBUGSYM)"=="1"
BINDIR=.\profbin
!else
@@ -121,6 +128,7 @@ BINDIR=.\bin
!endif
!endif
!endif
+!endif
!ifdef XP
BINDIR=$(BINDIR)xp
!endif
@@ -308,6 +316,12 @@ AROOTDIR=c:/gs
GSROOTDIR=$(AROOTDIR)/gs$(GS_DOT_VERSION)
!endif
+# Define the directory to look in for tesseract data.
+
+!ifndef TESSDATA
+TESSDATA=$(GSROOTDIR)/tessdata
+!endif
+
# Define the directory that will hold documentation at runtime.
!ifndef GS_DOCDIR
@@ -382,6 +396,10 @@ DEBUGSYM=0
WIN32=0
!endif
+!if "$(SANITIZE)"=="1" && defined(WIN64)
+!error 64bit Sanitize builds not supported by MSVC yet!
+!endif
+
# We can build either 32-bit or 64-bit target on a 64-bit platform
# but the location of the binaries differs. Would be nice if the
# detection of the platform could be automatic.
@@ -672,19 +690,12 @@ ENABLE_TIFF=$(D_)TIFF_INCLUDED$(_D)
ZSRCDIR=.\zlib
!endif
-# Define which jbig2 library to use
-!if !defined(JBIG2_LIB) && (!defined(NO_LURATECH) || "$(NO_LURATECH)" != "1")
-!if exist("luratech\ldf_jb2")
-JBIG2_LIB=luratech
-!endif
-!endif
-
!if exist("leptonica")
LEPTONICADIR=leptonica
!endif
!if exist("tesseract")
TESSERACTDIR=tesseract
-TESSCXXFLAGS=-DHAVE_AVX -DHAVE_AVX2 -DHAVE_SSE4_1 -DHAVE_FMA -D__AVX__ -D__AVX2__ -D__FMA__ -D__SSE4_1__ /EHsc /std:c++17
+TESSCXXFLAGS=-DHAVE_AVX -DHAVE_AVX2 -DHAVE_SSE4_1 -DHAVE_FMA -D__AVX__ -D__AVX2__ -D__FMA__ -D__SSE4_1__ /EHsc /std:c++17 /utf-8
!endif
!if defined(TESSERACTDIR) && defined(LEPTONICADIR)
OCR_VERSION=1
@@ -696,40 +707,34 @@ OCR_VERSION=0
JBIG2_LIB=jbig2dec
!endif
-!if "$(JBIG2_LIB)" == "luratech" || "$(JBIG2_LIB)" == "ldf_jb2"
-# Set defaults for using the Luratech JB2 implementation
-!ifndef JBIG2SRCDIR
-# CSDK source code location
-JBIG2SRCDIR=luratech\ldf_jb2
-!endif
-!ifndef JBIG2_CFLAGS
-# required compiler flags
-!ifdef WIN64
-JBIG2_CFLAGS=-DUSE_LDF_JB2 -DWIN64
-!else
-JBIG2_CFLAGS=-DUSE_LDF_JB2 -DWIN32
-!endif
-!endif
-!else
# Use jbig2dec by default. See jbig2.mak for more information.
!ifndef JBIG2SRCDIR
# location of included jbig2dec library source
JBIG2SRCDIR=jbig2dec
!endif
-!endif
# Alternatively, you can build a separate DLL
# and define SHARE_JBIG2=1 in src/winlib.mak
-# Define which jpeg2k library to use
-!if !defined(JPX_LIB) && (!defined(NO_LURATECH) || "$(NO_LURATECH)" != "1")
-!if exist("luratech\lwf_jp2")
-JPX_LIB=luratech
+!ifndef JPX_LIB
+JPX_LIB=openjpeg
!endif
+
+# If $EXTRACT_DIR is unset, and the 'extract' directory exists,
+# default it to that.
+!if "$(EXTRACT_DIR)" == ""
+! if exist("extract")
+EXTRACT_DIR=extract
+! endif
!endif
-!ifndef JPX_LIB
-JPX_LIB=openjpeg
+# If $EXTRACT_DIR is set, build with Extract library.
+#
+!if "$(EXTRACT_DIR)" != ""
+! if !exist($(EXTRACT_DIR))
+! error Cannot find extract directory: $(EXTRACT_DIR)
+! endif
+EXTRACT_DEVS=$(DD)docxwrite.dev
!endif
# Alternatively, you can build a separate DLL
@@ -1000,6 +1005,37 @@ MS_TOOLSET_VERSION=14.26.28806
!if "$(_NMAKE_VER)" == "14.27.29111.0"
# VS2019 (Toolset v142)
MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.27.29111
+!endif
+!if "$(_NMAKE_VER)" == "14.27.29112.0"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.27.29112
+!endif
+!if "$(_NMAKE_VER)" == "14.28.29333.0"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.28.29333
+!endif
+!if "$(_NMAKE_VER)" == "14.28.29334.0"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.28.29333
+!endif
+!if "$(_NMAKE_VER)" == "14.28.29335.0"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.28.29333
+!endif
+!if "$(_NMAKE_VER)" == "14.28.29336.0"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.28.29333
+!endif
+!if "$(_NMAKE_VER)" == "14.28.29910.0"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.28.29333
!endif
!endif
@@ -1320,9 +1356,9 @@ LINKLIBPATH=/LIBPATH:"$(DEVSTUDIO)\lib\$(DEVSTUDIO_TARGET)"
!if $(MSVC_VERSION) == 16
! ifndef DEVSTUDIO
! if exist("C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional")
-DEVSTUDIO_VARIANT="Professional"
+DEVSTUDIO_VARIANT=Professional
! else
-DEVSTUDIO_VARIANT="Community"
+DEVSTUDIO_VARIANT=Community
! endif
DEVSTUDIO=C:\Program Files (x86)\Microsoft Visual Studio\2019\$(DEVSTUDIO_VARIANT)\VC\Tools\MSVC\$(MS_TOOLSET_VERSION)
! endif
@@ -1538,24 +1574,6 @@ JPX_SSE_CFLAGS=
SYNC=winsync
!endif
-# Luratech jp2 flags depend on the compiler version
-#
-!if "$(JPX_LIB)" == "luratech" || "$(JPX_LIB)" == "lwf_jp2"
-# Set defaults for using the Luratech JP2 implementation
-!ifndef JPXSRCDIR
-# CSDK source code location
-JPXSRCDIR=luratech\lwf_jp2
-!endif
-!ifndef JPX_CFLAGS
-# required compiler flags
-!ifdef WIN64
-JPX_CFLAGS=-DUSE_LWF_JP2 -DWIN64 -DNO_ASSEMBLY
-!else
-JPX_CFLAGS=-DUSE_LWF_JP2 -DWIN32 -DNO_ASSEMBLY
-!endif
-!endif
-!endif
-
# OpenJPEG compiler flags
#
!if "$(JPX_LIB)" == "openjpeg"
@@ -1654,7 +1672,7 @@ DEVICE_DEVS11=$(DD)bmpmono.dev $(DD)bmpgray.dev $(DD)bmp16.dev $(DD)bmp256.dev $
DEVICE_DEVS12=$(DD)bit.dev $(DD)bitrgb.dev $(DD)bitcmyk.dev $(DD)bitrgbtags.dev $(DD)chameleon.dev
DEVICE_DEVS13=$(DD)pngmono.dev $(DD)pngmonod.dev $(DD)pnggray.dev $(DD)png16.dev $(DD)png256.dev $(DD)png16m.dev $(DD)pngalpha.dev $(DD)fpng.dev $(DD)psdcmykog.dev
DEVICE_DEVS14=$(DD)jpeg.dev $(DD)jpeggray.dev $(DD)jpegcmyk.dev $(DD)pdfimage8.dev $(DD)pdfimage24.dev $(DD)pdfimage32.dev $(DD)PCLm.dev
-DEVICE_DEVS15=$(DD)pdfwrite.dev $(DD)ps2write.dev $(DD)eps2write.dev $(DD)txtwrite.dev $(DD)pxlmono.dev $(DD)pxlcolor.dev $(DD)xpswrite.dev $(DD)inkcov.dev $(DD)ink_cov.dev
+DEVICE_DEVS15=$(DD)pdfwrite.dev $(DD)ps2write.dev $(DD)eps2write.dev $(DD)txtwrite.dev $(DD)pxlmono.dev $(DD)pxlcolor.dev $(DD)xpswrite.dev $(DD)inkcov.dev $(DD)ink_cov.dev $(EXTRACT_DEVS)
DEVICE_DEVS16=$(DD)bbox.dev $(DD)plib.dev $(DD)plibg.dev $(DD)plibm.dev $(DD)plibc.dev $(DD)plibk.dev $(DD)plan.dev $(DD)plang.dev $(DD)planm.dev $(DD)planc.dev $(DD)plank.dev $(DD)planr.dev
!if "$(WITH_CUPS)" == "1"
DEVICE_DEVS16=$(DEVICE_DEVS16) $(DD)cups.dev
@@ -1845,6 +1863,10 @@ $(GS_XE): $(GSDLL_DLL) $(DWOBJ) $(GSCONSOLE_XE) $(GLOBJ)gp_wutf8.$(OBJ) $(TOP_M
!if "$(PROFILE)"=="1"
echo /Profile >> $(PSGEN)gswin.rsp
!endif
+!if "$(SANITIZE)"=="1"
+ echo /wholearchive:clang_rt.asan-i386.lib >> $(PSGEN)gswin.rsp
+ echo /wholearchive:clang_rt.asan_cxx-i386.lib >> $(PSGEN)gswin.rsp
+!endif
!ifdef WIN64
echo /DEF:$(PSSRCDIR)\dwmain64.def /OUT:$(GS_XE) >> $(PSGEN)gswin.rsp
!else
@@ -1860,6 +1882,10 @@ $(GSCONSOLE_XE): $(OBJC) $(GS_OBJ).res $(PSSRCDIR)\dw64c.def $(PSSRCDIR)\dw32c.d
!if "$(PROFILE)"=="1"
echo /Profile >> $(PSGEN)gswin.rsp
!endif
+!if "$(SANITIZE)"=="1"
+ echo /wholearchive:clang_rt.asan-i386.lib >> $(PSGEN)gswin.rsp
+ echo /wholearchive:clang_rt.asan_cxx-i386.lib >> $(PSGEN)gswin.rsp
+!endif
!ifdef WIN64
echo /DEF:$(PSSRCDIR)\dw64c.def /OUT:$(GSCONSOLE_XE) >> $(PSGEN)gswin.rsp
!else
@@ -1875,6 +1901,9 @@ $(GSDLL_DLL): $(ECHOGS_XE) $(gs_tr) $(GS_ALL) $(DEVS_ALL) $(GSDLL_OBJS) $(GSDLL_
!if "$(PROFILE)"=="1"
echo /Profile >> $(PSGEN)gswin.rsp
!endif
+!if "$(SANITIZE)"=="1"
+ echo /wholearchive:clang_rt.asan_dll_thunk-i386.lib >> $(PSGEN)gswin.rsp
+!endif
$(LINK) $(LCT) @$(PSGEN)gswin.rsp $(GSDLL_OBJS) @$(gsld_tr) $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ) @$(PSGEN)lib.rsp $(LINKLIBPATH) @$(LIBCTR) $(GSDLL_OBJ).res
del $(PSGEN)gswin.rsp
@@ -1889,6 +1918,9 @@ $(GPCL6DLL_DLL): $(ECHOGS_XE) $(GSDLL_OBJ).res $(LIBCTR) $(LIB_ALL) $(PCL_DEVS_A
!if "$(PROFILE)"=="1"
echo /Profile >> $(PSGEN)gpclwin.rsp
!endif
+!if "$(SANITIZE)"=="1"
+ echo /wholearchive:clang_rt.asan_dll_thunk-i386.lib >> $(PSGEN)gpclwin.rsp
+!endif
$(LINK) $(LCT) @$(PCLGEN)gpclwin.rsp $(GPCL6DLL_OBJS) @$(PCLGEN)gpclwin.tr @$(PSGEN)pcllib.rsp $(LINKLIBPATH) @$(LIBCTR) $(GSDLL_OBJ).res
del $(PCLGEN)gpclwin.rsp
@@ -1897,6 +1929,10 @@ $(GPCL_XE): $(GPCL6DLL_DLL) $(DWMAINOBJS) $(GS_OBJ).res $(TOP_MAKEFILES)
!if "$(PROFILE)"=="1"
echo /Profile >> $(PCLGEN)gpclwin.rsp
!endif
+!if "$(SANITIZE)"=="1"
+ echo /wholearchive:clang_rt.asan-i386.lib >> $(PCLGEN)gpclwin.rsp
+ echo /wholearchive:clang_rt.asan_cxx-i386.lib >> $(PCLGEN)gpclwin.rsp
+!endif
!ifdef WIN64
echo /OUT:$(GPCL_XE) >> $(PCLGEN)gpclwin.rsp
!else
@@ -1917,6 +1953,9 @@ $(GXPSDLL_DLL): $(ECHOGS_XE) $(GSDLL_OBJ).res $(LIBCTR) $(LIB_ALL) $(XPS_DEVS_AL
!if "$(PROFILE)"=="1"
echo /Profile >> $(XPSGEN)gxpswin.rsp
!endif
+!if "$(SANITIZE)"=="1"
+ echo /wholearchive:clang_rt.asan_dll_thunk-i386.lib >> $(PSGEN)gxpswin.rsp
+!endif
$(LINK) $(LCT) @$(XPSGEN)gxpswin.rsp $(GXPSDLL_OBJS) @$(XPSGEN)gxpswin.tr @$(XPSGEN)xpslib.rsp $(LINKLIBPATH) @$(LIBCTR) $(GSDLL_OBJ).res
del $(PCLGEN)gxpswin.rsp
@@ -1925,6 +1964,10 @@ $(GXPS_XE): $(GXPSDLL_DLL) $(DWMAINOBJS) $(GS_OBJ).res $(TOP_MAKEFILES)
!if "$(PROFILE)"=="1"
echo /Profile >> $(XPSGEN)gxpswin.rsp
!endif
+!if "$(SANITIZE)"=="1"
+ echo /wholearchive:clang_rt.asan-i386.lib >> $(XPSGEN)gxpswin.rsp
+ echo /wholearchive:clang_rt.asan_cxx-i386.lib >> $(XPSGEN)gxpswin.rsp
+!endif
!ifdef WIN64
echo /OUT:$(GXPS_XE) >> $(XPSGEN)gxpswin.rsp
!else
@@ -1957,19 +2000,22 @@ $(GPDLDLL_DLL): $(ECHOGS_XE) $(GSDLL_OBJ).res $(LIBCTR) $(LIB_ALL) $(PCL_DEVS_AL
!if "$(PROFILE)"=="1"
echo /Profile >> $(GPDLGEN)gpdlwin.rsp
!endif
+!if "$(SANITIZE)"=="1"
+ echo /wholearchive:clang_rt.asan_dll_thunk-i386.lib >> $(PSGEN)gpdlwin.rsp
+!endif
$(LINK) $(LCT) @$(GPDLGEN)gpdlwin.rsp $(GPDLDLL_OBJS) @$(GPDLGEN)gpdlwin.tr @$(GPDLGEN)gpdllib.rsp $(LINKLIBPATH) @$(LIBCTR) $(GSDLL_OBJ).res
del $(GPDLGEN)gpdlwin.rsp
$(GPDL_XE): $(GPDLDLL_DLL) $(DWMAINOBJS) $(GS_OBJ).res $(TOP_MAKEFILES)
echo /SUBSYSTEM:CONSOLE$(SUBSUBSYS) > $(GPDLGEN)gpdlwin.rsp
!if "$(PROFILE)"=="1"
- echo /Profile >> $(XPSGEN)gpdlwin.rsp
+ echo /Profile >> $(GPDLGEN)gpdlwin.rsp
!endif
-!ifdef WIN64
- echo /OUT:$(GPDL_XE) >> $(GPDLGEN)gpdlwin.rsp
-!else
- echo /OUT:$(GPDL_XE) >> $(GPDLGEN)gpdlwin.rsp
+!if "$(SANITIZE)"=="1"
+ echo /wholearchive:clang_rt.asan-i386.lib >> $(GPDLGEN)gpdlwin.rsp
+ echo /wholearchive:clang_rt.asan_cxx-i386.lib >> $(GPDLGEN)gpdlwin.rsp
!endif
+ echo /OUT:$(GPDL_XE) >> $(GPDLGEN)gpdlwin.rsp
$(LINK) $(LCT) @$(GPDLGEN)gpdlwin.rsp $(DWMAINOBJS) $(BINDIR)\$(GPDLDLL).lib $(LINKLIBPATH) @$(LIBCTR) $(GS_OBJ).res
del $(GPDLGEN)gpdlwin.rsp
@@ -1994,6 +2040,10 @@ $(GS_XE): $(GSCONSOLE_XE) $(GS_ALL) $(DEVS_ALL) $(GSDLL_OBJS) $(DWOBJNO) $(GSDLL
!if "$(PROFILE)"=="1"
echo /Profile >> $(PSGEN)gswin.rsp
!endif
+!if "$(SANITIZE)"=="1"
+ echo /wholearchive:clang_rt.asan-i386.lib >> $(PSGEN)gswin.rsp
+ echo /wholearchive:clang_rt.asan_cxx-i386.lib >> $(PSGEN)gswin.rsp
+!endif
$(LINK) $(LCT) @$(PSGEN)gswin.rsp $(GLOBJ)gsdll @$(PSGEN)gswin.tr $(LINKLIBPATH) @$(LIBCTR) @$(PSGEN)lib.rsp $(GSDLL_OBJ).res $(DWTRACE)
del $(PSGEN)gswin.tr
del $(PSGEN)gswin.rsp
@@ -2013,6 +2063,13 @@ $(GSCONSOLE_XE): $(ECHOGS_XE) $(gs_tr) $(GS_ALL) $(DEVS_ALL) $(GSDLL_OBJS) $(OBJ
!else
echo /DEF:$(PSSRCDIR)\dw32c.def /OUT:$(GSCONSOLE_XE) >> $(PSGEN)gswin.rsp
!endif
+!if "$(PROFILE)"=="1"
+ echo /Profile >> $(PSGEN)gswin.rsp
+!endif
+!if "$(SANITIZE)"=="1"
+ echo /wholearchive:clang_rt.asan-i386.lib >> $(PSGEN)gswin.rsp
+ echo /wholearchive:clang_rt.asan_cxx-i386.lib >> $(PSGEN)gswin.rsp
+!endif
$(LINK) $(LCT) @$(PSGEN)gswin.rsp $(GLOBJ)gsdll @$(PSGEN)gswin.tr $(LINKLIBPATH) @$(LIBCTR) @$(PSGEN)lib.rsp $(GS_OBJ).res $(DWTRACE)
del $(PSGEN)gswin.rsp
del $(PSGEN)gswin.tr
@@ -2039,6 +2096,13 @@ $(GXPS_XE): $(ECHOGS_XE) $(LIBCTR) $(LIB_ALL) $(WINMAINOBJS) $(XPS_DEVS_ALL) $(X
echo $(WINMAINOBJS) $(MAIN_OBJ) $(XPS_TOP_OBJS) $(INT_ARCHIVE_SOME) $(XOBJS) >> $(XPSGEN)gxpswin.tr
echo $(PCLOBJ)xpsromfs$(COMPILE_INITS).$(OBJ) >> $(XPSGEN)gxpswin.tr
echo /SUBSYSTEM:CONSOLE$(SUBSUBSYS) > $(XPSGEN)xpswin.rsp
+!if "$(PROFILE)"=="1"
+ echo /Profile >> $(PSGEN)xpswin.rsp
+!endif
+!if "$(SANITIZE)"=="1"
+ echo /wholearchive:clang_rt.asan-i386.lib >> $(XPSGEN)xpswin.rsp
+ echo /wholearchive:clang_rt.asan_cxx-i386.lib >> $(XPSGEN)xpswin.rsp
+!endif
echo /OUT:$(GXPS_XE) >> $(XPSGEN)xpswin.rsp
$(LINK) $(LCT) @$(XPSGEN)xpswin.rsp @$(XPSGEN)gxpswin.tr $(LINKLIBPATH) @$(LIBCTR) @$(XPSGEN)xpslib.rsp
del $(XPSGEN)xpswin.rsp
@@ -2053,6 +2117,13 @@ $(GPDL_XE): $(ECHOGS_XE) $(ld_tr) $(gpdl_tr) $(LIBCTR) $(LIB_ALL) $(WINMAINOBJS)
echo $(WINMAINOBJS) $(MAIN_OBJ) $(GPDL_PSI_TOP_OBJS) $(PCL_PXL_TOP_OBJS) $(PSI_TOP_OBJ) $(XPS_TOP_OBJ) $(XOBJS) >> $(GPDLGEN)gpdlwin.tr
echo $(PCLOBJ)pdlromfs$(COMPILE_INITS).$(OBJ) >> $(GPDLGEN)gpdlwin.tr
echo /SUBSYSTEM:CONSOLE$(SUBSUBSYS) > $(GPDLGEN)gpdlwin.rsp
+!if "$(PROFILE)"=="1"
+ echo /Profile >> $(PSGEN)gpdlwin.rsp
+!endif
+!if "$(SANITIZE)"=="1"
+ echo /wholearchive:clang_rt.asan-i386.lib >> $(GPDLGEN)gpdlwin.rsp
+ echo /wholearchive:clang_rt.asan_cxx-i386.lib >> $(GPDLGEN)gpdlwin.rsp
+!endif
echo /OUT:$(GPDL_XE) >> $(GPDLGEN)gpdlwin.rsp
$(LINK) $(LCT) @$(GPDLGEN)gpdlwin.rsp @$(GPDLGEN)gpdlwin.tr $(LINKLIBPATH) @$(LIBCTR) @$(GPDLGEN)gpdllib.rsp
del $(GPDLGEN)gpdlwin.rsp
@@ -2154,6 +2225,32 @@ profilebsc:
+# -------------------- Sanitize targets --------------------- #
+# Simply set some definitions and call ourselves back #
+
+SANITIZEDEFS=SANITIZE=1 $(RECURSIVEDEFS)
+
+sanitize:
+ nmake -f $(MAKEFILE) $(SANITIZEDEFS) FT_BRIDGE=$(FT_BRIDGE)
+
+gssanitize:
+ nmake -f $(MAKEFILE) $(SANITIZEDEFS) FT_BRIDGE=$(FT_BRIDGE) gs
+
+gpcl6sanitze:
+ nmake -f $(MAKEFILE) $(SANITIZEDEFS) FT_BRIDGE=$(FT_BRIDGE) gpcl6
+
+gxpssanitize:
+ nmake -f $(MAKEFILE) $(SANITIZEDEFS) FT_BRIDGE=$(FT_BRIDGE) gxps
+
+gpdlsanitize:
+ nmake -f $(MAKEFILE) $(SANITIZEDEFS) FT_BRIDGE=$(FT_BRIDGE) gpdl
+
+sanitizeclean:
+ nmake -f $(MAKEFILE) $(SANITIZEDEFS) FT_BRIDGE=$(FT_BRIDGE) clean
+
+sanitizebsc:
+ nmake -f $(MAKEFILE) $(SANITIZEDEFS) FT_BRIDGE=$(FT_BRIDGE) bsc
+
# ---------------------- UFST targets ---------------------- #
# Simply set some definitions and call ourselves back #
@@ -2189,6 +2286,9 @@ ufst-lib:
ufst-debug: ufst-lib
nmake -f $(MAKEFILE) $(RECURSIVEDEFS) $(UFSTBASEDEFS) $(UFSTDEBUGDEFS) UFST_CFLAGS="$(UFST_CFLAGS)"
+gpcl6-ufst-debug: ufst-lib
+ nmake -f $(MAKEFILE) $(RECURSIVEDEFS) $(UFSTBASEDEFS) $(UFSTDEBUGDEFS) UFST_CFLAGS="$(UFST_CFLAGS)" gpcl6
+
ufst-debugclean: ufst-lib
nmake -f $(MAKEFILE) $(RECURSIVEDEFS) $(UFSTBASEDEFS) $(UFSTDEBUGDEFS) UFST_CFLAGS="$(UFST_CFLAGS)" clean
@@ -2198,6 +2298,9 @@ ufst-debugbsc: ufst-lib
ufst: ufst-lib
nmake -f $(MAKEFILE) $(RECURSIVEDEFS) $(UFSTBASEDEFS) $(UFSTDEFS) UFST_CFLAGS="$(UFST_CFLAGS)"
+gpcl6-ufst: ufst-lib
+ nmake -f $(MAKEFILE) $(RECURSIVEDEFS) $(UFSTBASEDEFS) $(UFSTDEFS) UFST_CFLAGS="$(UFST_CFLAGS)" gpcl6
+
ufst-clean: ufst-lib
nmake -f $(MAKEFILE) $(RECURSIVEDEFS) $(UFSTBASEDEFS) $(UFSTDEFS) UFST_CFLAGS="$(UFST_CFLAGS)" clean
diff --git a/psi/msvc32.mak b/psi/msvc32.mak
index 7a324e47..adf11dc7 100644
--- a/psi/msvc32.mak
+++ b/psi/msvc32.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/psi/msvc64.mak b/psi/msvc64.mak
index 0e93f6ff..aaf575a2 100644
--- a/psi/msvc64.mak
+++ b/psi/msvc64.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/psi/nsisinst.nsi b/psi/nsisinst.nsi
index 717bc8cb..dd9266ae 100644
--- a/psi/nsisinst.nsi
+++ b/psi/nsisinst.nsi
@@ -1,4 +1,4 @@
-; Copyright (C) 2001-2020 Artifex Software, Inc.
+; Copyright (C) 2001-2021 Artifex Software, Inc.
; All Rights Reserved.
;
; This software is provided AS-IS with no warranty, either express or
diff --git a/psi/oparc.h b/psi/oparc.h
index e169fbce..00eb3fa7 100644
--- a/psi/oparc.h
+++ b/psi/oparc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/opcheck.h b/psi/opcheck.h
index c2a69e22..15fba343 100644
--- a/psi/opcheck.h
+++ b/psi/opcheck.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/opdef.h b/psi/opdef.h
index e9d42a2a..9046c04c 100644
--- a/psi/opdef.h
+++ b/psi/opdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/oper.h b/psi/oper.h
index fd01b46c..90ff3ce3 100644
--- a/psi/oper.h
+++ b/psi/oper.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/opextern.h b/psi/opextern.h
index b76dabc9..b4791d11 100644
--- a/psi/opextern.h
+++ b/psi/opextern.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/os2.mak b/psi/os2.mak
index 2f3e619d..b58b90bf 100644
--- a/psi/os2.mak
+++ b/psi/os2.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ostack.h b/psi/ostack.h
index 22acfbc3..71b6f6da 100644
--- a/psi/ostack.h
+++ b/psi/ostack.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/psapi.c b/psi/psapi.c
index c74934a8..ae5796f5 100644
--- a/psi/psapi.c
+++ b/psi/psapi.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/psapi.h b/psi/psapi.h
index 5e38ce41..6b9ceb23 100644
--- a/psi/psapi.h
+++ b/psi/psapi.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/psromfs.mak b/psi/psromfs.mak
index d000a9af..6a336b3e 100644
--- a/psi/psromfs.mak
+++ b/psi/psromfs.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
diff --git a/psi/store.h b/psi/store.h
index fd7dc793..3f6e00ad 100644
--- a/psi/store.h
+++ b/psi/store.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/winint.mak b/psi/winint.mak
index 10656e98..6d74f80f 100644
--- a/psi/winint.mak
+++ b/psi/winint.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2020 Artifex Software, Inc.
+# Copyright (C) 2001-2021 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -192,8 +192,8 @@ nsis: $(PSSRC)nsisinst.nsi $(GSCONSOLE_XE) $(GS_ALL) $(GS_XE) $(GSDLL_DLL) $(BIN
!endif
# -------------------- Distribution source archive ------------------- #
-# This creates a zip file containing the files needed to build
-# ghostscript on MS-Windows. We don't distribute this zip file,
+# This creates a zip file containing the files needed to build
+# ghostscript on MS-Windows. We don't distribute this zip file,
# but use it to build the executable distribution.
#
# The MS-Windows build process for a release is
diff --git a/psi/zalg.c b/psi/zalg.c
index 88e8e408..50d09cd4 100644
--- a/psi/zalg.c
+++ b/psi/zalg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -124,58 +124,54 @@ zsort_continue(i_ctx_t *i_ctx_p)
status = esp - 8;
Rn = arry.value.refs - 1; /* the -1 compensates for using 1-based indices */
switch (H) {
- case 2:
-H2: if (l > 1) {
- l--;
- ref_assign(&R, &Rn[l]);
- } else {
- ref_assign(&R, &Rn[r]);
- ref_assign_old(&arry, &Rn[r], &Rn[1], ".sort(H2-a)");
- r--;
- if (r <= 1) {
- ref_assign_old(&arry, &Rn[1], &R, ".sort(H2-b)");
- esp -= 9;
- pop(1);
- return o_pop_estack;
- }
+ case 6:
+ /*H6_cont:*/if (!r_has_type(&op[0], t_boolean)) {
+ esp -= 9;
+ return_error(gs_error_typecheck);
}
-/* H3: */ j = l;
-H4: i = j;
- j <<= 1;
- if (j >= r)
- if (j == r)
- goto H6;
- else
- goto H8;
- else {
-/* H5: */ H = 5;
- push(1);
- ref_assign(&op[-1], &Rn[j]);
- ref_assign(&op[0], &Rn[j + 1]);
- break;
+ if (op[0].value.boolval) {
+/* H7: */ ref_assign_old(&arry, &Rn[i], &Rn[j], ".sort(H7)");
+ goto H4;
}
+ do {
+/* H8: */ ref_assign_old(&arry, &Rn[i], &R, ".sort(H8)");
+ /* fallthrough */
+ case 2:
+/* H2: */ if (l > 1) {
+ l--;
+ ref_assign(&R, &Rn[l]);
+ } else {
+ ref_assign(&R, &Rn[r]);
+ ref_assign_old(&arry, &Rn[r], &Rn[1], ".sort(H2-a)");
+ r--;
+ if (r <= 1) {
+ ref_assign_old(&arry, &Rn[1], &R, ".sort(H2-b)");
+ esp -= 9;
+ pop(1);
+ return o_pop_estack;
+ }
+ }
+/* H3: */ j = l;
+H4: i = j;
+ j <<= 1;
+ } while (j > r);
+ if (j == r)
+ goto H6;
+/* H5: */ H = 5;
+ push(1);
+ ref_assign(&op[-1], &Rn[j]);
+ ref_assign(&op[0], &Rn[j + 1]);
+ break;
case 5:
/*H5_cont:*/if (!r_has_type(&op[0], t_boolean))
return_error(gs_error_typecheck);
if (op[0].value.boolval)
j++;
-H6: H = 6;
+H6: H = 6;
push(1);
ref_assign(&op[-1], &R);
ref_assign(&op[0], &Rn[j]);
break;
- case 6:
- /*H6_cont:*/if (!r_has_type(&op[0], t_boolean)) {
- esp -= 9;
- return_error(gs_error_typecheck);
- }
- if (op[0].value.boolval) {
-/* H7: */ ref_assign_old(&arry, &Rn[i], &Rn[j], ".sort(H7)");
- goto H4;
- } else {
-H8: ref_assign_old(&arry, &Rn[i], &R, ".sort(H8)");
- goto H2;
- }
default:
pop(1);
esp -= 9;
diff --git a/psi/zarith.c b/psi/zarith.c
index 61132cf5..16a76ba7 100644
--- a/psi/zarith.c
+++ b/psi/zarith.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zarray.c b/psi/zarray.c
index 42c873f4..cfe0908f 100644
--- a/psi/zarray.c
+++ b/psi/zarray.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zbfont.c b/psi/zbfont.c
index 49b4efe6..fa2597d7 100644
--- a/psi/zbfont.c
+++ b/psi/zbfont.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zbseq.c b/psi/zbseq.c
index a8812377..ee185013 100644
--- a/psi/zbseq.c
+++ b/psi/zbseq.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zcfont.c b/psi/zcfont.c
index 709ab489..1ef99e36 100644
--- a/psi/zcfont.c
+++ b/psi/zcfont.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zchar.c b/psi/zchar.c
index 9ef52493..55af9f59 100644
--- a/psi/zchar.c
+++ b/psi/zchar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1014,7 +1014,16 @@ op_show_restore(i_ctx_t *i_ctx_p, bool for_error)
} else
code = gs_grestore(igs);
}
- gs_text_release(penum, "op_show_restore");
+
+ /* Possibly restore color. This occurs if we are going to a high
+ level device or if we were only doing a fill.
+ If we are going to be doing the stroke
+ operation through zstroke then we do not want to restore yet. */
+ if (penum->k_text_release) {
+ gsicc_restore_black_text(igs);
+ }
+
+ gs_text_release(NULL, penum, "op_show_restore");
return code;
}
/* Clean up after an error. */
diff --git a/psi/zchar1.c b/psi/zchar1.c
index d8304b5c..c289b3e2 100644
--- a/psi/zchar1.c
+++ b/psi/zchar1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zchar2.c b/psi/zchar2.c
index e46263d5..38f22fad 100644
--- a/psi/zchar2.c
+++ b/psi/zchar2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zchar32.c b/psi/zchar32.c
index 387d989a..709c60a4 100644
--- a/psi/zchar32.c
+++ b/psi/zchar32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zchar42.c b/psi/zchar42.c
index cb635827..5e4cf4d5 100644
--- a/psi/zchar42.c
+++ b/psi/zchar42.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -144,10 +144,18 @@ zchar42_set_cache(i_ctx_t *i_ctx_p, gs_font_base *pbfont, ref *cnref,
which stretch subglyphs. Uniting with FontBBox helps.
In same time, FontBBox with no glyph bbox
doesn't work for 34_all.PS page 4. */
- bbox.p.x = min(sbw_bbox[4], pbfont->FontBBox.p.y);
- bbox.p.y = min(sbw_bbox[5], pbfont->FontBBox.p.y);
- bbox.q.x = max(sbw_bbox[6], pbfont->FontBBox.q.x);
- bbox.q.y = max(sbw_bbox[7], pbfont->FontBBox.q.y);
+ /* Previously we used to expand the bbox to the maximum/minimum
+ * of the glyph and font bounding boxes combined, as noted above.
+ * However this causes incorrect output (bug #703697) for vertical
+ * writing fonts with pdfwrite. Since we no longer use this code
+ * for rendering, and pdfwrite doesn't use the metrics for clipping,
+ * but does for positioning, we've removed this code.
+ */
+
+ bbox.p.x = sbw_bbox[4];
+ bbox.p.y = sbw_bbox[5];
+ bbox.q.x = sbw_bbox[6];
+ bbox.q.y = sbw_bbox[7];
return zchar_set_cache(i_ctx_p, pbfont, cnref,
NULL,
w, &bbox,
diff --git a/psi/zchar42.h b/psi/zchar42.h
index 00e0aefa..44ee5c99 100644
--- a/psi/zchar42.h
+++ b/psi/zchar42.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zcharout.c b/psi/zcharout.c
index 31007d8a..42f8ebbb 100644
--- a/psi/zcharout.c
+++ b/psi/zcharout.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zcharx.c b/psi/zcharx.c
index 73b997f4..d2ddb745 100644
--- a/psi/zcharx.c
+++ b/psi/zcharx.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zcid.c b/psi/zcid.c
index 3c2d9af4..ca621370 100644
--- a/psi/zcid.c
+++ b/psi/zcid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zcie.c b/psi/zcie.c
index 0e1c266b..616b4b71 100644
--- a/psi/zcie.c
+++ b/psi/zcie.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zcie.h b/psi/zcie.h
index fdfcfcf5..ffc69457 100644
--- a/psi/zcie.h
+++ b/psi/zcie.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zcolor.c b/psi/zcolor.c
index 0ddc15f4..34a9326f 100644
--- a/psi/zcolor.c
+++ b/psi/zcolor.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1598,7 +1598,7 @@ static int setcmykspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CI
pcs = gs_cspace_new_DeviceCMYK(imemory);
if (pcs == NULL)
return_error(gs_error_VMerror);
- /* Bug 693816 unset device color prior to possible overprint
+ /* Bug 693816 unset device color prior to possible overprint
colorant check */
gx_unset_dev_color(igs);
code = gs_setcolorspace(igs, pcs);
diff --git a/psi/zcolor.h b/psi/zcolor.h
index ab910da2..a91b3e2f 100644
--- a/psi/zcolor.h
+++ b/psi/zcolor.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zcolor1.c b/psi/zcolor1.c
index 66238165..e33c4377 100644
--- a/psi/zcolor1.c
+++ b/psi/zcolor1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zcolor2.c b/psi/zcolor2.c
index acd96648..d1a35cda 100644
--- a/psi/zcolor2.c
+++ b/psi/zcolor2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zcolor3.c b/psi/zcolor3.c
index 82ac958f..51f176ff 100644
--- a/psi/zcolor3.c
+++ b/psi/zcolor3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zcontrol.c b/psi/zcontrol.c
index 460a8a19..b5b7798f 100644
--- a/psi/zcontrol.c
+++ b/psi/zcontrol.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zcrd.c b/psi/zcrd.c
index 117da1b9..2e46da55 100644
--- a/psi/zcrd.c
+++ b/psi/zcrd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zcsindex.c b/psi/zcsindex.c
index a8340b49..2c26da26 100644
--- a/psi/zcsindex.c
+++ b/psi/zcsindex.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zcspixel.c b/psi/zcspixel.c
index f72c0d83..b03f2ff9 100644
--- a/psi/zcspixel.c
+++ b/psi/zcspixel.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zcssepr.c b/psi/zcssepr.c
index bb9075bf..524f3585 100644
--- a/psi/zcssepr.c
+++ b/psi/zcssepr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zdevcal.c b/psi/zdevcal.c
index f3803d1d..b4c2f7f6 100644
--- a/psi/zdevcal.c
+++ b/psi/zdevcal.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zdevice.c b/psi/zdevice.c
index 6cc7aab1..a9d4e8a1 100644
--- a/psi/zdevice.c
+++ b/psi/zdevice.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -590,6 +590,7 @@ struct spec_op_s {
spec_op_t spec_op_defs[] = {
{(char *)"GetDeviceParam", 0},
{(char *)"EventInfo", 1},
+ {(char *)"SupportsDevn", 2},
};
/* <any> <any> .... /spec_op name .special_op <any> <any> .....
@@ -684,8 +685,8 @@ zspec_op(i_ctx_t *i_ctx_p)
stack_param_list list;
dev_param_req_t request;
ref rkeys;
- /* Get a single device parameter, we should be supplied with
- * the name of the paramter, as a name object.
+ /* EventInfo we should be supplied with a name object which we
+ * pass as the event info to the dev_spec_op
*/
check_op(1);
if (!r_has_type(op, t_name))
@@ -723,6 +724,19 @@ zspec_op(i_ctx_t *i_ctx_p)
}
}
break;
+ case 2:
+ {
+ /* SupportsDevn. Return the boolean from the device */
+
+ code = dev_proc(dev, dev_spec_op)(dev, gxdso_supports_devn, NULL, 0);
+ if (code < 0 && code != gs_error_undefined)
+ return_error(code); /* any other error leaves the stack unchanged */
+
+ op = osp;
+ push(1);
+ make_bool(op, code > 0 ? 1 : 0); /* return true/false */
+ }
+ break;
default:
/* Belt and braces; it shold not be possible to get here, as the table
* containing the names should mirror the entries in this switch. If we
diff --git a/psi/zdevice2.c b/psi/zdevice2.c
index 53374c2d..dab9e6b9 100644
--- a/psi/zdevice2.c
+++ b/psi/zdevice2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zdfilter.c b/psi/zdfilter.c
index 7ef53122..4099e268 100644
--- a/psi/zdfilter.c
+++ b/psi/zdfilter.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zdict.c b/psi/zdict.c
index efea18e7..17554c33 100644
--- a/psi/zdict.c
+++ b/psi/zdict.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zdouble.c b/psi/zdouble.c
index d06d39de..e6e7bad6 100644
--- a/psi/zdouble.c
+++ b/psi/zdouble.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zdps1.c b/psi/zdps1.c
index 2d81ad72..f0c29406 100644
--- a/psi/zdps1.c
+++ b/psi/zdps1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zdscpars.c b/psi/zdscpars.c
index 8a8ef130..0918a362 100644
--- a/psi/zdscpars.c
+++ b/psi/zdscpars.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfaes.c b/psi/zfaes.c
index fe47cd35..a49dc7c7 100644
--- a/psi/zfaes.c
+++ b/psi/zfaes.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfapi.c b/psi/zfapi.c
index 19043b84..0b3ab1cf 100644
--- a/psi/zfapi.c
+++ b/psi/zfapi.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1704,7 +1704,7 @@ decode_bytes(byte *p, const byte *s, int l, int lenIV)
static int
get_type1_data(gs_fapi_font *ff, const ref *type1string,
- byte *buf, ushort buf_length)
+ byte *buf, int buf_length)
{
gs_font_type1 *pfont = (gs_font_type1 *) ff->client_font_data;
int lenIV = max(pfont->data.lenIV, 0);
@@ -1899,6 +1899,7 @@ sfnt_get_glyph_offset(ref *pdr, gs_font_type42 *pfont42, int index,
{ /* Note : TTC is not supported and probably is unuseful for Type 42. */
sfnts_reader r;
int glyf_elem_size = (pfont42->data.indexToLocFormat) ? 4 : 2;
+ ulong fullsize;
if (index < pfont42->data.trueNumGlyphs) {
sfnts_reader_init(&r, pdr);
@@ -1906,6 +1907,10 @@ sfnt_get_glyph_offset(ref *pdr, gs_font_type42 *pfont42, int index,
*offset0 =
pfont42->data.glyf + (glyf_elem_size ==
2 ? r.rword(&r) * 2 : r.rlong(&r));
+ r.error = sfnt_get_sfnt_length(pdr, &fullsize);
+ if (r.error < 0 || *offset0 > fullsize) {
+ r.error = gs_note_error(gs_error_invalidaccess);
+ }
}
else {
r.error = gs_note_error(gs_error_rangecheck);
@@ -2118,15 +2123,14 @@ FAPI_FF_get_glyph(gs_fapi_font *ff, gs_glyph char_code, byte *buf, int buf_lengt
}
else {
ulong noffs, endoffs;
- int code;
/* If we haven't got a len_glyphs array, try using the offset of the next glyph offset
* to work out the length
*/
error = sfnt_get_glyph_offset(pdr, pfont42, char_code + 1, &noffs);
if (error == 0) {
glyph_length = noffs - offset0;
- code = sfnt_get_sfnt_length(pdr, &endoffs);
- if (code < 0) {
+ error = sfnt_get_sfnt_length(pdr, &endoffs);
+ if (error < 0) {
glyph_length = gs_fapi_glyph_invalid_index;
}
else {
@@ -2139,8 +2143,8 @@ FAPI_FF_get_glyph(gs_fapi_font *ff, gs_glyph char_code, byte *buf, int buf_lengt
/* And if we can't get the next glyph offset, use the end of the sfnt data
* to work out the length.
*/
- code = sfnt_get_sfnt_length(pdr, &noffs);
- if (code < 0) {
+ error = sfnt_get_sfnt_length(pdr, &noffs);
+ if (error < 0) {
glyph_length = gs_fapi_glyph_invalid_index;
}
else {
@@ -2873,7 +2877,7 @@ ps_get_glyphname_or_cid(gs_text_enum_t *penum,
cmapnmlen = r_size(&CMapNameStr);
}
}
- /* We only have to lookup the char code if we're *not* using an identity ordering
+ /* We only have to lookup the char code if we're *not* using an identity ordering
with the exception of Identity-UTF16 which is a different beast altogether */
if (unicode_cp || (cmapnmlen > 0 && !strncmp(cmapnm, utfcmap, cmapnmlen > utfcmaplen ? utfcmaplen : cmapnmlen))
|| (dict_find_string(pdr, "CIDSystemInfo", &CIDSystemInfo) > 0
diff --git a/psi/zfarc4.c b/psi/zfarc4.c
index dad70171..bbefe36d 100644
--- a/psi/zfarc4.c
+++ b/psi/zfarc4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -39,6 +39,9 @@ z_arcfour_d(i_ctx_t * i_ctx_p)
os_ptr op = osp; /* i_ctx_p->op_stack.stack.p defined in osstack.h */
ref *sop = NULL;
stream_arcfour_state state;
+ int code;
+
+ state.x = state.y = 0;
/* extract the key from the parameter dictionary */
check_type(*op, t_dictionary);
@@ -47,7 +50,9 @@ z_arcfour_d(i_ctx_t * i_ctx_p)
return_error(gs_error_rangecheck);
if (!r_has_type(sop, t_string))
return_error(gs_error_typecheck);
- s_arcfour_set_key(&state, sop->value.const_bytes, r_size(sop));
+
+ if ((code = s_arcfour_set_key(&state, sop->value.const_bytes, r_size(sop))) < 0)
+ return code;
/* we pass npop=0, since we've no arguments left to consume */
/* we pass 0 instead of the usual rspace(sop) will allocate storage for
@@ -64,6 +69,9 @@ z_arcfour_e(i_ctx_t * i_ctx_p)
os_ptr op = osp; /* i_ctx_p->op_stack.stack.p defined in osstack.h */
ref *sop = NULL;
stream_arcfour_state state;
+ int code;
+
+ state.x = state.y = 0;
/* extract the key from the parameter dictionary */
check_type(*op, t_dictionary);
@@ -73,7 +81,8 @@ z_arcfour_e(i_ctx_t * i_ctx_p)
if (!r_has_type(sop, t_string))
return_error(gs_error_typecheck);
- s_arcfour_set_key(&state, sop->value.const_bytes, r_size(sop));
+ if ((code = s_arcfour_set_key(&state, sop->value.const_bytes, r_size(sop))) < 0)
+ return code;
/* we pass npop=0, since we've no arguments left to consume */
/* we pass 0 instead of the usual rspace(sop) will allocate storage for
diff --git a/psi/zfbcp.c b/psi/zfbcp.c
index 88b4f207..cf4f7796 100644
--- a/psi/zfbcp.c
+++ b/psi/zfbcp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfcid.c b/psi/zfcid.c
index 19548d4c..80b8855f 100644
--- a/psi/zfcid.c
+++ b/psi/zfcid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfcid0.c b/psi/zfcid0.c
index c9e3ae04..ce81e57d 100644
--- a/psi/zfcid0.c
+++ b/psi/zfcid0.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfcid1.c b/psi/zfcid1.c
index dcaca163..fd502ff1 100644
--- a/psi/zfcid1.c
+++ b/psi/zfcid1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfcmap.c b/psi/zfcmap.c
index 6cb3a237..bd8e9361 100644
--- a/psi/zfcmap.c
+++ b/psi/zfcmap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfdctd.c b/psi/zfdctd.c
index c12e8ea8..cbd05772 100644
--- a/psi/zfdctd.c
+++ b/psi/zfdctd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfdcte.c b/psi/zfdcte.c
index 4adb3389..78bfda4d 100644
--- a/psi/zfdcte.c
+++ b/psi/zfdcte.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfdecode.c b/psi/zfdecode.c
index 43f654b2..952a95dc 100644
--- a/psi/zfdecode.c
+++ b/psi/zfdecode.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfile.c b/psi/zfile.c
index ec19796b..11fd6f8e 100644
--- a/psi/zfile.c
+++ b/psi/zfile.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfile.h b/psi/zfile.h
index a2579344..701583d9 100644
--- a/psi/zfile.h
+++ b/psi/zfile.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfile1.c b/psi/zfile1.c
index db6068f6..5179270d 100644
--- a/psi/zfile1.c
+++ b/psi/zfile1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfileio.c b/psi/zfileio.c
index 9b35f2ca..615d9526 100644
--- a/psi/zfileio.c
+++ b/psi/zfileio.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfilter.c b/psi/zfilter.c
index 818e9c65..a8da18bc 100644
--- a/psi/zfilter.c
+++ b/psi/zfilter.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfilter2.c b/psi/zfilter2.c
index e65a6d8c..fa1adf77 100644
--- a/psi/zfilter2.c
+++ b/psi/zfilter2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfimscale.c b/psi/zfimscale.c
index 088a6c5f..7b2e14c6 100644
--- a/psi/zfimscale.c
+++ b/psi/zfimscale.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -49,8 +49,8 @@ z_imscale_d(i_ctx_t * i_ctx_p)
if (dict_int_param(op, "Height", 0, 1<<24, -1, &height) < 0)
return_error(gs_error_rangecheck);
- state.params.spp_decode = 1;
- state.params.spp_interp = 1;
+ state.params.spp_decode = 1;
+ state.params.spp_interp = 1;
state.params.BitsPerComponentIn = 1;
state.params.MaxValueIn = 1;
state.params.WidthIn = width;
diff --git a/psi/zfjbig2.c b/psi/zfjbig2.c
index 055463b8..9628c599 100644
--- a/psi/zfjbig2.c
+++ b/psi/zfjbig2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -31,11 +31,7 @@
#include "strimpl.h"
#include "ifilter.h"
-#ifdef USE_LDF_JB2
-#include "sjbig2_luratech.h"
-#else
#include "sjbig2.h"
-#endif
/* We define a structure, s_jbig2_global_data_t,
allocated in the postscript
diff --git a/psi/zfjpx.c b/psi/zfjpx.c
index 8b612659..0428c3ae 100644
--- a/psi/zfjpx.c
+++ b/psi/zfjpx.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -33,9 +33,7 @@
#include "iname.h"
#include "gdebug.h"
-#if defined(USE_LWF_JP2)
-# include "sjpx_luratech.h"
-#elif defined(USE_OPENJPEG_JP2)
+#if defined(USE_OPENJPEG_JP2)
# include "sjpx_openjpeg.h"
#else
# include "sjpx.h"
diff --git a/psi/zfmd5.c b/psi/zfmd5.c
index 516c9195..b4562834 100644
--- a/psi/zfmd5.c
+++ b/psi/zfmd5.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfont.c b/psi/zfont.c
index 5d7dd15f..d25c3f02 100644
--- a/psi/zfont.c
+++ b/psi/zfont.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -50,14 +50,14 @@ zfont_mark_glyph_name(const gs_memory_t *mem, gs_glyph glyph, void *ignore_data)
/* Get a global glyph code. */
static int
-zfont_global_glyph_code(const gs_memory_t *mem, gs_const_string *gstr, gs_glyph *pglyph)
+zfont_global_glyph_code(const gs_font *pbfont, gs_const_string *gstr, gs_glyph *pglyph)
{
ref v;
- int code = name_ref(mem, gstr->data, gstr->size, &v, 0);
+ int code = name_ref(pbfont->memory, gstr->data, gstr->size, &v, 0);
if (code < 0)
return code;
- *pglyph = (gs_glyph)name_index(mem, &v);
+ *pglyph = (gs_glyph)name_index(pbfont->memory, &v);
return 0;
}
diff --git a/psi/zfont0.c b/psi/zfont0.c
index 31c89d0a..67998569 100644
--- a/psi/zfont0.c
+++ b/psi/zfont0.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfont1.c b/psi/zfont1.c
index 61e1ff4b..e465e990 100644
--- a/psi/zfont1.c
+++ b/psi/zfont1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -181,7 +181,7 @@ charstring_check_mm_params(ref *fdict, unsigned int ndesigns)
goto bad;
code = dict_find_string(BPriv, "BlueValues", &p1);
if (code > 0) {
- if (!r_is_array(p1)) {
+ if (!r_is_array(p1) || r_size(p1) < 2) {
goto bad;
}
else {
@@ -202,7 +202,7 @@ charstring_check_mm_params(ref *fdict, unsigned int ndesigns)
}
code = dict_find_string(BPriv, "OtherBlues", &p1);
if (code > 0) {
- if (!r_is_array(p1)) {
+ if (!r_is_array(p1) || r_size(p1) < 2) {
goto bad;
}
else {
@@ -328,7 +328,7 @@ charstring_check_mm_params(ref *fdict, unsigned int ndesigns)
}
code = dict_find_string(BPriv, "FamilyBlues", &p1);
if (code > 0) {
- if (!r_is_array(p1)) {
+ if (!r_is_array(p1) || r_size(p1) < 2) {
goto bad;
}
else {
@@ -348,7 +348,7 @@ charstring_check_mm_params(ref *fdict, unsigned int ndesigns)
}
code = dict_find_string(BPriv, "FamilyOtherBlues", &p1);
if (code > 0) {
- if (!r_is_array(p1)) {
+ if (!r_is_array(p1) || r_size(p1) < 2) {
goto bad;
}
else {
@@ -450,14 +450,23 @@ charstring_font_params(const gs_memory_t *mem,
if ((code = pdata1->BlueValues.count = dict_float_array_param(mem, pprivate, "BlueValues",
max_BlueValues * 2, &pdata1->BlueValues.values[0], NULL)) < 0)
return code;
+ if (pdata1->BlueValues.count % 2 != 0)
+ return_error(gs_error_rangecheck);
+
if ((code = dict_float_param(pprivate, "ExpansionFactor", 0.06, &pdata1->ExpansionFactor)) < 0)
return code;
if ((code = pdata1->FamilyBlues.count = dict_float_array_param(mem, pprivate, "FamilyBlues",
max_FamilyBlues * 2, &pdata1->FamilyBlues.values[0], NULL)) < 0)
return code;
+ if (pdata1->FamilyBlues.count % 2 != 0)
+ return_error(gs_error_rangecheck);
+
if ((code = pdata1->FamilyOtherBlues.count = dict_float_array_param(mem, pprivate, "FamilyOtherBlues",
max_FamilyOtherBlues * 2, &pdata1->FamilyOtherBlues.values[0], NULL)) < 0)
return code;
+ if (pdata1->FamilyOtherBlues.count % 2 != 0)
+ return_error(gs_error_rangecheck);
+
if ((code = dict_bool_param(pprivate, "ForceBold", false, &pdata1->ForceBold)) < 0)
return code;
/*
@@ -469,6 +478,9 @@ charstring_font_params(const gs_memory_t *mem,
if ((code = pdata1->OtherBlues.count = dict_float_array_param(mem, pprivate, "OtherBlues",
max_OtherBlues * 2, &pdata1->OtherBlues.values[0], NULL)) < 0)
return code;
+ if (pdata1->OtherBlues.count % 2 != 0)
+ return_error(gs_error_rangecheck);
+
if ((code = dict_bool_param(pprivate, "RndStemUp", true, &pdata1->RndStemUp)) < 0)
return code;
if ((code = pdata1->StdHW.count = dict_float_array_check_param(mem, pprivate, "StdHW",
diff --git a/psi/zfont2.c b/psi/zfont2.c
index db7b81e7..ae5d29d0 100644
--- a/psi/zfont2.c
+++ b/psi/zfont2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1526,12 +1526,18 @@ get_float(ref *fnum, const cff_data_t *data, unsigned p, unsigned pe)
int sign = 0;
char *eptr, *bptr = buf;
- if (buf[0] == '-'){
+ if (q > buf && buf[0] == '-'){
sign = -1;
bptr = &(buf[1]);
}
- code = scan_number ((const byte *)bptr, (const byte *)q, sign, fnum, (const byte **)&eptr, 0);
+ if (q > buf) {
+ code = scan_number ((const byte *)bptr, (const byte *)q, sign, fnum, (const byte **)&eptr, 0);
+ }
+ else {
+ code = 0;
+ make_int(fnum, 0);
+ }
if (code < 0) {
return(code);
}
diff --git a/psi/zfont32.c b/psi/zfont32.c
index a8780515..43005c99 100644
--- a/psi/zfont32.c
+++ b/psi/zfont32.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfont42.c b/psi/zfont42.c
index 7bc2b4c5..ad056af5 100644
--- a/psi/zfont42.c
+++ b/psi/zfont42.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfontenum.c b/psi/zfontenum.c
index 97101a80..486fbe6d 100644
--- a/psi/zfontenum.c
+++ b/psi/zfontenum.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -48,7 +48,7 @@ z_fontenum(i_ctx_t *i_ctx_p)
int code = 0;
int e,elements, e2;
char *fontname, *path;
- fontenum_t *r, *results;
+ fontenum_t *results, **presults;
ref array;
uint length;
uint length2;
@@ -62,37 +62,39 @@ z_fontenum(i_ctx_t *i_ctx_p)
goto all_done;
}
- r = results = gs_malloc(imemory->non_gc_memory, 1, sizeof(fontenum_t), "fontenum list");
- if (!r) {
- code = gs_note_error(gs_error_VMerror);
- goto done;
- }
- r->next = NULL;
+ presults = &results;
+ results = NULL;
elements = 0;
while((code = gp_enumerate_fonts_next(enum_state, &fontname, &path )) > 0) {
+ fontenum_t *r;
+
if (fontname == NULL || path == NULL) {
code = gs_note_error(gs_error_ioerror);
goto done;
}
-
+ r = gs_malloc(imemory->non_gc_memory, 1, sizeof(fontenum_t), "fontenum list");
+ if (r == NULL)
+ break;
length = strlen(fontname) + 1;
r->fontname = gs_malloc(imemory->non_gc_memory, length, 1, "native font name");
if (r->fontname) {
memcpy(r->fontname, fontname, length);
-
- r->next = gs_malloc(imemory->non_gc_memory, 1, sizeof(fontenum_t), "fontenum list");
length2 = strlen(path) + 1;
r->path = gs_malloc(imemory->non_gc_memory, length2, 1, "native font path");
- if (r->next == NULL || r->path == NULL) {
- gs_free(imemory->non_gc_memory, r->fontname, length, 1, "native font name");
- gs_free(imemory->non_gc_memory, r->path, length2, 1, "native font path");
- gs_free(imemory->non_gc_memory, r->next, sizeof(fontenum_t), 1, "fontenum list");
- }
- else {
+ if (r->path) {
memcpy(r->path, path, length2);
- r = r->next;
+ *presults = r;
+ presults = &r->next;
+ r->next = 0;
elements += 1;
+ } else {
+ gs_free(imemory->non_gc_memory, r->fontname, length, 1, "native font name");
+ gs_free(imemory->non_gc_memory, r, sizeof(fontenum_t), 1, "fontenum list");
+ break;
}
+ } else {
+ gs_free(imemory->non_gc_memory, r, sizeof(fontenum_t), 1, "fontenum list");
+ break;
}
}
@@ -100,8 +102,9 @@ z_fontenum(i_ctx_t *i_ctx_p)
enum_state = NULL;
if ((code = ialloc_ref_array(&array, a_all | icurrent_space, elements, "native fontmap")) >= 0) {
- r = results;
- for (e = e2 = 0; e < elements; e++) {
+ fontenum_t *r = results;
+
+ for (e = e2 = 0; e < elements && r != NULL; e++) {
ref mapping;
if ((code = ialloc_ref_array(&mapping, a_all | icurrent_space, 2, "native font mapping")) >= 0) {
@@ -135,8 +138,9 @@ z_fontenum(i_ctx_t *i_ctx_p)
}
}
else {
- while (elements--) {
- r = results->next;
+ while (elements-- && results != NULL) {
+ fontenum_t *r = results->next;
+
gs_free(imemory->non_gc_memory, results->fontname,
strlen(results->fontname) + 1, 1, "native font name");
gs_free(imemory->non_gc_memory, results->path,
diff --git a/psi/zform.c b/psi/zform.c
index 3c00b5a5..64224805 100644
--- a/psi/zform.c
+++ b/psi/zform.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -61,7 +61,7 @@ static int zbeginform(i_ctx_t *i_ctx_p)
tmplate.BBox.p.y = BBox[1];
tmplate.BBox.q.x = BBox[2];
tmplate.BBox.q.y = BBox[3];
-
+
code = dict_floats_param(imemory, op, "Matrix", 6, Matrix, NULL);
if (code < 0)
return code;
diff --git a/psi/zfproc.c b/psi/zfproc.c
index 620e5bdb..f57d130d 100644
--- a/psi/zfproc.c
+++ b/psi/zfproc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfrsd.c b/psi/zfrsd.c
index 3fa1d92e..11826224 100644
--- a/psi/zfrsd.c
+++ b/psi/zfrsd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfrsd.h b/psi/zfrsd.h
index 9777e653..e0f4b8da 100644
--- a/psi/zfrsd.h
+++ b/psi/zfrsd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfsample.c b/psi/zfsample.c
index 29080940..0e8e4bc8 100644
--- a/psi/zfsample.c
+++ b/psi/zfsample.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -551,9 +551,17 @@ sampled_data_continue(i_ctx_t *i_ctx_p)
} else {
if (stack_depth_adjust) {
stack_depth_adjust -= num_out;
- push(O_STACK_PAD - stack_depth_adjust);
- for (i=0;i<O_STACK_PAD - stack_depth_adjust;i++)
- make_null(op - i);
+ if ((O_STACK_PAD - stack_depth_adjust) < 0) {
+ stack_depth_adjust = -(O_STACK_PAD - stack_depth_adjust);
+ check_op(stack_depth_adjust);
+ pop(stack_depth_adjust);
+ }
+ else {
+ check_ostack(O_STACK_PAD - stack_depth_adjust);
+ push(O_STACK_PAD - stack_depth_adjust);
+ for (i=0;i<O_STACK_PAD - stack_depth_adjust;i++)
+ make_null(op - i);
+ }
}
}
diff --git a/psi/zfsha2.c b/psi/zfsha2.c
index 816607be..171ebb4d 100644
--- a/psi/zfsha2.c
+++ b/psi/zfsha2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfunc.c b/psi/zfunc.c
index 091549bf..97d57656 100644
--- a/psi/zfunc.c
+++ b/psi/zfunc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfunc.h b/psi/zfunc.h
index 1fef90d9..244084b8 100644
--- a/psi/zfunc.h
+++ b/psi/zfunc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfunc0.c b/psi/zfunc0.c
index 9a100207..0136862e 100644
--- a/psi/zfunc0.c
+++ b/psi/zfunc0.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfunc3.c b/psi/zfunc3.c
index c5179b03..d8c58f31 100644
--- a/psi/zfunc3.c
+++ b/psi/zfunc3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfunc4.c b/psi/zfunc4.c
index 97143528..c4f476a8 100644
--- a/psi/zfunc4.c
+++ b/psi/zfunc4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zfzlib.c b/psi/zfzlib.c
index bc5a74b5..4561d647 100644
--- a/psi/zfzlib.c
+++ b/psi/zfzlib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zgeneric.c b/psi/zgeneric.c
index 822d23fb..26d9fa22 100644
--- a/psi/zgeneric.c
+++ b/psi/zgeneric.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zgstate.c b/psi/zgstate.c
index 4910a7ec..9cc086cd 100644
--- a/psi/zgstate.c
+++ b/psi/zgstate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zht.c b/psi/zht.c
index 9eb591b3..6f707a3f 100644
--- a/psi/zht.c
+++ b/psi/zht.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zht1.c b/psi/zht1.c
index a2a4dbaa..65dee490 100644
--- a/psi/zht1.c
+++ b/psi/zht1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zht2.c b/psi/zht2.c
index 1b7337fc..88389b1e 100644
--- a/psi/zht2.c
+++ b/psi/zht2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -33,6 +33,7 @@
#include "zht2.h"
#include "gxgstate.h"
#include "gen_ordered.h"
+#include "gp.h"
/* Forward references */
static int dict_spot_params(const ref *, gs_spot_halftone *, ref *, ref *,
@@ -448,7 +449,13 @@ zgenordered(i_ctx_t *i_ctx_p)
return gs_error_undefined;
params.output_format = OUTPUT_TOS; /* we want this format */
- code = htsc_gen_ordered(params, &S, &final_mask);
+ code = htsc_gen_ordered(params, &S, &final_mask, mem);
+
+#if FINAL_SCREEN_DUMP
+ if (code >= 0) {
+ code = htsc_save_screen(&final_mask, params.holladay, S, params, mem);
+ }
+#endif
if (code < 0)
goto done;
@@ -512,6 +519,19 @@ zgenordered(i_ctx_t *i_ctx_p)
for (; cur_pix < num_pix; cur_pix++) {
thresh[final_mask.data[2 * cur_pix] + (width*final_mask.data[2 * cur_pix + 1])] = 0;
}
+#if FINAL_SCREEN_DUMP
+ {
+ char file_name[FULL_FILE_NAME_LENGTH];
+ gp_file *fid;
+
+ snprintf(file_name, FULL_FILE_NAME_LENGTH, "Screen_%dx%d.raw", width, final_mask.height);
+ fid = gp_fopen(mem, file_name, "wb");
+ if (fid) {
+ gp_fwrite(thresh, sizeof(unsigned char), num_pix, fid);
+ gp_fclose(fid);
+ }
+ }
+#endif
if (output_type == OUTPUT_RAW) {
make_string(&thresh_ref, a_all | icurrent_space, 4 + num_pix, thresh-4);
*op = thresh_ref;
diff --git a/psi/zht2.h b/psi/zht2.h
index cbbbce5b..5580d84f 100644
--- a/psi/zht2.h
+++ b/psi/zht2.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zicc.c b/psi/zicc.c
index 8922d458..e01913eb 100644
--- a/psi/zicc.c
+++ b/psi/zicc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zicc.h b/psi/zicc.h
index acb94153..39908c9d 100644
--- a/psi/zicc.h
+++ b/psi/zicc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zimage.c b/psi/zimage.c
index c2d31611..5962019e 100644
--- a/psi/zimage.c
+++ b/psi/zimage.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zimage3.c b/psi/zimage3.c
index 2747edb8..dee25b32 100644
--- a/psi/zimage3.c
+++ b/psi/zimage3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ziodev.c b/psi/ziodev.c
index 7c829bc3..c75ecc62 100644
--- a/psi/ziodev.c
+++ b/psi/ziodev.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ziodev2.c b/psi/ziodev2.c
index 1eceafd2..3e8198d8 100644
--- a/psi/ziodev2.c
+++ b/psi/ziodev2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ziodevsc.c b/psi/ziodevsc.c
index 1bba4f4b..4b7feaef 100644
--- a/psi/ziodevsc.c
+++ b/psi/ziodevsc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zmath.c b/psi/zmath.c
index 518424f2..00bf825d 100644
--- a/psi/zmath.c
+++ b/psi/zmath.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zmatrix.c b/psi/zmatrix.c
index 154f7105..94f1a85f 100644
--- a/psi/zmatrix.c
+++ b/psi/zmatrix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zmedia2.c b/psi/zmedia2.c
index 94da7327..d960999b 100644
--- a/psi/zmedia2.c
+++ b/psi/zmedia2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zmisc.c b/psi/zmisc.c
index 196b40d5..eee27df4 100644
--- a/psi/zmisc.c
+++ b/psi/zmisc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zmisc1.c b/psi/zmisc1.c
index 1ab4bbc0..3c47e995 100644
--- a/psi/zmisc1.c
+++ b/psi/zmisc1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zmisc2.c b/psi/zmisc2.c
index c47ef793..dc4e2422 100644
--- a/psi/zmisc2.c
+++ b/psi/zmisc2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zmisc3.c b/psi/zmisc3.c
index b962d61b..5e523b9d 100644
--- a/psi/zmisc3.c
+++ b/psi/zmisc3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zncdummy.c b/psi/zncdummy.c
index e7a98511..be36b842 100644
--- a/psi/zncdummy.c
+++ b/psi/zncdummy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zpacked.c b/psi/zpacked.c
index 3171b44f..4ebab0ca 100644
--- a/psi/zpacked.c
+++ b/psi/zpacked.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zpaint.c b/psi/zpaint.c
index 8834a444..42963b51 100644
--- a/psi/zpaint.c
+++ b/psi/zpaint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zpath.c b/psi/zpath.c
index 10aceaa1..4a84358d 100644
--- a/psi/zpath.c
+++ b/psi/zpath.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zpath1.c b/psi/zpath1.c
index ab617a7a..34c0115b 100644
--- a/psi/zpath1.c
+++ b/psi/zpath1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zpcolor.c b/psi/zpcolor.c
index 483d22e4..26e15dd2 100644
--- a/psi/zpcolor.c
+++ b/psi/zpcolor.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -244,7 +244,7 @@ pattern_paint_prepare(i_ctx_t *i_ctx_p)
gs_setdevice_no_init(pgs, (gx_device *)pdev);
if (pinst->templat.uses_transparency) {
if_debug0m('v', imemory, " pushing the pdf14 compositor device into this graphics state\n");
- if ((code = gs_push_pdf14trans_device(pgs, true, true)) < 0)
+ if ((code = gs_push_pdf14trans_device(pgs, true, true, 0, 0)) < 0) /* FIXME: do we need spot_color_count ??? */
return code;
} else { /* not transparent */
if (pinst->templat.PaintType == 1 && !(pinst->is_clist)
diff --git a/psi/zpdf_r6.c b/psi/zpdf_r6.c
index a958fdb2..218e4540 100644
--- a/psi/zpdf_r6.c
+++ b/psi/zpdf_r6.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -144,7 +144,7 @@ zcheck_r6_password(i_ctx_t * i_ctx_p)
return_error(gs_error_typecheck);
if (!r_has_type(Pref, t_string))
return_error(gs_error_typecheck);
-
+
code = dict_find_string(CryptDict, "O", &Oref);
if (code < 0)
return code;
diff --git a/psi/zpdfops.c b/psi/zpdfops.c
index 0e896eb4..e60cf97f 100644
--- a/psi/zpdfops.c
+++ b/psi/zpdfops.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zrelbit.c b/psi/zrelbit.c
index cade486f..8b25174d 100644
--- a/psi/zrelbit.c
+++ b/psi/zrelbit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zshade.c b/psi/zshade.c
index d468bdba..aa7799f3 100644
--- a/psi/zshade.c
+++ b/psi/zshade.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -382,6 +382,10 @@ build_directional_shading(i_ctx_t *i_ctx_p, const ref * op, float *Coords, int n
static const float default_Domain[2] = {0, 1};
ref *pExtend;
+ if (code >= 0 && code < num_Coords) {
+ code = gs_note_error(gs_error_rangecheck);
+ }
+
*pFunction = 0;
if (code < 0 ||
(code = dict_floats_param_errorinfo(i_ctx_p, op, "Domain", 2, Domain,
diff --git a/psi/zstack.c b/psi/zstack.c
index 2f2f0db9..ef13bda2 100644
--- a/psi/zstack.c
+++ b/psi/zstack.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zstring.c b/psi/zstring.c
index 58e1af2b..44eb8970 100644
--- a/psi/zstring.c
+++ b/psi/zstring.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zsysvm.c b/psi/zsysvm.c
index 0abaa665..4fa7f05b 100644
--- a/psi/zsysvm.c
+++ b/psi/zsysvm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ztoken.c b/psi/ztoken.c
index de7b2b05..2fe40515 100644
--- a/psi/ztoken.c
+++ b/psi/ztoken.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ztrans.c b/psi/ztrans.c
index 4a26bdd4..3a5563ef 100644
--- a/psi/ztrans.c
+++ b/psi/ztrans.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -26,6 +26,7 @@
#include "gxiparam.h" /* for image enumerator */
#include "gxcspace.h"
#include "idict.h"
+#include "idstack.h"
#include "idparam.h"
#include "ifunc.h"
#include "igstate.h"
@@ -471,10 +472,18 @@ static int
zpushpdf14devicefilter(i_ctx_t *i_ctx_p)
{
int code;
+ int depth;
+ int spot_color_count = -1; /* default is 'unknown' spot color count */
os_ptr op = osp;
gx_device *cdev = gs_currentdevice_inline(igs);
+ dict_stack_t *dstack = &(i_ctx_p->dict_stack);
+ ref_stack_t *rdstack = &dstack->stack;
+ const ref *puserdict = ref_stack_index(rdstack, ref_stack_count(rdstack) - 1 -
+ dstack->userdict_index);
check_type(*op, t_integer);
+ depth = (int)op->value.intval;
+
if (dev_proc(cdev, dev_spec_op)(cdev, gxdso_is_pdf14_device, NULL, 0) > 0)
return 0; /* ignore push_device if already is pdf14 device */
@@ -482,7 +491,8 @@ zpushpdf14devicefilter(i_ctx_t *i_ctx_p)
/* sure that the device knows that we are using the pdf14 */
/* transparency. Note this will close and re-open the device */
/* and erase the page. This should not occur with PDF files. */
- if (cdev->page_uses_transparency == 0) {
+ /* We don't do this if this is a push for the overprint_sim mode */
+ if (depth >= 0 && cdev->page_uses_transparency == 0) {
gs_c_param_list list;
bool bool_true = 1;
@@ -504,7 +514,12 @@ zpushpdf14devicefilter(i_ctx_t *i_ctx_p)
if ((code = gs_erasepage(igs)) < 0)
return code;
}
- code = gs_push_pdf14trans_device(igs, false, true);
+ /* Get the PageSpotColors value from the userdict, if it is defined */
+ code = dict_int_param(puserdict, "PageSpotColors", -1, max_int, -1, &spot_color_count);
+ if (code < 0)
+ return code;
+ /* and finally actually push the compositor device */
+ code = gs_push_pdf14trans_device(igs, false, true, depth, spot_color_count);
if (code < 0)
return code;
pop(1);
diff --git a/psi/ztrap.c b/psi/ztrap.c
index 31eb28ce..c1a57480 100644
--- a/psi/ztrap.c
+++ b/psi/ztrap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/ztype.c b/psi/ztype.c
index fab27017..213c9726 100644
--- a/psi/ztype.c
+++ b/psi/ztype.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zupath.c b/psi/zupath.c
index 799471a0..49f2c45d 100644
--- a/psi/zupath.c
+++ b/psi/zupath.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zusparam.c b/psi/zusparam.c
index 2ca0f4f9..be98672a 100644
--- a/psi/zusparam.c
+++ b/psi/zusparam.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zutf8.c b/psi/zutf8.c
index 5e55c650..1dca8991 100644
--- a/psi/zutf8.c
+++ b/psi/zutf8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zvmem.c b/psi/zvmem.c
index 63dfe251..0a1f5bdf 100644
--- a/psi/zvmem.c
+++ b/psi/zvmem.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -73,17 +73,36 @@ zsave(i_ctx_t *i_ctx_p)
return_error(gs_error_VMerror);
vmsave->gsave = NULL; /* Ensure constructed enough to destroy safely */
code = alloc_save_state(idmemory, vmsave, &sid);
- if (code < 0)
- return code;
- if (sid == 0) {
+
+ if (code < 0 || sid == 0) {
ifree_object(vmsave, "zsave");
- return_error(gs_error_VMerror);
+ if (code < 0)
+ return code;
+ else
+ return_error(gs_error_VMerror);
}
if_debug2m('u', imemory, "[u]vmsave "PRI_INTPTR", id = %lu\n",
(intptr_t) vmsave, (ulong) sid);
code = gs_gsave_for_save(igs, &prev);
- if (code < 0)
+ if (code < 0) {
+ alloc_save_t *asave;
+ int code2;
+ /* dorestore() pops the restore operand off the stack,
+ despite dorestore() actually having the save state
+ passed to it as a C function parameter. So push a
+ sacrificial object.
+ */
+ push(1);
+ make_null(op);
+ /* We use dorestore() to discard the save state we
+ created above.
+ */
+ asave = alloc_find_save(idmemory, sid);
+ code2 = dorestore(i_ctx_p, asave);
+ if (code2 < 0) /* shouldn't happen! */
+ return_error(gs_error_Fatal);
return code;
+ }
vmsave->gsave = prev;
push(1);
make_tav(op, t_save, 0, saveid, sid);
@@ -156,7 +175,11 @@ dorestore(i_ctx_t *i_ctx_p, alloc_save_t *asave)
do {
vmsave = alloc_save_client_data(alloc_save_current(idmemory));
/* Restore the graphics state. */
- gs_grestoreall_for_restore(igs, vmsave->gsave);
+ /* The only time vmsave->gsave should be NULL is if we are
+ cleaning up after a VMerror during a save operation.
+ */
+ if (vmsave->gsave != NULL)
+ gs_grestoreall_for_restore(igs, vmsave->gsave);
/*
* If alloc_save_space decided to do a second save, the vmsave
* object was allocated one save level less deep than the
diff --git a/psi/zvmem2.c b/psi/zvmem2.c
index fe45c900..06cce53a 100644
--- a/psi/zvmem2.c
+++ b/psi/zvmem2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/psi/zwinutf8.c b/psi/zwinutf8.c
index 1db79818..bd58d49e 100644
--- a/psi/zwinutf8.c
+++ b/psi/zwinutf8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or