Table of contents

This document is a record of changes in Ghostscript releases numbered 9.xx. For earlier versions, see the the history documents:

History of Ghostscript versions 8.n
History of Ghostscript versions 7.n
History of Ghostscript versions 6.n
History of Ghostscript versions 5.n
History of Ghostscript versions 4.n
History of Ghostscript versions 3.n
History of Ghostscript versions 2.n
History of Ghostscript versions 1.n

For other information, see the Ghostscript overview.


Version 9.25 (2018-09-13)

Highlights in this release include:

  • This release fixes problems with argument handling, some unintended results of the security fixes to the SAFER file access restrictions (specifically accessing ICC profile files), and some additional security issues over the recent 9.24 release.

  • Security issues have been the primary focus of this release, including solving several (well publicised) real and potential exploits.

    PLEASE NOTE: We strongly urge users to upgrade to this latest release to avoid these issues.

  • As well as Ghostscript itself, jbig2dec has had a significant amount of work improving its robustness in the face of out specification files.

  • IMPORTANT: We are in the process of forking LittleCMS. LCMS2 is not thread safe, and cannot be made thread safe without breaking the ABI. Our fork will be thread safe, and include performance enhancements (these changes have all be been offered and rejected upstream). We will maintain compatibility between Ghostscript and LCMS2 for a time, but not in perpetuity. Our fork will be available as its own package separately from Ghostscript (and MuPDF).

  • The usual round of bug fixes, compatibility changes, and incremental improvements.

For a list of open issues, or to report problems, please visit bugs.ghostscript.com.

Incompatible changes

  • None

Changelog

2018-09-13 10:54:33 +0100
Chris Liddell <chris.liddell@artifex.com>
2f00215a28bcc43bb5857081378a6d956ef8b9d5

Dates, product string, etc for 9.25 release

base/gscdef.c
base/version.mak
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-09-11 10:59:24 +0100
Chris Liddell <chris.liddell@artifex.com>
4b3fbf2bca24b2833322985be390fc739d237f7d

Bug 699757: disable epo device for x11 devices

The epo device interferes with the operation of the x11 devices when those
are integrating with an existing X application (i.e. xv, or other application
that relies on the 'GHOSTVIEW' functionality).

Disable epo by adding an x11 specific fillpage method.

devices/gdevx.c


2018-09-11 11:12:13 +0100
Ken Sharp <ken.sharp@artifex.com>
5ac63e47077e0e7d02e99e247e0c47c4737e0cb8

PDF interpreter - work around GSView 5 and PAGELABEL pdfmarks

We added the ability to process PDF page labels as pdfmarks, instead of
using the .pagelabels operator (as used by pdfwrite) for the benefit of
DejaVu.

Unfortunately, GSView 5 redefines the pdfmark operator, and attempts
to process the information itself. This is a problem when it doesn't
recognise the pdfmark in question, which it does not with PAGELABEL.

There's no way for us to fix GSView 5, and we don't want to revert the
enhancement for DejaVu because that is still being actively maintained.

This commit is a rather ugly hack which relies upon the presence of a
specific named dictionary in userdict when GSView is executing. If that
dictionary is present then we don't create PAGELABEL pdfmarks, thus
avoiding confusing GSView 5.

Resource/Init/pdf_main.ps


2018-09-10 17:05:47 +0100
Chris Liddell <chris.liddell@artifex.com>
b3974730243cb449299524768fc810ad7bac4f73

Bug 699753: Windows uninstall: remove all installed files etc

This was partly caused by a subtlety of the nsis installer syntax which means
the '/r' option for the 'File' operation will match and install all
files/directories in the file heirarchy that match the search term, unless they
are explicitly excluded.

For example:
File /r doc

will end up matching:
doc/
something/doc
another/thing/doc

So, ensure we exclude subtrees so we no longer accidentally include files we
don't intend.

Also, add the missing removals, so we do remove eveything we intended to
install.

Lastly add in (and include removal of!) the Resource/* tree, and the iccprofiles
directories - both of which users have asked to be included.

psi/nsisinst.nsi


2018-09-10 07:42:13 -0700
Ray Johnston <ray.johnston@artifex.com>
7738ffa5136549dd0cdcdf89974e339187246998

Correct getdeviceprops documentation

doc/Language.htm


2018-09-10 09:54:14 +0100
Chris Liddell <chris.liddell@artifex.com>
7146378240f90bf4171ae7a2a00cc9d46eaec86d

Add a note about unSAFERness of ps2epsi

doc/History9.htm
doc/News.htm


2018-09-10 09:25:22 +0100
Chris Liddell <chris.liddell@artifex.com>
7657f3698ce5a440b069ff953e57841950919132

Dates etc for 9.25 release candidate 1

base/gscdef.c
base/version.mak
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-09-10 08:41:34 +0100
Ken Sharp <ken.sharp@artifex.com>
7b0c4cc3e79d1e689b5fc3251a1130f409ed7a82

Bug 699748 "gs9.24/windows can't process environment variable GS_OPTIONS anymore"

This problem only exhibits in a 64-bit build.

The problem is caused by the union of 's' and 'file' in the arg_source
structure. When in a 32-bit build, this happens to work out to be 0
when the source is a string and not a file. But in a 64-bit it does not.

Now because we have a 'is_file' member in the structure this isn't a
problem, except that in get_codepoint() we pass both the u.file and
u.str members to the decoding function. In get_codepoint_utf8 we then
check to see if 'file' is 0, and if it is not, we attempt to read from
it. If 'file' is 0, then we treat this as a string instead.

To avoid altering the decoding function, with potential knock-on effects
through the code, I've chosen to test the 'is_file' member and pass
NULL for the file if this is not a file.

base/gsargs.c


2018-09-08 09:47:19 +0100
Ken Sharp <ken.sharp@artifex.com>
95281026d983bff8f72e431c7f620a0e8d07c2af

Bug 699744 "ps2epsi fails with Error: /undefined in --setpagedevice--"

Recent changes required to harden SAFER mode mean that it is no longer
possible to run this script in SAFER mode, because it relies upon
unsafe Ghostscript non-standard extension operators.

Removing SAFER and DELAYSAFER, and the code to reset SAFER, allow the
program to run as well as it ever did (ie badly). This program should
now be considered unsafe, you should not use it on untrusted PostScript
programs.

I think its likely we will deprecate and remove this program in future.

lib/ps2epsi
lib/ps2epsi.bat
lib/ps2epsi.cmd
lib/ps2epsi.ps


2018-09-07 10:33:41 -0700
Michael Vrhel <michael.vrhel@artifex.com>
232c2bf9db56ab32fbe5026e1b3eabdbb88380a8

gprf device: Memory leak

The deflate_block was not being freed after the writing of the page.

devices/gdevgprf.c


2018-09-07 10:17:44 -0700
Michael Vrhel <michael.vrhel@artifex.com>
d4c2e30bc057bc99e8d0fac04f6ecaae4721f435

Get formats set properly in gscms_transform_color

The color space was not getting set in the input
and output formats when we had a change in the lcms
formatters.

base/gsicc_lcms2mt.c


2018-09-07 08:54:58 +0100
Chris Liddell <chris.liddell@artifex.com>
fa78d81c37afc28950020df4accf58d7bb1d01e7

Initialize a variable.

Prevents static analysis tools from complaining about it being used
uninitialized (it's being to in order to initialize it).

psi/interp.c


2018-09-07 08:16:06 +0100
Chris Liddell <chris.liddell@artifex.com>
790f13e61ddbe232327b34665606f52b4d943676

Tidy up adding the temp dirs to the PermitFile* arrays

Resource/Init/gs_init.ps


2018-09-07 08:07:12 +0100
Chris Liddell <chris.liddell@artifex.com>
643b24dbd002fb9c131313253c307cf3951b3d47

Bug 699718(2): Improve/augment stack size checking

Improve the rebustness of the previous solution (previously it could trigger an
error when there *was* stack capacity available).

Remove redundant check: we don't need to check if the *current* stack size is
sufficient, before checking the maximum permitted stack size.

Also check the exec stack, as execstackoverflow can also cause the
Postscript call out to fail.

Lastly, in event of failure, put the LockSafetyParams flag back in the existing
device (this is only necessary because we don't enfore JOBSERVER mode).

Note: the Postscript callout (%grestorepagedevice) never pushes any dictionaries
on the dict stack - if that changes, we should check that stack, too.

psi/zdevice2.c


2018-09-07 08:05:52 +0100
Chris Liddell <chris.liddell@artifex.com>
7dd56d01397a40da636ad88a5d19af4e2e404e6a

Put .setdebug back into the proc removal list for SAFER

accidentally removed in a previous commit

Resource/Init/gs_init.ps


2018-09-07 15:22:29 +0100
Ken Sharp <ken.sharp@artifex.com>
65a9046ded8e9edd5d33bc812a9e94ae29607a1e

Bug #699707 "Security review bug - continuation procedures"

As a result of the recent security review, this bug was raised to go
through the PostScript interpreter looking for places where we exit the
'C' level and return control to PostScript. This is done when we need
to evaluate something in the PostScript environment, such as a transfer
function or a tint transform.

Because these functions are written in PostScript we need to run them
in the PostScript environment.

To do this we push the procedure (or at least 'a' procedure) onto the
exec stack and exit with an o_push_estack error. In many cases that's
all we need to do, but sometimes we want to return control back to the
'C' environment and, in some of those cases, we want to store some state
for the C code. We can't use the operand stack (because the PostScript
function will alter that) so we store stuff on the exec stack instead.

When we complete the C level, we should restore the exec stack, so if
we stored any state on it, we should remove it. Sometimes we were not
doing so if there was an error.

Generally this did not cause a problem, because in general on an error
we would stop. However if the error handler had been altered it was
possible we might carry on. 'Sometimes' that would mean we tried to
execute something which wasn't executable, and sometimes it might mean
that we tried to return to the C level, but without the expected
state on the exec stack.

This could lead to memory corruption and crashes.

This commit tries to find everywhere where we might end up leaving
extra items on the exec stack in the case of an error, and either
removes the required number of items from the exec stack or uses
whatever cleanup routine was established for the C code.

Its important to note that, in normal use, none of these could actually
cause a problem. This makes it hard to test. all the cases here I have
tested, though in many cases the only way I could produce an error was
by forcing an error return in the debugger. I suspect some error cases
simply aren't possible but its good practice to check the return codes
anyway, even if its only a theoretical problem.

psi/zalg.c
psi/zcie.c
psi/zcolor1.c
psi/zcontrol.c
psi/zfile.c
psi/zht1.c
psi/zht2.c
psi/zpath1.c
psi/zpcolor.c


2018-09-06 14:18:22 -0700
Michael Vrhel <michael.vrhel@artifex.com>
0da9680ca0506fd3cdf70840ad5387d85cab4996

gscms_transform_color fails in cloning operation

The cloning operation was getting called with a NULL
pointer for the current ICC link handle.

base/gsicc_lcms2mt.c


2018-09-06 11:39:58 -0700
Ray Johnston <ray.johnston@artifex.com>
f6ebd382763546e31a024376ff49ff2f074627de

Remove obsolete code and comment (from 1999)

After this long, there is no reason to carry this code around that was
a hack for joins of a flattened curve.

base/gxstroke.c


2018-09-06 12:07:35 -0700
Michael Vrhel <michael.vrhel@artifex.com>
f509c2c1350fbb3549dcd539448bf02742c1b49e

gproof device supports post rendering ICC profile

This issue was introduced during some error clean up
of the ICC profile code.

devices/gdevgprf.c


2018-09-06 18:40:05 +0100
Chris Liddell <chris.liddell@artifex.com>
13418541a5ae19b15f51cbb87faf344902f5af98

Bug 699722 (2): add wildcards to the permissions paths.

The temp and ICC profile paths need to finish with wildcards to work correctly.

Resource/Init/gs_init.ps


2018-09-05 17:14:59 +0100
Chris Liddell <chris.liddell@artifex.com>
3e5d316b72e3965b7968bb1d96baa137cd063ac6

Bug 699718: Ensure stack space is available before gsrestore call out

During a grestore, if the device is going to change, we call out to Postscript
to restore the device configuration, before returning to restore the graphics
state internally.

We have to ensure sufficient op stack space is available to complete the
operation, otherwise the device can end up an undefined state.

Resource/Init/gs_setpd.ps
psi/zdevice2.c


2018-09-06 14:08:41 +0100
Chris Liddell <chris.liddell@artifex.com>
c8c01f8c4164bc10281d9e8f87cf96314d93104b

Bug 699722: Add the ICCProfilesDir to the PermitReading list

There was also an issue that the string being returned from the graphics
library was null terminated, and Postscript strings are not (and Ghostscript
strings are not necessarily). We leave the null termination in place, but
reduce the length returned by 1.

Resource/Init/gs_init.ps
base/gsicc_manage.c


2018-09-06 09:16:22 +0100
Chris Liddell <chris.liddell@artifex.com>
fb713b3818b52d8a6cf62c951eba2e1795ff9624

Bug 699708 (part 1): 'Hide' non-replaceable error handlers for SAFER

We already had a 'private' dictionary for non-standard errors: gserrordict.

This now includes all the default error handlers, the dictionary is made
noaccess and all the prodedures are bound and executeonly.

When running with -dSAFER, in the event of a Postscript error, instead of
pulling the handler from errordict, we'll pull it from gserrordict - thus
malicious input cannot trigger problems by the use of custom error handlers.

errordict remains open and writeable, so files such as the Quality Logic tests
that install their own handlers will still 'work', with the exception that the
custom error handlers will not be called.

This is a 'first pass', 'sledgehammer' approach: a nice addition would to allow
an integrator to specify a list of errors that are not to be replaced (for
example, embedded applications would probably want to ensure that VMerror is
always handled as they intend).

Resource/Init/gs_init.ps
psi/interp.c


2018-09-05 17:00:41 +0100
Chris Liddell <chris.liddell@artifex.com>
0d8c7d563745bfd89051a203267fcbf2492ecfcc

Bug 699720: Change available buffer space to int from uint

sbufavailable() returns the number of bytes still available in the stream
buffer. This can end up as negative at EOF (after we've read the final byte in
the buffer, we read ptr is moved to the next byte, past the end of the buffer -
that should never be read, however).

We can safely use a signed integer since this is buffer space, *not* the total
bytes available from the stream

psi/interp.c


2018-09-05 12:54:46 +0100
Chris Liddell <chris.liddell@artifex.com>
37c1547e61e758cdd17c3dcb0504e2f5988004c3

Delete legacy code source file, and references to it

base/gp_sysv.c
base/unix-aux.mak
doc/Develop.htm
doc/Source.htm
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-09-04 14:35:18 +0100
Robin Watts <robin.watts@artifex.com>
164b6cb355900d0faea7468b4eafb3154aa90f6a

Fix some comment typos.

Resource/Init/gs_init.ps


2018-09-06 07:33:16 -0700
Michael Vrhel <michael.vrhel@artifex.com>
3a5815b014c316e28584f134dc3c06e43c848b38

Add overprint support to knock out rect-fill

When doing the rect fill for transparency knockout groups
we were not handling overprint properly

base/gdevp14.c


2018-09-04 11:18:48 -0700
Michael Vrhel <michael.vrhel@artifex.com>
5317e232d5a0309fc367d8bedb89988dd4bc38c9

Fix bit rot in RAW_DUMP and TRACK_COMPOSE_GROUPS

maskbuf is not defined in this particular path (as it is NULL)

base/gxblend.c


2018-07-09 16:38:15 +0100
Robin Watts <robin.watts@artifex.com>
1435e31660ba94909688dabf74b411ead3196384

Fix bug in mkromfs binary compaction.

When writing long strings, psc->inpos changes value between
writing it's low and high bytes.

base/mkromfs.c


2018-07-05 17:16:00 +0100
Robin Watts <robin.watts@artifex.com>
5ec955366733d15a4f720271186abcf922ea2535

Remove GS_NO_UTF8

base/gp_mswin.c
base/gp_ntfs.c
base/gp_wgetv.c
base/gp_wutf8.c
base/gsargs.c
base/msvclib.mak
base/windows_.h
devices/gdevwpr2.c
pcl/pl/plmain.c
pcl/pl/plwmainc.c
psi/dwmain.c
psi/dwmainc.c
psi/dwtext.c
psi/dwtext.h
psi/iapi.c
psi/imainarg.c
psi/iminst.h
psi/msvc.mak


2018-07-09 11:15:00 +0100
Robin Watts <robin.watts@artifex.com>
bc1d2d9742c960f1d4905f43810be072c5d92390

Bug 691725: Tweak gssetgs*.bat files.

The existing scripts assume that the gs binaries are on the path.
The tweaked scripts check to see if there is a binary in the same
directory as the .bat file, and if there is, use that in preference
to any version on the path.

Otherwise functionality is identical.

lib/gssetgs.bat
lib/gssetgs32.bat
lib/gssetgs64.bat


2018-09-06 12:56:51 +0100
Robin Watts <robin.watts@artifex.com>
68eca5e94e6f63f4392b15581ad41af52e0edfd9

Fix SEGV seen in all-devices test with plank examples/ridt91.eps

Silly typo in the contone fill code for the landscape flippedy
color cache case.

base/gximono.c


2018-09-05 23:58:39 +0100
Robin Watts <robin.watts@artifex.com>
6473ad1394900c79a7ca5335accaaad9cd67d42a

Add prototype missed from previous commit.

psi/interp.h


2018-09-05 18:07:40 +0100
Robin Watts <robin.watts@artifex.com>
2b533271d8bd915593a2f8e1a1f446ee940c7d76

Fix arg_copy leaks.

When handling -d or -s args, the code currently arg_copies the string
it gets back, then uses that copied block to make postscript names
from.

Here we change the code so that postscript names are made in a
slightly different way, so they copy the string content. This means
we can free the arg_copied block afterwards, solving the leaks.

While we are here, remove a layer of nasty variable hiding macros
that do nothing but confuse things.

psi/iddict.h
psi/idict.c
psi/idict.h
psi/iinit.c
psi/imain.c
psi/imainarg.c
psi/interp.h


2018-09-05 15:59:43 +0100
Robin Watts <robin.watts@artifex.com>
a8c7899267121cb92503fe0f7e7f6ae433c386b1

Bug 699711: Review arg_next to ensure that NULL arg returns are coped with.

We can only return NULL from arg_next if the return code == 0. We
therefore have to ensure that all call sites check for either of
those conditions.

base/gsargs.c
pcl/pl/plmain.c
psi/imainarg.c


2018-09-05 13:46:50 +0100
Robin Watts <robin.watts@artifex.com>
df4ec49e0f2237fe5b17d5d620f8c3cad95b3b5e

Second attempt at fix for bug 699699.

The previous attempt failed because it gave the wrong return value
when we hit an empty argument.

Now we ignore empty arguments.

base/gsargs.c
psi/imainarg.c


2018-09-05 13:19:51 +0100
Robin Watts <robin.watts@artifex.com>
ecfbc3126834e442edb309112e8995df9f10daa4

Revert previous fix for Bug 699699.

Revert "Bug 699699 "Crash upon bogus input argument.""
(commit b509290189f1f37a76339f7b6921d42f126bfd57).

This reopens bug 699699, so we can fix it in a way that doesn't
return 1 for 'empty' arguments.
This reopens bug 699699.

base/gsargs.c
psi/imainarg.c


2018-09-05 16:42:44 +0100
Robin Watts <robin.watts@artifex.com>
01514a0c6add9cbafe3c3ba55f57968154d2b323

Bug 699719: Fix @ files in arg handling.

When we met an @file in the arg handling, we were failing to swallow
it and returning "@file" to the caller.

base/gsargs.c


2018-09-05 16:43:20 +0100
Chris Liddell <chris.liddell@artifex.com>
6c887103a58563dd4e95acab49f9ee60f2aa13a7

Update signed ghostpdf.cat to new certificate

also add a *.cat rule to .gitattributes to ensure .cat files are always treated
as binary

.gitattributes
lib/ghostpdf.cat


2018-09-05 08:44:41 +0100
Chris Liddell <chris.liddell@artifex.com>
e914f1da46e33decc534486598dc3eadf69e6efb

Fix incomplete comment from previous commit

Resource/Init/gs_setpd.ps


2018-09-04 23:18:46 +0100
Chris Liddell <chris.liddell@artifex.com>
5812b1b78fc4d36fdc293b7859de69241140d590

Bug 699714: retain .LockSafetyParams through failed .installpagedevice

In the event that the .trysetparams fails during .installpagedevice, catch the
error, and ensure that at least the .LockSafetyParams is set.

Resource/Init/gs_setpd.ps


2018-09-04 17:01:08 +0100
Chris Liddell <chris.liddell@artifex.com>
bc3df0773fccf4b4906a3e59652ad646ea0fee91

For ICC profile validation, have cups id iteself as DeviceN

Give the range of color spaces and models that cups supports, we can't
reasonably provide (or expect others to provide) output ICC profiles for all
cases.

For the purpose of profile validation, have it claim to be DeviceN and benefit
from the extra tolerance in profiles allowed for that class of device.

cups/gdevcups.c
devices/devs.mak


2018-08-28 16:55:49 +0100
Chris Liddell <chris.liddell@artifex.com>
90a692cfbfc2d6ec3c227149cd8d52fc22dc9e4e

Bring master up to date with 9.24 release branch

Doc changes, etc

base/version.mak
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-09-03 16:57:51 +0100
Chris Liddell <chris.liddell@artifex.com>
cc6fafb69b7957c9a7eac9a0087793d48be0443c

Silence a coverity warning.

base/gdevdflt.c


2018-09-03 15:32:40 +0100
Chris Liddell <chris.liddell@artifex.com>
29b6890cc618a88e0d9eb8e996d3e0153b5fbda9

Update files for jbig2dec release 0.15

jbig2dec/CHANGES
jbig2dec/config_win32.h
jbig2dec/configure.ac
jbig2dec/jbig2dec.1


2018-09-03 15:34:44 +0100
Ken Sharp <ken.sharp@artifex.com>
fd6cac72bbc050e1a2832fd59f9fb1792b493750

PostScript interpreter - More places where exec stack is not restored

For the setcolorspace continuation procedure, and the related procs
for specific colour spaces, we need to remove the extra operands we
placed on the exec stack, so that there's no possibility of returning
and executing them.

psi/zcolor.c


2018-09-03 14:17:05 +0100
Ken Sharp <ken.sharp@artifex.com>
b509290189f1f37a76339f7b6921d42f126bfd57

Bug 699699 "Crash upon bogus input argument."

The code in arg_next starts by setting *argstr to NULL, the following
do..while loop assumes that *argstr will be filled in, and checks its
first byte. However, if we run out of characters in the argument string
then *argstr remains NULL, and causes a crash.

This can happen if we pass an empty quoted argument ""

In addition, the processing of -o and possibly other switches assumes
that arg_next will return an error if it doesn't find an argument
whereas now it can return a NULL. I believe its possible that it always
could do so.

So check the 'arg' returned from arg_next to make sure its not NULL
before we try to use it.

We should check other places where arg_next is called as well.

base/gsargs.c
psi/imainarg.c


2018-09-01 17:50:05 +0100
Chris Liddell <chris.liddell@artifex.com>
0704d18b10314d701a522ad6c16718e0b8e199b7

Bug 699658(related): Move recording of temp file names into C

When we successfully create a temporary file from Postscript, either doing so
when SAFER is not in force, or when SAFER is in force, and creating it in
a write permitted directory, we record the file name so we can later delete
the file, even is SAFER has been engaged, or if the PermitWriting list has
changed to no longer the directory in question.

Previously the recording of the name was done in Postscript, even though the
checking was done in C.

This moves the recording of the names to C, meaning we can remove the Postscript
redefinitions of .tempfile and deletfile, and make the dictionary in question
noaccess.

Also, tidy up the adding of the temporary file directory to the list of
permitted directories, and include the list in all of the categories
(PermitFileWriting, PermitFileReading and PermitFileControl) - it was only
previously adding to writing.

Resource/Init/gs_init.ps
psi/int.mak
psi/zfile.c


2018-08-31 15:57:55 +0100
Chris Liddell <chris.liddell@artifex.com>
29f4603fc0c6de7d5df1f293f0a7efbffe8112bd

Bug 699693: Fix FAPI handling of multibyte Unicode code point

The original code worked for one byte code points, and for the case there the
original character code and Unicode value both had the same number of bytes,
but was totally wrong if the the two were different.

psi/zfapi.c


2018-09-01 11:28:06 +0100
Ken Sharp <ken.sharp@artifex.com>
7ba6d80c69f0c74601ffc1077d27e0d1a299e57f

Bug #699687 "grestore can bypass SAFER"

The code in z2grestore (part of the level 2 restore machinery) in
ghostpdl/psi/zdevice2.c sets the device's LockSafetyParams to false, and
according to the comments there relies on putdeviceparams setting
the flag back when the old device is re-instated.

However, if we have corrupted any part of the device's content, then
its possible to exit putdeviceparams, in one place only, without
setting LockSafetyParams. Here we simply add an explicit reset of the
value even in the case of an error setting the new device.

base/gsdparam.c


2018-09-01 09:28:08 +0100
Ken Sharp <ken.sharp@artifex.com>
61ad589fb861d28e2d2c9d0b609ec4da4d7dd247

Bug 699677 ".bindnow still causing side effects"

In fact, its nothing to do with .bindnow. That simply modifies the exec
stack in a way which makes the problem exhibit.

setcustomcolor should really check its operands. because it doens't, it
creates a tint transform function which tries to mulitply a number by
(in this case) a name. This throws an error of course.

The problem is that the code to sample the tint transform function
didn't deal properly with the case where the PostScript function throws
an error. In that case it properly exits the code which executes the
function, but it fails to unwind the exec stack.

This leads to use trying to complete the function, using the enumerator,
which has been stored on the exec stack. Because we didn't clean up the
exec stack, what we retrieve isn't an enumerator. This causes us to try
to access invalid memory and can result in a crash.

So, several steps. Firstly have the sampling code properly handle the
error and restore the exec stack. Secondly, have the setcolorspace code
be prepared to accept a NULL returned from the sampling code and treat
that as an error (and also fix a similar exec stack problem in the
setcolorspace code). Finally; have setcustomcolor validate its operands.

Resource/Init/gs_lev2.ps
psi/zcolor.c
psi/zfsample.c


2018-08-29 09:30:19 -0700
Ray Johnston <ray.johnston@artifex.com>
c98cb5237c983e363fe05757b2639eab550499e8

Fix for security issues found during internal security audit

While most of the invocations of .forceput and related operators were
"protected" by being within "executeonly" procedures, several had crept
in that did not make sure that the operator was hidden in a procedure
that could not be read.

Resource/Init/gs_dps.ps
Resource/Init/gs_fntem.ps
Resource/Init/gs_init.ps
Resource/Init/gs_lev2.ps
Resource/Init/gs_pdfwr.ps
Resource/Init/gs_setpd.ps
Resource/Init/gs_typ32.ps


2018-08-31 08:12:48 +0100
Chris Liddell <chris.liddell@artifex.com>
d60214879cd71cf9f995c7d8862394293ffa9014

Remove embedded, copyrighted ICC profile from PNG images

doc/images/Artifex_logo.png
doc/images/favicon.png
doc/images/ghostscript_logo.png
doc/images/hamburger-light.png
doc/images/x-light.png


2018-08-31 09:58:00 +0100
Ken Sharp <ken.sharp@artifex.com>
478b73874179262d880c1417b5a11fb534a18651

PDF interpreter - remove a warning message

Commit f6bcc0dfc173b80fddab4fbf10afb34332ff1112 added extra checking
and processing to deal with the (illegal) case of a Text block which
includes a 'q' operator.

As part of that commit, we added a warning message so that users would
be able to tell there was a problem. Unfortunately, there are cases
which are perfectly legal (eg running a Pattern PaintProc to fill the
text) where a q can apparently occur inside a text object.

We can't differentiate between executing a 'q' in such cases, so the
only option is to remove the warning. This does not affect the actual
operation of the code, it still copes with a 'q' inside text objects,
whether legally or not.

Resource/Init/pdf_ops.ps


2018-08-30 13:33:36 +0100
Ken Sharp <ken.sharp@artifex.com>
f8834d04215857e6150876bf189b682dbf254f8a

ps2write - modify Lab space handling

Commit 9e58cc8dd7e9b98620c798c901f800aff2e381ce improved the handling of
/Separation spaces with an Lab alternate space.

However, it also altered the handling of Lab spaces as the base space
for patterns, or the initial space. This caused a small difference in
release testing.

The result was incorrect previously, and after the above commit, but the
commit made it appear worse from a user's perspective. Until we can
get time to properly convert Lab base spaces into a device space, return
the code to its prior state. This does not affect the improvement to
Separation spaces.

devices/vector/gdevpdfc.c


2018-08-30 09:34:07 +0100
Ken Sharp <ken.sharp@artifex.com>
6dfd431fb4a97665044dcea7a061e8fa6ec36098

Bug #699684 "gs segfaults in refset_null_new when processing malformed file"

It is possible for a specifically malformed Binary Object Sequence to
run out of data to process (and return to refill the buffer) when it
had read *exactly* the maximum number of objects declared in the top
array.

This meant that the 'index' pointing to the next expected array entry
to be filled in actually pointed past the end of the array.

We then called a routine to set the unused entries in the array to null
objects (for GC purposes), using the index. Because it pointed past the
end of the array this led to the count of objects being -1. The code
then counted down the count, until it reached 0, while at the same time
writing null objects past the end of the array.

This commit simply checks the index against the array size and doesn't
attempt to fill it in if its less than that value. Note that the array
index is 0-based, hence < not <=.

psi/iscanbin.c


2018-08-29 07:59:17 +0100
Chris Liddell <chris.liddell@artifex.com>
d469deaf34e25f701a531ffd36cfc7f738efc4a2

Fix a typo in commit 21ae2f8d9953

psi/zfapi.c


2018-08-28 16:39:43 +0100
Chris Liddell <chris.liddell@artifex.com>
a25e6980ca87eaf0ef3d7e71acbed1ff2db7ab28

Bump version on master to 9.25

Resource/Init/gs_init.ps
base/version.mak


2018-08-26 15:16:46 +0800
Sebastian Rasmussen <sebras@gmail.com>
032603f3c5448fc32609c51c932d11529eb6b581

Bug 699673: jbig2dec: Initialize return code for all cases.

Thanks to oss-fuzz for reporting.

jbig2dec/jbig2_arith.c


2018-08-26 15:16:02 +0800
Sebastian Rasmussen <sebras@gmail.com>
343366cf2d6c3170d8b582d5df076f803c699262

jbig2dec: Avoid dereferencing pointer before it is tested.

Thanks to coverity.

jbig2dec/jbig2.c


2018-09-03 09:44:54 +0100
Chris Liddell <chris.liddell@artifex.com>
32f1afe5c1e0b862e3bde05dc7b860a5f65cfbea

Update dates, product string etc for release

Fix release date

base/gscdef.c
base/version.mak
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-09-03 08:34:25 +0100
Chris Liddell <chris.liddell@artifex.com>
ae222d8aa93783ba542b8ba91d62a1e107650563

Update changelog... again

doc/History9.htm


2018-09-01 17:50:05 +0100
Chris Liddell <chris.liddell@artifex.com>
07da47959687c1e6a112ad746929ef66e82b5aa9

Bug 699658(related): Move recording of temp file names into C

When we successfully create a temporary file from Postscript, either doing so
when SAFER is not in force, or when SAFER is in force, and creating it in
a write permitted directory, we record the file name so we can later delete
the file, even is SAFER has been engaged, or if the PermitWriting list has
changed to no longer the directory in question.

Previously the recording of the name was done in Postscript, even though the
checking was done in C.

This moves the recording of the names to C, meaning we can remove the Postscript
redefinitions of .tempfile and deletfile, and make the dictionary in question
noaccess.

Also, tidy up the adding of the temporary file directory to the list of
permitted directories, and include the list in all of the categories
(PermitFileWriting, PermitFileReading and PermitFileControl) - it was only
previously adding to writing.

Resource/Init/gs_init.ps
psi/int.mak
psi/zfile.c


2018-08-31 15:57:55 +0100
Chris Liddell <chris.liddell@artifex.com>
d8cfd2e7e1000f644afcaca2f196cb6d494049b8

Bug 699693: Fix FAPI handling of multibyte Unicode code point

The original code worked for one byte code points, and for the case there the
original character code and Unicode value both had the same number of bytes,
but was totally wrong if the the two were different.

psi/zfapi.c


2018-09-01 11:28:06 +0100
Ken Sharp <ken.sharp@artifex.com>
a5993c537ae035b2396da5189fd985006627a478

Bug #699687 "grestore can bypass SAFER"

The code in z2grestore (part of the level 2 restore machinery) in
ghostpdl/psi/zdevice2.c sets the device's LockSafetyParams to false, and
according to the comments there relies on putdeviceparams setting
the flag back when the old device is re-instated.

However, if we have corrupted any part of the device's content, then
its possible to exit putdeviceparams, in one place only, without
setting LockSafetyParams. Here we simply add an explicit reset of the
value even in the case of an error setting the new device.

base/gsdparam.c


2018-09-01 09:28:08 +0100
Ken Sharp <ken.sharp@artifex.com>
21b27dc55b493564006c91326a5ddc636cf88563

Bug 699677 ".bindnow still causing side effects"

In fact, its nothing to do with .bindnow. That simply modifies the exec
stack in a way which makes the problem exhibit.

setcustomcolor should really check its operands. because it doens't, it
creates a tint transform function which tries to mulitply a number by
(in this case) a name. This throws an error of course.

The problem is that the code to sample the tint transform function
didn't deal properly with the case where the PostScript function throws
an error. In that case it properly exits the code which executes the
function, but it fails to unwind the exec stack.

This leads to use trying to complete the function, using the enumerator,
which has been stored on the exec stack. Because we didn't clean up the
exec stack, what we retrieve isn't an enumerator. This causes us to try
to access invalid memory and can result in a crash.

So, several steps. Firstly have the sampling code properly handle the
error and restore the exec stack. Secondly, have the setcolorspace code
be prepared to accept a NULL returned from the sampling code and treat
that as an error (and also fix a similar exec stack problem in the
setcolorspace code). Finally; have setcustomcolor validate its operands.

Resource/Init/gs_lev2.ps
psi/zcolor.c
psi/zfsample.c


2018-08-29 09:30:19 -0700
Ray Johnston <ray.johnston@artifex.com>
91d6bc4d3e3865388ede3bcd4e84bbb8787b78e4

Fix for security issues found during internal security audit

While most of the invocations of .forceput and related operators were
"protected" by being within "executeonly" procedures, several had crept
in that did not make sure that the operator was hidden in a procedure
that could not be read.

Resource/Init/gs_dps.ps
Resource/Init/gs_fntem.ps
Resource/Init/gs_init.ps
Resource/Init/gs_lev2.ps
Resource/Init/gs_pdfwr.ps
Resource/Init/gs_setpd.ps
Resource/Init/gs_typ32.ps


2018-08-31 08:12:48 +0100
Chris Liddell <chris.liddell@artifex.com>
cd83407209c3901ddfabd09e144c90ea105005d7

Remove embedded, copyrighted ICC profile from PNG images

doc/images/Artifex_logo.png
doc/images/favicon.png
doc/images/ghostscript_logo.png
doc/images/hamburger-light.png
doc/images/x-light.png


2018-08-30 15:07:33 +0100
Chris Liddell <chris.liddell@artifex.com>
f667df996290e64fc091d81b7513abdac488e156

Update dates etc for release candidate 2

base/gscdef.c
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-08-30 13:33:36 +0100
Ken Sharp <ken.sharp@artifex.com>
214d6725e4a2b539294ebfba528a8d0961379fd0

ps2write - modify Lab space handling

Commit 9e58cc8dd7e9b98620c798c901f800aff2e381ce improved the handling of
/Separation spaces with an Lab alternate space.

However, it also altered the handling of Lab spaces as the base space
for patterns, or the initial space. This caused a small difference in
release testing.

The result was incorrect previously, and after the above commit, but the
commit made it appear worse from a user's perspective. Until we can
get time to properly convert Lab base spaces into a device space, return
the code to its prior state. This does not affect the improvement to
Separation spaces.

devices/vector/gdevpdfc.c


2018-08-30 09:34:07 +0100
Ken Sharp <ken.sharp@artifex.com>
e40f79df969e4168daf65b3b3af3ea73b6a71fc4

Bug #699684 "gs segfaults in refset_null_new when processing malformed file"

It is possible for a specifically malformed Binary Object Sequence to
run out of data to process (and return to refill the buffer) when it
had read *exactly* the maximum number of objects declared in the top
array.

This meant that the 'index' pointing to the next expected array entry
to be filled in actually pointed past the end of the array.

We then called a routine to set the unused entries in the array to null
objects (for GC purposes), using the index. Because it pointed past the
end of the array this led to the count of objects being -1. The code
then counted down the count, until it reached 0, while at the same time
writing null objects past the end of the array.

This commit simply checks the index against the array size and doesn't
attempt to fill it in if its less than that value. Note that the array
index is 0-based, hence < not <=.

psi/iscanbin.c


2018-08-29 11:43:49 +0100
Chris Liddell <chris.liddell@artifex.com>
06e4829c6756f0aa6918ba19710050295bd29bfe

Update changelog post 9.24rc1

doc/History9.htm


2018-08-29 07:59:17 +0100
Chris Liddell <chris.liddell@artifex.com>
110b1843b16d92878fd56d874b95bac5e130c720

Fix a typo in commit 21ae2f8d9953

psi/zfapi.c


2018-08-26 15:16:46 +0800
Sebastian Rasmussen <sebras@gmail.com>
74cc0437c7d4aa8bef051300b0ba3b510b9922c4

Bug 699673: jbig2dec: Initialize return code for all cases.

Thanks to oss-fuzz for reporting.

jbig2dec/jbig2_arith.c


2018-08-26 15:16:02 +0800
Sebastian Rasmussen <sebras@gmail.com>
46c4a646d5c7954f076478aa8e85a4fc3b2b1f66

jbig2dec: Avoid dereferencing pointer before it is tested.

Thanks to coverity.

jbig2dec/jbig2.c


Version 9.24 (2018-09-03)

Highlights in this release include:

  • Security issues have been the primary focus of this release, including solving several (well publicised) real and potential exploits.

    PLEASE NOTE: We strongly urge users to upgrade to this latest release to avoid these issues.

  • As well as Ghostscript itself, jbig2dec has had a significant amount of work improving its robustness in the face of out specification files.

  • IMPORTANT: We are in the process of forking LittleCMS. LCMS2 is not thread safe, and cannot be made thread safe without breaking the ABI. Our fork will be thread safe, and include performance enhancements (these changes have all be been offered and rejected upstream). We will maintain compatibility between Ghostscript and LCMS2 for a time, but not in perpetuity. Our fork will be available as its own package separately from Ghostscript (and MuPDF).

  • The usual round of bug fixes, compatibility changes, and incremental improvements.

For a list of open issues, or to report problems, please visit bugs.ghostscript.com.

Incompatible changes

  • None

Changelog

2018-09-01 17:50:05 +0100
Chris Liddell <chris.liddell@artifex.com>
07da47959687c1e6a112ad746929ef66e82b5aa9

Bug 699658(related): Move recording of temp file names into C

When we successfully create a temporary file from Postscript, either doing so
when SAFER is not in force, or when SAFER is in force, and creating it in
a write permitted directory, we record the file name so we can later delete
the file, even is SAFER has been engaged, or if the PermitWriting list has
changed to no longer the directory in question.

Previously the recording of the name was done in Postscript, even though the
checking was done in C.

This moves the recording of the names to C, meaning we can remove the Postscript
redefinitions of .tempfile and deletfile, and make the dictionary in question
noaccess.

Also, tidy up the adding of the temporary file directory to the list of
permitted directories, and include the list in all of the categories
(PermitFileWriting, PermitFileReading and PermitFileControl) - it was only
previously adding to writing.

Resource/Init/gs_init.ps
psi/int.mak
psi/zfile.c


2018-08-31 15:57:55 +0100
Chris Liddell <chris.liddell@artifex.com>
d8cfd2e7e1000f644afcaca2f196cb6d494049b8

Bug 699693: Fix FAPI handling of multibyte Unicode code point

The original code worked for one byte code points, and for the case there the
original character code and Unicode value both had the same number of bytes,
but was totally wrong if the the two were different.

psi/zfapi.c


2018-09-01 11:28:06 +0100
Ken Sharp <ken.sharp@artifex.com>
a5993c537ae035b2396da5189fd985006627a478

Bug #699687 "grestore can bypass SAFER"

The code in z2grestore (part of the level 2 restore machinery) in
ghostpdl/psi/zdevice2.c sets the device's LockSafetyParams to false, and
according to the comments there relies on putdeviceparams setting
the flag back when the old device is re-instated.

However, if we have corrupted any part of the device's content, then
its possible to exit putdeviceparams, in one place only, without
setting LockSafetyParams. Here we simply add an explicit reset of the
value even in the case of an error setting the new device.

base/gsdparam.c


2018-09-01 09:28:08 +0100
Ken Sharp <ken.sharp@artifex.com>
21b27dc55b493564006c91326a5ddc636cf88563

Bug 699677 ".bindnow still causing side effects"

In fact, its nothing to do with .bindnow. That simply modifies the exec
stack in a way which makes the problem exhibit.

setcustomcolor should really check its operands. because it doens't, it
creates a tint transform function which tries to mulitply a number by
(in this case) a name. This throws an error of course.

The problem is that the code to sample the tint transform function
didn't deal properly with the case where the PostScript function throws
an error. In that case it properly exits the code which executes the
function, but it fails to unwind the exec stack.

This leads to use trying to complete the function, using the enumerator,
which has been stored on the exec stack. Because we didn't clean up the
exec stack, what we retrieve isn't an enumerator. This causes us to try
to access invalid memory and can result in a crash.

So, several steps. Firstly have the sampling code properly handle the
error and restore the exec stack. Secondly, have the setcolorspace code
be prepared to accept a NULL returned from the sampling code and treat
that as an error (and also fix a similar exec stack problem in the
setcolorspace code). Finally; have setcustomcolor validate its operands.

Resource/Init/gs_lev2.ps
psi/zcolor.c
psi/zfsample.c


2018-08-29 09:30:19 -0700
Ray Johnston <ray.johnston@artifex.com>
91d6bc4d3e3865388ede3bcd4e84bbb8787b78e4

Fix for security issues found during internal security audit

While most of the invocations of .forceput and related operators were
"protected" by being within "executeonly" procedures, several had crept
in that did not make sure that the operator was hidden in a procedure
that could not be read.

Resource/Init/gs_dps.ps
Resource/Init/gs_fntem.ps
Resource/Init/gs_init.ps
Resource/Init/gs_lev2.ps
Resource/Init/gs_pdfwr.ps
Resource/Init/gs_setpd.ps
Resource/Init/gs_typ32.ps


2018-08-30 15:07:33 +0100
Chris Liddell <chris.liddell@artifex.com>
00dd8bc74c2abb38195b9f88f7de36f169296a97

Update dates etc for release candidate 2

base/gscdef.c
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-08-30 13:33:36 +0100
Ken Sharp <ken.sharp@artifex.com>
214d6725e4a2b539294ebfba528a8d0961379fd0

ps2write - modify Lab space handling

Commit 9e58cc8dd7e9b98620c798c901f800aff2e381ce improved the handling of
/Separation spaces with an Lab alternate space.

However, it also altered the handling of Lab spaces as the base space
for patterns, or the initial space. This caused a small difference in
release testing.

The result was incorrect previously, and after the above commit, but the
commit made it appear worse from a user's perspective. Until we can
get time to properly convert Lab base spaces into a device space, return
the code to its prior state. This does not affect the improvement to
Separation spaces.

devices/vector/gdevpdfc.c


2018-08-30 09:34:07 +0100
Ken Sharp <ken.sharp@artifex.com>
e40f79df969e4168daf65b3b3af3ea73b6a71fc4

Bug #699684 "gs segfaults in refset_null_new when processing malformed file"

It is possible for a specifically malformed Binary Object Sequence to
run out of data to process (and return to refill the buffer) when it
had read *exactly* the maximum number of objects declared in the top
array.

This meant that the 'index' pointing to the next expected array entry
to be filled in actually pointed past the end of the array.

We then called a routine to set the unused entries in the array to null
objects (for GC purposes), using the index. Because it pointed past the
end of the array this led to the count of objects being -1. The code
then counted down the count, until it reached 0, while at the same time
writing null objects past the end of the array.

This commit simply checks the index against the array size and doesn't
attempt to fill it in if its less than that value. Note that the array
index is 0-based, hence < not <=.

psi/iscanbin.c


2018-08-29 11:43:49 +0100
Chris Liddell <chris.liddell@artifex.com>
7874cfe914edc8a244976d914fc5a150c263651e

Update changelog post 9.24rc1

doc/History9.htm


2018-08-29 07:59:17 +0100
Chris Liddell <chris.liddell@artifex.com>
110b1843b16d92878fd56d874b95bac5e130c720

Fix a typo in commit 21ae2f8d9953

psi/zfapi.c


2018-08-26 15:16:46 +0800
Sebastian Rasmussen <sebras@gmail.com>
74cc0437c7d4aa8bef051300b0ba3b510b9922c4

Bug 699673: jbig2dec: Initialize return code for all cases.

Thanks to oss-fuzz for reporting.

jbig2dec/jbig2_arith.c


2018-08-26 15:16:02 +0800
Sebastian Rasmussen <sebras@gmail.com>
46c4a646d5c7954f076478aa8e85a4fc3b2b1f66

jbig2dec: Avoid dereferencing pointer before it is tested.

Thanks to coverity.

jbig2dec/jbig2.c


2018-08-28 16:55:49 +0100
Chris Liddell <chris.liddell@artifex.com>
fa11dee6f8a779edbb03ce20853b719f49815fcc

Dates, strings and stuff for 9.24 rc1

base/gscdef.c
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-08-28 16:27:53 +0100
Ken Sharp <ken.sharp@artifex.com>
520bb0ea7519aa3e79db78aaf0589dae02103764

Bug #699654 (again) and Bug #699677 Improve operator removal for SAFER

Take inspiration from the code to remove unused/dangerous operators
and, when SAFER is true, remove a bunch more non-standard operators
or routines.

In particular remove the .bindnow operator, which should have been
removed previously for Bug #699677 and remove the
.pushpdf14devicefilter for Bug #699654. Only the PDF interpreter
needs to use that, and the device in question only expects to be used
carefully and in the correct sequence. Make sure nobody can meddle with
it.

In addition I removed a number of other operators which are not needed
in normal operation. Some of them, however, are useful so these
(with the exception of .bindnow which is always removed) are only
undefined if SAFER is true.

This allows our QA procedure to continue to use them, which is
particularly important in the case of .makeoperator and .setCPSImode.

At a later date we may choose to move some of these into the regular
undefinition code, ie not dependent on SAFER.

Resource/Init/gs_init.ps


2018-08-28 14:53:49 +0100
Chris Liddell <chris.liddell@artifex.com>
21ae2f8d9953ffe8d6c8f1b2bf72a14b54d50e74

Bug 699682: Handle text from single "gs_glyph" or "gs_char"

In the FAPI code, when dealing a substituted cidfont, we extract the original
character code, and decode that using the ToUnicode CMap, in order to get a
Unicode code point we can then put through the TTF Unicode cmap table - thus
improving the chances of getting a legible result.

It failed to account for the possiblity that we were dealing with a single
character code stored directly, rather than a string of 1 or more codes in a
buffer - derefencing an invalid pointer.

Add code to handle those cases.

psi/zfapi.c


2018-08-28 14:17:09 +0100
Chris Liddell <chris.liddell@artifex.com>
7a702103b4490e370b36587c34b8b549a75ef3a5

Bug 699678: don't allow bytes to be "unread" from stdin

base/stream.c


2018-08-28 12:13:55 +0100
Ken Sharp <ken.sharp@artifex.com>
4b00990640258f464b02ce3f721a22fcb59b289b

Bug 699676 "PDF interpreter can leave dangerous operators available"

The problem here is that certain PDF functions require the ability to
use some of the non-standard, and dangerous, operators/procedures
from the PostScript interpreter.

If we leave those functions readable then a malicious PostScript program
could instantiate the PDF interpreter, inspect the packedarrray and
copy the otherwise unobtainable operator/function, then use it for
mischief.

By making the PDF functions executeonly its impossible to read the
function contents, which prevents this kind of abuse.

Resource/Init/pdf_base.ps
Resource/Init/pdf_draw.ps
Resource/Init/pdf_font.ps
Resource/Init/pdf_main.ps
Resource/Init/pdf_ops.ps
Resource/Init/pdf_rbld.ps
Resource/Init/pdf_sec.ps


2018-08-28 09:55:48 +0100
Chris Liddell <chris.liddell@artifex.com>
5b5536fa88a9e885032bc0df3852c3439399a5c0

Remove gssetresolution/gsgetresolution

These are non-standard, and never used, so remove them.

Also rejig gsgetdeviceprop, rename to .gsgetdeviceprop and undefine it after
it's used.

For the only other use of gsgetdeviceprop, replace with a special_op call.

Resource/Init/gs_init.ps
Resource/Init/gs_setpd.ps


2018-08-28 07:52:18 +0100
Chris Liddell <chris.liddell@artifex.com>
c9b362ba908ca4b1d7c72663a33229588012d7d9

Bug 699670: disallow copying of the epo device

The erasepage optimisation (epo) subclass device shouldn't be allowed to be
copied because the subclass private data, child and parent pointers end up
being shared between the original device and the copy.

Add an epo_finish_copydevice which NULLs the three offending pointers, and
then communicates to the caller that copying is not allowed.

This also exposed a separate issue with the stype for subclasses devices.
Devices are, I think, unique in having two stype objects associated with them:
the usual one in the memory manager header, and the other stored in the device
structere directly. In order for the stype to be correct, we have to use the
stype for the incoming device, with the ssize of the original device (ssize
should reflect the size of the memory allocation). We correctly did so with the
stype in the device structure, but then used the prototype device's stype to
patch the memory manager stype - meaning the ssize potentially no longer
matched the allocated memory. This caused problems in the garbager where there
is an implicit assumption that the size of a single object clump (c_alone == 1)
is also the size (+ memory manager overheads) of the single object it contains.

The solution is to use the same stype instance to patch the memory manager
data as we do in the device structure (with the correct ssize).

base/gdevdflt.c
base/gdevepo.c


2018-08-27 11:15:16 +0100
Ken Sharp <ken.sharp@artifex.com>
ea735ba37dc0fd5f5622d031830b9a559dec1cc9

Fix error condition for SC and CS

The SC and CS PDF operators correctly checked the return code from the
underlying setcolor and setcolorspace code, but we had already
set up the exec stack for handling a non-error return.

We have to do this before calling the underlying code, as that also
uses a state machine, and alters the exec stack. We must push our
own execution context first.

Ordinarily this isn't a problem, but if we have a custom error handler
which doesn't stop the interpreter, then we would continue on to try
and use what we'd pushed onto the exec stack, with predictably dire
results.

Here we avoid this by saving the exec stack pointer on entry, and if
an error occurs, restoring back to that point before returning control
to the PostScript interpreter.

A minor point, but we now also reset the space/color on an error as
well, previously it would have been left with the wrong space set.

psi/zcolor.c


2018-08-25 07:45:45 +0100
Chris Liddell <chris.liddell@artifex.com>
79cccf641486a6595c43f1de1cd7ade696020a31

Bug 699654(2): preserve LockSafetyParams in the nulldevice

The nulldevice does not necessarily use the normal setpagedevice machinery,
but can be set using the nulldevice operator. In which case, we don't preserve
the settings from the original device (in the way setpagedevice does).

Since nulldevice does nothing, this is not generally a problem, but in the case
of LockSafetyParams it *is* important when we restore back to the original
device, when LockSafetyParams not being set is "preserved" into the post-
restore configuration.

We have to initialise the value to false because the nulldevice is used during
initialisation (before any other device exists), and *must* be writable for
that.

base/gsdevice.c


2018-08-24 18:17:50 +0100
Chris Liddell <chris.liddell@artifex.com>
e5b46839994ec093251bb641fb7cbffe81712e40

Fix a typo in a dependency

psi/int.mak


2018-08-24 09:26:04 +0100
Chris Liddell <chris.liddell@artifex.com>
5516c614dc33662a2afdc377159f70218e67bde5

Improve restore robustness

Prompted by looking at Bug 699654:

There are two variants of the restore operator in Ghostscript: one is Level 1
(restoring VM), the other is Level 2+ (adding page device restoring to the
Level operator).

This was implemented by the Level 2+ version restoring the device in the
graphics state, then calling the Level 1 implementation to handle actually
restoring the VM state.

The problem was that the operand checking, and sanity of the save object was
only done by the Level 1 variant, thus meaning an invalid save object could
leave a (Level 2+) restore partially complete - with the page device part
restored, but not VM, and the page device not configured.

To solve that, this commit splits the operand and sanity checking, and the
core of the restore operation into separate functions, so the relevant
operators can validate the operand *before* taking any further action. That
reduces the chances of an invalid restore leaving the interpreter in an
unknown state.

If an error occurs during the actual VM restore it is essentially fatal, and the
interpreter cannot continue, but as an extra surety for security, in the event
of such an error, we'll explicitly preserve the LockSafetyParams of the device,
rather than rely on the post-restore device configuration (which won't happen
in the event of an error).

psi/int.mak
psi/isave.h
psi/zdevice2.c
psi/zvmem.c


2018-08-24 12:59:45 +0100
Ken Sharp <ken.sharp@artifex.com>
b0a3854751363657998d4c9bd33c290bf9d07c67

Improve PDF operator hiding

Firstly, hide the .setdistillerparams operator, if we try to use this
with a device which doesn't accept distiller params it could cause
problems. The setdistillerparams operator checks the device before
calling .setdistillerparams. This change is needed in *both*
pdf_main.ps and gs_init.ps (see next)

Secondly, fix the code for hiding PDF operators, when DELAYBIND is
true. We can't undefine the operators in pdf_main.ps if DELAYBIND
is true, because the procedures using them won't have been bound yet.
So we duplicate the code for removing the operators in gs_init.ps
and call that during .bindnow, after all the deferred binding has been
completed.

Previously the code for hiding the PDF and PostScript operators had been
left commented out, meaning that if a user chose DELAYBIND (which is
itself a massive security hole) then this minor layer of security
would not have been activated.

Resource/Init/gs_init.ps
Resource/Init/pdf_main.ps


2018-08-24 12:44:26 +0100
Ken Sharp <ken.sharp@artifex.com>
e01e77a36cbb2e0277bc3a63852244bec41be0f6

Hide the .shfill operator

Commit 0b6cd1918e1ec4ffd087400a754a845180a4522b was supposed to make
the .shfill operator unobtainable, but I accidentally left a comment
in the line doing so.

Fix it here, without this the operator can still be exploited.

Resource/Init/gs_init.ps


2018-08-23 15:42:02 +0100
Ken Sharp <ken.sharp@artifex.com>
8e9ce5016db968b40e4ec255a3005f2786cce45f

Bug 699665 "memory corruption in aesdecode"

The specimen file calls aesdecode without specifying the key to be
used, though it does manage to do enough work with the PDF interpreter
routines to get access to aesdecode (which isn't normally available).

This causes us to read uninitialised memory, which can (and often does)
lead to a segmentation fault.

In this commit we set the key to NULL explicitly during intialisation
and then check it before we read it. If its NULL we just return.

It seems bizarre that we don't return error codes, we should probably
look into that at some point, but this prevents the code trying to
read uninitialised memory.

base/aes.c
base/saes.c


2018-08-23 15:41:18 +0100
Chris Liddell <chris.liddell@artifex.com>
241d91112771a6104de10b3948c3f350d6690c1d

Bug 699664: Ensure the correct is in place before cleanup

If the PS job replaces the device and leaves that graphics state in place, we
wouldn't cleanup the default device in the normal way, but rely on the garbage
collector.

This works (but isn't ideal), *except* when the job replaces the device with
the null device (using the nulldevice operator) - this means that
.uninstallpagedevice doesn't replace the existing device with the nulldevice
(since it is already installed), the device from the graphics ends up being
freed - and as it is the nulldevice, which we rely on, memory corruption
and a segfault can happen.

We avoid this by checking if the current device is the nulldevice, and if so,
restoring it away, before continuing with the device cleanup.

psi/imain.c


2018-08-23 14:13:25 +0100
Chris Liddell <chris.liddell@artifex.com>
c432131c3fdb2143e148e8ba88555f7f7a63b25e

Bug 699661: Avoid sharing pointers between pdf14 compositors

If a copdevice is triggered when the pdf14 compositor is the device, we make
a copy of the device, then throw an error because, by default we're only allowed
to copy the device prototype - then freeing it calls the finalize, which frees
several pointers shared with the parent.

Make a pdf14 specific finish_copydevice() which NULLs the relevant pointers,
before, possibly, throwing the same error as the default method.

This also highlighted a problem with reopening the X11 devices, where a custom
error handler could be replaced with itself, meaning it also called itself,
and infifite recursion resulted.

Keep a note of if the handler replacement has been done, and don't do it a
second time.

base/gdevp14.c
devices/gdevxini.c


2018-08-23 14:12:48 +0100
Ken Sharp <ken.sharp@artifex.com>
0b6cd1918e1ec4ffd087400a754a845180a4522b

Fix Bug 699660 "shading_param incomplete type checking"

Its possible to pass a t_struct parameter to .shfill which is not a
shading function built by .buildshading. This could then lead to memory
corruption or a segmentation fault by treating the object passed in
as if it were a shading.

Its non-trivial to check the t_struct, because this function can take
7 different kinds of structures as a parameter. Checking these is
possible, of course, but would add a performance penalty.

However, we can note that we never call .shfill without first calling
.buildshading, and we never call .buildshading without immediately
calling .shfill. So we can treat these as an atomic operation. The
.buildshading function takes all its parameters as PostScript objects
and validates them, so that should be safe.

This allows us to 'hide' the .shfill operator preventing the possibility
of passing an invalid parameter.

Resource/Init/gs_init.ps
Resource/Init/gs_ll3.ps
Resource/Init/pdf_draw.ps


2018-08-23 12:20:56 +0100
Chris Liddell <chris.liddell@artifex.com>
b575e1ec42cc86f6a58c603f2a88fcc2af699cc8

Bug 699668: handle stack overflow during error handling

When handling a Postscript error, we push the object throwing the error onto
the operand stack for the error handling procedure to access - we were not
checking the available stack before doing so, thus causing a crash.

Basically, if we get a stack overflow when already handling an error, we're out
of options, return to the caller with a fatal error.

psi/interp.c


2018-08-23 09:30:56 +0100
Chris Liddell <chris.liddell@artifex.com>
d224b4abec1d0bd991028b7e38e95d47b7a834f4

Bug 699623: ICC profile creation file permissions check

The original fix missed the initial branch with an explicitly specified
directory.

This also uncovered problems with device profile reference counting, where
if profile creation failed we'd leave a pointer to the original profile
in place - either a dangling pointer, or leaving the ref count wrong.

To solve this, we NULL the relevant profile pointer in the device after
adjusting the reference count.

base/gsicc_manage.c


2018-08-23 09:54:59 +0100
Chris Liddell <chris.liddell@artifex.com>
78911a01b67d590b4a91afac2e8417360b934156

Bug 699654: Check the restore operand type

The primary function that implements restore correctly checked its parameter,
but a function that does some preliminary work for the restore (gstate and
device handling) did not check.

So, even though the restore correctly errored out, it left things partially done
and, in particular, the device in partially restored state. Meaning the
LockSafetyParams was not correctly set.

psi/zdevice2.c


2018-08-21 20:36:52 +0100
Chris Liddell <chris.liddell@artifex.com>
0edd3d6c634a577db261615a9dc2719bca7f6e01

Bug 699659: Don't just assume an object is a t_(a)struct

psi/ztype.c


2018-08-21 20:17:51 +0100
Chris Liddell <chris.liddell@artifex.com>
a054156d425b4dbdaaa9fda4b5f1182b27598c2b

Bug 699658: Fix handling of pre-SAFER opened files.

Temp files opened for writing before SAFER is engaged are not subject to the
SAFER restrictions - that is handled by recording in a dictionary, and
checking that as part of the permissions checks.

By adding a custom error handler for invalidaccess, that allowed the filename
to be added to the dictionary (despite the attempted open throwing the error)
thus meaning subsequent accesses were erroneously permitted.

Resource/Init/gs_init.ps


2018-08-21 20:17:05 +0100
Chris Liddell <chris.liddell@artifex.com>
0d3901189f245232f0161addf215d7268c4d05a3

Bug 699657: properly apply file permissions to .tempfile

psi/zfile.c


2018-08-21 16:42:45 +0100
Chris Liddell <chris.liddell@artifex.com>
c3476dde7743761a4e1d39a631716199b696b880

Bug 699656: Handle LockDistillerParams not being a boolean

This caused a function call commented as "Can't fail" to fail, and resulted
in memory correuption and a segfault.

devices/vector/gdevpdfp.c
psi/iparam.c


2018-08-21 16:24:05 +0100
Chris Liddell <chris.liddell@artifex.com>
b326a71659b7837d3acde954b18bda1a6f5e9498

Bug 699655: Properly check the return value....

...when getting a value from a dictionary

psi/zcolor.c


2018-08-15 16:24:11 +0100
Chris Liddell <chris.liddell@artifex.com>
f25045e88de674a1202c1239565ee99e9ddabe91

Fix missing dependency declaration for gdevoflt.h

base/lib.mak


2018-08-20 15:18:27 +0100
Chris Liddell <chris.liddell@artifex.com>
50ef2aa8c28f0eb097b8dab3effbe6b1c3948879

Fix "ignored return code" Coverity errors.

Several places in pl_main_process_options(), we were ignoring return codes -
particularly, cases where a genuine error is possible.

Rather than handle each error case automatically, drop out of the switch,
and catch the error before jumping to the top of the while loop.

For consistency, ignore the error triggered by -dBATCH

pcl/pl/plmain.c


2018-08-20 19:03:26 +0100
Ken Sharp <ken.sharp@artifex.com>
678261f0d973badfc4609e9e7b27a1d039609ebb

PostScrip ICC spaces - fix minor memory leak

psi/zicc.c


2018-08-18 17:12:46 +0100
Ken Sharp <ken.sharp@artifex.com>
4ade82d9471971937ff3bcb39823cb080a18c2d5

Fix a minor compiler warning

devices/gdevdsp.c


2018-08-18 10:44:52 +0100
Ken Sharp <ken.sharp@artifex.com>
6b1106c232bb18366c527f9da54715ac79165317

Fix display device (some more) with subclassing

Because the display device isn't based off one of the standard devices
we need to do extra work with it to ensure it behaves well with the
subclassing device code.

Commit 1203adc8bbcb60f0e4145300aac44f1988b7c2de contained some of this
work, but unfortunately it had an oversight, it didn't update the
parent (subclassing) devices when the device parameters changed.

This led to it using the wrong width for the raster, if the media
size changed after initialisation.

devices/gdevdsp.c


2018-08-15 13:44:53 -0600
Henry Stiles <henry.stiles@artifex.com>
c265ee6563a1a65d225c4255d95d7306a21c3146

Token buffer not freed.

Unrecognized PJL settings resulted in a memory leak of the token
buffer.

pcl/pl/pjparse.c


2018-08-15 10:45:50 -0700
Nancy Durgin <nancy.durgin@artifex.com>
fa9b0f51a5fbac1bdabef012cc5b0ca006c2c281

Fix compiler warning

base/gdevepo.c


2018-08-15 14:10:55 +0100
Chris Liddell <chris.liddell@artifex.com>
7ab21af0b0c70707aefb1083505136ff7862d337

Bug 699638(3): Fix param list key handling in pl_main_process_options()

param lists can be configured to handle keys in two ways: persistent keys, or
transient keys. For persistent keys, the param list contains a reference to the
key string, and does no management of the string memory.

Configured for transient key strings, the param list makes a copy of the string
and the string memory is managed along with the parameter list itself.

The two approaches cannot be mixed in the same param list.

The pl_main_process_options() code configures the param list to use transient
key strings (which is the default). But it was then copying the key strings,
before passing them to the param list API, and taking no action to manage
the string memory - causing memory leaks.

Since the param list (as configured) takes a copy of the key string, there's no
call for the calling code to do so, and not doing the local string copy
prevents leaking memory.

pcl/pl/plmain.c


2018-08-15 09:30:09 +0100
Chris Liddell <chris.liddell@artifex.com>
1ff8b85ae28c7813aa484dd8f1779f4a4d0742af

Bug 699638(2): correct reference counts in gs_initgraphics

In gs_initgraphics(), when we create new color spaces for the graphics state
the color space is created with a reference count of 1, we then call
gs_setcolorspace() which attaches the color space to the gstate and increments
the reference count - we then drop the "local" reference, leaving a
reference count of 2, but only a single reference to the color space (the one
in the graphics state). Meaning the memory leaks.

So, decrement the reference count for the local reference, before dropping the
local reference.

base/gsstate.c


2018-08-15 08:37:38 +0100
Chris Liddell <chris.liddell@artifex.com>
854f14096c0c6467068701ad19c4c775374e1ce4

Bug 699638(1): Clean up before early exit in gx_image_cached_char()

If we end up using the imagemask method to render a cached glyph, we can drop
out early if the glyph is outside the current clip. Previously, the function
simply returned at that point, leaking memory.

Now it falls through to the cleanup and normal return, no longer leaking.

base/gxccache.c


2018-08-14 10:01:08 -0700
Nancy Durgin <nancy.durgin@artifex.com>
1fe06b350370a51d1bcccde37f8daf13af803d3c

Change the debugging in epo to use the gs_debug stuff

I am using 3 flags -- epo-details, epo-install-only, epo-disable.

Can also call "epo_disable(1)" during a gdb session to turn on/off
during the session.

base/gdbflags.h
base/gdevepo.c


2018-08-09 07:56:51 -0700
Nancy Durgin <nancy.durgin@artifex.com>
df188f54f3e3eed5f12b921440ac7d29970aba35

Bug 690131: Add epo subclass device to do erasepage optimization.

This optimization only works for devices that have a fillpage
implementation that is "gx_default_fillpage". For other devices the
subclass device will not be installed. If the device transitions to
clist (or any other non-gx_default_fillpage device), we will stop
doing the optimization.

The optimization basically swallows(defers) all fillpages, remembering
the color (which is probably always white, but it will work with any
"pure" color). Then when the first actual marking operation happens,
we do a fill_rectangle operation with the remembered color.

base/gdevepo.c
base/gdevepo.h
base/gspaint.c
base/lib.mak


2018-08-09 11:25:57 +0100
Ken Sharp <ken.sharp@artifex.com>
428c05bf7168df79721f9bf3c574ccd9e1294e7e

Fix a couple of compiler warnings

Part of the subclassing updates.

devices/vector/gdevpdfo.c


2018-08-09 11:25:57 +0100
Ken Sharp <ken.sharp@artifex.com>
55cb739c1134882c6abaca6264a8d8bccf24dedf

Fix a couple of compiler warnings

Part of the subclassing updates.

devices/gdevdsp.c
devices/vector/gdevpdfo.c


2018-07-31 16:36:28 +0100
Ken Sharp <ken.sharp@artifex.com>
5f8ac1413077051fd0f559b7b2d5f36b10d58bfe

Device Subclassing - fix memory leak of the 'stype' device member

This is all horribly crufty and really not possible to explain.

With the addition of the custom finalize() for subclassing devices we
sorted this out for the case where all the devices were garbage
collected (the GC, the custom finalize and the device finalize take
care of all the wrinkles here).

But for unsubclassing we cannot use the finalize() routine for the
original device when freeing the child. For most devices this does
actually work, but if the device itself has a custom finalize method
(rare, but see psdcmyk) then if we allow the finalize routine to run
it might (and in the case of psdcmyk does) free memory which is still
being pointed at by the parent (original) device structure.

So we need to NULL the finalize routine in the stype structure, tell
the memory manager to use the newly modified structure, then free the
child device memory and finally free the stype structure.

We also need to properly handle the reference counts of the icc_struct
and PagesList objects, but we had done that already in previous commits.

For safety, set the parent and child pointers to NULL and set the child
device structure reference count to 0 to ensure it is not retained.

Finally; there was a minor error when patching back the memory manager
'stype' copy in the parent device, fix that now too.

base/gdevdflt.c


2018-07-27 12:17:32 +0100
Ken Sharp <ken.sharp@artifex.com>
1203adc8bbcb60f0e4145300aac44f1988b7c2de

Device subclassing - synchronise devices on put_params

Commit 434fb65601b91e14fe4f846dcbb92a68d939faf9 on the erasepage
branch fixed the initial problem, but was not a sufficient solution.

While it seems correct to update the 'target' of the clist so that it
points to the head of the subclassing chain, we can run into problems
using that device, if its parameters (eg width and height) do not
match the ultimate device.

This can happen if we get a put_params() which alters the device
parameters. Although we update the chain after the put_params has
completed, gdevprn-derived devices will reallocate memory or
re-initialise the clist *during* the course of the put_params. If we
don't resynchronise the chain but do update the clist target, then the
clist re-initialisation will be using the wrong parameters.

base/gdevprn.c


2018-07-26 17:39:40 +0100
Ken Sharp <ken.sharp@artifex.com>
9cb7fbd8ca2f2dee6652d832c76da16b85a5f730

Device Subclassing - fix memory leaks with child device

We should not patch out the finalize routine (now that we have a custom
one), that prevents the child device finalize being run, leading to
memory leaks with ICC profiles.

Also, now we have a finalize routine, we need to free the child device
if there is one present. The child device's own finalize routine will
clean everything up.

base/gdevdflt.c
base/gdevsclass.c


2018-07-26 16:03:30 +0100
Ken Sharp <ken.sharp@artifex.com>
12a188d18097e2161f3d653b677e55f558d57faf

Device Subclassing - add a finalize routine for subclassing devices

After some research its clear that subclassing devices do actually need
their own specific finalize routine, borrowing the device finalize
leads to problems.

So here we define a default version. All subclassing devices should
either use this routine, or implement their own of the allocate additional
memory. In that case the specific finalize routine should clean up its
own memory and then call the default one.

Add default subclassing finalize to system devices

base/gdevflp.c
base/gdevmplt.c
base/gdevoflt.c
base/gdevsclass.c
base/gdevsclass.h


2018-07-17 12:45:20 +0100
Ken Sharp <ken.sharp@artifex.com>
ae5fddd0bd7b06215235090470d3f9297faa24bb

Subclassing - correct reference counts on ICC profiles

We weren't previously reference counting the profile structure, this
wasn't a problem until pdfwrite started honouring /ProcessColorModel
requests in setpagedevice, which could lead to the ICC profile
structure altering between the device being subclassed, and the
device being unsubclassed.

base/gdevdflt.c


2018-07-17 10:08:33 +0100
Ken Sharp <ken.sharp@artifex.com>
2642d19883e4c008f999f2872cc0a37b2268634e

Fix the display device with subclassing devices

When the display device is chosen, the executable calls display_set_callbacks
on the current device. That code then sets a member in the current
device, *without* checking the device is actually the display device.

It does this *before* opening the device....

This is a quick hack to resolve the problem by descending to the bottom
child device if there is a chain of devices in place. We should really
check the device name at each step.

In addition the Windows display device keeps a pointer to the device along
with each 'image'. Not sure why, but it breaks if we are using device
subclassing, because the device can change.

Finally; the code doesn't cope with being unable to find a matching
image with the same device. It sets the 'img' to NULL and then goes ahead
and tries to use it anyway. Fix that at the same time so we don't crash!

devices/gdevdsp.c
psi/dwmain.c
psi/idisp.c


2018-07-16 16:02:26 +0100
Ken Sharp <ken.sharp@artifex.com>
8c0d309e74526e0eb5152af05067a9b0a53892c7

pdfwrite - fix stored device pointers in streams, when subclassing

Yet more evidence of nasty hackery in pdfwrite. It stores a copy of the
device pointer in the pdf stream_state. Of course, if we had a
subclassed device when we created the stream, and unsubclassed it before
we closed the (eg if we create a high level pattern before the first
marking operation) then the stored pointer was pointing at the wrong
(child, freed) device.

Just do some pointer traversal to make sure we store the top level one
and use the bottom level one when we need it.

devices/vector/gdevpdfo.c
devices/vector/gdevpsds.c


2018-07-16 15:58:35 +0100
Ken Sharp <ken.sharp@artifex.com>
40b7e425f7ba239e4639baf3feb9d54ebbb85957

device subclassing - solve several problems with short-lived subclassing

Nancy's new erasepage optimisation code revealed some interesting
wrinkles in the subclassing code, Firstly;

If we did a save, then inserted a subclassing device, then a restore
we would get a segmentation fault.

This is because when we subclass a device, we make a new copy of the
original device. This device is, of course, created inside the current
save context. When we restore, that restores away the copied device
with the result that the 'child' pointer of the original device is now
pointing at garbage memory.

Fix this by using 'stable' memory instead of immovable memory. Stable
memory is unaffected by save and restore.

This means we also need to 'null' the members of the copied child when
we 'unsubclass' the device. Otherwise garbage collection may end up
trying to enumerate the pointers in the freed device.

Following on from that, when we get a create_compositor call in the
subclassing code we do a dance whereby we patch the method in the
compositor handler that gets pushed, so that it points to the subclass
device, not the device's ultimate child. Of course, when we unsubclass
the device, we need to unpatch the compositor as well.

That one may need more work.

Finally (for now) we weren't properly handling the parent and child
pointers for the list when we removed a device from the middle of a
chain. The doubly-linked pointers weren't being properly updated.

base/gdevdflt.c


2018-07-14 10:22:45 +0100
Ken Sharp <ken.sharp@artifex.com>
39e8e61d79488909b7645ecc31563ce15aa05702

Fix subclassing and page buffer reallocation in prn devices

It is possible for us to need to reallocate the page buffer for a
device if (or example) a setpagedevice call results in changed width
or height of the media.

When we do that, if we need to change to (or re-initialise) a clist
then we set the clist 'target' member to be the 'current' device. That
doesn't mean the current device in the graphics state though, if
we have subclassed the device then we will have passed the params
request down the chain, so the rendering device is not the current
device in the gstate.

We need the target of the clist to be the subclassing device, ie the
one in the graphics state, not the 'current' one. Otherwise if we
were to unsubclass the device, then the clist would be pointing at a
device which was freed.

There's no good way to do this from the subclassing code itself, so
I have (reluctantly) modified gdevprn.c to handle this. Any devices
which don't derive from gdevprn, and use the clist, will need to handle
this case themselves.

base/gdevprn.c


2018-07-14 10:15:34 +0100
Ken Sharp <ken.sharp@artifex.com>
8eb6643606556921bbbbf495825470cd75123874

subclassing devices - fix clist patching on unsubclass

When removing a subclassing device from the chain, if we have patched
the clist create_compositor method, then we need to restore it,
otherwise it will continue to point to the (now vanished) subnclassing
device's method.

base/gdevdflt.c
base/gdevsclass.c
base/gxdevice.h


2018-08-09 11:55:54 +0100
Chris Liddell <chris.liddell@artifex.com>
88c54234ef0565e54de8b2378907ca201f348b4b

Update "Font lookup" description

The FONTPATH section did not explicitly state the search includes descendants
of the directories listed in FONTPATH.

Possibly this is because filenameforall (with which the search is implemented)
did not recurse into subdirectories when the FONTPATH feature was originally
added, but filenameforall now does (as it is supposed to), so the docs should
reflect that.

doc/Use.htm


2018-08-06 11:31:11 +0100
Ken Sharp <ken.sharp@artifex.com>
398fd3742abf40cd1c4b94273e81755bdcb5e88f

PDF interpreter remove debug code

Accidentally left a 'pstack' in the last commit

Resource/Init/pdf_draw.ps


2018-08-06 11:23:00 +0100
Ken Sharp <ken.sharp@artifex.com>
17d6b5fd47e161b8a0bfd23e7a4214b16acd07dd

PDF interpreter - resurrect Link handling improvements

commit 61f53ab8f9e586c8722ccd0ea7de3722b0d40cd2 removed the duplication
of /Link and /Text annotation handling, and used the newer code for
handling these instead.

It transpires that the /Link handling in the old (removed) code was
considerably more functional than that in the newer code...

Here we replace the new code with the old code in order to get the same
functionality, but with the proper controls in place, and only handling
annotations in one place instead of 2.

Resource/Init/pdf_draw.ps


2018-08-06 09:37:32 +0100
Ken Sharp <ken.sharp@artifex.com>
61f53ab8f9e586c8722ccd0ea7de3722b0d40cd2

PDF interpreter - Remove old annotation handling for pdfwrite

Bug #699619 "Annotations included twice with pdfwrite"

At some point in the past we handled a very few annotations with
pdfwrite and did so in the pdfshowpage_finish routine. Since then we
have moved the handling of annotations for pdfwrite into the
showpagecontents routine, along with regular annotation rendering.

But leaving the old code in place meant that some annotations (/Link
and /Text) were being processed twice (for pdfwrite). Additionally
the old code didn't honour the ShowAnnots or PreserveAnnots controls.

Just remove the old code.

Resource/Init/pdf_main.ps


2018-08-03 21:36:26 +0800
Sebastian Rasmussen <sebras@gmail.com>
1c12d01a2fb48e5fc69f46318348a4ad641be131

Revert accidentally pushed "WIP: gitignore"

This reverts commit 3f6507e834e92d9f5fc07ec8e91509a54ce9ec6d.

.gitignore
jbig2dec/.gitignore


2018-08-03 10:48:55 +0100
Ken Sharp <ken.sharp@artifex.com>
3bf4f3ea45f0022b6cd36415f095f1bfc119fb73

pdfwrite - improve further the glyph bounding box calculation

Bug #699571 "Missing characters when convert eps to pdf. Ok when convert to png."

When deciding whether to include a text string in the output PDF file
we compare the bounding box of the string with the bounding box of the
current clip path. If the string bbox is not at least partially within
the clip, then we don't emit it.

To do this we previously used the font's FontBBox in order to estimate
the size of each glyph in the string.

Commit 6a4202691c4317a698fa23c5309ad8974fe2b003 fixed a bug where the
font has a wildly incorrect FontBBox leading to us deciding that the
glyph was outside the clip area.

In that commit Chris Liddell noted that using the 'real' glyph bounding
box would require executing the complete CharString which has
performance implications.

Unfortunately this latest bug has forced us into this course. The EPS
file draws the same glyph multiple times, clipping portions of it each
time. Sometimes it uses charpath/fill to render the clipped portion, and
sometimes it uses an xyshow where the advance in both directions is 0.
At the same time, the font has a completely inaccurate FontBBox.

Because the advance width is 0 the previous fix does not address this
situation. The FontBBox is so inaccurate that most of the times the
glyph is rendered it is deemed to be outside the clip.

The only remaining solution is to determine the *actual* Bounding Box
of the glyph, which means we have to execute the glyph description.

This does result in some degradation in performance.

devices/vector/gdevpdte.c


2018-08-03 10:40:44 +0100
Ken Sharp <ken.sharp@artifex.com>
3cbfb32d83f8910a9aeae805542c805eba584e34

TrueType interpreter - set the TrueType rendering routine

Ensure the GS TTF interpreter is associated with a TTF font before attempting
to retrieve the glyph bounding box. We have to eplicitly NULL the FAPI entry
before doing so because, for normal rendering, we'll use the FAPI/Freetype API
(in this case, we want to avoid rendering the glyph)

Fix supplied by Chris Liddell

base/gstype42.c


2018-05-26 19:11:58 +0800
Sebastian Rasmussen <sebras@gmail.com>
3f6507e834e92d9f5fc07ec8e91509a54ce9ec6d

WIP: gitignore

.gitignore
jbig2dec/.gitignore


2018-08-03 19:14:15 +0800
Sebastian Rasmussen <sebras@gmail.com>
8c7d55b8f5b1248bf120ed312538bd824ba5ad9f

jbig2dec: Avoid accessing symbol bitmap width if it is missing.

jbig2dec/jbig2_text.c


2018-08-03 19:11:02 +0800
Sebastian Rasmussen <sebras@gmail.com>
06d82c1d8b0c625f5bb8db8acd7113ff0b8179d8

jbig2dec: Prevent underflow when checking if enough data for bitmap.

When decoding the symbol dictionary the bitmap size field
determines the size of the bitmap. The bitmap size is however
restricted to the size of the segment's data region. This was
checked previously, but the check itself may underflow, so
another check was introduced to prevent this from happening.

jbig2dec/jbig2_symbol_dict.c


2018-08-03 19:10:09 +0800
Sebastian Rasmussen <sebras@gmail.com>
d20a98cb7d3e10a68c7d288318f216db70db610c

jbig2dec: When reading past the end of a word stream, return 0.

Previously the returned value would be uninitialized, leading
to issues detected by valgrind later on in the parsing.

jbig2dec/jbig2.c


2018-08-03 12:28:23 +0800
Sebastian Rasmussen <sebras@gmail.com>
105f72c232121b12ec2b53bc76c66dd8cf821a78

jbig2dec: Initialize entire page structure upon allocation.

Without this uninitialized values in the page structure will be
used when parsing segments. An example of this is in
jbig2_immediate_generic_region() when a the height of the page is
used to determine if the region is outside of the page.

jbig2dec/jbig2.c


2018-04-26 01:48:05 +0800
Sebastian Rasmussen <sebras@gmail.com>
163d0687c8c6bcfbff9e2ebae634530de0c3ebce

jbig2dec: Explanation of (un)optimized generic region decoder.

Previously it was difficult to understand the magic values used in the
optimized generic region decoder, and also whether the order of pixels
in the context in the unoptimized decoder were important. This new
explanation attempts to rectify these issues.

jbig2dec/jbig2_generic.c


2018-07-24 01:00:18 +0800
Sebastian Rasmussen <sebras@gmail.com>
e115b9b367645f85b42c5c7922b84af6fad7a907

jbig2dec: Print warning messages even for non-debug builds.

This is useful because jbig2dec emits warnings when it encounters
broken files it is able to cope with, e.g. referrals to symbols
outside the symbol dictionary are ignored but a warning is
emitted. Ghostscript ought to output warnings in these cases so
that users know that the final render might not be the intended
one because the input file is broken.

base/sjbig2.c


2018-07-01 17:26:21 +0800
Sebastian Rasmussen <sebras@gmail.com>
2db336dc75bf710bcf327545c61f2d215332ce99

jbig2dec: Read region segment height/width/x/y as unsigned.

The specification in 5.4.4 states that numbers are unsigned unless
otherwise stated. 7.4.1.1 through 7.4.1.4 specifying the region segment
height, width, x and y do not mention that these fields are signed,
hence they ought to read and handled as unsigned.

jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_page.h
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_segment.h


2018-07-08 14:10:09 +0800
Sebastian Rasmussen <sebras@gmail.com>
fd551bc0e40d2220b4343aeeefa7d9d3a64140eb

jbig2dec: Use accurate references to the specification.

jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_halftone.h


2018-07-31 19:32:00 +0800
Sebastian Rasmussen <sebras@gmail.com>
ab862e07f1a804d5cf55548e73c0128673070e17

jbig2dec: Support up to 16 bit gray-scale image for halftoning.

Without this commit if jbig2dec is fed a fuzzed bitstream where
HBPP ends up larger than 8, jbig2dec will access bits outside of
each 8 bit sample in GSVALS.

HBPP is in Table 22 in 6.6.4 defined to be 32 bits unsigned. The
specification in C.2 limits GSBPP to 6 bits unsigned, a maximum
value of 63, i.e. a gray-scale image with 63 bits per sample.
According to table 23 in 6.6.5 HBPP is assigned to GSBPP, so any
value larger than 63 would be out of spec.

A non-fuzzed bitstream that has HBPP larger than 9 is yet to be
encountered. So for the time being use uint16_t the GSVALS and
limit HBPP to 16. If a file with HBPP larger than 16 is ever
encountered, the type and limit needs to be revisited.

jbig2dec/jbig2_halftone.c


2018-07-09 00:42:51 +0800
Sebastian Rasmussen <sebras@gmail.com>
907b9dff401154cdf5a4716e4f067bdf3a45de27

jbig2dec: Use corresponding stride for gray-scale bitplane.

All bitplanes have the same stride, but this change makes it obvious
that we will not overwrite any boundaries (i.e. use the stride of the
bitplane in question, not the stride for another bitplane).

jbig2dec/jbig2_halftone.c


2018-07-08 22:05:57 +0800
Sebastian Rasmussen <sebras@gmail.com>
7f4cd0ad4c0d8636141de50bb6eb76b17e574eb5

jbig2dec: Fix accidental typo in context size function.

jbig2dec/jbig2_generic.c


2018-07-04 03:03:17 +0800
Sebastian Rasmussen <sebras@gmail.com>
2bc62e131fb14d22e7f4e0701a190b1cf50e9792

jbig2dec: Ignore negative pixel runs in MMR decoder.

Previously these were fatal errors, now warn and continue.

jbig2dec/jbig2_mmr.c


2018-07-03 00:36:40 +0800
Sebastian Rasmussen <sebras@gmail.com>
9bff24e265f40fca19926f2a44390d1ac543e309

jbig2dec: Ignore missing glyphs when rendering text region.

jbig2dec/jbig2_text.c


2018-05-28 22:46:16 +0800
Sebastian Rasmussen <sebras@gmail.com>
052910bb5f16adaa0bc28fb2e8c7aeb562e0e7cb

jbig2dec: Rephrase jbig2_error() messages.

* Do not prefix messages with "jbig2 error:", this ought to be
done by the error callback itself.
* Avoid using function names in messages as they mean nothing to
the end user.
* Avoid contractions in messages.
* Try to adhere to "failed to" pattern as far as possible.
* Messages start with lower case character, unless it refers to
something in the specification.
* Messages do not end with punctuation.

jbig2dec/jbig2.c
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_image.c
jbig2dec/jbig2_image_pbm.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c
jbig2dec/jbig2dec.c


2018-07-03 20:02:04 +0800
Sebastian Rasmussen <sebras@gmail.com>
fdf6a2d9b8a33b04429608c104680d982fb085f5

jbig2dec: Implement support for generic region pixel skipping.

jbig2dec/jbig2_generic.c
jbig2dec/jbig2_generic.h
jbig2dec/jbig2_halftone.c


2018-07-04 12:36:41 +0800
Sebastian Rasmussen <sebras@gmail.com>
c10cd780ace02cdc2a07e9c9e59e4617c0434fc6

jbig2dec: Fix where end row of stripe was only updated locally.

jbig2dec/jbig2_page.c


2018-07-03 03:10:55 +0800
Sebastian Rasmussen <sebras@gmail.com>
90964e633488e2d8e9fa450ebe04ace16ec0d396

jbig2dec: Warn on too many symbols in text region, do not report fatal error.

This condition is already taken care of by not continuing to read symbols,
so attempt to proceed with parsing the image.

jbig2dec/jbig2_text.c


2018-07-02 12:44:31 +0800
Sebastian Rasmussen <sebras@gmail.com>
0073f2a6524c731528e950deb7eac598c819a3da

jbig2dec: Treat unstriped pages with unknown height as striped with max stripe height.

jbig2dec/jbig2_page.c


2018-07-01 17:25:48 +0800
Sebastian Rasmussen <sebras@gmail.com>
3d8b1c3fc85271e075b22627182998ae4cf894d5

jbig2dec: Limit region height to page/stripe height.

Make sure to ignore regions outside of stripe/page.

jbig2dec/jbig2_generic.c
jbig2dec/jbig2_page.c


2018-07-09 01:30:11 +0800
Sebastian Rasmussen <sebras@gmail.com>
f3e4a8978b9577bad31d0f818b206eb65da222d6

jbig2dec: Stripe offsets are absolute, not relative.

jbig2dec/jbig2_page.c


2018-07-30 16:24:28 +0100
Ken Sharp <ken.sharp@artifex.com>
cf964a720496ff8e1c55f0d629bdec91b789faf0

Coverity ID 305953 - uninitialised variable

Also a scan-build warning.

devices/vector/gdevpdtt.c


2018-07-01 00:36:28 +0800
Sebastian Rasmussen <sebras@gmail.com>
e3212ede0590b02ef57f8946ae413ce44ef3658e

jbig2dec: Cap runlength for exported symbols, don't error out.

Capping is necessary because the preceding symbol dictionary segment header
stated that a specific number of symbols will be exported to succeeding symbol
dictionaries. By capping overly long runlengths of exported symbol instead of
reporting fatal errors somewhat corrupt JBIG2 bitstreams may still partially
render, albeit with a warning about the capping taking place.

jbig2dec/jbig2_symbol_dict.c


2018-07-01 13:28:26 +0800
Sebastian Rasmussen <sebras@gmail.com>
bbbb7eff0b63f383e073ec760b2b8a94896d81a1

jbig2dec: Occasional runlengths may be zero, avoid infinite sequence.

Previously any runlength when exporting symbol dictionary symbols
being zero caused a fatal error. These are not disallowed by the
specification, but if there is an infinite sequence of them the
decoder cannot make any progress in establishing the dictionary
of exported symbols from a symbol dictionary. This may happen
when the huffman or arithmetic integer decoder due to e.g. fuzzed
input data returns an infinite sequence of zeroes when the
decoder attempts to read the runlengths. This case of infinite
zero runlengths is best handled as a fatal error. An arbitrary
limit of 1000 of zero runlengths in sequence (an approximation of
an infinite sequence of zero runlengths) will now cause a fatal
error, but the occasional zero runlength will be accepted without
any kind of message.

jbig2dec/jbig2_symbol_dict.c


2018-07-13 14:10:40 +0800
Sebastian Rasmussen <sebras@gmail.com>
55ed0cbe04df585a987ca8ce7b6255e9705646d1

jbig2dec: Advance and limit b1 in MMR decoder in a single location.

Previously this unnecessarily happened multiple times.

jbig2dec/jbig2_mmr.c


2018-07-13 13:39:42 +0800
Sebastian Rasmussen <sebras@gmail.com>
1d22aa82619bfd6e02dd1e4afa019a68ba2f3cca

jbig2dec: Remove check for a0 set before scanline in MMR decoder.

A few lines of code prior if a0 is set before the scanline it is
reset to index 0, so no need to recheck for this condition.

jbig2dec/jbig2_mmr.c


2018-07-13 13:00:06 +0800
Sebastian Rasmussen <sebras@gmail.com>
230dd860b0db9924794570654db3bb162194977e

jbig2dec: Error message in MMR coded data mixed black/white pixel runs.

jbig2dec/jbig2_mmr.c


2018-07-13 12:31:19 +0800
Sebastian Rasmussen <sebras@gmail.com>
7f94da2ccf574524d71a7d6aa2e381893dbacb37

jbig2dec: The MMR runlength tables list error codes, handle those.

Previously these errors led to spurious negative values for runlengths,
which were treated as if these were legal even though they are not.

jbig2dec/jbig2_mmr.c


2018-07-26 11:43:10 +0100
Chris Liddell <chris.liddell@artifex.com>
4b16b3762c1177497633178303665317eae8297e

Bug 699560: Shut down libjpeg encoder in gdevjpeg

Have the jpeg devices correctly shutdown libjpeg and release the encoder
context correctly - solves memory leaks reported by memento.

devices/gdevjpeg.c


2018-07-26 08:28:23 +0100
Ken Sharp <ken.sharp@artifex.com>
2f017502459778cac3c2b8cb2c6df2f52629aae3

pdfwrite - don't retry CharProc capture on error.

Bug #699561 "Infinite loop or Segfault"

The input PostScript file for this case is invalid and throws a
rangecheck error with normal devices.

However when the output device is pdfwrite in the case of *any* error
handling text we fall back to the 'default implementation' which means
we run the glyph description normally, and capture the bitmap into a
type 3 bitmap font.

In the case of this file, however, when we try to use the captured
bitmap we again throw an error. This causes us to run the glyph
description again and capture the bitmap. Of course, that again fails
when we try to use it leading to an infinite loop. But not any simple
loop, it involves exiting the code and re-entering it after capture.

This commit adds a new variable, captured_pte_index. When we complete
a capture, we record the index (the pointer to the input character codes)
from the text enumerator. We then try to process the text as normal. If
we get an error, before falling back to the default implementation, we
test the current text enumerator index. If its the same as the captured
index then we know that it was the captured CharProc threw an error.

In the case of this kind of error we simply return the error, there is
nothing further we can do.

devices/vector/gdevpdtt.c


2018-07-20 11:43:54 +0800
Sebastian Rasmussen <sebras@gmail.com>
d735b5ae0b8fc6573f09aee9b8663612bdde3c9b

jbig2dec: Change overflow check for allocations.

The maximum size of an allocation was previously limited to
(maximum value of size_t)-256 bytes. Use SIZE_MAX instead.

jbig2dec/jbig2.c


2018-06-29 17:47:25 +0800
Sebastian Rasmussen <sebras@gmail.com>
2272769bf1126e20f8458729c334f2134b95e951

jbig2dec: Always complete a page, attempting decode of problematic streams.

When JBIG2 bitstreams contain end of page segments the parser in
jbig2dec calls jbig2_complete_page() to signal that the page is
now finished.

JBIG2 bitstreams created by some producers do not contain end of
page segments but are otherwise well-formed JBIG2 bitstreams.
Embedded JBIG2 bitstreams do not have to contain end of page
segments. jbig2dec previously tried to detect these cases and
simulated an end of page segment by manually calling
jbig2_complete_page() so as to be able to output a displayable
image.

Problematic non-embedded JBIG2 bitstreams that have parse errors
before any end of page segment is reached, or bitstreams where
the end of page segment itself is broken, do not fall into either
of the categories above but may be missing end of page segments.
Previously jbig2dec treated this type of bistreams as not having
any displayable image because the pages were never finished.

To handle all types of bitstreams and attempt to output a
displayable image (possibly partial due to parse errors),
jbig2dec now always calls jbig2_complete_page() function.

jbig2dec/jbig2dec.c


2018-07-13 12:49:36 +0800
Sebastian Rasmussen <sebras@gmail.com>
2483cf3a3467068510a012dc814aa607d6c6a32f

jbig2dec: Limit scanline index in MMR coded data.

According to the T.6 specification the pixel references, e.g. a0,
may point to any of the pixels (indices 0 through N-1) on a
scanline, one pixel to the left of a scanline (index MINUS1) or
one pixel beyond the scanline (index N). These indicies are all
positive (despite its name MINUS1 is defined to UINT32_MAX).

This commit changes the index type from signed to unsigned to
reflect this. Moreover, when looking for changing elements,
make sure to limit the returned index to N.

jbig2dec/jbig2_mmr.c


2018-07-13 12:41:14 +0800
Sebastian Rasmussen <sebras@gmail.com>
e05019b96b7e038d9335e640b83db098022d1e2c

jbig2dec: Handle EOFB whether it is required or not.

Chapter 6.2.6 in the JBIG2 specification states that MMR-encoded
data _may_ skip the EOFB code when the data length is known in
advance. If the data length is _not_ known in advance EOFB is
required. Since an encoder may choose to use or skip EOFB when
the data length is known, decoders must always be prepared to
handle EOFB regardless of whether the data length is known or
unknown.

After encountering EOFB jbig2dec now stops consuming MMR-coded
data regardless of whether the data lenght is known in advance
or not. The remainder of the decoded image region is filled with
white.

jbig2dec/jbig2_mmr.c


2018-05-29 03:09:58 +0800
Sebastian Rasmussen <sebras@gmail.com>
7fade522e9e406b1faedc76e71f86951901633d2

jbig2dec: Limit image size to 2GByte and check for overflow.

The width/height fields of a JBIG2 image are limited by the
specification to UINT32_MAX. This means that the total size of
the image is limited to UINT32_MAX * UINT32_MAX pixels.

jbig2_alloc() take a size argument of type size_t, limiting
allocations to at most SIZE_MAX bytes. For 32 bit systems
SIZE_MAX == UINT32_MAX and for 64 bit systems SIZE_MAX ==
UINT64_MAX.

This means that for 32 bit systems the maximum image size is
limited to UINT32_MAX * 8 pixels. For 64 bit systems it could
conceivably be limited to UINT64_MAX * 8 pixels if all indexing
into the image buffer allocation is 64 bit safe.

However jbig2dec's indexing into the image buffer allocations is
not always 64 bit safe, so limit image allocations to the safe
choice of 2Gbyte. This equates to limiting image sizes to
INT32_MAX * 8 pixels, or a square of 131072 by 131072 pixels.

jbig2dec/jbig2_image.c


2018-06-20 01:38:41 +0800
Sebastian Rasmussen <sebras@gmail.com>
6f06c79a4f0ee664840ce7bedc35dafc921e5086

jbig2dec: Cast BMSIZE in symbol dicts to size_t.

BMSIZE is used to skip over uncompressed symbols in a symbol dictionary.
Therefore this value is inherently unsigned. Also because the value is
a multiplication of the height and stride of an image, both of which are
unsigned 32 bit numbers, rely on the size_t type which is large enough
to handle images this big.

jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_huffman.h
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-05-29 02:58:14 +0800
Sebastian Rasmussen <sebras@gmail.com>
c01e08cf984192defb63017e1a11a9f1bf05f9ef

jbig2dec: Remove denial of service check which is no longer needed.

In commit ee0bc20cc98c8e8381003a25dfa0b21e681c6545 an attempt to detect the end
of the arithmetic integer decoder bit stream is detected. Now once more error
handling has been implemented, the files from bug 694949 that caused this end of
bitstream detection code to be added no longer end in an infinite loop, but fail
with fatal errors due to other reasons.

jbig2dec/jbig2_arith.c
jbig2dec/jbig2_symbol_dict.c


2018-07-24 13:35:03 +0100
Ken Sharp <ken.sharp@artifex.com>
160431b50a3154341fa9ef1270ecb6f8ae045b4d

Fix tiffpack and tifflzw devices

Commit 0ef309305417776a9f8b8cd143fbf3c5e89456b2 moved the FillOrder
parameter into the 'generic' tiff fax device structure, and added a new
BlackIs1 parameter.

The macro FAX_DEVICE_BODY was updated to reflect this but unfortunately
two of the devices, tiffpack and tifflzw do not use the FAX_DEVICE_BODY
macro, as they need to use device-specific code for the output_page
device method.

This meant that the initialisation of these devices was incorrect and
led to failures in our automated testing.

devices/gdevtfax.c


2018-07-23 11:54:50 +0100
Chris Liddell <chris.liddell@artifex.com>
da7288fe212f24db7789f9807b9e55a0e4367b8a

gx_cpath_unshare(): zero unset entries.

gx_cpath_unshare() does not copy the clip path list, and leaves the list
structure uninitialized.

Until/Unless we implement copying the list, set the values in the list to
zero/NULL so later freeing of the unshared clip path doesn't trip up.

base/gxcpath.c
base/lib.mak


2018-07-18 16:41:17 +0100
Chris Liddell <chris.liddell@artifex.com>
954d535ee5a63ff751c1af24bbd45adefc2a078c

Bug 699542: Fix compiler/linker options for shared lib on AIX

configure.ac


2018-07-18 16:32:38 +0100
Chris Liddell <chris.liddell@artifex.com>
3afe2983e8e3c5fd9f290d7af0f7469d944a57ec

Bug 699543: handle missing isinf() and fpclassify()

Makefile.in
base/lcms2mt.mak
configure.ac
lcms2mt/src/cmsplugin.c
lcms2mt/src/lcms2_internal.h


2018-07-24 13:03:39 +0100
Ken Sharp <ken.sharp@artifex.com>
f6bcc0dfc173b80fddab4fbf10afb34332ff1112

PDF interpreter - improve handling of 'q' inside a text object

Bug #699551 "Text with rendering mode stroke is not displayed"

We already did deal with a q/Q pair inside a text object (BT/ET pair)
but a couple of points were missed. We didn't check for the existence
of a qTextSavematrix in settextstate, which meant that we didn't
set the text matrix. So vector and image marking worked, but text did
not.

We also didn't check for the existence of a qSaveTextMatrix when handling
the stroke width for a text rendering mode which involves stroking the
text.

This commit exhibits one 'progression' (ie it now matches Acrobat) in
the Quality Logice PDF 2.0 FTS files. I intend to raise this with QL as
the file is demonstrably invalid.

It also adversely impacts the performance of text in PDF files, since we
must now do additional checking on every text operation. This has pushed
a small number of our test files beyond the point where they start to
time out on our automated testing.

Resource/Init/pdf_ops.ps


2018-07-23 13:50:59 -0600
Henry Stiles <henry.stiles@artifex.com>
0ef309305417776a9f8b8cd143fbf3c5e89456b2

Bug 699425, new fax device parameters added.

Two new device parameters specify bit order and black white polarity,
these parameters are the same as found in the tiff fax devices
(gdevtfax.c)

devices/gdevfax.c
devices/gdevfax.h
devices/gdevtfax.c


2018-07-23 11:51:03 -0600
Henry Stiles <henry.stiles@artifex.com>
dca564fc2a95b6610084ad06a939367217aa78e3

Bug #699550 - Fix infinite loop processing PCL file with JPEG image.

The color depth was set to 1 instead of 8 resulting in an ouput buffer
smaller than the filter needed. Also, make sure we process the return
code from the dct stream filter correctly so an error will be handled
properly.

pcl/pxl/pximage.c


2018-07-20 10:46:59 +0100
Ken Sharp <ken.sharp@artifex.com>
285cd8f8ced5b561116190d56e14baabef740ee9

ps2write - add a check for PreserveSeparation

When we check for a /Separation with a Lab alternate, check whether we
should be preserving Separation spaces before going ahead and converting
the alternate space to the ProcessColorModel of the device.

devices/vector/gdevpdfg.c


2018-07-20 10:45:33 +0100
Ken Sharp <ken.sharp@artifex.com>
d0c058c8ef9112f6245e96e3cef81a24e7c9c103

Documentation - Documentation on PreserveSeparation for pdfwrite was missing

doc/VectorDevices.htm


2018-07-20 09:49:44 +0100
Ken Sharp <ken.sharp@artifex.com>
9e58cc8dd7e9b98620c798c901f800aff2e381ce

ps2write - improve handling of Separation colour space with Lab alternate

Bug #699535 "Separation Colors with alternate Color Lab are not converted correctly when device (e)ps2write is used"

We can't embed a Lab space in the output from ps2write with the current
colour handling. So instead spot the condition and convert the
/Separation alternate space into the underlying ProcessColorModel.

This preserves the /Separation ink, though the resulting tint transform
is less than ideal.

At the same time, make sure we don't try to handle the ICC Lab space
as if it were a device space. Instead return a rangecheck error so that
we convert the whole space into the ProcessColorModel.

devices/vector/gdevpdfc.c
devices/vector/gdevpdfg.c


2018-07-19 12:09:02 +0100
Ken Sharp <ken.sharp@artifex.com>
b44096b33d28d25c8f88c9fc2565713d85ca0614

JBIG2DEC - add declarations which are not defined in VS 2005

Like INT32_MAX and INT32_MIN, UINT32_MAX which is defined in stdint.h
is not defined for old versions of Visual Studio. Add simple definitions
in the two source files that use it, if it is not already defined.

jbig2dec/jbig2_generic.c
jbig2dec/jbig2_segment.c


2018-07-01 17:26:37 +0800
Sebastian Rasmussen <sebras@gmail.com>
e7ededef7c8b09845aedae08674519fbf50654b8

jbig2dec: Ignore extension segments that are not marked necessary.

Previously this was a fatal error, but it is better as a warning as
the extension segment has not been marked necessary as outlined in
the specification.

jbig2dec/jbig2_segment.c


2018-07-04 22:23:26 +0800
Sebastian Rasmussen <sebras@gmail.com>
a6fef0ad778e67783204f71a28119a47fe6eb7c7

jbig2dec: Improve halftoning debug message.

jbig2dec/jbig2_halftone.c


2018-07-11 02:40:57 +0800
Sebastian Rasmussen <sebras@gmail.com>
c21d7dfb8cd82f698eb93b0b122a4e01c152faad

jbig2dec: Fix composing subset of image onto destination.

jbig2dec/jbig2_image.c


2018-07-01 13:19:43 +0800
Sebastian Rasmussen <sebras@gmail.com>
f8300fe31d487088e2de195ab0bf3a5725e6806f

jbig2dec: Warn on out of range symbol IDs, but continue.

jbig2dec/jbig2_text.c


2018-07-01 13:18:48 +0800
Sebastian Rasmussen <sebras@gmail.com>
12e9787cd20407b1440edf212d8e7f1c544dc29e

jbig2dec: Use already parsed size of page association field.

jbig2dec/jbig2_segment.c


2018-07-01 13:03:01 +0800
Sebastian Rasmussen <sebras@gmail.com>
72165c941ad4c4134ca593cd744be6b1b5ac1dda

jbig2dec: Handle text regions without symbol dictionaries.

Normal text regions reference symbol dictionaries. The symbols
in those dictionaries are then referenced to by the text region
and placed somewhere on the page. In the degenerate case a text
region might not have any instances of symbols that it wants to
place on the page. If that is the case then there is no need for
the text region to refer to any symbol dictionaries (since it
doesn't need any symbols). Previously this was treated as a fatal
error, but now this just creates a warning and decoding proceeds.

jbig2dec/jbig2_text.c


2018-07-01 13:07:19 +0800
Sebastian Rasmussen <sebras@gmail.com>
de25a4676d82587b8c6d6c6aeca3785514fde1c2

jbig2dec: Attempting to compose NULL on a page is silently accepted.

jbig2dec/jbig2_image.c


2018-07-04 22:19:34 +0800
Sebastian Rasmussen <sebras@gmail.com>
b417ef1deee793f93cc0643e3eccc4a8fea6cf3d

jbig2dec: Make local functions static.

jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_halftone.h


2018-06-29 01:54:15 +0800
Sebastian Rasmussen <sebras@gmail.com>
5158b558038c939c287d3a1194412134a5dc1134

jbig2dec: Handling missing OOB at end of height class.

jbig2dec/jbig2_symbol_dict.c


2018-06-24 16:00:30 +0800
Sebastian Rasmussen <sebras@gmail.com>
fb8347da8e388793a4add8442931dbd5033fce41

jbig2dec: Handle immediate generic regions with unknown height.

jbig2dec/jbig2.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_segment.h


2018-06-27 02:13:04 +0800
Sebastian Rasmussen <sebras@gmail.com>
29371c6872f9b72e3810d76bd920f41619924fa7

jbig2dec: Print segment number in messages when available.

jbig2dec/jbig2.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c


2018-06-22 21:16:24 +0800
Tor Andersson <tor.andersson@artifex.com>
d469fa3d995c8593680c2425f9c2c5a7a231bac7

jbig2dec: Avoid accessing bytes outside of MMR decoder line.

Previously the file Bug688080.pdf in bug 693798 e.g. has an object 668
containing a JBIG2 bitstream containing an MMR-coded region where the
width of the region is 32 pixels. At one point while decoding this
image, a0 is in the middle of the line and because of the decoded black
and white runs both a1 and a2 end up at the pixel just beyond the end
of the line. At this point jbig2dec would access the byte supposedly
containing this pixel beyond the end of the line, but that is not
allowed. Because this byte was written back unchanged no real harm was
done, but the access was still being performed, triggering software
like valgrind/ASAN that detects buffer overflows.

This commit also reverts the incorrect fix for bug 693798
introduced in commit 46d6b40803cb7a68ceb06b2f71db8cf3f384c2ee
where the allocated image buffer was simply extended by one byte,
thereby accommodating the illegal access.

jbig2dec/jbig2_image.c
jbig2dec/jbig2_mmr.c


2018-07-14 18:19:47 +0800
Sebastian Rasmussen <sebras@gmail.com>
dfa5b1b784b9c575cb9d797248e282871d24625c

jbig2dec: Untie fix for Visual Studio from Microsoft's compiler.

The i32 suffix is specific for MSVC, but can be avoided.
gssprintf.c for APR_INT32_MAX and APR_INT32_MIN also leaves out
the suffix out. This is legal because the default integer literal
size is large enough to fit 32 bit signed integers.

jbig2dec/jbig2_arith_int.c


2018-07-14 10:31:08 +0100
Ken Sharp <ken.sharp@artifex.com>
29363ac25e7f8796e4cd09a7a88b3b1104191519

Jbig2dec - Fix compile error on old version of Visual Studio

A recent change uses INT32_MAX and INT32_MIN, but these are not defined
in old versions of Visual Studio (not C99 probably).

This commit works around the problem by including two simple #defines
if the values are undefined.

Sebastian may want to alter this.

jbig2dec/jbig2_arith_int.c


2018-06-10 16:36:21 +0800
Sebastian Rasmussen <sebras@gmail.com>
c7bd3bb9fc9d008ab9d70f4d762be95d3f33cb0c

jbig2dec: Plug context leak upon errors.

E.g. failing to complete a page previously caused a context leak.

jbig2dec/jbig2dec.c


2018-06-10 21:29:31 +0800
Sebastian Rasmussen <sebras@gmail.com>
d06d19b3cfda9a563ffa09e4aa58322774d751fb

jbig2dec: Free huffman tables upon symbol dictionary parse errors.

jbig2dec/jbig2_symbol_dict.c


2018-06-10 21:14:48 +0800
Sebastian Rasmussen <sebras@gmail.com>
afed61efb38bed3a5580ee0e458b8c6946ee49f5

jbig2dec: Free symbol images upon text region parse error.

The symbol images were previously not freed upon errors.

jbig2dec/jbig2_text.c


2018-06-19 23:16:17 +0800
Sebastian Rasmussen <sebras@gmail.com>
314fb613ca8fa3028e33627bbb3fa484d4da1e13

jbig2dec: Remove untested, incomplete metadata handling.

base/jbig2.mak
jbig2dec/Makefile.am
jbig2dec/Makefile.unix
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_metadata.h
jbig2dec/jbig2_segment.c
jbig2dec/msvc.mak
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-06-19 01:31:14 +0800
Sebastian Rasmussen <sebras@gmail.com>
3835fcfe6d3894e03a68c66bd211c7a739007b5d

jbig2dec: Limit EXRUNLENGTH according to symbol dictionary header.

jbig2dec/jbig2_symbol_dict.c


2018-06-19 01:30:34 +0800
Sebastian Rasmussen <sebras@gmail.com>
22e702351066d38c30d2bf695140f8fe6719c3f3

jbig2dec: Remove unnecessary limitation of EXRUNLENGTH.

Due to missing boundary checks in other code bug 693285 was resolved
by limiting the number of times EXRUNLENGTH may be zero. This limit
is actually not according to the specification. Now that the missing
boundary checks have been introduced the limitation may be removed.

jbig2dec/jbig2_symbol_dict.c


2018-06-18 19:04:38 +0800
Sebastian Rasmussen <sebras@gmail.com>
be27bd6685b714e1deca80d580d3ff9dc82f78dc

jbig2dec: Make private function static.

jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_metadata.h


2018-05-30 15:31:10 +0800
Sebastian Rasmussen <sebras@gmail.com>
79eee7b35a6070cacfe94343d01e9e1b7ebb1191

jbig2dec: Return NULL upon error, avoid returning variable.

This makes it clearer what is being returned upon error.

jbig2dec/jbig2.c
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_segment.c


2018-06-01 14:33:11 -0700
Sebastian Rasmussen <sebras@gmail.com>
a97b724a6639e710cb4626ba53be2f86b1ebd5ba

jbig2dec: Make sure to print fatal error upon detected error.

jbig2dec/jbig2_huffman.c


2018-06-01 16:56:39 -0700
Sebastian Rasmussen <sebras@gmail.com>
8ea06bef59929bbaa0450a94ab9586dd154657e8

jbig2dec: Make sure to return fatal/warnings when propagating error.

jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-05-30 17:30:37 +0800
Sebastian Rasmussen <sebras@gmail.com>
443588c95d5776f141940d57aee2b3a0a21b668f

jbig2dec: Change types to match those of the parsed data.

jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c


2018-06-21 00:30:02 +0800
Sebastian Rasmussen <sebras@gmail.com>
0188d0818b6f5b25aefdbafefa46d2845a21da9b

jbig2dec: Keep track of previous lines in generic region decoding.

This avoids issues with negative array indices.

jbig2dec/jbig2_generic.c


2018-05-30 14:26:16 +0800
Sebastian Rasmussen <sebras@gmail.com>
7352f5a01fd2e0a1f221d25cbf35fe088226232e

jbig2dec: No need to check for NULL in huff_get_next_word, use macro instead.

jbig2dec/jbig2_huffman.c


2018-05-27 02:49:49 +0800
Sebastian Rasmussen <sebras@gmail.com>
6da6f365a8c93128fcd67938ed3f5ef362c77630

jbig2dec: Label everything not yet implemented NYI.

jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_segment.c


2018-05-27 02:48:56 +0800
Sebastian Rasmussen <sebras@gmail.com>
67c937009233f4496b8ece8270c10c4021785752

jbig2dec: Validate ASCII characters in metadata comments.

jbig2dec/jbig2_metadata.c


2018-05-27 00:33:45 +0800
Sebastian Rasmussen <sebras@gmail.com>
5c8a10f2e936b990fa3340650849186e92f1ecfd

jbig2dec: Implement support for profile segment.

The information in the profile segment is simply printed
as informational messages via jbig2_error().

jbig2dec/jbig2_segment.c


2018-04-24 21:43:48 +0800
Sebastian Rasmussen <sebras@gmail.com>
46f4acd48c81fa0db76f26c40b2e76c0fe7d7842

jbig2dec: Implement support for outputting multipage PBM files.

jbig2dec/jbig2dec.c


2018-04-25 02:47:39 +0800
Sebastian Rasmussen <sebras@gmail.com>
540f6a2f1c7f98b29b60a6e666623caec8dc8983

jbig2dec: Share arithmetic/huffman decoding contexts/tables.

Previously text regions had their own arithmetic/huffman
decoding contexts/tables, separate from those used to decode
fields in the symbol dictionary itself. This is incorrect.

Annex E.3.7 describes how to reset the arithmetic coding
contexts. Only the top-level symbol dictionary decoding
procedure described in chapter 7.4.2.2 references this
annex.

Neither the symbol dictionary decoding procedure outlined
in chapter 6.5 in the specification, nor chapter 6.5.8
describing how to decode the symbol bitmap itself (and
thereby implicitly chapter 6.2 describing the generic
region decoding procedure, 6.4 explaining the text
region decoding procedure and 6.5.8.2.2 describing how to
decode bitmaps with only one symbol in the
refinement/aggregate coding) refer to annex E.3.7.

It is therefore incorrect to separate the arithmetic
integer decoding contexts from the ones used to parse
the symbol dictionary fields as the specification calls
for these to be reused.

This created a problem when decoding page 3 in the sample
bitstream in Annex H.1. More specifically in Annex H.1,
step 37 (f) xi E where the refinement flag was decoded as
3 instead of the expected 0. This was because the IAID
arithmetic coding context used in step 37 (f) xi D had
not been shared with that in step 37 (f) v as is expected
in the specification. The result was that page 3 of the
sample bitstream was never decoded. Potentially this may
also have affected other JBIG2 bitstreams.

Sharing the arithmetic coding contexts between the symbol
dictionary decoding procedure and the text region decoder
resolves the issue

jbig2dec/jbig2_symbol_dict.c


2018-06-18 18:48:49 +0800
Sebastian Rasmussen <sebras@gmail.com>
d7b659b9853059ddd1d5ecaab79de16a7f675b32

jbig2dec: Handle very large symbol code lengths without overflowing.

jbig2dec/jbig2_symbol_dict.c


2018-04-25 02:33:52 +0800
Sebastian Rasmussen <sebras@gmail.com>
62df49ab137726635c9f3d2f76c0b599d733e8b5

jbig2dec: Reorder test for huffman decoding vs arithmetic integer decoding.

jbig2dec/jbig2_symbol_dict.c


2018-04-25 02:27:59 +0800
Sebastian Rasmussen <sebras@gmail.com>
fdf1504cb5dfbe77b0458ccad025fc992df77ad8

jbig2dec: Move text region decoder parameters initialization.

Previously the text region decoder parameters were only initialized
once a text region was about to be decoded. Now they are initialized
at the beginning of the decoding of the symbol dictionary. This
prepares for sharing of the IAID, IARDX and IARDY arithmetic
integer decoder contexts as well as the SBHUFFRDX, SBHUFFRDY and
SBHUFFRSIZE huffman tables between the text region decoder and the
symbol dictionary parser itself.

jbig2dec/jbig2_symbol_dict.c


2018-04-25 02:16:29 +0800
Sebastian Rasmussen <sebras@gmail.com>
e32e214b5de77ca1b658e46ae8d7cc6cabfb9d62

jbig2dec: Simplify cleanup when parsing symbol dictionary.

In the process move all cleanup, including any intermediate
images to the cleanup section towards the end of the symbol
decoding function.

jbig2dec/jbig2_symbol_dict.c


2018-04-25 02:11:00 +0800
Sebastian Rasmussen <sebras@gmail.com>
94a5d891cb5cf495b4d2bb8460b293b39e1603ce

jbig2dec: Initialize huffman table for size of symbols refinement data.

Previously this was uninitialized, possibly leading to dereferencing
an uninitialized table pointer.

jbig2dec/jbig2_symbol_dict.c


2018-04-25 01:57:52 +0800
Sebastian Rasmussen <sebras@gmail.com>
a27e623cac13c67926c42222589ff87f76f369dc

jbig2dec: Let symbol refinement Y offset use its own huffman table.

Previously both the symbol instances refinement X and Y offset reused
the same table SBHUFFRDX, but according to 6.4.11.3 and 6.4.11.4 in
the specification they ought to be using the independent SBHUFFRDX
and SBHUFFRDY tables. Let's make it so.

jbig2dec/jbig2_symbol_dict.c


2018-04-25 01:50:07 +0800
Sebastian Rasmussen <sebras@gmail.com>
721338e0846bc0e50cf4528ba6b0d54b1a577db4

jbig2dec: Remember to put all new symbols into ref/agg dictionary.

Previously the symbol dictionary propagated to the text region
decoder for a refinement/aggregate coded symbol did not contain
all necessary symbols. Only the symbols in the symbol dictionaries
referred to (SDINSYMS) by the currently parsed symbol dictionary
would be propagated into the text region decoder (SBSYMS).

Table 17 in the specification states that SBSYMS should be set
according to 6.5.8.2.4 which clearly states that SDINSYMS as well
as any symbols decoded up to that point (NSYMSDECODED symbols in
SDNEWSYMS) ought to be introduced into the dictionary that is
propagated to the text region decoder (SBSYMS). This is now done
by providing the text region decoder not just with a single symbol
dictionary, but both with SDINSYMS and SDNEWSYMS allowing the
decoder to refer to symbols from both.

jbig2dec/jbig2_symbol_dict.c


2018-04-24 22:32:16 +0800
Sebastian Rasmussen <sebras@gmail.com>
9eab580c634eb61d9340ebc40f4c40174ed226c5

jbig2dec: Paper over the fact that VS 2010 and earlier may not have SIZE_MAX.

jbig2dec/config_win32.h


2018-04-20 02:33:31 +0800
Sebastian Rasmussen <sebras@gmail.com>
0ee7f3b1c19f6d777eaf6bdf2b8ea8d241bf49d4

jbig2dec: Check for T.88 amendments 2/3 bitstreams.

T.88 Amendment 2 adds up to 12 adaptive template pixels in generic regions.
T.88 Amendment 3 adds support for generic/text regions to encode colors.
Neither amendment is implemented and no sample files have been found.
Return fatal errors for such bitstreams/files for the time being.

jbig2dec/jbig2.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_text.c


2018-04-24 13:39:07 +0800
Sebastian Rasmussen <sebras@gmail.com>
b200c6e476d00e760100b0b3e23f6e57f0794969

jbig2dec: Handle under-/overflow in arithmetic integer decoder.

jbig2dec/jbig2_arith_int.c


2018-04-24 13:54:47 +0800
Sebastian Rasmussen <sebras@gmail.com>
d73eadc850bd8b4f3bd26a70d7916de9f5c824c8

jbig2dec: Rename variables to closely follow the specification.

jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_refinement.h
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-04-24 04:01:13 +0800
Sebastian Rasmussen <sebras@gmail.com>
f135d8f51b7a3da455c6cd4ccd88c5f6ab7f930b

jbig2dec: Implement support for resizing image width.

jbig2dec/jbig2_image.c


2018-04-24 03:48:35 +0800
Sebastian Rasmussen <sebras@gmail.com>
fe83cea1333445c0273e45003d6eeb172bc82e0e

jbig2dec: When extending image use default page color.

jbig2dec/jbig2_image.c
jbig2dec/jbig2_image.h
jbig2dec/jbig2_page.c


2018-04-24 03:40:06 +0800
Sebastian Rasmussen <sebras@gmail.com>
95df4340d0d65c1f5f180d31a93e8806ddb345dd

jbig2dec: Clarify lack of support for dependency bit.

The extension segment dependency bit only matters for
encoders. This is because it informs the encoder what
other segments a specific segment depends on. Since
jbig2dec doesn't do any alteration of segments this
need not be supported (or indeed even parsed).

jbig2dec/jbig2_segment.c


2018-04-24 23:57:18 +0800
Sebastian Rasmussen <sebras@gmail.com>
edb5c4000cc7e38c1f9f5e93243ab1737e13aeee

jbig2dec: Move arithmetic decoder test logging inside test.

Also take the opportunity to make the test stream static.

jbig2dec/jbig2_arith.c


2018-04-24 04:51:31 +0800
Sebastian Rasmussen <sebras@gmail.com>
3a2b2f13a26355a0ca7dc58d7c28276df3d7b786

jbig2dec: Enable both huffman tests when running check.

jbig2dec/jbig2_huffman.c


2018-04-23 14:02:46 +0800
Sebastian Rasmussen <sebras@gmail.com>
db1efdfb5f194079070bfd1ab50ae11e881de50d

jbig2dec: Handle get_next_word() returning error/less than a word.

This includes propagating the error handling to all callers.

jbig2dec/jbig2_arith.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_huffman.h
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-04-24 20:05:39 +0800
Sebastian Rasmussen <sebras@gmail.com>
968c424a70471c086466568bee21097e89149663

jbig2dec: free/release functions must handle NULL argument.

jbig2dec/jbig2.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_image.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c


2018-04-11 00:02:39 +0800
Sebastian Rasmussen <sebras@gmail.com>
a21e4d7cf5b7928c490a2f804dfc01fc66069e35

jbig2dec: Implement pixel out of field test for refinement regions too.

jbig2dec/jbig2_refinement.c


2018-04-21 23:36:54 +0800
Sebastian Rasmussen <sebras@gmail.com>
01ae24d85f67b3c1b11993f1644a71da643ecc9b

jbig2dec: Differentiate error messages in generic region decoder.

This makes it easier to know from where the error message originated.

jbig2dec/jbig2_generic.c


2018-04-22 01:45:15 +0800
Sebastian Rasmussen <sebras@gmail.com>
f920a1839a66b844651b2ff5524944b0dd9484cf

jbig2dec: Fix and use decoder for template 3 generic regions.

Previously an optimized implementation for template generic
regions was commented out, presumably because it was faulty,
but now once the implementation is fixed it may be used.

The PDF in bug 693617 has an object 25 that contains a JBIG2
bitstream that can use this fix optimized decoder. Without
the fix in the optimized decoder the rendered output image
is incorrect.

jbig2dec/jbig2_generic.c


2018-04-23 01:25:34 +0800
Sebastian Rasmussen <sebras@gmail.com>
8e1b5e97f0950a47be4094028cf242a2b2861a07

jbig2dec: Handle non-nominal adaptive pixel locations in template 2.

Optimized generic region decoders can only handle nominal
adaptive pixel locations, while the unoptimized generic region
decoders can handle them being located at any location.

Previously the optimized decode was always used regardless of the
locations of the adaptive pixels, possibly causing decoding
issues. Now an unoptimized decoder is added for template 2 and is
being used whenever the adaptive pixel locations are at non-nominal
locations.

jbig2dec/jbig2_generic.c


2018-04-23 01:28:14 +0800
Sebastian Rasmussen <sebras@gmail.com>
c389757b311d9e01cf98cfb5d56c500929e28c43

jbig2dec: Handle non-nominal adaptive pixel locations in template 1.

Optimized generic region decoders can only handle nominal
adaptive pixel locations, while the unoptimized generic region
decoders can handle them being located at any location.

Previously the optimized decode was always used regardless of the
locations of the adaptive pixels, possibly causing decoding
issues. Now an unoptimized decoder is added for template 1 and is
being used whenever the adaptive pixel locations are at non-nominal
locations.

jbig2dec/jbig2_generic.c


2018-04-09 22:25:34 +0800
Sebastian Rasmussen <sebras@gmail.com>
d522f9a9815dce16977f7a9e9715e861cab76a55

jbig2dec: Fix incorrect adaptive pixel location check.

Previously for the adaptive pixel template 2 the check for the
location of the adaptive pixel was wrong. Because generic regions
with nominal locations are more common this lead to the
unoptimized decoder being used. Only a few images where the
adaptive pixel location happened to be at this wrong location
used the optimized decoder, and presumably were decoded
incorrectly. This incorrect location check therefore hid the bug
in the optimized generic region decoder concerning what pixels
are included at what location in the arithmetic integer context.

Now the adaptive pixel location check is corrected as well as the
bug in the optimized generic region decoder itself.

jbig2dec/jbig2_generic.c


2018-05-24 03:27:21 +0800
Sebastian Rasmussen <sebras@gmail.com>
18a051f2f422f9d336e1d6a28f990068faaf2abc

jbig2dec: Differentiate between errors/OOB when decoding BMSIZE.

Previously the two very lumped together, causing a single error message.

jbig2dec/jbig2_symbol_dict.c


2018-04-24 13:39:46 +0800
Sebastian Rasmussen <sebras@gmail.com>
851e3885386f992af8e73ba90c8b8fcf5a6cb69a

jbig2dec: Print errors when out of boundary values occur.

According to the specification in 6.4.5 when decoding text
regions, where OOB values in IDS indicate that the last symbol
in a strip has been decoded, or in 6.5.5 when decoding symbol
dictionaries, where OOB values in DW indicate that all the
symbols in a height class have been decoded. When decoding any
other symbols than IDS or DW, OOB values are not expected, so
report these as fatal errors.

jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-04-25 02:08:40 +0800
Sebastian Rasmussen <sebras@gmail.com>
6f4075cae5c70e5f766a79d011624326c4bf5185

jbig2dec: Check if all arithmetic decoder contexts are initialized.

Previously the IADT and IARI contexts were never checked for having
been successfully initialized, possibly causing uninitialized data
issues later.

jbig2dec/jbig2_symbol_dict.c


2018-05-24 03:28:04 +0800
Sebastian Rasmussen <sebras@gmail.com>
7241bffe648d3f75cd03bbaa404fc927163e6215

jbig2dec: Skip over undecoded pages when getting pages.

jbig2dec/jbig2_page.c


2018-05-24 03:23:25 +0800
Sebastian Rasmussen <sebras@gmail.com>
7b68d2964935c40fe8f58a9540c5765fb2f53f0f

jbig2dec: Detect NULL image pointer before trying to take reference.

Attempting to take a reference to NULL is a no-op anyway.

jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_text.c


2018-06-01 10:36:53 -0700
Sebastian Rasmussen <sebras@gmail.com>
f8f900369183f908fb8e8796154e2c7b57fbd202

jbig2dec: Rename jbig2_image_clone() to jbig2_image_reference().

This more accurately explains what the function does, and
mirrors jbig2_image_release() quite well.

jbig2dec/jbig2_image.c
jbig2dec/jbig2_image.h
jbig2dec/jbig2_page.c
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-05-24 03:24:33 +0800
Sebastian Rasmussen <sebras@gmail.com>
c3707893650d631dfcc4ca5a99b2eb28f7108fd9

jbig2dec: Refinement bitmaps without images should be treated as fatal errors.

jbig2dec/jbig2_refinement.c


2018-05-23 23:12:16 +0800
Sebastian Rasmussen <sebras@gmail.com>
dc80246ab0a08f3c946d43d930c772dedb8b7bf4

jbig2dec: Report warnings if called functions indicate errors.

The first error detected ought to be a fatal error, but when this
error condition is propagated to callers, they should indicate warnings.

jbig2dec/jbig2.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-05-27 02:51:10 +0800
Sebastian Rasmussen <sebras@gmail.com>
689fa69bfd6c423194e58f22835836870cb519b5

jbig2dec: Unsupported intermediate generic region is now a fatal error.

jbig2dec/jbig2_segment.c


2018-05-27 02:50:32 +0800
Sebastian Rasmussen <sebras@gmail.com>
f394d8e7b5588bed1c2265136da0bcb2502507fb

jbig2dec: Halftone regions with skip enabled is now a fatal error.

jbig2dec/jbig2_halftone.c


2018-05-24 03:20:52 +0800
Sebastian Rasmussen <sebras@gmail.com>
de4b96e07690cde1999554b1413d79f20d1e8523

jbig2dec: Detected errors should be fatal, not warnings.

jbig2dec/jbig2_generic.c
jbig2dec/jbig2_metadata.c


2018-05-23 21:48:31 +0800
Sebastian Rasmussen <sebras@gmail.com>
d175962540cd0ff2b6dcec2a13bf61a17df93741

jbig2dec: Remember to free IAID context upon error.

Previously this might result in a memory leak.

jbig2dec/jbig2_arith_iaid.c


2018-05-24 00:52:15 +0800
Sebastian Rasmussen <sebras@gmail.com>
e32e5535ca5055e31417d022753eed67a30d482e

jbig2dec: Free referred to symbol dictionary upon error.

jbig2dec/jbig2_symbol_dict.c


2018-05-24 03:26:43 +0800
Sebastian Rasmussen <sebras@gmail.com>
fc4940d6aabebd6516befefc0b51676ccc332a7f

jbig2dec: Pages without decoded images cannot be completed.

jbig2dec/jbig2_page.c


2018-05-24 00:51:20 +0800
Sebastian Rasmussen <sebras@gmail.com>
e4e1e6ac335eaccd92eff57308e173ac67a392f0

jbig2dec: When a page fails to complete, handle as an error.

Previously this only caused a warning message but didn't fail,
but failing to complete a page means the parsing is somehow broken,
and so it ought to be best to treat it as a fatal error.

jbig2dec/jbig2dec.c


2018-05-24 00:33:18 +0800
Sebastian Rasmussen <sebras@gmail.com>
3da06c6284e3370f31382299eddf7c76f11960cd

jbig2dec: Releasing a page cannot not fail.

It can only fail if you supply a random page pointer.
Don't do that it would be a programming error.

jbig2dec/jbig2.h
jbig2dec/jbig2_page.c


2018-05-23 23:21:27 +0800
Sebastian Rasmussen <sebras@gmail.com>
451ee5588ec2616afc21ae9ccc61c2afb8144bf7

jbig2dec: Directly return jbig2_error(FATAL); they indicate errors.

Because jbig2_error(ctx, JBIG2_SEVERITY_FATAL, ...) returns -1,
it can be immediately returned or assigned as a return code.

jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_text.c


2018-05-23 23:12:43 +0800
Sebastian Rasmussen <sebras@gmail.com>
1e751b882e18fee36a16488e7b46c0e1b571d605

jbig2dec: Return jbig2_error(WARNING); they indicate errors.

Because jbig2_error(ctx, JBIG2_SEVERITY_WARNING, ...) now returns -1,
it can be immediately returned or assigned as a return code.

jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-05-24 01:24:32 +0800
Sebastian Rasmussen <sebras@gmail.com>
c159c4534b9b9af4998d6dcdee896fe2197fa542

jbig2dec: Convert debug messages in debug code to warnings.

This is because the debug code calls functions that write
PBM images or similar, these may fail and when this happens
the calling function ought to print a warning and fail itself.

jbig2dec/jbig2_page.c
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_symbol_dict.c


2018-05-23 00:22:41 +0800
Sebastian Rasmussen <sebras@gmail.com>
a8b6f19d5f5e7af568c448421c24bbe200ea9c89

jbig2dec: Error callback should not modify jbig2_error() return code.

If a function detects an error it should call
jbig2_error(ctx, JBIG2_SEVERITY_FATAL, ...) and return -1. The caller
of this function may then detect the return code indicating error
and call jbig2_error(ctx, JBIG2_SEVERITY_WARNING, ...). Previously
this latter call to jbig2_error() would not return -1, but it is good
form for the calling function to fail and return -1 to the next caller.
Therefore the error callback no longer has the option to override the
return code from jbig2_error(), instead jbig2_error() always returns -1.

base/sjbig2.c
jbig2dec/jbig2.c
jbig2dec/jbig2.h
jbig2dec/jbig2dec.c


2018-05-23 02:00:49 +0800
Sebastian Rasmussen <sebras@gmail.com>
2c743c193e1812795c9c23a8c6cc9d69d2a47eb5

jbig2dec: Only return jbig2_error() for fatal errors/warnings.

Only calls to jbig2_error() using fatal errors or warnings may
return, no calls to jbig2_error() using informational or debug
messages may return. This is preparation for jbig2_error() to
always return -1 for errors/warnings.

jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c


2018-04-06 23:43:51 +0800
Sebastian Rasmussen <sebras@gmail.com>
be59a40717ec60a5a054ccf88f7064c90788aa78

jbig2dec: Add support to process embedded JBIG2 bitstreams.

This type of stream is present in PDF files which is a good source
of test streams for jbig2dec.

jbig2dec/jbig2dec.c


2018-04-24 04:19:31 +0800
Sebastian Rasmussen <sebras@gmail.com>
d7f529ac50d61a1fe07eb1a667322234402e9894

jbig2dec: Remove check for bitmap coding context use.

The removed check used bitmask 0x80 to check for the flag
"bitmap coding context used" among the symbol dictionary flags.
The correct bitmask is 0x100, which was already checked for
later in the code, rendering this incorrect check unnecessary.

jbig2dec/jbig2_symbol_dict.c


2018-04-22 16:11:32 +0800
Sebastian Rasmussen <sebras@gmail.com>
22fbf1bb62b49316452c7556399618399c463039

jbig2dec: Return error code from get_next_word().

Previously Jbig2WordStream's get_next_word() callback
sometimes returned error codes. This contradicted the
declaration of the callback. However indicating errors
and the number of bytes returned upon successful calls
is a good idea. The declaration and all implementations
of the callback have been adjusted accordingly.

This means that jbig2dec now compiles without warnings.

jbig2dec/jbig2.c
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_priv.h


2018-04-25 05:01:41 +0800
Sebastian Rasmussen <sebras@gmail.com>
ef05820d514fd6a27d1b7690df16b63f8b20cf26

jbig2dec: Indicate success when using arithmetic decoder.

Commit 2b2dcf4ccf401ed210f03c858b304994749fd2b3 accidentally
forgot to set the out parameter to indicate success when the
call was indeed successful.

jbig2dec/jbig2_arith.c


2018-05-23 20:05:20 +0800
Sebastian Rasmussen <sebras@gmail.com>
359a15e1c8b460268ff80fb8e8a5da121fcbafc3

jbig2dec: Avoid NULL-check before jbig2_free()/jbig2_image_release().

jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c


2018-05-23 00:04:55 +0800
Sebastian Rasmussen <sebras@gmail.com>
b9f15473bdd8f48b9336b67d15dc08a6f78f750b

jbig2dec: Move declarations from jbig2_priv.h to their respective headers.

Due to this some .c-files now need new includes.

jbig2dec/jbig2.c
jbig2dec/jbig2.h
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_generic.h
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_halftone.h
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_image.h
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c
jbig2dec/jbig2_text.h


2018-05-26 19:12:28 +0800
Sebastian Rasmussen <sebras@gmail.com>
c6d6efdc340e0cac31cda1bbb654bcbfcda92b47

jbig2dec: Create jbig2_segment.h with segment declarations.

jbig2dec/jbig2.c
jbig2dec/jbig2.h
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_segment.h
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-05-26 15:00:00 +0800
Sebastian Rasmussen <sebras@gmail.com>
624bc3cc86c95bc6215d02d6bf39ff694e2c2a9d

jbig2dec: Create jbig2_refinement.h with refinement declarations.

jbig2dec/jbig2_generic.h
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_refinement.h
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-05-26 14:51:42 +0800
Sebastian Rasmussen <sebras@gmail.com>
8f4288807d659f72734d41dd8b7d434b1e15dfc2

jbig2dec: Create jbig2_page.h with page declarations.

jbig2dec/jbig2.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_page.h
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_text.c


2018-05-26 15:12:54 +0800
Sebastian Rasmussen <sebras@gmail.com>
55925ee6220fe371b1fe34fdc27cfd4dad8847b2

jbig2dec: Create jbig2_image_rw.h with image reading/writing declarations.

jbig2dec/jbig2_image.h
jbig2dec/jbig2_image_pbm.c
jbig2dec/jbig2_image_rw.h
jbig2dec/jbig2dec.c
jbig2dec/pbm2png.c


2018-05-26 15:01:37 +0800
Sebastian Rasmussen <sebras@gmail.com>
f7d2387f73488a24db04b22884d1e2c7bb83a857

jbig2dec: Remove non-existing function from header.

jbig2dec/jbig2_priv.h


2018-05-24 23:54:54 +0800
Sebastian Rasmussen <sebras@gmail.com>
cbb2072c14305de22f2334acf44a080933f26e21

jbig2dec: Add include guards to all headers.

jbig2dec/jbig2_arith.h
jbig2dec/jbig2_arith_iaid.h
jbig2dec/jbig2_arith_int.h
jbig2dec/jbig2_generic.h
jbig2dec/jbig2_huffman.h
jbig2dec/jbig2_hufftab.h
jbig2dec/jbig2_mmr.h
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_symbol_dict.h
jbig2dec/jbig2_text.h


2018-05-24 03:18:04 +0800
Sebastian Rasmussen <sebras@gmail.com>
6cc76f397ff5af382e4e49914d1b42df3e0a78e4

jbig2dec: Rephrase error messages.

jbig2dec/jbig2.c
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_image.c
jbig2dec/jbig2_image_png.c
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-05-24 02:05:36 +0800
Sebastian Rasmussen <sebras@gmail.com>
344a90c91dc03e9ae80500303e67594f175374e3

jbig2dec: Remove unnecessary scoping.

jbig2dec/jbig2_refinement.c


2018-04-25 00:50:12 +0800
Sebastian Rasmussen <sebras@gmail.com>
120732b27011a1651ebfcf50536cac953c7b4c9b

jbig2dec: Remove many unnecessary parentheses.

jbig2dec/jbig2_page.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-04-22 23:08:49 +0800
Sebastian Rasmussen <sebras@gmail.com>
b3d2e786ace758422cdeb22c1cc688bb52087ddf

jbig2dec: Remove unnecessary comments, whitespace and unused code.

jbig2dec/jbig2.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_image.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c
jbig2dec/jbig2dec.c


2018-05-08 22:35:11 +0800
Sebastian Rasmussen <sebras@gmail.com>
def343c44322ebdf609d0113884385d944dc361a

jbig2dec: Fix typos in error messages and comments.

jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2dec.1


2018-05-26 15:46:16 +0800
Sebastian Rasmussen <sebras@gmail.com>
a4ebc6d3cd3e2fcab8b3e9b7bcb7364c14f09d8d

jbig2dec: Reindent sources in the same way as before.

Accept some whitespace changes as done by the commands
from commit d3d767d9b91ae7d82c261fbdfd735f3042161032.

jbig2dec/jbig2.c
jbig2dec/jbig2_arith.h
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_image.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2dec.c


2018-07-12 16:35:12 +0100
Ken Sharp <ken.sharp@artifex.com>
bc6af8da1adc9b4939e3acbfc4194a143412af3c

Fix an error in the type 3 stitching function monotonic detection

Bug #699528 "A rare edge condition can cause a function to incorrectly signal a rangecheck error"

This is rather difficult to describe. The problem occurs when we try to
check for monotonicity of a stitching function between two data points
of the parametric variable.

We actually calculate a series of points between the two values and
check to see that they all increase (or decrease). However, a stitching
function can contain multiple functions, and so we break the range of
values into groups at the limits of each function and check each
group of values.

If the lower value of the parameteric variable is 'close' to the upper
bound of the current function, we decide to 'punt' it up to the next
function, presumably to avoid the overhead of a miniscule break. That is
we simply don't bother calculating tiny amounts at the end of a function
we just do the next function.

However, if the upper range of the parametric variable happened also
to lie close to (but less than) the upper bound of the function, then
when we used it to evaluate the next function in the array, it would lie
below the bottom bound of that function, resulting in a rangecheck error.

This commit applies two fixes; firstly, if the upper and lower values
of the parametric variable are the same then this is a point, and there
is no point in checking it, so just jump straight out.

Secondly, the upper value is now promoted to the lower bound of the
current function if it is less than that. This prevents us trying to
use an out of bound value, in case we should somehow get both an upper
*and* a lower bound which lie within the 'noise' threshold.

Because the range of 'noise' is so small (the bounds values of the
function divided by 1 million) there is no practical likelihood of
us missing a function which is not monotonic between those data
points.

base/gsfunc3.c


2015-03-19 11:33:51 +0000
Tim Waugh <twaugh@redhat.com>
00c14a25c0f0d5e5e65d2d489045e566ccf436df

bug #695876: check that page margins don't overlap in cups driver.

cups/gdevcups.c


2018-07-10 09:51:37 +0100
Ken Sharp <ken.sharp@artifex.com>
87cfc860ea49a4a39c1198b419a019ed598416f0

PDF interpreter improve handling of PageLabels as pdfmark

Patch supplied by Leon Bottou, see Bug #696568. This improves the way
the code handles the number tree when converting it to pdfmark
operations.

I don't have any reasonable way to test this, as it relies on using a
device which implements pdfmark, but doesn't implement WantsPageLabels
(to avoid getting the number tree passed).

Resource/Init/pdf_base.ps
Resource/Init/pdf_main.ps


2018-07-10 08:50:11 +0100
Ken Sharp <ken.sharp@artifex.com>
ac9f8412e8c35edd7c0bbbbcd1c7195a56bc15d8

PDF interpreter - fix new PageLabels processing for non-pdfwrite case

The commit to treat PageLabels as pdfmark operations instead of using
our internal code had a logical error when *not* using pdfwrite.

Committed verbatim as there's no simple way to test this case.

Resource/Init/pdf_main.ps


2018-07-09 09:24:27 -0700
Nancy Durgin <nancy.durgin@artifex.com>
d45ebe705de7b7618ad0d0d20fc31a960c8d9ba2

Bug 690339 - use free/alloc instead of resize when change frame buffer size

In gdev_prn_allocate(), when size of frame buffer changed, we used to call
call gs_resize_object(). Now we call gs_free_object() followed by
gs_alloc_bytes().

Two advantages -- avoids copying the old frame buffer to the new one
(which was pointless) and now the old buffer and new buffer don't need
to coexist, which could help on a low memory system.

base/gdevprn.c


2018-07-09 16:49:38 +0100
Ken Sharp <ken.sharp@artifex.com>
9d168db605fba44e6238d53d8c29f5997760d2ca

device subclassing of patterns, use the correct memory structure

Spotted by Chris while looking at a customer problem, the customer's
code allocs a new pattern accumulator using the device's memory, but it
should really be using the current VM state of the interpreter.

The reason it didn't was because that information wasn't available at
the point where the allocation is made. This commit adds the current
interpreter VM mode to the 'param' structure, which enables us to pass
it to th device, and have the device use it properly.

base/gxdevsop.h
psi/zpcolor.c


2018-07-09 14:16:31 +0100
Ken Sharp <ken.sharp@artifex.com>
4f02acd487721451256d3348760cd3c9333e7635

pdfwrite - allow PageLabels to be (optionally) transmitted as pdfmarks

Bug #696568 "Treatment of page labels"

Patch supplied by Leon Bottou, the creator and maintainer of the djvu
device for Ghostscript, very slightly modified.

The djvu device wants the PageLabels from existing PDF files sent to
the device as pdfmarks, exactly as they would be from PostScript. The
problem with this from the pdfwrite point of view is that this would
result in us unpicking the number tree to create pdfmark operations, and
then at the pdfwrite end rebuilding a number tree to emit. Not rebuilding
the tree would result in larger output.

This patch checks that the device implements pdfmark, and if it does
checks whether WantsPageLabels is set in the device. If it is then we
assume its pdfwrite (or a similar device prepared to accept the number
tree). If it is not set then we walk the tree and create a new pdfmark
for each page in the tree range.

I'm unable to test this properly, because it relies on a device which
does implement pdfmark, but doesn't want PageLabels. Rudimentary
testing seemed to work as expected, its possible that more complex
examples might require some more work.

Resource/Init/pdf_main.ps


2018-07-06 09:58:06 +0100
Ken Sharp <ken.sharp@artifex.com>
42cee04f173ccacb6aafc8243dd6c2ef12cdde54

Forgot to include the changed doc file in last commit

doc/Use.htm


2018-07-06 09:53:45 +0100
Ken Sharp <ken.sharp@artifex.com>
cc826ca86485321cbc5fc111f7dad7ee39e69a17

Update PageList processing in the FirstPage/LastPage device

The intention of the PageList was that pages would be specified in
ascending order, but the documentation didn't actually say that
explicitly, so update the documentation to make it absolutely clear.

In addition, by specifying a lower page number at the end, it was
possible to cause a buffer overrun, so prevent that here and flag an
error to the user so they know.

base/gdevflp.c


2018-07-05 18:04:28 +0100
Robin Watts <robin.watts@artifex.com>
18e4b59efeca56ec2ca716559a7b9e0639561428

Bug 699379: Fix infinite loop with filenames starting with #.

The argument handling routines treat lines starting with #
as being comments. Unfortunately, the logic for this was failing
to recognise EOF as stopping the search for the end of a line.

Doubly unfortunatately, it was extending this courtesy, intended
for lines within @files to command line arguments too. We take
steps to avoid that too.

base/gsargs.c


2018-07-05 11:22:41 +0100
Robin Watts <robin.watts@artifex.com>
f390123f8e34ec149fe1a3366ebb872368a57d7f

Bug 698928: Rework arg_next.

When I worked on arg_next before, I think I had the wrong idea of
what it was doing.

The idea of arg_next (I thought) was that we'd call it, and get back
a pointer to a decoded version of the next argument. Sadly, this
wasn't true - it would leave us with an *encoded* version of the
argument. Now, for most things this didn't matter, for for encodings
like UTF16LE, it certainly did.

So, largely revert the previous misguided commit to this code, and
update arg_next so that it really does return a "decoded" (i.e. always
utf-8 encoded) buffer.

This fixes Bug 698928 where I had an underflow read in a buffer.

base/gsargs.c
base/gsargs.h


2018-07-05 16:38:01 +0100
Ken Sharp <ken.sharp@artifex.com>
62e67ecc475d3648f32d7d8c4459bbabd740ea2b

Fix a device subclassing problem with colour mapping procedures

Bug #699520 "Seg fault with customer device utilising device subclassing"

When we retrieve colour mapping methods, we need to use the first
subclassing device in the chain which does not have a 'default' for
the colour mapping methods. This is so that the monochrome palette
device in PCL works properly.

In contrast, if none of the subclassing devices overrides the colour
mapping then we want to use the first non-subclassing device's
methods and, importantly, that device as well.

base/gxdevcli.h


2018-07-03 13:44:28 +0100
Ken Sharp <ken.sharp@artifex.com>
2f8082aa9777a7274c463c6375c2f7d01c299251

Increase limit on UniqueIDs for fonts

Bug #699513 "CFF font UniqueID greater then 2^24 - 1 causes error"

The PDF file contains a font with a UniqueID of 0x7fffff which exceeds
the PostScript definition of a font UniqueID (0 -> 2^24 - 1).

Experimentation shows that no PostScript interpreter that I have access
to (other than GS) implements this limit. However, to keep the change
conservative, I'm chosen to raise the limit to 2^32-1 to match the CFF
specification, rather than eliminate it altogether.

psi/idparam.c


2018-07-03 08:55:43 +0100
Chris Liddell <chris.liddell@artifex.com>
3e44dd7a9f112ea5334a4e189ec64f7a16139597

Remove some obsolete sections from the docs.

DOS and OS/2 install sections in install.htm

doc/Install.htm


2018-06-30 16:10:48 +0100
Ken Sharp <ken.sharp@artifex.com>
dc20112ef13ebdfc6e1ad20ac9ef5462e9145682

Fix a compiler warning

devices/vector/gdevpdfp.c


2018-06-30 14:29:43 +0100
Ken Sharp <ken.sharp@artifex.com>
aba212c73d6f10fe891786a938bb461636563dba

pdfwrite - when changing ProcessColorModel, don't just change the name

Bug 699490 "Broken PDF/X-3 generated"

The reason that an empty file was generated was due to a mismatch
between the underlying device process color model and the ICC profile
attached to the device. The profile was a CMYK profile, while the
device was set to have 3 components.

This is due to the fact that setting the ProcessColorModel separately
from the ColorConversionStrategy was not actually changing the model,
it just changed the name.

This should, of course, have generated an error and an earlier commit
had already addressed that. In this commit, we call the routine which
actually switches the colour model, and we also count down the ICC
structure attached to the device, and set it to 0. This forces a reload
of the ICC profile. That isn't needed for this particular bug but it
is needed when OutputICCProfile is not set, because we will otherwise
try to use the profile for the prior colour model, which will be
incorrect and leaed to errors.

devices/vector/gdevpdfp.c


2018-06-29 14:13:39 -0700
Michael Vrhel <michael.vrhel@artifex.com>
8d415abe6f1e0e3a7e895511e20d99eebad48ada

Fix rendering issue on tiffscaled devices

The tiffscaled contone devices have to be able to change their color model
to allow a more flexible use of the post render ICC profile with the output
intent. Prior to this commit, certain profile combinations would result in
mis-rendered results.

With this fix, if we are wanting to render to a CMYK intermediate
output intent but we want the output to be in sRGB then we need to use
-sDEVICE=tiffscaled24 -dUsePDFX3Profile -sOutputICCProfile=default_cmyk.icc
-sPostRenderProfile=srgb.icc . This should then render to a temporary
buffer the is in the OutputIntent color space and then be converted to
sRGB. This should look like the result we get when we go out to the
tiffscaled32 device. This is in contrast to the command line
sDEVICE=tiffscaled24 -dUsePDFX3Profile -sPostRenderProfile=srgb.icc which would
end up using the output intent as a proofing profile. The results may be similar
but not exact as overprint and spot colors would not appear correctly due to the
additive color model during rendering.

base/gsicc.c
base/gsicc.h
base/lib.mak
devices/devs.mak
devices/gdevtsep.c


2018-06-28 16:44:41 +0100
Ken Sharp <ken.sharp@artifex.com>
da3810ce626a1c5dca856a7bac757bf254761f69

pdfwrite - create GC desscriptors for JPEG Passthrough stream

Bug #699427 " Shrinking PDF is causing SIGSEGV"

Its not absolutely clear that this is the same problem, but I'm
reasonably confident. When passing JPEG data through untouched, we
copied the stream pointer for the uncompressed data into the device
structure (because the image enumerator isn't available at that time)
but if the stream should be relocated after the copy is taken, then the
old stream might not be valid any more.

This commit adds a GC descriptor for the copied stream pointer to the
PDF device structure. For me this solves the problem, but the nature
of these kinds of problems means that *any* change which affects memory
layout will affect the execution, so I'm not 100% certain this is the
problem.

devices/vector/gdevpdf.c
devices/vector/gdevpdfx.h


2018-06-26 14:52:22 -0700
Michael Vrhel <michael.vrhel@artifex.com>
250b5e83e923bed9b6d48bf3965f3b38af52286d

Fix errors introduced in previous commit

The commit f2cf68297e3d63cb927db3c98d317f7ee68e7898
resulted in errors with the separation type devices.
With these devices, we can simply check if the color
model matches the ICC profile since these devices
change their number of components. Will likely need
to do some testing with these device and different
profiles to see what breaks when and make sure we
exit gracefully.

base/gsicc_manage.c
devices/devs.mak
devices/gdevcmykog.c
devices/gdevgprf.c
devices/gdevpsd.c


2018-06-27 13:22:41 +0100
Chris Liddell <chris.liddell@artifex.com>
e4a7fc24c051241e4dbd14760a218290769d78a6

Fix a typo in a link

doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm


2018-06-25 09:44:34 +0100
Chris Liddell <chris.liddell@artifex.com>
6a4202691c4317a698fa23c5309ad8974fe2b003

Bug 699454: 'improve' pdfwrite guesstimate of glyph bbox

When estimating the bounding box of a glyph, we were basically only using the
FontBBox - which is often bogus (as it is in this case).

We'll now, additionally, use the advance width of the glyph in that estimate.

This could possibly result in glyphs being included whose marking operations
are outside the current clip, but whose advance width intersects with the
current clip. But that would be preferable to (as was happening) a glyph inside
the clip being dropped.

(Using the "real" glyph bbox would require executing the complete charstring,
which, obviously, has performance implications)

devices/vector/gdevpdte.c


2018-06-22 11:48:58 -0700
Michael Vrhel <michael.vrhel@artifex.com>
9ae241f271ae2eafc69ca44a0b8b70af17705c0e

Fix crash introduced by commit to make lcms thread-safe

Using a proof profile or even using -dUsePDFX3Profile with
a device color model that was different than the output
intent caused a crash after commit
9ff6b34e461fcbd4ef27fbb6c5c8a15071fe1370

Problem was that the intermediate device link was not
getting created.

base/gsicc_lcms2mt.c


2018-06-22 10:35:48 -0700
Michael Vrhel <michael.vrhel@artifex.com>
f2cf68297e3d63cb927db3c98d317f7ee68e7898

Bug 699381 Add error checking for device icc profiles

Make sure that the various types of profiles that can be set work with
the device color model and with each other. Only allow the use of
the post render ICC profile when the device supports it.

base/gdevdflt.c
base/gsdparam.c
base/gsicc_manage.c
base/gxdevsop.h
base/lib.mak
devices/devs.mak
devices/gdevtsep.c


2018-06-21 11:56:17 -0700
Michael Vrhel <michael.vrhel@artifex.com>
6b981f05c5dafe5d03e8827cb3b5c1cd879c0644

Fix crash when using PostRenderProfile

Crash was introduced by commit to make lcms thread-safe
9ff6b34e461fcbd4ef27fbb6c5c8a15071fe1370

base/gsicc_cache.c


2018-06-19 11:28:31 +0100
Chris Liddell <chris.liddell@artifex.com>
da399f89d08f66d8608e83ecf2cd5c33ec45b866

Don't overwrite filename in the event of an error.

When we 'wrap' a file to allow thread safe file access for multithreaded clist
operation, we replace the original file name with a special 'encoded' file
name - we shouldn't do the replacement if the underlying file fails to open
since it means the error message shows the encoded file name, rather than the
name of the 'real' file.

base/gxclfile.c


2018-06-14 12:47:21 -0700
Ray Johnston <ray.johnston@artifex.com>
f92376925f99cd418ce94ab738935eb88013175f

Add aarch64:Linux case to tiff config.guess

Needed for configure on 64-bit Linux on ARM (seen with SUSE 64-bit linux
on the Raspberry Pi).

tiff/config/config.guess


2018-06-14 12:42:49 -0700
Ray Johnston <ray.johnston@artifex.com>
255fe6272797351f83613e6ca079a903bdabb136

Fix typo in lib.mak. Missing sfilter2 in psfilters.dev

Both entries were $(GLOBJ)sfilter1.$(OBJ) which resulted in s_A85E_template
undefined in the link.

base/lib.mak


2018-06-14 13:57:30 +0100
Ken Sharp <ken.sharp@artifex.com>
fbf2eefa62b8dd4eb1b96aa77b7d4cf6719af5fe

fix lib.mak for Windows builds

Commit ca18b9663b10798a2bd800173df3bfbca4a87650 had an extra $(GLOBJ)
macro in the build line for psfilters.dev. On Linux this doesn't seem
to be a problem, but nmake (Windows build in Visual Studio) throws
an error.

Just remove the extraneous macro.

base/lib.mak


2018-06-13 16:27:32 +0100
Chris Liddell <chris.liddell@artifex.com>
ca18b9663b10798a2bd800173df3bfbca4a87650

Move the PS Level 1 filters into 'base/'

Oddly, Level 2 filters were already in 'base/', but the Level 1 filters were
still (partially) in 'psi/' (but at least one was partially in base/).

This not only moves the code, but puts both Level 1 and 2 filters into a
'feature' .dev (called psfilters.dev) - on the basis we don't really support
building as a Level 1 only interpreter any more.

It is still up to the interpreter makefile(s) to include the dependency on
psfilter.dev to get these built in.

This is tidier than before, but primarily done so the SubFileDecode filter
is available for use by the in-development C based PDF interpreter.

base/lib.mak
base/sfilter1.c
psi/int.mak


2018-06-12 10:08:09 +0100
Ken Sharp <ken.sharp@artifex.com>
e0b4f52ee1904ff3f1cf72d86163321b2f9d6357

Fix PageList when the last page in the file is not included in the list

It was possible to run off the end of the array of pages if the last
page was not included in the list of pages to be printed.

Also, the trailing '-' syntax (from page 'n' to the end of file) was
off by one printing the initial page.

base/gdevflp.c
base/gdevflp.h


2018-06-11 11:31:05 +0100
Ken Sharp <ken.sharp@artifex.com>
bc0b0ff9bd8dbdd91a142b46a0e5f5168c13306d

Better fix for bug #699404

Bug #699404 "Failure with psdcmyk -dGraphicsAlphaBits=4 -dFirstPage=1 -dLastPage=1"

The commit 3347a19f6fd89fc1b7d9644ff6c4703897501f7e did fix this problem
but it left a more serious underlying problem. The devices in the chain
weren't being updated to note that the standard subclassing devcies had
been installed.

This could lead to them being installed multiple times, and also to
taking the wrong code path and failing to update the device methods
when required.

This commit unwinds the previous one in gdevprn.c and applies a better
fix in gdevkrnlsclass.c

base/gdevkrnlsclass.c
base/gdevprn.c


2018-06-08 14:05:24 +0100
Ken Sharp <ken.sharp@artifex.com>
a219c745f5fd3bcf38da40f64c5b7cd053721a16

Documentation update - PageList

Update use.htm to make it clear that using PageList will override any
values for FirstPage and LastPage.

doc/Use.htm


2018-06-07 16:16:08 -0600
Henry Stiles <henry.stiles@artifex.com>
493066fceed538d3c499221aea8e085fba86c827

Add PCL symbol sets: PC-865 Norway and PC-860 Portugal.

pcl/pl/plsymbol.c


2018-06-06 17:25:00 +0100
Ken Sharp <ken.sharp@artifex.com>
3347a19f6fd89fc1b7d9644ff6c4703897501f7e

Move installation of standard subclassing devices

Bug #699404 "Failure with psdcmyk -dGraphicsAlphaBits=4 -dFirstPage=1 -dLastPage=1"

The installation of the devices in gdev_prn_open() was slightly too
early, the procs can still (quite reasonably because this is part of
the device installation) be altered by gdev_prn_allocate_memory().

If we had already subclassed the device, then the procs of the
subclassing device (ie firstPage/LastPage) would be altered rather than
the real target device's procs. This led to the wrong graphics library
call, which produced an error.

Moving the subclassing later in the installation solves the problem.

base/gdevprn.c


2018-06-05 10:16:26 -0600
Henry Stiles <henry.stiles@artifex.com>
bfbd2a02cd39c799d5d5f2d9850fb0fd06e57b7a

Fix #699390 - text position wrong.

The PCL current position (CAP) can be in two states: floating or
fixed. Floating tracks the origin with margin and orientation changes
fixed does not. The CAP is floating until we have printable data or a
command that affects the cursor position is received. We were
mistakenly resetting the the CAP from fixed to float for orientation
changes resulting in incorrect text position.

Norbert Janssen provided the analysis and code change for this fix.

pcl/pcl/pcpage.c


2018-06-01 17:40:09 +0100
Ken Sharp <ken.sharp@artifex.com>
e997c6836d243ab37fe3a5f0d57974af95eb5eac

pdfwrite - drop UTF16-BE DOCINFO strings when creating PDF/A-1

Bug #699392 " XMP metadata missing when trying to create PDF/A "

Its not obvious, but it appears to be impossible to embed UTF-16BE
strings in XMP metadata and have them be validated against the same
string in the Info dictionary, because of the specified method for
comparing such strings.

PDF/A-2 states that the document information dictionary should be
ignored, in contrast to the PDF/A-1 specification which says the
XMP and Info dictionary information must be consistent. So this
problem can't arise there.

This commit detects the use of any UTF-16BE string in a DOCINFO
pdfmark and use the usual PDFACompatibilityPolicy to decide whether to
abort PDF/A-1 production, drop the string or raise an error.

devices/vector/gdevpdfm.c


2018-05-30 15:59:32 +0100
Ken Sharp <ken.sharp@artifex.com>
71de6d0f9c2a48d6e4a69287b2123bf9efd6df88

txtwrite - Increment character index in text enumerator

Bug #699391 "segfault in txtwrite_process_plain_text()"

We need to increment the text enumerator character index no matter what
kind of operation this is, we had omitted it in the
TEXT_FROM_SINGLE_GLYPH case.

devices/vector/gdevtxtw.c


2018-05-28 17:39:55 +0100
Robin Watts <robin.watts@artifex.com>
7a91a08d9c78b5e37b0d434ffaafa30aa1d680ad

Bug 699382: Fix UTF-8 encoding screwup.

Also fix utf8_to_wchar making wchar buffers longer than required.

base/gp_wutf8.c
base/gsargs.c


2018-05-24 16:37:15 +0100
Chris Liddell <chris.liddell@artifex.com>
fa7a350708d393bad28dffff22da4f96ba037001

Ghostscript documentation pages revised to new look and feel

doc/API.htm
doc/AUTHORS
doc/C-style.htm
doc/Changes.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/Hershey.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-style.css
doc/gs.css
doc/images/.DS_Store
doc/images/Artifex_logo.png
doc/images/favicon.png
doc/images/ghostscript_logo.png
doc/images/hamburger-light.png
doc/images/x-light.png
doc/index.js
doc/sample_downscale_device.htm
doc/style.css
doc/subclass.htm
doc/thirdparty.htm


2018-05-24 09:21:17 +0100
Ken Sharp <ken.sharp@artifex.com>
1eab394d3715ac37eca4ee3d4b139520166f37f4

Improve FirstPage/LastPage image data handling

commit e92f7cbadec35ced4e38d2be9bf13fe4f362aa59 had the right idea but
erroneous implementation. We can't simply cast the image enumerator,
because we didn't allocate the enumerator that way.

Instead, add the expected height and tracking variable to the individual
enumerator.

Implement for object filtering device as well.

base/gdevflp.c
base/gdevoflt.c


2018-05-23 15:57:16 +0100
Ken Sharp <ken.sharp@artifex.com>
59dce27871a39a9f161aaaf0e852dbd05ba009fe

PDF interpreter - fix illegal CIDSystemInfo dictionaries

Bug #699294 " Ghostscript giving errors for attached pdfs and generating blank tiffs"

The supplied example file has several CIDFonts embedded which have
illegal CIDSystemInfo dictionaries; they are missing the required
Registry and Ordering entries.

A long time ago we discarded the CIDSystemInfo from the CIDFont and
created a dummy one, which is why the reporter thinks this 'used to
work'. It didn't. Discarding the information caused problems with the
pdfwrite output.

In this case we simply manufacture the missing data. Its wrong, but it
allows the file to proceed to completion. Naturally we emit a warning
so that users know their file is garbage.

Resource/Init/pdf_font.ps


2018-05-23 09:14:07 +0100
Ken Sharp <ken.sharp@artifex.com>
e92f7cbadec35ced4e38d2be9bf13fe4f362aa59

First/Last page - Fix image data handling with proc data source

Bug #699215 "Subclassing device leads to infinite(?) loop"

When processing images, its acceptable for the subclassed device to
return 0 (need more data) in response to image_plane_data, if the
source is a file, because the file will reach EOF and the code will
properly terminate.

For procedural (or string) data sources this isn't true. The code needs
to keep track of the number of rows of image data received, and return
1 (completed) when we have received enough data.

Fixed the object filtering device at the same time.

base/gdevflp.c
base/gdevoflt.c


2018-05-22 14:47:54 +0100
Ken Sharp <ken.sharp@artifex.com>
b61071c9411c3f6aa0dd594da2c5a20ff4ecd914

Replace EOI marker in JPEG passthrough

Bug #699216 " JPEG passthrough appears to truncate JPEGs in some cases"

The IJG JPEG implementation consumes the EOI marker before the JPEG
passthrough code gets to see it (in general). Most PDF consumers don't
care, but some seem to, so when we terminate the DCT decompression
send the EOI marker to the passthrough code.

base/sdctd.c


2018-05-22 14:04:31 +0100
Ken Sharp <ken.sharp@artifex.com>
4a288cb8678517c578b336b3d26e5c4115906624

Fix conversion from PDF time to XMP time for pdfwrite

Bug #699182 " Invalid XMP metadata and possibly invalid memory access for dates without timezone in pdfmark"

Two different problems; in the first case a '>' should be '>=' so that
we properly identify an empty string.

Then when converting the string, there was a different off-by-one error
in the buffer index. Also corrected a comment while passing.

devices/vector/gdevpdfe.c


2018-05-22 10:51:46 +0100
Ken Sharp <ken.sharp@artifex.com>
16ad4cc70918da40f62a919e11187dfb72f4ff63

Prevent use of CID 0 in a PDF/A output file.

Bug #699375 "PDF/A 1b / 2b Validation fails after conversion with Ghostscript on some files"

The input file(s) use CID 0 (which is defined as the /.notdef glyph)
which is illegal in PDF/A files.

'Fixing' this would require us to alter the CID, change the CMap and
the ToUnicode CMap, and runs the obvious risk of the CID we use as a
replacement being used later in the document. We could avoid this by
scanning for 'holes' in the CMap, but even that potentially leaves us
with a problem if there are no empty entries in the CMap.

Since we can't guarantee fixing the problem, a partial fix would be a
great deal of coding, would almost certainly introduce a bug tail and
still wouldn't guarantee a compliant result, don't try. Instead if we
encounter this condition abort PDF/A output, or throw an error if the
PDFACompatibilityPolicy is set that way.

devices/vector/gdevpdtc.c


2018-05-17 14:30:40 +0100
Chris Liddell <chris.liddell@artifex.com>
48e4565e967eae091b97a9037e77016d8d99f3ce

Bug 699329: add display device to default Unix build.

Previously it was only included in the .so build (it doesn't really make sense
in a monolithic exe build). But since we now have a "supported" static library
build, it makes sense to include it.

configure.ac


2018-05-17 07:35:02 +0100
Chris Liddell <chris.liddell@artifex.com>
891ea7d2813edaa3c7c874a4053afdda128e8a10

Fix for small glyph distortion

Glyphs with very few pixels (i.e. lower case "i" in 9pt text rendered at 72dpi)
we being distorted due to the specific rules applied by Freetype's dropout
compensation. This isn't a full solution but resolves the change in behaviour
between 2.7.x and 2.9.x (the change was due to different rounding being
applied).

This fix is from upstream:
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=f1458d2e44d8

So should be in future Freetype releases, and not need re-applied here.

freetype/src/base/ftobjs.c


2018-04-03 15:49:48 +0100
Chris Liddell <chris.liddell@artifex.com>
9cb169b6b260f650aac2c3c7ed7af0f345ee0707

Work around a behaviour change in freetype > 2.8

Freetype will throw an error when we try to retrieve the glyph if the x/y
advance values are too big to fit in a 16.16 fixed point value.

Since we have no need of those values, set them to zero, and avoid the error.

Bring freetype up to 2.9.1

Plus the gs makefile changes to support the new version.

Reapply "Work around a change in the zlib API for 1.2.11"

for Freetype
commit: 08482c582115a1396d0fd9186011008f889a61c5

base/fapi_ft.c
base/freetype.mak
freetype/CMakeLists.txt
freetype/ChangeLog
freetype/ChangeLog.20
freetype/ChangeLog.21
freetype/ChangeLog.22
freetype/ChangeLog.23
freetype/ChangeLog.24
freetype/ChangeLog.25
freetype/ChangeLog.26
freetype/ChangeLog.27
freetype/ChangeLog.28
freetype/Jamfile
freetype/Jamrules
freetype/Makefile
freetype/README
freetype/README.git
freetype/autogen.sh
freetype/builds/amiga/README
freetype/builds/amiga/include/config/ftconfig.h
freetype/builds/amiga/include/config/ftmodule.h
freetype/builds/amiga/makefile
freetype/builds/amiga/makefile.os4
freetype/builds/amiga/smakefile
freetype/builds/amiga/src/base/ftdebug.c
freetype/builds/amiga/src/base/ftsystem.c
freetype/builds/ansi/ansi-def.mk
freetype/builds/ansi/ansi.mk
freetype/builds/beos/beos-def.mk
freetype/builds/beos/beos.mk
freetype/builds/beos/detect.mk
freetype/builds/cmake/FindHarfBuzz.cmake
freetype/builds/cmake/iOS.cmake
freetype/builds/cmake/testbuild.sh
freetype/builds/compiler/ansi-cc.mk
freetype/builds/compiler/bcc-dev.mk
freetype/builds/compiler/bcc.mk
freetype/builds/compiler/emx.mk
freetype/builds/compiler/gcc-dev.mk
freetype/builds/compiler/gcc.mk
freetype/builds/compiler/intelc.mk
freetype/builds/compiler/unix-lcc.mk
freetype/builds/compiler/visualage.mk
freetype/builds/compiler/visualc.mk
freetype/builds/compiler/watcom.mk
freetype/builds/compiler/win-lcc.mk
freetype/builds/detect.mk
freetype/builds/dos/detect.mk
freetype/builds/dos/dos-def.mk
freetype/builds/dos/dos-emx.mk
freetype/builds/dos/dos-gcc.mk
freetype/builds/dos/dos-wat.mk
freetype/builds/exports.mk
freetype/builds/freetype.mk
freetype/builds/link_dos.mk
freetype/builds/link_std.mk
freetype/builds/mac/FreeType.m68k_cfm.make.txt
freetype/builds/mac/FreeType.m68k_far.make.txt
freetype/builds/mac/FreeType.ppc_carbon.make.txt
freetype/builds/mac/FreeType.ppc_classic.make.txt
freetype/builds/mac/ftmac.c
freetype/builds/modules.mk
freetype/builds/newline
freetype/builds/os2/detect.mk
freetype/builds/os2/os2-def.mk
freetype/builds/os2/os2-dev.mk
freetype/builds/os2/os2-gcc.mk
freetype/builds/symbian/bld.inf
freetype/builds/symbian/freetype.mmp
freetype/builds/toplevel.mk
freetype/builds/unix/aclocal.m4
freetype/builds/unix/config.guess
freetype/builds/unix/config.sub
freetype/builds/unix/configure
freetype/builds/unix/configure.ac
freetype/builds/unix/configure.raw
freetype/builds/unix/detect.mk
freetype/builds/unix/freetype-config.in
freetype/builds/unix/freetype2.in
freetype/builds/unix/freetype2.m4
freetype/builds/unix/ft-munmap.m4
freetype/builds/unix/ftconfig.in
freetype/builds/unix/ftsystem.c
freetype/builds/unix/install.mk
freetype/builds/unix/pkg.m4
freetype/builds/unix/unix-cc.in
freetype/builds/unix/unix-def.in
freetype/builds/unix/unix-dev.mk
freetype/builds/unix/unix-lcc.mk
freetype/builds/unix/unix.mk
freetype/builds/unix/unixddef.mk
freetype/builds/vms/ftconfig.h
freetype/builds/vms/ftsystem.c
freetype/builds/wince/ftdebug.c
freetype/builds/wince/vc2005-ce/freetype.vcproj
freetype/builds/wince/vc2005-ce/index.html
freetype/builds/wince/vc2008-ce/freetype.vcproj
freetype/builds/wince/vc2008-ce/index.html
freetype/builds/windows/detect.mk
freetype/builds/windows/ftdebug.c
freetype/builds/windows/vc2005/freetype.vcproj
freetype/builds/windows/vc2005/index.html
freetype/builds/windows/vc2008/freetype.vcproj
freetype/builds/windows/vc2008/index.html
freetype/builds/windows/vc2010/freetype.sln
freetype/builds/windows/vc2010/freetype.vcxproj
freetype/builds/windows/vc2010/freetype.vcxproj.filters
freetype/builds/windows/vc2010/index.html
freetype/builds/windows/visualc/freetype.dsp
freetype/builds/windows/visualc/freetype.vcproj
freetype/builds/windows/visualc/index.html
freetype/builds/windows/visualce/freetype.dsp
freetype/builds/windows/visualce/freetype.vcproj
freetype/builds/windows/visualce/index.html
freetype/builds/windows/w32-bcc.mk
freetype/builds/windows/w32-bccd.mk
freetype/builds/windows/w32-dev.mk
freetype/builds/windows/w32-gcc.mk
freetype/builds/windows/w32-icc.mk
freetype/builds/windows/w32-intl.mk
freetype/builds/windows/w32-lcc.mk
freetype/builds/windows/w32-mingw32.mk
freetype/builds/windows/w32-vcc.mk
freetype/builds/windows/w32-wat.mk
freetype/builds/windows/win32-def.mk
freetype/configure
freetype/devel/ft2build.h
freetype/devel/ftoption.h
freetype/docs/CHANGES
freetype/docs/CUSTOMIZE
freetype/docs/DEBUG
freetype/docs/FTL.TXT
freetype/docs/INSTALL
freetype/docs/INSTALL.ANY
freetype/docs/INSTALL.CROSS
freetype/docs/INSTALL.GNU
freetype/docs/INSTALL.MAC
freetype/docs/INSTALL.UNIX
freetype/docs/INSTALL.VMS
freetype/docs/MAKEPP
freetype/docs/TODO
freetype/docs/VERSIONS.TXT
freetype/docs/formats.txt
freetype/docs/freetype-config.1
freetype/docs/raster.txt
freetype/docs/reference/ft2-auto_hinter.html
freetype/docs/reference/ft2-base_interface.html
freetype/docs/reference/ft2-basic_types.html
freetype/docs/reference/ft2-bdf_fonts.html
freetype/docs/reference/ft2-bitmap_handling.html
freetype/docs/reference/ft2-bzip2.html
freetype/docs/reference/ft2-cache_subsystem.html
freetype/docs/reference/ft2-cff_driver.html
freetype/docs/reference/ft2-cid_fonts.html
freetype/docs/reference/ft2-computations.html
freetype/docs/reference/ft2-error_code_values.html
freetype/docs/reference/ft2-error_enumerations.html
freetype/docs/reference/ft2-font_formats.html
freetype/docs/reference/ft2-gasp_table.html
freetype/docs/reference/ft2-glyph_management.html
freetype/docs/reference/ft2-glyph_stroker.html
freetype/docs/reference/ft2-glyph_variants.html
freetype/docs/reference/ft2-gx_validation.html
freetype/docs/reference/ft2-gzip.html
freetype/docs/reference/ft2-header_file_macros.html
freetype/docs/reference/ft2-header_inclusion.html
freetype/docs/reference/ft2-incremental.html
freetype/docs/reference/ft2-index.html
freetype/docs/reference/ft2-lcd_filtering.html
freetype/docs/reference/ft2-list_processing.html
freetype/docs/reference/ft2-lzw.html
freetype/docs/reference/ft2-mac_specific.html
freetype/docs/reference/ft2-module_management.html
freetype/docs/reference/ft2-multiple_masters.html
freetype/docs/reference/ft2-ot_validation.html
freetype/docs/reference/ft2-outline_processing.html
freetype/docs/reference/ft2-parameter_tags.html
freetype/docs/reference/ft2-pcf_driver.html
freetype/docs/reference/ft2-pfr_fonts.html
freetype/docs/reference/ft2-properties.html
freetype/docs/reference/ft2-quick_advance.html
freetype/docs/reference/ft2-raster.html
freetype/docs/reference/ft2-sfnt_names.html
freetype/docs/reference/ft2-sizes_management.html
freetype/docs/reference/ft2-system_interface.html
freetype/docs/reference/ft2-t1_cid_driver.html
freetype/docs/reference/ft2-toc.html
freetype/docs/reference/ft2-truetype_engine.html
freetype/docs/reference/ft2-truetype_tables.html
freetype/docs/reference/ft2-tt_driver.html
freetype/docs/reference/ft2-type1_tables.html
freetype/docs/reference/ft2-user_allocation.html
freetype/docs/reference/ft2-version.html
freetype/docs/reference/ft2-winfnt_fonts.html
freetype/docs/release
freetype/include/freetype/config/ftconfig.h
freetype/include/freetype/config/ftheader.h
freetype/include/freetype/config/ftoption.h
freetype/include/freetype/config/ftstdlib.h
freetype/include/freetype/freetype.h
freetype/include/freetype/ftadvanc.h
freetype/include/freetype/ftautoh.h
freetype/include/freetype/ftbbox.h
freetype/include/freetype/ftbdf.h
freetype/include/freetype/ftbitmap.h
freetype/include/freetype/ftbzip2.h
freetype/include/freetype/ftcache.h
freetype/include/freetype/ftcffdrv.h
freetype/include/freetype/ftchapters.h
freetype/include/freetype/ftcid.h
freetype/include/freetype/ftdriver.h
freetype/include/freetype/fterrdef.h
freetype/include/freetype/fterrors.h
freetype/include/freetype/ftfntfmt.h
freetype/include/freetype/ftgasp.h
freetype/include/freetype/ftglyph.h
freetype/include/freetype/ftgxval.h
freetype/include/freetype/ftgzip.h
freetype/include/freetype/ftimage.h
freetype/include/freetype/ftincrem.h
freetype/include/freetype/ftlcdfil.h
freetype/include/freetype/ftlist.h
freetype/include/freetype/ftlzw.h
freetype/include/freetype/ftmac.h
freetype/include/freetype/ftmm.h
freetype/include/freetype/ftmodapi.h
freetype/include/freetype/ftmoderr.h
freetype/include/freetype/ftotval.h
freetype/include/freetype/ftoutln.h
freetype/include/freetype/ftparams.h
freetype/include/freetype/ftpfr.h
freetype/include/freetype/ftrender.h
freetype/include/freetype/ftsizes.h
freetype/include/freetype/ftsnames.h
freetype/include/freetype/ftstroke.h
freetype/include/freetype/ftsynth.h
freetype/include/freetype/ftsystem.h
freetype/include/freetype/fttrigon.h
freetype/include/freetype/ftttdrv.h
freetype/include/freetype/fttypes.h
freetype/include/freetype/ftwinfnt.h
freetype/include/freetype/internal/autohint.h
freetype/include/freetype/internal/cffotypes.h
freetype/include/freetype/internal/cfftypes.h
freetype/include/freetype/internal/ftcalc.h
freetype/include/freetype/internal/ftdebug.h
freetype/include/freetype/internal/ftdrv.h
freetype/include/freetype/internal/ftgloadr.h
freetype/include/freetype/internal/ftmemory.h
freetype/include/freetype/internal/ftobjs.h
freetype/include/freetype/internal/ftpic.h
freetype/include/freetype/internal/ftpsprop.h
freetype/include/freetype/internal/ftrfork.h
freetype/include/freetype/internal/ftserv.h
freetype/include/freetype/internal/ftstream.h
freetype/include/freetype/internal/fttrace.h
freetype/include/freetype/internal/ftvalid.h
freetype/include/freetype/internal/internal.h
freetype/include/freetype/internal/psaux.h
freetype/include/freetype/internal/pshints.h
freetype/include/freetype/internal/services/svbdf.h
freetype/include/freetype/internal/services/svcfftl.h
freetype/include/freetype/internal/services/svcid.h
freetype/include/freetype/internal/services/svfntfmt.h
freetype/include/freetype/internal/services/svgldict.h
freetype/include/freetype/internal/services/svgxval.h
freetype/include/freetype/internal/services/svkern.h
freetype/include/freetype/internal/services/svmetric.h
freetype/include/freetype/internal/services/svmm.h
freetype/include/freetype/internal/services/svotval.h
freetype/include/freetype/internal/services/svpfr.h
freetype/include/freetype/internal/services/svpostnm.h
freetype/include/freetype/internal/services/svprop.h
freetype/include/freetype/internal/services/svpscmap.h
freetype/include/freetype/internal/services/svpsinfo.h
freetype/include/freetype/internal/services/svsfnt.h
freetype/include/freetype/internal/services/svttcmap.h
freetype/include/freetype/internal/services/svtteng.h
freetype/include/freetype/internal/services/svttglyf.h
freetype/include/freetype/internal/services/svwinfnt.h
freetype/include/freetype/internal/sfnt.h
freetype/include/freetype/internal/t1types.h
freetype/include/freetype/internal/tttypes.h
freetype/include/freetype/t1tables.h
freetype/include/freetype/ttnameid.h
freetype/include/freetype/tttables.h
freetype/include/freetype/tttags.h
freetype/include/freetype/ttunpat.h
freetype/include/ft2build.h
freetype/modules.cfg
freetype/src/Jamfile
freetype/src/autofit/Jamfile
freetype/src/autofit/afangles.c
freetype/src/autofit/afblue.c
freetype/src/autofit/afblue.cin
freetype/src/autofit/afblue.dat
freetype/src/autofit/afblue.h
freetype/src/autofit/afblue.hin
freetype/src/autofit/afcjk.c
freetype/src/autofit/afcjk.h
freetype/src/autofit/afcover.h
freetype/src/autofit/afdummy.c
freetype/src/autofit/afdummy.h
freetype/src/autofit/aferrors.h
freetype/src/autofit/afglobal.c
freetype/src/autofit/afglobal.h
freetype/src/autofit/afhints.c
freetype/src/autofit/afhints.h
freetype/src/autofit/afindic.c
freetype/src/autofit/afindic.h
freetype/src/autofit/aflatin.c
freetype/src/autofit/aflatin.h
freetype/src/autofit/aflatin2.c
freetype/src/autofit/aflatin2.h
freetype/src/autofit/afloader.c
freetype/src/autofit/afloader.h
freetype/src/autofit/afmodule.c
freetype/src/autofit/afmodule.h
freetype/src/autofit/afpic.c
freetype/src/autofit/afpic.h
freetype/src/autofit/afranges.c
freetype/src/autofit/afranges.h
freetype/src/autofit/afscript.h
freetype/src/autofit/afshaper.c
freetype/src/autofit/afshaper.h
freetype/src/autofit/afstyles.h
freetype/src/autofit/aftypes.h
freetype/src/autofit/afwarp.c
freetype/src/autofit/afwarp.h
freetype/src/autofit/afwrtsys.h
freetype/src/autofit/autofit.c
freetype/src/autofit/module.mk
freetype/src/autofit/rules.mk
freetype/src/base/Jamfile
freetype/src/base/basepic.c
freetype/src/base/basepic.h
freetype/src/base/ftadvanc.c
freetype/src/base/ftapi.c
freetype/src/base/ftbase.c
freetype/src/base/ftbase.h
freetype/src/base/ftbbox.c
freetype/src/base/ftbdf.c
freetype/src/base/ftbitmap.c
freetype/src/base/ftcalc.c
freetype/src/base/ftcid.c
freetype/src/base/ftdbgmem.c
freetype/src/base/ftdebug.c
freetype/src/base/ftfntfmt.c
freetype/src/base/ftfstype.c
freetype/src/base/ftgasp.c
freetype/src/base/ftgloadr.c
freetype/src/base/ftglyph.c
freetype/src/base/ftgxval.c
freetype/src/base/ftinit.c
freetype/src/base/ftlcdfil.c
freetype/src/base/ftmac.c
freetype/src/base/ftmm.c
freetype/src/base/ftobjs.c
freetype/src/base/ftotval.c
freetype/src/base/ftoutln.c
freetype/src/base/ftpatent.c
freetype/src/base/ftpfr.c
freetype/src/base/ftpic.c
freetype/src/base/ftpsprop.c
freetype/src/base/ftrfork.c
freetype/src/base/ftsnames.c
freetype/src/base/ftstream.c
freetype/src/base/ftstroke.c
freetype/src/base/ftsynth.c
freetype/src/base/ftsystem.c
freetype/src/base/fttrigon.c
freetype/src/base/fttype1.c
freetype/src/base/ftutil.c
freetype/src/base/ftver.rc
freetype/src/base/ftwinfnt.c
freetype/src/base/rules.mk
freetype/src/bdf/Jamfile
freetype/src/bdf/README
freetype/src/bdf/bdf.c
freetype/src/bdf/bdfdrivr.c
freetype/src/bdf/bdflib.c
freetype/src/bzip2/Jamfile
freetype/src/bzip2/ftbzip2.c
freetype/src/bzip2/rules.mk
freetype/src/cache/Jamfile
freetype/src/cache/ftcache.c
freetype/src/cache/ftcbasic.c
freetype/src/cache/ftccache.c
freetype/src/cache/ftccache.h
freetype/src/cache/ftccback.h
freetype/src/cache/ftccmap.c
freetype/src/cache/ftcerror.h
freetype/src/cache/ftcglyph.c
freetype/src/cache/ftcglyph.h
freetype/src/cache/ftcimage.c
freetype/src/cache/ftcimage.h
freetype/src/cache/ftcmanag.c
freetype/src/cache/ftcmanag.h
freetype/src/cache/ftcmru.c
freetype/src/cache/ftcmru.h
freetype/src/cache/ftcsbits.c
freetype/src/cache/ftcsbits.h
freetype/src/cache/rules.mk
freetype/src/cff/Jamfile
freetype/src/cff/cf2intrp.c
freetype/src/cff/cff.c
freetype/src/cff/cffcmap.c
freetype/src/cff/cffcmap.h
freetype/src/cff/cffdrivr.c
freetype/src/cff/cffdrivr.h
freetype/src/cff/cfferrs.h
freetype/src/cff/cffgload.c
freetype/src/cff/cffgload.h
freetype/src/cff/cffload.c
freetype/src/cff/cffload.h
freetype/src/cff/cffobjs.c
freetype/src/cff/cffobjs.h
freetype/src/cff/cffparse.c
freetype/src/cff/cffparse.h
freetype/src/cff/cffpic.c
freetype/src/cff/cffpic.h
freetype/src/cff/cfftoken.h
freetype/src/cff/module.mk
freetype/src/cff/rules.mk
freetype/src/cid/Jamfile
freetype/src/cid/ciderrs.h
freetype/src/cid/cidgload.c
freetype/src/cid/cidgload.h
freetype/src/cid/cidload.c
freetype/src/cid/cidload.h
freetype/src/cid/cidobjs.c
freetype/src/cid/cidobjs.h
freetype/src/cid/cidparse.c
freetype/src/cid/cidparse.h
freetype/src/cid/cidriver.c
freetype/src/cid/cidriver.h
freetype/src/cid/cidtoken.h
freetype/src/cid/module.mk
freetype/src/cid/rules.mk
freetype/src/cid/type1cid.c
freetype/src/gxvalid/Jamfile
freetype/src/gxvalid/README
freetype/src/gxvalid/gxvalid.c
freetype/src/gxvalid/gxvalid.h
freetype/src/gxvalid/gxvbsln.c
freetype/src/gxvalid/gxvcommn.c
freetype/src/gxvalid/gxvcommn.h
freetype/src/gxvalid/gxverror.h
freetype/src/gxvalid/gxvfeat.c
freetype/src/gxvalid/gxvfeat.h
freetype/src/gxvalid/gxvfgen.c
freetype/src/gxvalid/gxvjust.c
freetype/src/gxvalid/gxvkern.c
freetype/src/gxvalid/gxvlcar.c
freetype/src/gxvalid/gxvmod.c
freetype/src/gxvalid/gxvmod.h
freetype/src/gxvalid/gxvmort.c
freetype/src/gxvalid/gxvmort.h
freetype/src/gxvalid/gxvmort0.c
freetype/src/gxvalid/gxvmort1.c
freetype/src/gxvalid/gxvmort2.c
freetype/src/gxvalid/gxvmort4.c
freetype/src/gxvalid/gxvmort5.c
freetype/src/gxvalid/gxvmorx.c
freetype/src/gxvalid/gxvmorx.h
freetype/src/gxvalid/gxvmorx0.c
freetype/src/gxvalid/gxvmorx1.c
freetype/src/gxvalid/gxvmorx2.c
freetype/src/gxvalid/gxvmorx4.c
freetype/src/gxvalid/gxvmorx5.c
freetype/src/gxvalid/gxvopbd.c
freetype/src/gxvalid/gxvprop.c
freetype/src/gxvalid/gxvtrak.c
freetype/src/gxvalid/module.mk
freetype/src/gxvalid/rules.mk
freetype/src/gzip/Jamfile
freetype/src/gzip/ftgzip.c
freetype/src/gzip/ftzconf.h
freetype/src/gzip/rules.mk
freetype/src/gzip/zlib.h
freetype/src/lzw/Jamfile
freetype/src/lzw/ftlzw.c
freetype/src/lzw/ftzopen.c
freetype/src/lzw/ftzopen.h
freetype/src/lzw/rules.mk
freetype/src/otvalid/Jamfile
freetype/src/otvalid/module.mk
freetype/src/otvalid/otvalid.c
freetype/src/otvalid/otvalid.h
freetype/src/otvalid/otvbase.c
freetype/src/otvalid/otvcommn.c
freetype/src/otvalid/otvcommn.h
freetype/src/otvalid/otverror.h
freetype/src/otvalid/otvgdef.c
freetype/src/otvalid/otvgpos.c
freetype/src/otvalid/otvgpos.h
freetype/src/otvalid/otvgsub.c
freetype/src/otvalid/otvjstf.c
freetype/src/otvalid/otvmath.c
freetype/src/otvalid/otvmod.c
freetype/src/otvalid/otvmod.h
freetype/src/otvalid/rules.mk
freetype/src/pcf/Jamfile
freetype/src/pcf/README
freetype/src/pcf/pcf.c
freetype/src/pcf/pcf.h
freetype/src/pcf/pcfdrivr.c
freetype/src/pcf/pcfread.c
freetype/src/pfr/Jamfile
freetype/src/pfr/module.mk
freetype/src/pfr/pfr.c
freetype/src/pfr/pfrcmap.c
freetype/src/pfr/pfrcmap.h
freetype/src/pfr/pfrdrivr.c
freetype/src/pfr/pfrdrivr.h
freetype/src/pfr/pfrerror.h
freetype/src/pfr/pfrgload.c
freetype/src/pfr/pfrgload.h
freetype/src/pfr/pfrload.c
freetype/src/pfr/pfrload.h
freetype/src/pfr/pfrobjs.c
freetype/src/pfr/pfrobjs.h
freetype/src/pfr/pfrsbit.c
freetype/src/pfr/pfrsbit.h
freetype/src/pfr/pfrtypes.h
freetype/src/pfr/rules.mk
freetype/src/psaux/Jamfile
freetype/src/psaux/afmparse.c
freetype/src/psaux/afmparse.h
freetype/src/psaux/cffdecode.c
freetype/src/psaux/cffdecode.h
freetype/src/psaux/module.mk
freetype/src/psaux/psarrst.c
freetype/src/psaux/psarrst.h
freetype/src/psaux/psaux.c
freetype/src/psaux/psauxerr.h
freetype/src/psaux/psauxmod.c
freetype/src/psaux/psauxmod.h
freetype/src/psaux/psblues.c
freetype/src/psaux/psblues.h
freetype/src/psaux/psconv.c
freetype/src/psaux/psconv.h
freetype/src/psaux/pserror.c
freetype/src/psaux/pserror.h
freetype/src/psaux/psfixed.h
freetype/src/psaux/psfont.c
freetype/src/psaux/psfont.h
freetype/src/psaux/psft.c
freetype/src/psaux/psft.h
freetype/src/psaux/psglue.h
freetype/src/psaux/pshints.c
freetype/src/psaux/pshints.h
freetype/src/psaux/psintrp.c
freetype/src/psaux/psintrp.h
freetype/src/psaux/psobjs.c
freetype/src/psaux/psobjs.h
freetype/src/psaux/psread.c
freetype/src/psaux/psread.h
freetype/src/psaux/psstack.c
freetype/src/psaux/psstack.h
freetype/src/psaux/pstypes.h
freetype/src/psaux/rules.mk
freetype/src/psaux/t1cmap.c
freetype/src/psaux/t1cmap.h
freetype/src/psaux/t1decode.c
freetype/src/psaux/t1decode.h
freetype/src/pshinter/Jamfile
freetype/src/pshinter/module.mk
freetype/src/pshinter/pshalgo.c
freetype/src/pshinter/pshalgo.h
freetype/src/pshinter/pshglob.c
freetype/src/pshinter/pshglob.h
freetype/src/pshinter/pshinter.c
freetype/src/pshinter/pshmod.c
freetype/src/pshinter/pshmod.h
freetype/src/pshinter/pshnterr.h
freetype/src/pshinter/pshpic.c
freetype/src/pshinter/pshpic.h
freetype/src/pshinter/pshrec.c
freetype/src/pshinter/pshrec.h
freetype/src/pshinter/rules.mk
freetype/src/psnames/Jamfile
freetype/src/psnames/module.mk
freetype/src/psnames/psmodule.c
freetype/src/psnames/psmodule.h
freetype/src/psnames/psnamerr.h
freetype/src/psnames/psnames.c
freetype/src/psnames/pspic.c
freetype/src/psnames/pspic.h
freetype/src/psnames/pstables.h
freetype/src/psnames/rules.mk
freetype/src/raster/Jamfile
freetype/src/raster/ftmisc.h
freetype/src/raster/ftraster.c
freetype/src/raster/ftraster.h
freetype/src/raster/ftrend1.c
freetype/src/raster/ftrend1.h
freetype/src/raster/module.mk
freetype/src/raster/raster.c
freetype/src/raster/rasterrs.h
freetype/src/raster/rastpic.c
freetype/src/raster/rastpic.h
freetype/src/raster/rules.mk
freetype/src/sfnt/Jamfile
freetype/src/sfnt/module.mk
freetype/src/sfnt/pngshim.c
freetype/src/sfnt/pngshim.h
freetype/src/sfnt/rules.mk
freetype/src/sfnt/sfdriver.c
freetype/src/sfnt/sfdriver.h
freetype/src/sfnt/sferrors.h
freetype/src/sfnt/sfnt.c
freetype/src/sfnt/sfntpic.c
freetype/src/sfnt/sfntpic.h
freetype/src/sfnt/sfobjs.c
freetype/src/sfnt/sfobjs.h
freetype/src/sfnt/ttbdf.c
freetype/src/sfnt/ttbdf.h
freetype/src/sfnt/ttcmap.c
freetype/src/sfnt/ttcmap.h
freetype/src/sfnt/ttcmapc.h
freetype/src/sfnt/ttkern.c
freetype/src/sfnt/ttkern.h
freetype/src/sfnt/ttload.c
freetype/src/sfnt/ttload.h
freetype/src/sfnt/ttmtx.c
freetype/src/sfnt/ttmtx.h
freetype/src/sfnt/ttpost.c
freetype/src/sfnt/ttpost.h
freetype/src/sfnt/ttsbit.c
freetype/src/sfnt/ttsbit.h
freetype/src/smooth/Jamfile
freetype/src/smooth/ftgrays.c
freetype/src/smooth/ftgrays.h
freetype/src/smooth/ftsmerrs.h
freetype/src/smooth/ftsmooth.c
freetype/src/smooth/ftsmooth.h
freetype/src/smooth/ftspic.c
freetype/src/smooth/ftspic.h
freetype/src/smooth/module.mk
freetype/src/smooth/rules.mk
freetype/src/smooth/smooth.c
freetype/src/tools/afblue.pl
freetype/src/tools/apinames.c
freetype/src/tools/docmaker/content.py
freetype/src/tools/docmaker/docbeauty.py
freetype/src/tools/docmaker/docmaker.py
freetype/src/tools/docmaker/formatter.py
freetype/src/tools/docmaker/sources.py
freetype/src/tools/docmaker/tohtml.py
freetype/src/tools/docmaker/utils.py
freetype/src/tools/ftfuzzer/README
freetype/src/tools/ftfuzzer/ftfuzzer.cc
freetype/src/tools/ftfuzzer/ftmutator.cc
freetype/src/tools/ftfuzzer/rasterfuzzer.cc
freetype/src/tools/ftfuzzer/runinput.cc
freetype/src/tools/ftrandom/ftrandom.c
freetype/src/tools/glnames.py
freetype/src/tools/update-copyright-year
freetype/src/truetype/Jamfile
freetype/src/truetype/module.mk
freetype/src/truetype/rules.mk
freetype/src/truetype/truetype.c
freetype/src/truetype/ttdriver.c
freetype/src/truetype/ttdriver.h
freetype/src/truetype/tterrors.h
freetype/src/truetype/ttgload.c
freetype/src/truetype/ttgload.h
freetype/src/truetype/ttgxvar.c
freetype/src/truetype/ttgxvar.h
freetype/src/truetype/ttinterp.c
freetype/src/truetype/ttinterp.h
freetype/src/truetype/ttobjs.c
freetype/src/truetype/ttobjs.h
freetype/src/truetype/ttpic.c
freetype/src/truetype/ttpic.h
freetype/src/truetype/ttpload.c
freetype/src/truetype/ttpload.h
freetype/src/truetype/ttsubpix.c
freetype/src/truetype/ttsubpix.h
freetype/src/type1/Jamfile
freetype/src/type1/module.mk
freetype/src/type1/rules.mk
freetype/src/type1/t1afm.c
freetype/src/type1/t1afm.h
freetype/src/type1/t1driver.c
freetype/src/type1/t1driver.h
freetype/src/type1/t1errors.h
freetype/src/type1/t1gload.c
freetype/src/type1/t1gload.h
freetype/src/type1/t1load.c
freetype/src/type1/t1load.h
freetype/src/type1/t1objs.c
freetype/src/type1/t1objs.h
freetype/src/type1/t1parse.c
freetype/src/type1/t1parse.h
freetype/src/type1/t1tokens.h
freetype/src/type1/type1.c
freetype/src/type42/Jamfile
freetype/src/type42/module.mk
freetype/src/type42/rules.mk
freetype/src/type42/t42drivr.c
freetype/src/type42/t42drivr.h
freetype/src/type42/t42error.h
freetype/src/type42/t42objs.c
freetype/src/type42/t42objs.h
freetype/src/type42/t42parse.c
freetype/src/type42/t42parse.h
freetype/src/type42/t42types.h
freetype/src/type42/type42.c
freetype/src/winfonts/Jamfile
freetype/src/winfonts/fnterrs.h
freetype/src/winfonts/module.mk
freetype/src/winfonts/rules.mk
freetype/src/winfonts/winfnt.c
freetype/src/winfonts/winfnt.h
freetype/vms_make.com


2018-05-16 22:25:06 -0700
Ray Johnston <ray.johnston@artifex.com>
ddace435eb99ea1c8a517f4ec94307cfe0743bce

Fixup msvclib.mak that had seriously bit-rotted.

Mainly pulling macro definition in from msvc.mak and add missing FEATURE_DEVS
and change the default device to ppmraw (more useful than ljet2).

base/msvclib.mak


2018-05-16 22:22:46 -0700
Ray Johnston <ray.johnston@artifex.com>
eab096dcf3d528c4a533ab1fb0616179dd0ee4e6

Add missing dependency for sicclib (md5 is needed for icc cache hash)

base/lib.mak


2018-05-16 13:35:26 -0700
Ray Johnston <ray.johnston@artifex.com>
cee69d4f50ff9a860040b8afdeb2cdb65a7252d8

Rename "rand" function to "gs_rand" to avoid name clash on Windows

Apparently (at least with VS 2015) stdlib.h contains a declaration for
"rand" that clashes with the local version.

base/gslib.c


2018-05-14 22:33:26 -0700
Ray Johnston <ray.johnston@artifex.com>
fc42e417956d4bf3b3b2d7138c550e04f62c3159

Fix some InterpolateControl issues.

Some devices (such as clist) rely on image->Interpolate to determine how
to handle the image. Rather than checking dev->interpolate control there,
and look for other devices that may also need it, do the force in the
gs_image_begin_typed. Also, fix gs_pdf14_device_copy_params to copy the
interpolate_control.

base/gdevp14.c
base/gsimage.c


2018-05-15 21:36:30 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f90f090c0a5c3e5744d3ec6f0430fbe1a86ac44c

Bug 697545 : Prevent SEGV in freetype if running out of memory.

Prevent SEGV when trying to use buffer after memory failure. This patch has
been accepted by the freetype team as commit e0015f7612cf07ff80561475321ce1f98c7c2b88

Error created using :-
MEMENTO_FAILAT=17104 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0051

freetype/src/autofit/afcjk.c
freetype/src/autofit/aflatin.c
freetype/src/autofit/afshaper.c


2018-05-09 11:31:38 -0700
Ray Johnston <ray.johnston@artifex.com>
43f429a2508e72d36a3b27671c8d7e43f1bbc591

Increase the data_size for pattern-clist to 128k (from 32K).

The tile cache is kept in the clist buffer, and there are a few files that
trip over the limit of the number of hash slots with the small data_size,
particularly comparefiles/Bug689851.pdf at 72 dpi. With this file, the clist
size is reduced by about 65%. Other than the pattern-clist, the tile cache
seems to work adequately without needing to delete tiles.

Also this means that more data can be accumulated for image_data before
needing to flush the buffer to the memory_clist storage, which should
improve performance a bit (but pattern-clist is never going to be fast).

base/gxpcmap.c


2018-04-26 20:11:31 +0100
Robin Watts <robin.watts@artifex.com>
9df005ac54c94dc986c3ed94b24d5ecdfe03582b

Fix problem with transparency and ROPs.

A comment from 1998 in gdevrop.c indicates that
if we are given a LOP that says "S is transparent", and
S isn't used, then we should ignore that flag. (Similarly
for T). Tests seem to indicate that this is indeed true
(See page 12 of C425.bin for an example).

Unfortunately, when we start 'folding' LOPs down onto simpler
ones, we can start with a LOP where S (or T) matters, and
end up with one where it looks like it doesn't. As such we
introduce another flag so we can avoid trying to remove
the S/T transparency flags after we have started to fold the
rop down.

We use this in mem_gray8_rgb24_strip_copy_rop, and rop_get_run_op
to ensure we don't throw away transparency by mistake.

For example, in mem_gray8_rgb24_strip_copy_rop when called with
lop=0x2fc, with S as a bitmap where both colors are the same, the
current code spots that S is always 1, and rewrites the rop to be
0xff. This in turn leads to T not being required, so it is ignored,
despite the fact that T should still be consulted for transparency.

(Check that page 12 of C425.bin is still OK!)

base/gdevmr8n.c
base/gsroprun.c
base/gsropt.h


2018-05-10 13:58:34 -0600
Henry Stiles <henry.stiles@artifex.com>
30aa9aee30bc0324359df1f931efb75c5a2c5dd7

Only add the source to the ROP if it isn't already specified.

The previous code unconditionally added the source to the ROP, so any
ROP which contained ~S was changed to S. With the extra logic, the
expression to determine the lop actual paramater was getting
unreadable so it has been split up.

base/gxdcolor.c


2018-05-09 17:34:43 +0100
Robin Watts <robin.watts@artifex.com>
8e31bcbf7214568b09a00683a19f7c4e847618f6

Tweak previous fix to rounding in image code.

Back in September 2016, commit bffe2011e1 went in, entitled "Fix bug
69707. SMask subpixel offset must match image offset."

In this, an adjustment was applied to the dda to attempt to make it
match the rounding used in the mono case.

This adjustment was made *after* the position of the first edge was
made, rather than after it, resulting in a slight difference to the
size of the first pixel of a run.

This error was spotted when comparing the output of an experimental
optimisation to use memcpy for 1:1 runs of data.

base/gxicolor.c


2018-05-08 12:37:07 +0100
Chris Liddell <chris.liddell@artifex.com>
f302fbc59b974a167a7a0023ac6f9e89ed27d243

Honor the single object clump flag when allocating strings

When checking whether a given clump was a candidate to allocate a string,
the code was not checking the flag that marks the clump as being for a
single object. That could lead to the clump being freed (with it's original,
single object content, along with the string) when the string(s) were still
in use.

This is better than resetting the flag since single object clumps are such
for a reason (they implement immovable memory), and we *never* want
immovable memory to become movable

base/gsalloc.c


2018-05-05 20:23:13 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e1652d0b73989b77a914f6a0de58ec6f53fc8e01

Bug 697545 : Prevent SEGV after gs_stroke.

Prevent SEGV if memory allocation fails.

Error created using :-
MEMENTO_FAILAT=9971 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0010

base/gspaint.c


2018-05-05 22:49:20 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
93d78c6299905fe0a192840015f71820772be95c

Bug 697545 : Fix memory leak in gx_image_enum_begin.

Fix memory leak due to buffer not being freed on error.

Error created using :-
MEMENTO_FAILAT=10035 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0010

base/gxipixel.c


2018-05-05 21:28:41 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
2b2fef0e97c148795af8c4c08b261f2807f1ba52

Bug 697545 : Prevent SEGV after fill_with_rule.

Prevent SEGV if memory allocation fails.

Error created using :-
MEMENTO_FAILAT=9999 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0010

base/gspaint.c


2018-05-04 19:31:59 +0100
Robin Watts <robin.watts@artifex.com>
9e8ef6c2f2086adbf784ddbe71fe2799afc4002b

Fix image skip logic (again).

The device to be used is not penum->dev, that'd be far too sensible!

Pass in the actual device to be used.

base/gxidata.c
base/gximage.h


2018-05-03 22:31:31 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
7fa6e4a640857f6cfb1d520e65376c0304594980

Bug 697545 : Fix memory leak in gx_gstate_dev_ht_install.

Fix memory leak due to cache not being freed on error.

Error created using :-
MEMENTO_FAILAT=10111 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./pcl/examples/owl.pcl

base/gsht.c


2018-05-03 12:00:11 -0700
Ray Johnston <ray.johnston@artifex.com>
9df84425aab2009f6335d57b5c19da2ac49294c4

Clean up some left over RECT_RECOVER code, delete band_code from state

base/gxcldev.h
base/gxclimag.c
base/gxclrect.c


2018-05-02 08:34:52 -0700
Ray Johnston <ray.johnston@artifex.com>
fe6b6679bced0f6f9b617e72278c538da8386b5c

Remove unused clist command definitions, document unused code values.

In preparation for upcoming clist changes for tiles, do some clean up of
the definitions and document unused command codes. Note that there are
still commands with flag bits where there are unused bits when certain
flags are set, e.g. copy_mono_planes, low 3 bits unused if copy_use_tile
is set, but using these code combinations would need changes in the
clist_playback_band reader.

base/gxcldev.h
base/gxclimag.c
base/gxclpath.h
base/gxclrast.c


2018-05-03 18:49:03 +0100
Robin Watts <robin.watts@artifex.com>
a080da17f4d060b4e23d85b35989df92bb4bf76c

Remove outdated comment.

base/gxicolor.c


2018-05-03 11:51:22 +0100
Robin Watts <robin.watts@artifex.com>
23de52cfaf6e263dde824bd7be0b8d9d1d2cd053

Fix quirk in image enumerator creation routines.

When we start an image, the image code runs through the handlers
for different types of image until it finds one that can handle
the required type.

These handlers are queried with the current device in as penum->dev.

The image code then sets up any clip or rop device on top of this
device.

If the handlers were to call device functions, they would be in
the somewhat odd position of calling a different device in the setup
phase than they would be calling in the processing phase. This
upsets a forthcoming commit.

The fix is to ensure that any clip and rop devices are setup BEFORE
the image handlers are called.

base/gxipixel.c


2018-04-29 10:28:48 +0100
Chris Liddell <chris.liddell@artifex.com>
7b4ad6025f0576e2adb971230a9a2dfb62335a13

Update doc/thirdparty.htm

doc/thirdparty.htm


2018-04-25 14:22:03 +0100
Robin Watts <robin.watts@artifex.com>
f7bfa8db8f1407f70253667d832f3b219b434559

Fix source + texture both data in mem_gray8_rgb24_strip_copy_rop.

Using rop rather than lop means transparency was broken in the
(unusual) source + texture both being data based case.

Also, we were failing to update the source pointer, causing odd
repeats in output.

base/gdevmr8n.c


2018-04-27 07:52:52 -0600
Henry Stiles <henry.stiles@artifex.com>
2fd21f767d9b4065fd4f3ef1319ad6dbee8a2ffd

Change ownership of jbig2 to Sebastian.

doc/who_owns_what.txt


2018-04-27 11:27:44 +0100
Ken Sharp <ken.sharp@artifex.com>
5ff675bcb1ce0a1349a81c4c2dbfde20769616fa

pdf_info.ps - report if a PDF file uses XFA forms

toolbin/pdf_info.ps


2018-04-26 19:01:44 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
133d0c54ba05f887f67c441ceda59f49cf563902

Bug 697545 : Fix memory leak in clist_open.

Fix memory leak due to cache not being freed on error.

Error created using :-
MEMENTO_FAILAT=1835 ./membin/gpcl6 -sDEVICE=pbmraw -sDEVICE=pbmraw -o /dev/null ./pcl/examples/owl.pcl

base/gxclist.c


2018-04-25 09:55:51 -0700
Ray Johnston <ray.johnston@artifex.com>
4609498d02a91f954636124d5f5699794ffac48a

Fix bug 697671: Banding/Page mode mismatch

The simplified case had a character (copy_mono) followed by a rect
fill.

The copy_mono for the character sets the rect.height clamped to the
"cropping_max" (dev->height) for the band in the writer, but it doesn't
actually write the height to the clist for that band. Then the reader
was using the entire bitmap height, but that went past the end of the
device, so the next time the state.rect.height was used in the reader,
it was wrong.

base/gxclrast.c


2018-04-25 20:26:43 +0100
Robin Watts <robin.watts@artifex.com>
bf9c9faf78caacc7e90faf04b50611153a64d014

Update clusterpush.pl to allow for larger files.

toolbin/localcluster/clusterpush.pl


2018-04-24 16:00:31 +0100
Chris Liddell <chris.liddell@artifex.com>
8197eaf98c552991a0b7f8068ff3fcce56c07803

Bug 699201: Fix alignment of rendering bands memory

The bottom section of the "raster buffer", when rendering through the page
clist, is reserved as a cache (tile cache, to be specific). Hence to bottom
address of the memory we actually render into starts immediately after the
cache.

No account was taken when setting up that cache size of the alignment expected
by the rendering code.

We'll now ensure that the the cache ends, and the raster band memory starts
on an appropriately aligned address.

base/gxclist.c


2018-04-24 15:22:15 +0100
Robin Watts <robin.watts@artifex.com>
610862e06b739430a2994dc4a0c399fa21900521

Tweak MSVC Profile build settings.

While attempting to debug an unrelated issue, I found a note on
an MSVC forum from an MS developer suggesting that we should use
/Profile rather than /PROFILE or /profile as the flags. They
*should* do the same thing, but the suggestion is that there
might be a bug in the MS linker.

Committing this here as it certainly doesn't hurt, and might save
someone hours in future.

psi/msvc.mak


2018-04-24 11:57:28 +0100
Robin Watts <robin.watts@artifex.com>
0be413a3f3a24c3d55062273cd37e8fcac7c0c4f

Fix mem_gray8_rgb24_strip_copy_rop.

A couple of cases in this routine were failing to increment
the destination pointer after writing. I guess this shows
that a couple of cases are rarely used for partial scanlines.

base/gdevmr8n.c


2018-04-20 23:50:59 +0100
Robin Watts <robin.watts@artifex.com>
c56b2c2d72ef86f3e45882dd5b35a772ce79e8f9

Avoid 'const' warning.

base/gxi12bit.c


2018-04-20 14:45:52 +0100
Robin Watts <robin.watts@artifex.com>
7657398e7574f4a54eb35ea757a7c3037fe7c0e5

Further simplification to image_render_icc_... functions.

Avoid needless alternations in the middle of the loop in
exchange for a single function call.

base/gxcmap.c
base/gxcmap.h
base/gxi12bit.c
base/gxicolor.c


2018-04-20 18:10:12 +0100
Robin Watts <robin.watts@artifex.com>
4a2f6848f38c60eb39a5467c951cfdc06c334a19

Apply same simplification/optimisations to image_render_icc16

Apply the same changes to image_render_icc16 as we did just a few
commits ago.

base/gxi12bit.c


2018-04-19 19:13:50 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
7b539b765dcc960d257bffbcfef8a496120887a8

Bug 697545 : Prevent SEGV in c_param_add.

Prevent SEGV if pkey memory allocation fails.

Error created using :-
MEMENTO_FAILAT=1823 ./membin/gpcl6 -sDEVICE=pbmraw -r300 -dMaxBitmap=2000 -o /dev/null ./pcl/examples/owl.pcl

base/gscparam.c


2018-04-16 20:34:46 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
28c25a7aa12ab36996e12850dfc8e0935c0e4437

Bug 697545 : Prevent SEGV in pcfont_do_reset.

Prevent SEGV if memory allocation fails.

Error created using :-
MEMENTO_FAILAT=1908 ./membin/gpcl6 -sDEVICE=pbmraw -r300 -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pcfont.c


2018-04-19 17:42:06 +0100
Robin Watts <robin.watts@artifex.com>
b35f89d9bef02a02c55a377c6797afcbbe78664d

Simplify some image_render code routines.

Primarily these cut down on needlessly duplicated code.

The skew case should actually benefit in speed, because we don't
pointlessly redo the color mapping for every pixel.

base/gxicolor.c


2018-04-17 21:38:31 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
2c25f3c8582749cc9641d12ca4eb51adefa6d04d

Bug 697545 : Fix memory leak in rc_unshare_struct.

Rearrange order of macro so that the memory is freed even if the call to
rc_alloc_struct_1 fails.

Error created using :-
MEMENTO_FAILAT=10044 ./membin/gpcl6 -sDEVICE=pbmraw -r300 -o /dev/null ./pcl/examples/owl.pcl

base/gsrefct.h


2018-04-19 13:41:33 +0100
Chris Liddell <chris.liddell@artifex.com>
8f37f0e4f6325ea8f58194d81a8a6e3321e6660e

Remove some experimental code that was ifdef'ed out

base/gxfapi.c


2018-04-19 13:38:30 +0100
Chris Liddell <chris.liddell@artifex.com>
e8e91f7046645ac7334516735d06ae5109127892

Ensure uncached glyphs have the "text" tag set.

Glyphs bitmaps being drawn from FAPI, bypassing the glyph cache, were not
causing the device's tag to be set to text.

base/gxfapi.c


2018-04-18 13:54:13 +0100
Chris Liddell <chris.liddell@artifex.com>
8f912519ee1d7407126479fefc2210bc69f9e11a

Fix compiler warning with debug build

In a debug build, to facilitate logging/debugging, the rc_ajust() macro
calls a function to trace the reference count changes. The client name (cname)
parameter should be declared const to avoid a compiler warning.

base/gsmemory.c
base/gsrefct.h


2018-04-18 10:11:50 +0100
Chris Liddell <chris.liddell@artifex.com>
b8c65eab50076cfd56f0301ec764b30df9d86ae3

Bug 699214: Add and use a "no cache" flag for glyphs

Previously, to avoid using a cached glyph, the PXL code went around the
graphics library API to set a flag in the show enumerator that really should
only be touched internally.

This adds the capability to the enumerator for the client to request that no
cached glyphs be used for the current block of text, and changes the PXL code
to used it.

base/gstext.h
base/gxchar.c
pcl/pxl/pxfont.c


2018-04-18 09:07:27 +0100
Chris Liddell <chris.liddell@artifex.com>
fd22032d14134f32a42897c9db6a796340a912de

Bug 699214 (related): make text and show enums the same

This is the first part of removing the text enumerator altogether.

base/gxchar.h
base/gxtext.h
base/lib.mak
devices/vector/gdevpdtt.h
devices/vector/gdevtxtw.c


2018-04-18 15:47:20 +0100
Ken Sharp <ken.sharp@artifex.com>
49dcf2a599434f2cb9e0847a75ad61270d30e68a

Documentation - document two missing parameters

These got missed from the documentation when they were implemented.

doc/VectorDevices.htm


2018-04-18 15:46:32 +0100
Ken Sharp <ken.sharp@artifex.com>
39b1e54b2968620723bf32e96764c88797714879

pdfwrite - Guard against trying to output an infinite number

Bug #699255 " Buffer overflow on pprintg1 due to mishandle postscript file data to pdf"

The file uses an enormous parameter to xyxhow, causing an overflow in
the calculation of text positioning (value > 1e39).

Since this is basically a nonsense value, and PostScript only supports
real values up to 1e38, this patch follows the same approach as for
a degenerate CTM, and treats it as 0.

Adobe Acrobat Distiller throws a limitcheck error, so we could do that
instead if this approach proves to be a problem.

devices/vector/gdevpdts.c


2018-04-17 16:09:40 +0100
Chris Liddell <chris.liddell@artifex.com>
fb4c58a0e097e39547dde3d46893ce1b05d19539

Remove redundant references to Xfonts.htm

base/unixinst.mak
doc/Drivers.htm
doc/Readme.htm
doc/Use.htm


2018-03-30 14:38:28 +0100
Chris Liddell <chris.liddell@artifex.com>
59c722d075cb70fc076c2d41b30f16e0e54a4704

Bug 699160: rejig the .so "loaders" builds.

The two simple .so "loaders" (gsx and gsc) were built as a single step, source
to exe, process. Because of that LDFLAGS wasn't used.

We'll now separate the compile and link stages, meaning we can properly use
CFLAGS and LDFLAGS. It also means we can have more control of the order in
which the -L lib search paths are applied.

Properly pass on debug options, and extend these changes to the PCL/XPS/PDL
.so/exe targets.

Makefile.in
base/unix-dll.mak
base/unixlink.mak
configure.ac


2018-04-15 12:49:40 -0700
Ray Johnston <ray.johnston@artifex.com>
769ffb76e7cfd5eeff32251d122399f4b729477b

Fix warning on exit with ref_count > 0 due to pclxl image handling.

The pclxl_begin_image gets a link profile, but did not release the
link in pclxl_image_end_image causing the ref_count to be wrong.

devices/vector/gdevpx.c


2018-04-15 12:48:20 -0700
Ray Johnston <ray.johnston@artifex.com>
e88d8e90de569adedb614a2a7e3dda38063f4d02

Add ref_count debug to icc link cache.

base/gsicc_cache.c


2018-04-11 19:37:07 +0100
Robin Watts <robin.watts@artifex.com>
dfbf92a35d2be0aaa35bdb301c0647deec55b054

Attempt to fix vertical shifts seen in halftoning.

Differences are evident between old (slow, non SSE based) and new
(fast, C/SSE based) halftoning. This is not because of the SSE,
but rather because of different calculations in the C that prepares
the screen for the fast SSE based thresholding, specifically, I
believe, to the calculation of the y offset into the texture tile.

This commit changes the texture tile y offset calculation in the
'fast' code to involve screen_phase.y, in the hopes that this
will better match the 'old' version.

With this fix in, we see just a few PS/PDF diffs, but lots of PCL
diffs (as I guess you'd expect, as PCL makes much more use of this
kind of stuff). I've checked a random selection of them, and in all
cases the new page mode renderings with the "fast" code match the
page mode renderings given by the "old" code.

There are instances where the clist rendering no longer matches the
page mode rendering, but in the tests I've done the clist old code
does match the clist fast code. So we are consistent at least. I
suspect that there is something up with the way the y_phase is
transmitted across the clist, and have opened bug 699209 to
track that.

base/gxht_thresh.c


2018-04-11 20:28:23 +0100
Robin Watts <robin.watts@artifex.com>
b9e0722267e8770c01914da28f924cffcae1c0b8

Fix stray debugging code that was breaking windows builds.

base/write_t1.c


2018-04-10 16:01:44 +0100
Chris Liddell <chris.liddell@artifex.com>
1da9cf6dd87287b952826e8606a26f97b474c556

Multiple master font cached glyphs

In the event that the WeightVector is changed (via setweightvector) on an
already defined font object, we had no way to invalidate the glyph cache
entries already created for that font, with the previous WeightVector.

Given that MM fonts generally substitute for an entire use of a "real" font,
and changing "mid stream" is rare (and almost entirely restricted to test
files), this uses the sledgehammer approach of purging the existing glyphs
from the cache.

In real world use, this is going to have less effect on performance than adding
a conditional check on a variable length array of floating point numbers is
likely to have.

psi/int.mak
psi/zchar1.c


2018-01-30 09:31:04 +0000
Chris Liddell <chris.liddell@artifex.com>
36e7d38af2a11b5e4d7117ddd0ebf7326fad7c72

Bug 698767: Improve handling of multiple master fonts

The FAPI API didn't really handle the possibility that multiple master fonts
could change (via setweightvector) without a call to definefont/setfont etc.

We now allow two ways for FAPI to handle this: if the scaler in force allows it,
we'll set the new weight vector, and carry on as before.

If the scaler does *not* allow us to change the weight vector "on the fly",
we'll destroy the scaler's font object and related data, and recreate it with
the new weight vector in the font dictionary.

base/fapi_ft.c
base/fapibstm.c
base/fapiufst.c
base/gsalloc.c
base/gxfapi.c
base/gxfapi.h
base/write_t1.c
psi/zfapi.c


2018-04-08 20:34:43 +0800
Sebastian Rasmussen <sebras@gmail.com>
890e637bf7a1d8a5e3438c2aab4e0eef33d795f1

jbig2dec: Detect data shortage.

jbig2dec/jbig2_page.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_text.c


2018-04-08 20:33:33 +0800
Sebastian Rasmussen <sebras@gmail.com>
44ff6900ac97d53101c8585880acb9a73631cefe

jbig2dec: Remember to free halftone GB_stats in case of error.

jbig2dec/jbig2_halftone.c


2018-04-08 20:32:59 +0800
Sebastian Rasmussen <sebras@gmail.com>
9efdbd90790f87ab9f56a4cd39b703a23c9d3172

jbig2dec: Make error messages distinguishable.

jbig2dec/jbig2_symbol_dict.c


2018-04-08 14:58:23 +0800
Sebastian Rasmussen <sebras@gmail.com>
1fca43f52caa90926169fe1fe845837749bab233

jbig2dec: Plug leak of image upon error decoding text region.

jbig2dec/jbig2_symbol_dict.c


2018-04-06 00:41:01 +0800
Sebastian Rasmussen <sebras@gmail.com>
2b2dcf4ccf401ed210f03c858b304994749fd2b3

jbig2dec: Improve error handling.

Some functions detected errors but would not return these
to the caller. These functions may now indicate errors:

jbig2_arith_decode(), jbig2_image_resize()

Errors detected by following functions were not always
handled, but they are now handled properly:

jbig2_arith_decode(), jbig2_arith_iaid_decode()
jbig2_arith_int_ctx_new(), jbig2_build_huffman_table()
jbig2_complete_page(), jbig2_image_compose()
jbig2_decode_refinement_region(), jbig2_ctx_new()
jbig2_image_resize(), jbig2_image_write_pbm()
jbig2_image_write_pbm_file(), jbig2_image_write_png()
jbig2_image_write_png_file(), jbig2_metadata_add()
jbig2_page_add_result(), jbig2_renew()
jbig2_strndup()

Some functions detected errors but did not fail early enough:

jbig2_decode_pattern_dict(), jbig2_decode_halftone_region()

jbig2_decode_mmr_line() detected errors but did not produce
suitable error messages. This has been rectified.

Finally, if a subfunction indicates an error by returning an
error code, the calling function will report a warning and
return, indicating failure.

jbig2dec/jbig2.c
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith.h
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_arith_iaid.h
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_arith_int.h
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_image.c
jbig2dec/jbig2_image_pbm.c
jbig2dec/jbig2_image_png.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c
jbig2dec/jbig2dec.c
jbig2dec/pbm2png.c


2018-04-06 00:44:10 +0800
Sebastian Rasmussen <sebras@gmail.com>
7ede8fc2b5e8498619d1e32b6b7fbbf9f926a055

jbig2dec: Remove unused return value for setting pixel.

jbig2dec/jbig2_image.c
jbig2dec/jbig2_image.h


2018-04-09 21:30:07 +0800
Sebastian Rasmussen <sebras@gmail.com>
2afeb8384e4db612df56d5f02162767647893a7d

jbig2dec: Remove end of line characters to jbig2_error() messages.

jbig2dec/jbig2_image.c
jbig2dec/jbig2_symbol_dict.c


2018-04-07 00:12:15 +0800
Sebastian Rasmussen <sebras@gmail.com>
d38507b3d62d9d0710b1c5122af5db9730167082

jbig2dec: Fix some cosmetic typos in code/headers/tests.

jbig2dec/jbig2.h
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_image_png.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_text.c
jbig2dec/jbig2dec.c
jbig2dec/memento.c
jbig2dec/test_jbig2dec.py


2018-03-26 21:57:33 +0800
Sebastian Rasmussen <sebras@gmail.com>
c0f89bd215d700339429da4375a4eaf89445f872

jbig2dec: Remove unnecessary whitespace.

jbig2dec/jbig2.c
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c
jbig2dec/test_jbig2dec.py


2018-04-09 11:49:52 +0200
Tor Andersson <tor.andersson@artifex.com>
47f3be9b6676ed09e844362b267daae2a1b04a4d

jbig2dec: Make sure to include stdint.h in the generated config_types.h

The previous commit accidentally broke the autoconf build.

jbig2dec/autogen.sh


2018-04-06 12:44:38 +0100
Robin Watts <robin.watts@artifex.com>
bda3b5087d136c7839ded79594ac70e9712228e5

Fix Memento locking problem.

When calling Memento_event, it would lock, and then call
Memento_checkAllMemory which would lock again. This is fine
on windows, as locks are recursive, but not on Linux.

base/memento.c


2018-04-04 22:36:24 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
cbbe08d116ae91e0cc0ffa91eb71ec364b4d44a3

Bug 697545 : Fix memory leak in gx_pattern_load.

Fix memory leak due to pattern cache data being allocated but not used.

Error created using :-
MEMENTO_FAILAT=10103 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gxpcmap.c


2018-04-04 18:40:01 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
cbc44b82c2c63ef48c994fb2eced4350e41159aa

Bug 697545 : Fix memory leak in show_proceed.

Fix memory leak due to gsave/grestore mismatch.

Error created using :-
MEMENTO_FAILAT=10946 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gxchar.c


2018-04-05 16:28:01 +0100
Robin Watts <robin.watts@artifex.com>
4372854939842240c7edb58dd0fa285a0c2f15b1

Another attempt at fixing the 'skip' logic for halftoned images.

When rendering images, if the dda is not shared between the
halftoner and gs, gs cannot just skip lines that it knows should
be clipped, lest the halftoner get confused about it.

The previous attempt to solve this used a separate 'skip_render'
routine, but the decision as to whether to call this or not was
itself dependent on the values of the dda. When scaling down
scanlines can be completely skipped. In the cases where the dda
in gs doesn't match the one in the halftoner exactly we could
get dropouts.

So, a new attempt. Here we introduce a new function call that
checks with the halftoner whether the next scanline will be
required or not. If it is, gs unpacks the data and passes it in.
If not, the data can just be skipped.

base/gxidata.c
base/gximage.h
base/gxipixel.c


2018-04-04 18:38:02 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
5886c28f2a7376ad3818dadeb9cc3c6989f7702a

Bug 697545 : Fix memory leak in pcl_start_raster.

Fix memory leak after memory allocation failure.

Error created using :-
MEMENTO_FAILAT=11602 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/rtraster.c


2018-04-05 14:12:25 +0100
Chris Liddell <chris.liddell@artifex.com>
9ef02a883952ecc225792896a1eabac93e19f143

Bug 699158: Tidy up a validation check

Use a cleaner check to ensure UFST only gets passed Microtype fonts (from .fco
font collections).

Not sure what I was thinking when I wrote the original check, but it was clearly
a bad code day!

base/fapiufst.c


2018-04-05 14:10:54 +0100
Chris Liddell <chris.liddell@artifex.com>
410d5f9372db241713f0e9730ec18edfa117f687

Fix some link typos in Develop.html

doc/Develop.htm


2018-04-04 17:30:17 +0100
Robin Watts <robin.watts@artifex.com>
bc9e133f81e02e90e9fc9a82853d0aea18cdb905

Fix new logic for skipping clipped image lines.

In refactoring the previous commit so that it didn't cause
diffs, I broke it so that it gave no advantage.

This version should give no diffs, AND give a speed increase
by avoiding unpacking elided lines.

base/gxidata.c


2018-04-03 17:47:03 +0100
Robin Watts <robin.watts@artifex.com>
41e94a745cdbed112efc0e72d76645e8500a0791

Tweak logic for skipping clipped image lines.

As gs runs through image data, it unpacks each line into
a buffer, then checks whether that buffer is trivially
outside the clipping region. If it is, then it doesn't
bother to call the line renderer.

This has 2 implications. Firstly, we unpack the line data
even if it is to be skipped. Secondly, for line renderers
that rely on counting the number of lines they have been
passed (rather than on consulting the position of the dda)
to know where they are, this can cause problems.

Accordingly, this commit rejigs the code a bit. As well
as a function pointer within penum that points to the
rendering routine, we have a new function pointer that
points to an optional "skip_render" routine.

We also rejig the code so that we only unpack the data if
we know it is going to be used.

base/gxidata.c
base/gximage.h
base/gxipixel.c


2018-04-02 12:43:21 +0100
Robin Watts <robin.watts@artifex.com>
2870842d23f13413f3492f206cd12bb4144fc80d

Whitespace fix.

base/gxicolor.c


2018-04-02 12:44:36 +0100
Robin Watts <robin.watts@artifex.com>
8afca3fad1acbfd34b2a2910d04a5447c2e4555b

Downgrade gen_ordered solutions to VS2005.

From VS2008. VS2008 can still read the new (old!) ones.

toolbin/halftone/gen_ordered/gen_ordered.sln
toolbin/halftone/gen_ordered/gen_ordered.vcproj


2018-04-03 00:13:16 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
7891eda84b33aef5ee7540b3b3d04477e3602a3d

Prevent SEGV in memento squeeze builds.

Remove leftover variables from commit 9ff6b34e461fcbd4e.
Added conditional compilation to prevent SEGV from thread code.

base/gsicc_cache.c
base/gsicc_manage.c


2018-03-29 20:15:29 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f0e234d660dbeb774f39392f0e45e333fd9308a3

Bug 697545 : Update set_cache_device to prevent memory leaks.

Added a matching grestore for the gsave on all error paths.

base/gxchar.c


2018-03-30 09:21:28 +0100
Chris Liddell <chris.liddell@artifex.com>
bd2ce49067793d8b57c6a1b4831e16f952183f6b

Address warnings and deprecated API calls.

A number of gtk/gdk/cairo API calls have been deprecated since GTK+ 3.0 was
introduced, and using them triggers warnings - this replaces them with the
currently recommended APIs.

Also fix a couple of regular compiler warnings, and a gsapi related warning.

psi/dxmain.c


2018-03-29 14:04:10 -0700
Michael Vrhel <michael.vrhel@artifex.com>
25785cd67484e6ebf3625f7d2adedac076e80de2

Do not create a new cache for the ICC links with each page in clist mode

Right now the code currently creates a new ICC cache with every page.
This commit maintains the cache and only destroys it when we gdev_prn_tear_down

base/gxclist.c
base/gxclread.c


2018-03-27 20:13:18 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
344db7fb39f457201f243b2775e3d63cf8406010

Bug 697545 : Update functions to return error codes.

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

base/gsdps1.c
base/gxchar.c
base/gxifast.c
base/gximage4.c
pcl/pcl/pctext.c


2018-03-29 10:14:22 -0700
Robin Watts <Robin.Watts@artifex.com>
0f6ec1c44bb38175344be16d747b8feee35ae35f

Memento: Fix typo in Mutex init.

Thanks to Shelly for pointing this out.

base/memento.c


2018-03-28 14:57:56 +0100
Chris Liddell <chris.liddell@artifex.com>
a31ccd111b6ff21a1e49806c1e6e0861a9e45446

Update OpenJPEG to 2.3.0

Incorporates changes from:
1) Add predefined openjpeg headers.
71242c9a04bb76b8b17fc489d62a91d04c1ad60c

2) Import patches from Sumatra's tree.
8b89e4b5750069172522ecf85e69d094b5e567e7

3) Avoid getenv call in openjpeg
202a0318a7b3a397fcd5d015dcad4293474f464c

base/openjpeg.mak
openjpeg/CHANGELOG.md
openjpeg/NEWS.md
openjpeg/README.md
openjpeg/appveyor.yml
openjpeg/doc/CMakeLists.txt
openjpeg/doc/Doxyfile.dox.cmake.in
openjpeg/doc/jpip_architect.png
openjpeg/doc/jpip_protocol.png
openjpeg/doc/mainpage.dox.in
openjpeg/doc/man/man1/opj_compress.1
openjpeg/doc/man/man1/opj_decompress.1
openjpeg/doc/man/man1/opj_dump.1
openjpeg/doc/man/man3/libopenjp2.3
openjpeg/doc/openjpip.dox.in
openjpeg/src/bin/CMakeLists.txt
openjpeg/src/bin/common/CMakeLists.txt
openjpeg/src/bin/common/color.c
openjpeg/src/bin/common/color.h
openjpeg/src/bin/common/format_defs.h
openjpeg/src/bin/common/opj_apps_config.h.cmake.in
openjpeg/src/bin/common/opj_getopt.c
openjpeg/src/bin/common/opj_getopt.h
openjpeg/src/bin/common/opj_string.h
openjpeg/src/bin/jp2/CMakeLists.txt
openjpeg/src/bin/jp2/convert.c
openjpeg/src/bin/jp2/convert.h
openjpeg/src/bin/jp2/convertbmp.c
openjpeg/src/bin/jp2/convertpng.c
openjpeg/src/bin/jp2/converttif.c
openjpeg/src/bin/jp2/index.c
openjpeg/src/bin/jp2/index.h
openjpeg/src/bin/jp2/opj_compress.c
openjpeg/src/bin/jp2/opj_decompress.c
openjpeg/src/bin/jp2/opj_dump.c
openjpeg/src/bin/jp2/windirent.h
openjpeg/src/bin/jp3d/CMakeLists.txt
openjpeg/src/bin/jp3d/convert.c
openjpeg/src/bin/jp3d/convert.h
openjpeg/src/bin/jp3d/getopt.c
openjpeg/src/bin/jp3d/getopt.h
openjpeg/src/bin/jp3d/opj_jp3d_compress.c
openjpeg/src/bin/jp3d/opj_jp3d_decompress.c
openjpeg/src/bin/jp3d/tcltk/LPI_JP3D_VM.tcl
openjpeg/src/bin/jp3d/tcltk/README
openjpeg/src/bin/jp3d/tcltk/Thumbs.db
openjpeg/src/bin/jp3d/tcltk/decoder.tcl
openjpeg/src/bin/jp3d/tcltk/encoder.tcl
openjpeg/src/bin/jp3d/tcltk/logoLPI.gif
openjpeg/src/bin/jp3d/windirent.h
openjpeg/src/bin/jpip/CMakeLists.txt
openjpeg/src/bin/jpip/README
openjpeg/src/bin/jpip/opj_dec_server.c
openjpeg/src/bin/jpip/opj_jpip_addxml.c
openjpeg/src/bin/jpip/opj_jpip_test.c
openjpeg/src/bin/jpip/opj_jpip_transcode.c
openjpeg/src/bin/jpip/opj_server.c
openjpeg/src/bin/jpip/opj_viewer/dist/manifest.txt
openjpeg/src/bin/jpip/opj_viewer/src/ImageManager.java
openjpeg/src/bin/jpip/opj_viewer/src/ImageViewer.java
openjpeg/src/bin/jpip/opj_viewer/src/ImageWindow.java
openjpeg/src/bin/jpip/opj_viewer/src/ImgdecClient.java
openjpeg/src/bin/jpip/opj_viewer/src/JPIPHttpClient.java
openjpeg/src/bin/jpip/opj_viewer/src/MML.java
openjpeg/src/bin/jpip/opj_viewer/src/PnmImage.java
openjpeg/src/bin/jpip/opj_viewer/src/RegimViewer.java
openjpeg/src/bin/jpip/opj_viewer/src/ResizeListener.java
openjpeg/src/bin/jpip/opj_viewer_xerces/dist/manifest.txt.in
openjpeg/src/bin/jpip/opj_viewer_xerces/src/ImageViewer.java
openjpeg/src/bin/jpip/opj_viewer_xerces/src/ImageWindow.java
openjpeg/src/bin/jpip/opj_viewer_xerces/src/JP2XMLparser.java
openjpeg/src/bin/jpip/opj_viewer_xerces/src/OptionPanel.java
openjpeg/src/bin/jpwl/CMakeLists.txt
openjpeg/src/bin/jpwl/convert.c
openjpeg/src/bin/jpwl/convert.h
openjpeg/src/bin/jpwl/index.c
openjpeg/src/bin/jpwl/index.h
openjpeg/src/bin/jpwl/opj_jpwl_compress.c
openjpeg/src/bin/jpwl/opj_jpwl_decompress.c
openjpeg/src/bin/jpwl/windirent.h
openjpeg/src/bin/mj2/CMakeLists.txt
openjpeg/src/bin/mj2/meta_out.c
openjpeg/src/bin/mj2/meta_out.h
openjpeg/src/bin/mj2/mj2_to_metadata.c
openjpeg/src/bin/mj2/mj2_to_metadata.dtd
openjpeg/src/bin/mj2/mj2_to_metadata.h
openjpeg/src/bin/mj2/mj2_to_metadata.sln
openjpeg/src/bin/mj2/mj2_to_metadata.vcproj
openjpeg/src/bin/mj2/mj2_to_metadata_Notes.doc
openjpeg/src/bin/mj2/opj_mj2_compress.c
openjpeg/src/bin/mj2/opj_mj2_decompress.c
openjpeg/src/bin/mj2/opj_mj2_extract.c
openjpeg/src/bin/mj2/opj_mj2_wrap.c
openjpeg/src/bin/mj2/readme.txt
openjpeg/src/bin/wx/CMakeLists.txt
openjpeg/src/bin/wx/OPJViewer/CMakeLists.txt
openjpeg/src/bin/wx/OPJViewer/OPJViewer.iss
openjpeg/src/bin/wx/OPJViewer/Readme.txt
openjpeg/src/bin/wx/OPJViewer/about/about.htm
openjpeg/src/bin/wx/OPJViewer/about/opj_logo.png
openjpeg/src/bin/wx/OPJViewer/source/OPJAbout.cpp
openjpeg/src/bin/wx/OPJViewer/source/OPJChild.ico
openjpeg/src/bin/wx/OPJViewer/source/OPJChild16.xpm
openjpeg/src/bin/wx/OPJViewer/source/OPJDialogs.cpp
openjpeg/src/bin/wx/OPJViewer/source/OPJThreads.cpp
openjpeg/src/bin/wx/OPJViewer/source/OPJViewer.cpp
openjpeg/src/bin/wx/OPJViewer/source/OPJViewer.h
openjpeg/src/bin/wx/OPJViewer/source/OPJViewer.ico
openjpeg/src/bin/wx/OPJViewer/source/OPJViewer.rc
openjpeg/src/bin/wx/OPJViewer/source/OPJViewer16.xpm
openjpeg/src/bin/wx/OPJViewer/source/about_htm.h
openjpeg/src/bin/wx/OPJViewer/source/build.h
openjpeg/src/bin/wx/OPJViewer/source/icon1.xpm
openjpeg/src/bin/wx/OPJViewer/source/icon2.xpm
openjpeg/src/bin/wx/OPJViewer/source/icon3.xpm
openjpeg/src/bin/wx/OPJViewer/source/icon4.xpm
openjpeg/src/bin/wx/OPJViewer/source/icon5.xpm
openjpeg/src/bin/wx/OPJViewer/source/imagjpeg2000.cpp
openjpeg/src/bin/wx/OPJViewer/source/imagjpeg2000.h
openjpeg/src/bin/wx/OPJViewer/source/imagmxf.cpp
openjpeg/src/bin/wx/OPJViewer/source/imagmxf.h
openjpeg/src/bin/wx/OPJViewer/source/license.txt
openjpeg/src/bin/wx/OPJViewer/source/opj_logo.xpm
openjpeg/src/bin/wx/OPJViewer/source/readmeafter.txt
openjpeg/src/bin/wx/OPJViewer/source/readmebefore.txt
openjpeg/src/bin/wx/OPJViewer/source/wxj2kparser.cpp
openjpeg/src/bin/wx/OPJViewer/source/wxjp2parser.cpp
openjpeg/src/lib/openjp2/CMakeLists.txt
openjpeg/src/lib/openjp2/bench_dwt.c
openjpeg/src/lib/openjp2/dwt.c
openjpeg/src/lib/openjp2/dwt.h
openjpeg/src/lib/openjp2/image.c
openjpeg/src/lib/openjp2/j2k.c
openjpeg/src/lib/openjp2/j2k.h
openjpeg/src/lib/openjp2/jp2.c
openjpeg/src/lib/openjp2/jp2.h
openjpeg/src/lib/openjp2/mct.c
openjpeg/src/lib/openjp2/mct.h
openjpeg/src/lib/openjp2/mqc.c
openjpeg/src/lib/openjp2/mqc.h
openjpeg/src/lib/openjp2/mqc_inl.h
openjpeg/src/lib/openjp2/openjpeg.c
openjpeg/src/lib/openjp2/openjpeg.h
openjpeg/src/lib/openjp2/opj_codec.h
openjpeg/src/lib/openjp2/opj_config.h
openjpeg/src/lib/openjp2/opj_config_private.h
openjpeg/src/lib/openjp2/opj_includes.h
openjpeg/src/lib/openjp2/opj_intmath.h
openjpeg/src/lib/openjp2/sparse_array.c
openjpeg/src/lib/openjp2/sparse_array.h
openjpeg/src/lib/openjp2/t1.c
openjpeg/src/lib/openjp2/t1.h
openjpeg/src/lib/openjp2/t2.c
openjpeg/src/lib/openjp2/t2.h
openjpeg/src/lib/openjp2/tcd.c
openjpeg/src/lib/openjp2/tcd.h
openjpeg/src/lib/openjp2/test_sparse_array.c
openjpeg/src/lib/openjp2/thread.c


2018-03-27 16:26:13 +0100
Chris Liddell <chris.liddell@artifex.com>
25971c91d6433b0249d3b721b75ef704afe0a09c

Update libjpeg to 9c

Plus re-applying:
Bug 697186: Workaround JPEG lib bug.
8dcec8cc076a0cf8350ca7a6ec1d3136812e2a24

Bug 697186: Tweak to previous JPEG fix.
dc62c90930512f4b571f68c9110022b234cbd411

jpeg/Makefile.am
jpeg/Makefile.in
jpeg/README
jpeg/aclocal.m4
jpeg/ar-lib
jpeg/cderror.h
jpeg/change.log
jpeg/cjpeg.1
jpeg/compile
jpeg/config.guess
jpeg/config.sub
jpeg/configure
jpeg/configure.ac
jpeg/depcomp
jpeg/djpeg.1
jpeg/djpeg.c
jpeg/filelist.txt
jpeg/install-sh
jpeg/install.txt
jpeg/jcinit.c
jpeg/jcmaster.c
jpeg/jconfig.vc
jpeg/jcsample.c
jpeg/jctrans.c
jpeg/jdarith.c
jpeg/jdatadst.c
jpeg/jdatasrc.c
jpeg/jdcolor.c
jpeg/jdct.h
jpeg/jdhuff.c
jpeg/jdmainct.c
jpeg/jdmaster.c
jpeg/jdmerge.c
jpeg/jdsample.c
jpeg/jerror.c
jpeg/jfdctflt.c
jpeg/jfdctfst.c
jpeg/jfdctint.c
jpeg/jidctflt.c
jpeg/jidctfst.c
jpeg/jidctint.c
jpeg/jinclude.h
jpeg/jpegint.h
jpeg/jpeglib.h
jpeg/jpegtran.1
jpeg/jversion.h
jpeg/libjpeg.pc.in
jpeg/ltmain.sh
jpeg/makeasln.v15
jpeg/makecfil.v15
jpeg/makecvcx.v15
jpeg/makedfil.v15
jpeg/makedvcx.v15
jpeg/makefile.ansi
jpeg/makefile.b32
jpeg/makefile.bcc
jpeg/makefile.dj
jpeg/makefile.manx
jpeg/makefile.mc6
jpeg/makefile.mms
jpeg/makefile.sas
jpeg/makefile.unix
jpeg/makefile.vc
jpeg/makefile.vs
jpeg/makefile.wat
jpeg/makejfil.v15
jpeg/makejsln.v15
jpeg/makejvcx.v15
jpeg/makerfil.v15
jpeg/makervcx.v15
jpeg/maketfil.v15
jpeg/maketvcx.v15
jpeg/makewfil.v15
jpeg/makewvcx.v15
jpeg/missing
jpeg/rdbmp.c
jpeg/rdppm.c
jpeg/rdswitch.c
jpeg/rdtarga.c
jpeg/transupp.c
jpeg/usage.txt
jpeg/wrbmp.c
jpeg/wrgif.c
jpeg/wrjpgcom.c
jpeg/wrppm.c
jpeg/wrrle.c
jpeg/wrtarga.c


2018-03-27 16:16:49 +0100
Chris Liddell <chris.liddell@artifex.com>
d8a919d4b45097a527f6f39d509b920d285d709b

Update expat to 2.2.5

With a couple of tweaks to base/expat.mak to make it work.

base/expat.mak
expat/AUTHORS
expat/CMake.README
expat/CMakeLists.txt
expat/COPYING
expat/Changes
expat/ConfigureChecks.cmake
expat/MANIFEST
expat/Makefile.am
expat/Makefile.in
expat/README
expat/README.md
expat/aclocal.m4
expat/amiga/Makefile
expat/amiga/README.txt
expat/amiga/expat.xml
expat/amiga/expat_68k.c
expat/amiga/expat_68k.h
expat/amiga/expat_68k_handler_stubs.c
expat/amiga/expat_base.h
expat/amiga/expat_lib.c
expat/amiga/expat_vectors.c
expat/amiga/include/inline4/expat.h
expat/amiga/include/interfaces/expat.h
expat/amiga/include/libraries/expat.h
expat/amiga/include/proto/expat.h
expat/amiga/launch.c
expat/bcb5/README.txt
expat/bcb5/all_projects.bpg
expat/bcb5/elements.bpf
expat/bcb5/elements.bpr
expat/bcb5/elements.mak
expat/bcb5/expat.bpf
expat/bcb5/expat.bpr
expat/bcb5/expat.mak
expat/bcb5/expat_static.bpf
expat/bcb5/expat_static.bpr
expat/bcb5/expat_static.mak
expat/bcb5/expatw.bpf
expat/bcb5/expatw.bpr
expat/bcb5/expatw.mak
expat/bcb5/expatw_static.bpf
expat/bcb5/expatw_static.bpr
expat/bcb5/expatw_static.mak
expat/bcb5/libexpat_mtd.def
expat/bcb5/libexpatw_mtd.def
expat/bcb5/makefile.mak
expat/bcb5/outline.bpf
expat/bcb5/outline.bpr
expat/bcb5/outline.mak
expat/bcb5/setup.bat
expat/bcb5/xmlwf.bpf
expat/bcb5/xmlwf.bpr
expat/bcb5/xmlwf.mak
expat/configure
expat/configure.ac
expat/conftools/compile
expat/conftools/config.guess
expat/conftools/config.sub
expat/conftools/depcomp
expat/conftools/get-version.sh
expat/conftools/install-sh
expat/conftools/missing
expat/conftools/mkinstalldirs
expat/conftools/test-driver
expat/doc/Makefile.am
expat/doc/Makefile.in
expat/doc/reference.html
expat/doc/xmlwf.1
expat/doc/xmlwf.xml
expat/examples/Makefile.am
expat/examples/Makefile.in
expat/examples/elements.c
expat/examples/elements.dsp
expat/examples/elements.vcxproj
expat/examples/elements.vcxproj.filters
expat/examples/outline.c
expat/examples/outline.dsp
expat/examples/outline.vcxproj
expat/examples/outline.vcxproj.filters
expat/expat.dsw
expat/expat.sln
expat/expat_config.h
expat/expat_config.h.cmake
expat/expat_config.h.in
expat/lib/Makefile.MPW
expat/lib/Makefile.am
expat/lib/Makefile.in
expat/lib/amigaconfig.h
expat/lib/ascii.h
expat/lib/asciitab.h
expat/lib/expat.dsp
expat/lib/expat.h
expat/lib/expat.vcxproj
expat/lib/expat.vcxproj.filters
expat/lib/expat_external.h
expat/lib/expat_static.dsp
expat/lib/expat_static.vcxproj
expat/lib/expat_static.vcxproj.filters
expat/lib/expatw.dsp
expat/lib/expatw.vcxproj
expat/lib/expatw.vcxproj.filters
expat/lib/expatw_static.dsp
expat/lib/expatw_static.vcxproj
expat/lib/expatw_static.vcxproj.filters
expat/lib/iasciitab.h
expat/lib/internal.h
expat/lib/latin1tab.h
expat/lib/libexpat.def
expat/lib/libexpatw.def
expat/lib/loadlibrary.c
expat/lib/macconfig.h
expat/lib/nametab.h
expat/lib/siphash.h
expat/lib/utf8tab.h
expat/lib/winconfig.h
expat/lib/xmlparse.c
expat/lib/xmlrole.c
expat/lib/xmlrole.h
expat/lib/xmltok.c
expat/lib/xmltok.h
expat/lib/xmltok_impl.c
expat/lib/xmltok_impl.h
expat/lib/xmltok_ns.c
expat/m4/libtool.m4
expat/run.sh.in
expat/test-driver-wrapper.sh
expat/tests/Makefile.am
expat/tests/Makefile.in
expat/tests/benchmark/Makefile.am
expat/tests/benchmark/Makefile.in
expat/tests/benchmark/benchmark.c
expat/tests/benchmark/benchmark.dsp
expat/tests/benchmark/benchmark.dsw
expat/tests/benchmark/benchmark.sln
expat/tests/benchmark/benchmark.vcxproj
expat/tests/chardata.c
expat/tests/chardata.h
expat/tests/memcheck.c
expat/tests/memcheck.h
expat/tests/minicheck.c
expat/tests/minicheck.h
expat/tests/runtests.c
expat/tests/runtests.sln
expat/tests/runtests.vcxproj
expat/tests/runtests.vcxproj.filters
expat/tests/runtestspp.cpp
expat/tests/structdata.c
expat/tests/structdata.h
expat/tests/udiffer.py
expat/tests/xmltest.log.expected
expat/tests/xmltest.sh
expat/vms/README.vms
expat/vms/descrip.mms
expat/vms/expat_config.h
expat/win32/MANIFEST.txt
expat/win32/README.txt
expat/win32/expat.iss
expat/xmlwf/Makefile.am
expat/xmlwf/Makefile.in
expat/xmlwf/codepage.c
expat/xmlwf/codepage.h
expat/xmlwf/ct.c
expat/xmlwf/filemap.h
expat/xmlwf/readfilemap.c
expat/xmlwf/unixfilemap.c
expat/xmlwf/win32filemap.c
expat/xmlwf/xmlfile.c
expat/xmlwf/xmlfile.h
expat/xmlwf/xmlmime.c
expat/xmlwf/xmlmime.h
expat/xmlwf/xmltchar.h
expat/xmlwf/xmlurl.h
expat/xmlwf/xmlwf.c
expat/xmlwf/xmlwf.dsp
expat/xmlwf/xmlwf.vcxproj
expat/xmlwf/xmlwf.vcxproj.filters
expat/xmlwf/xmlwin32url.cxx


2018-03-27 14:08:47 +0100
Chris Liddell <chris.liddell@artifex.com>
003c4211a019eb5c4719860f353777e177553490

Update libtiff to 4.0.9

Add in portability changes to tiffiop.h

Portability tiffiop.h

Remove globals from tif_pixarlog.c

Tweaks to support libtiff 4.0.9

base/gstiffio.c
configure.ac
tiff/CMakeLists.txt
tiff/ChangeLog
tiff/HOWTO-RELEASE
tiff/RELEASE-DATE
tiff/VERSION
tiff/config/ltmain.sh
tiff/configure
tiff/configure.ac
tiff/html/Makefile.am
tiff/html/Makefile.in
tiff/html/index.html
tiff/html/man/CMakeLists.txt
tiff/html/man/Makefile.am
tiff/html/man/Makefile.in
tiff/html/man/rgb2ycbcr.1.html
tiff/html/man/thumbnail.1.html
tiff/html/v4.0.7.html
tiff/html/v4.0.8.html
tiff/html/v4.0.9.html
tiff/libtiff/libtiff.def
tiff/libtiff/tif_aux.c
tiff/libtiff/tif_color.c
tiff/libtiff/tif_dir.c
tiff/libtiff/tif_dir.h
tiff/libtiff/tif_dirinfo.c
tiff/libtiff/tif_dirread.c
tiff/libtiff/tif_dirwrite.c
tiff/libtiff/tif_error.c
tiff/libtiff/tif_fax3.c
tiff/libtiff/tif_fax3.h
tiff/libtiff/tif_getimage.c
tiff/libtiff/tif_jbig.c
tiff/libtiff/tif_jpeg.c
tiff/libtiff/tif_jpeg_12.c
tiff/libtiff/tif_luv.c
tiff/libtiff/tif_lzw.c
tiff/libtiff/tif_ojpeg.c
tiff/libtiff/tif_open.c
tiff/libtiff/tif_packbits.c
tiff/libtiff/tif_pixarlog.c
tiff/libtiff/tif_predict.c
tiff/libtiff/tif_print.c
tiff/libtiff/tif_read.c
tiff/libtiff/tif_strip.c
tiff/libtiff/tif_swab.c
tiff/libtiff/tif_unix.c
tiff/libtiff/tif_warning.c
tiff/libtiff/tif_win32.c
tiff/libtiff/tif_write.c
tiff/libtiff/tif_zip.c
tiff/libtiff/tiffio.h
tiff/libtiff/tiffiop.h
tiff/libtiff/tiffvers.h
tiff/m4/libtool.m4
tiff/man/CMakeLists.txt
tiff/man/Makefile.am
tiff/man/Makefile.in
tiff/man/TIFFGetField.3tiff
tiff/man/TIFFSetDirectory.3tiff
tiff/man/TIFFSetField.3tiff
tiff/man/rgb2ycbcr.1
tiff/man/thumbnail.1
tiff/nmake.opt
tiff/test/CMakeLists.txt
tiff/test/Makefile.am
tiff/test/Makefile.in
tiff/test/TiffTestCommon.cmake
tiff/test/common.sh
tiff/test/images/quad-lzw-compat.tiff
tiff/test/tiff2bw-palette-1c-8b.sh
tiff/test/tiff2bw-quad-lzw-compat.sh
tiff/test/tiff2bw-rgb-3c-8b.sh
tiff/test/tiffcp-lzw-compat.sh
tiff/tools/fax2tiff.c
tiff/tools/raw2tiff.c
tiff/tools/tiff2bw.c
tiff/tools/tiff2pdf.c
tiff/tools/tiff2ps.c
tiff/tools/tiffcp.c
tiff/tools/tiffcrop.c
tiff/tools/tiffinfo.c
tiff/tools/tiffset.c


2018-03-26 16:12:39 +0100
Chris Liddell <chris.liddell@artifex.com>
bc817a3afdb932eadac17155834f89efd1c96da4

Bring libpng up to 1.6.34

base/png.mak
libpng/ANNOUNCE
libpng/CHANGES
libpng/CMakeLists.txt
libpng/INSTALL
libpng/LICENSE
libpng/Makefile.am
libpng/Makefile.in
libpng/README
libpng/TODO
libpng/arm/filter_neon.S
libpng/config.h.in
libpng/configure
libpng/configure.ac
libpng/contrib/arm-neon/android-ndk.c
libpng/contrib/arm-neon/linux.c
libpng/contrib/examples/pngtopng.c
libpng/contrib/gregbook/README
libpng/contrib/gregbook/readpng.c
libpng/contrib/gregbook/readpng2.c
libpng/contrib/gregbook/readppm.c
libpng/contrib/gregbook/rpng-win.c
libpng/contrib/gregbook/rpng-x.c
libpng/contrib/gregbook/rpng2-win.c
libpng/contrib/gregbook/rpng2-x.c
libpng/contrib/gregbook/wpng.c
libpng/contrib/gregbook/writepng.c
libpng/contrib/intel/INSTALL
libpng/contrib/intel/intel_sse.patch
libpng/contrib/libtests/pngstest.c
libpng/contrib/libtests/pngunknown.c
libpng/contrib/libtests/pngvalid.c
libpng/contrib/oss-fuzz/Dockerfile
libpng/contrib/oss-fuzz/README.txt
libpng/contrib/oss-fuzz/build.sh
libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc
libpng/contrib/oss-fuzz/libpng_read_fuzzer.options
libpng/contrib/oss-fuzz/newcc
libpng/contrib/oss-fuzz/png.dict
libpng/contrib/pngminus/png2pnm.c
libpng/contrib/pngminus/pnm2png.c
libpng/contrib/powerpc-vsx/README
libpng/contrib/powerpc-vsx/linux.c
libpng/contrib/powerpc-vsx/linux_aux.c
libpng/contrib/testpngs/crashers/bad_iCCP.png
libpng/contrib/testpngs/crashers/badadler.png
libpng/contrib/testpngs/crashers/badcrc.png
libpng/contrib/testpngs/crashers/empty_ancillary_chunks.png
libpng/contrib/testpngs/crashers/huge_IDAT.png
libpng/contrib/testpngs/crashers/huge_bKGD_chunk.png
libpng/contrib/testpngs/crashers/huge_cHRM_chunk.png
libpng/contrib/testpngs/crashers/huge_eXIf_chunk.png
libpng/contrib/testpngs/crashers/huge_gAMA_chunk.png
libpng/contrib/testpngs/crashers/huge_hIST_chunk.png
libpng/contrib/testpngs/crashers/huge_iCCP_chunk.png
libpng/contrib/testpngs/crashers/huge_iTXt_chunk.png
libpng/contrib/testpngs/crashers/huge_juNK_unsafe_to_copy.png
libpng/contrib/testpngs/crashers/huge_juNk_safe_to_copy.png
libpng/contrib/testpngs/crashers/huge_pCAL_chunk.png
libpng/contrib/testpngs/crashers/huge_pHYs_chunk.png
libpng/contrib/testpngs/crashers/huge_sCAL_chunk.png
libpng/contrib/testpngs/crashers/huge_sPLT_chunk.png
libpng/contrib/testpngs/crashers/huge_sRGB_chunk.png
libpng/contrib/testpngs/crashers/huge_sTER_chunk.png
libpng/contrib/testpngs/crashers/huge_tEXt_chunk.png
libpng/contrib/testpngs/crashers/huge_tIME_chunk.png
libpng/contrib/testpngs/crashers/huge_zTXt_chunk.png
libpng/contrib/testpngs/gray-1-1.8-tRNS.png
libpng/contrib/testpngs/gray-1-1.8.png
libpng/contrib/testpngs/gray-1-linear-tRNS.png
libpng/contrib/testpngs/gray-1-linear.png
libpng/contrib/testpngs/gray-1-sRGB-tRNS.png
libpng/contrib/testpngs/gray-1-sRGB.png
libpng/contrib/testpngs/gray-1-tRNS.png
libpng/contrib/testpngs/gray-1.png
libpng/contrib/testpngs/gray-16-1.8-tRNS.png
libpng/contrib/testpngs/gray-16-1.8.png
libpng/contrib/testpngs/gray-16-linear-tRNS.png
libpng/contrib/testpngs/gray-16-linear.png
libpng/contrib/testpngs/gray-16-sRGB-tRNS.png
libpng/contrib/testpngs/gray-16-sRGB.png
libpng/contrib/testpngs/gray-16-tRNS.png
libpng/contrib/testpngs/gray-16.png
libpng/contrib/testpngs/gray-2-1.8-tRNS.png
libpng/contrib/testpngs/gray-2-1.8.png
libpng/contrib/testpngs/gray-2-linear-tRNS.png
libpng/contrib/testpngs/gray-2-linear.png
libpng/contrib/testpngs/gray-2-sRGB-tRNS.png
libpng/contrib/testpngs/gray-2-sRGB.png
libpng/contrib/testpngs/gray-2-tRNS.png
libpng/contrib/testpngs/gray-2.png
libpng/contrib/testpngs/gray-4-1.8-tRNS.png
libpng/contrib/testpngs/gray-4-1.8.png
libpng/contrib/testpngs/gray-4-linear-tRNS.png
libpng/contrib/testpngs/gray-4-linear.png
libpng/contrib/testpngs/gray-4-sRGB-tRNS.png
libpng/contrib/testpngs/gray-4-sRGB.png
libpng/contrib/testpngs/gray-4-tRNS.png
libpng/contrib/testpngs/gray-4.png
libpng/contrib/testpngs/gray-8-1.8-tRNS.png
libpng/contrib/testpngs/gray-8-1.8.png
libpng/contrib/testpngs/gray-8-linear-tRNS.png
libpng/contrib/testpngs/gray-8-linear.png
libpng/contrib/testpngs/gray-8-sRGB-tRNS.png
libpng/contrib/testpngs/gray-8-sRGB.png
libpng/contrib/testpngs/gray-8-tRNS.png
libpng/contrib/testpngs/gray-8.png
libpng/contrib/testpngs/gray-alpha-16-1.8.png
libpng/contrib/testpngs/gray-alpha-16-linear.png
libpng/contrib/testpngs/gray-alpha-16-sRGB.png
libpng/contrib/testpngs/gray-alpha-16.png
libpng/contrib/testpngs/gray-alpha-8-1.8.png
libpng/contrib/testpngs/gray-alpha-8-linear.png
libpng/contrib/testpngs/gray-alpha-8-sRGB.png
libpng/contrib/testpngs/gray-alpha-8.png
libpng/contrib/testpngs/makepngs.sh
libpng/contrib/testpngs/palette-1-1.8-tRNS.png
libpng/contrib/testpngs/palette-1-1.8.png
libpng/contrib/testpngs/palette-1-linear-tRNS.png
libpng/contrib/testpngs/palette-1-linear.png
libpng/contrib/testpngs/palette-1-sRGB-tRNS.png
libpng/contrib/testpngs/palette-1-sRGB.png
libpng/contrib/testpngs/palette-1-tRNS.png
libpng/contrib/testpngs/palette-1.png
libpng/contrib/testpngs/palette-2-1.8-tRNS.png
libpng/contrib/testpngs/palette-2-1.8.png
libpng/contrib/testpngs/palette-2-linear-tRNS.png
libpng/contrib/testpngs/palette-2-linear.png
libpng/contrib/testpngs/palette-2-sRGB-tRNS.png
libpng/contrib/testpngs/palette-2-sRGB.png
libpng/contrib/testpngs/palette-2-tRNS.png
libpng/contrib/testpngs/palette-2.png
libpng/contrib/testpngs/palette-4-1.8-tRNS.png
libpng/contrib/testpngs/palette-4-1.8.png
libpng/contrib/testpngs/palette-4-linear-tRNS.png
libpng/contrib/testpngs/palette-4-linear.png
libpng/contrib/testpngs/palette-4-sRGB-tRNS.png
libpng/contrib/testpngs/palette-4-sRGB.png
libpng/contrib/testpngs/palette-4-tRNS.png
libpng/contrib/testpngs/palette-4.png
libpng/contrib/testpngs/palette-8-1.8-tRNS.png
libpng/contrib/testpngs/palette-8-1.8.png
libpng/contrib/testpngs/palette-8-linear-tRNS.png
libpng/contrib/testpngs/palette-8-linear.png
libpng/contrib/testpngs/palette-8-sRGB-tRNS.png
libpng/contrib/testpngs/palette-8-sRGB.png
libpng/contrib/testpngs/palette-8-tRNS.png
libpng/contrib/testpngs/palette-8.png
libpng/contrib/testpngs/rgb-16-1.8-tRNS.png
libpng/contrib/testpngs/rgb-16-1.8.png
libpng/contrib/testpngs/rgb-16-linear-tRNS.png
libpng/contrib/testpngs/rgb-16-linear.png
libpng/contrib/testpngs/rgb-16-sRGB-tRNS.png
libpng/contrib/testpngs/rgb-16-sRGB.png
libpng/contrib/testpngs/rgb-16-tRNS.png
libpng/contrib/testpngs/rgb-16.png
libpng/contrib/testpngs/rgb-8-1.8-tRNS.png
libpng/contrib/testpngs/rgb-8-1.8.png
libpng/contrib/testpngs/rgb-8-linear-tRNS.png
libpng/contrib/testpngs/rgb-8-linear.png
libpng/contrib/testpngs/rgb-8-sRGB-tRNS.png
libpng/contrib/testpngs/rgb-8-sRGB.png
libpng/contrib/testpngs/rgb-8-tRNS.png
libpng/contrib/testpngs/rgb-8.png
libpng/contrib/testpngs/rgb-alpha-16-1.8.png
libpng/contrib/testpngs/rgb-alpha-16-linear.png
libpng/contrib/testpngs/rgb-alpha-16-sRGB.png
libpng/contrib/testpngs/rgb-alpha-16.png
libpng/contrib/testpngs/rgb-alpha-8-1.8.png
libpng/contrib/testpngs/rgb-alpha-8-linear.png
libpng/contrib/testpngs/rgb-alpha-8-sRGB.png
libpng/contrib/testpngs/rgb-alpha-8.png
libpng/contrib/tools/genpng.c
libpng/contrib/tools/pngfix.c
libpng/contrib/tools/sRGB.h
libpng/contrib/visupng/PngFile.c
libpng/contrib/visupng/VisualPng.c
libpng/example.c
libpng/intel/filter_sse2_intrinsics.c
libpng/intel/intel_init.c
libpng/libpng-manual.txt
libpng/libpng.3
libpng/libpng.pc.in
libpng/libpngpf.3
libpng/ltmain.sh
libpng/mips/filter_msa_intrinsics.c
libpng/mips/mips_init.c
libpng/png.5
libpng/png.c
libpng/png.h
libpng/pngconf.h
libpng/pngerror.c
libpng/pngget.c
libpng/pnginfo.h
libpng/pngpread.c
libpng/pngpriv.h
libpng/pngread.c
libpng/pngrtran.c
libpng/pngrutil.c
libpng/pngset.c
libpng/pngstruct.h
libpng/pngtest.c
libpng/pngtest.png
libpng/pngtrans.c
libpng/pngwrite.c
libpng/pngwutil.c
libpng/powerpc/filter_vsx_intrinsics.c
libpng/powerpc/powerpc_init.c
libpng/projects/owatcom/pngconfig.mak
libpng/projects/vstudio/README.txt
libpng/projects/vstudio/zlib.props
libpng/scripts/README.txt
libpng/scripts/def.c
libpng/scripts/libpng-config-head.in
libpng/scripts/libpng.pc.in
libpng/scripts/makefile.cegcc
libpng/scripts/makefile.linux
libpng/scripts/makefile.linux-opt
libpng/scripts/makefile.msys
libpng/scripts/makefile.ne12bsd
libpng/scripts/makefile.netbsd
libpng/scripts/makefile.openbsd
libpng/scripts/makefile.solaris-x86
libpng/scripts/pnglibconf.dfa
libpng/scripts/pnglibconf.h.prebuilt
libpng/scripts/symbols.def
libpng/tests/pngimage-full
libpng/tests/pngimage-quick
libpng/tests/pngstest
libpng/tests/pngstest-1.8
libpng/tests/pngstest-1.8-alpha
libpng/tests/pngstest-linear
libpng/tests/pngstest-linear-alpha
libpng/tests/pngstest-none
libpng/tests/pngstest-none-alpha
libpng/tests/pngstest-sRGB
libpng/tests/pngstest-sRGB-alpha
libpng/tests/pngtest
libpng/tests/pngtest-badpngs
libpng/tests/pngunknown-IDAT
libpng/tests/pngunknown-discard
libpng/tests/pngunknown-if-safe
libpng/tests/pngunknown-sAPI
libpng/tests/pngunknown-sTER
libpng/tests/pngunknown-save
libpng/tests/pngunknown-vpAg
libpng/tests/pngvalid-gamma-16-to-8
libpng/tests/pngvalid-gamma-alpha-mode
libpng/tests/pngvalid-gamma-background
libpng/tests/pngvalid-gamma-expand16-alpha-mode
libpng/tests/pngvalid-gamma-expand16-background
libpng/tests/pngvalid-gamma-expand16-transform
libpng/tests/pngvalid-gamma-sbit
libpng/tests/pngvalid-gamma-threshold
libpng/tests/pngvalid-gamma-transform
libpng/tests/pngvalid-progressive-interlace-standard
libpng/tests/pngvalid-progressive-size
libpng/tests/pngvalid-progressive-standard
libpng/tests/pngvalid-standard
libpng/tests/pngvalid-transform


2018-03-27 13:47:02 +0100
Chris Liddell <chris.liddell@artifex.com>
0a4ef8b01c2ea146b9dce7b80f21f6cd65420099

Remove symlink from docs install.

For 9.23 we moved the default installation path for the documentation to better
fit with "modern" Linux/Unix directory layouts. To minimize upheaval, we
included a symlink to the "old"style path.

Remove that now, as it was only a temporary thing.

base/unixinst.mak


2018-03-27 10:43:29 +0100
Chris Liddell <chris.liddell@artifex.com>
3de8ff9bc31edb60370e7275a7c35b557737cd84

Improve the configure check for "restrict" keyword

configure.ac


2018-03-29 12:41:37 +0200
Tor Andersson <tor.andersson@artifex.com>
5249489366cfac73e83e529bae06a08ad6703980

Clean up the stdint configuration mess.

Don't require HAVE_STDINT_H to be defined to assume the sane default of
including the C standard stdint.h header file.

Use the configuration defines to include non-standard header files.

VS 2012 and newer have stdint.h, so use it.

jbig2dec/config_win32.h
jbig2dec/os_types.h


2018-03-29 12:59:58 +0200
Tor Andersson <tor.andersson@artifex.com>
0cb8374113ae2770464b6ac7462f11f0cc9677ea

Fix undeclared function warning.

jbig2dec/jbig2_image_png.c


2018-03-29 12:56:07 +0200
Tor Andersson <tor.andersson@artifex.com>
a8430e881971485fa4a824a3488f79b7ab0abfeb

Fix signed/unsigned comparison warnings.

jbig2dec/Makefile.unix
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_image_png.c
jbig2dec/jbig2_mmr.c


2017-05-19 12:49:15 +0200
Tor Andersson <tor.andersson@artifex.com>
15f72a0b272e751ce7147bb0d8179eac68da52b0

xps: Remove needless NULL terminator when parsing abbreviated geometry.

xps/xpspath.c


2018-03-27 21:21:38 -0700
Ray Johnston <ray.johnston@artifex.com>
59d82e831e62bdf2e44331d10c88dd7837429dad

Rename lcms2art to lcms2mt, Remove cmsChangeBuffersFormat

Since cmsChangeBuffersFormat is NOT threadsafe, we want it to remove it
so that it would not be part of this package which is inteded for multi-
threaded used. The internal use in CreateNamedColorDevicelink was replaced
with the appropriate code from the removed function, but that does not
cause a thread safety issue since the link returned is new and not shared
when the buffer formatters are changed.

Note: All internal references to lcms2art are replaced with lcms2mt

Makefile.in
base/gsicc_lcms2mt.c
base/lcms2mt.mak
base/lib.mak
base/msvclib.mak
base/openvms.mak
base/ugcclib.mak
base/unix-gcc.mak
base/unixansi.mak
base/winlib.mak
configure.ac
lcms2art/include/Makefile.am
lcms2mt/.travis.yml
lcms2mt/AUTHORS
lcms2mt/COPYING
lcms2mt/ChangeLog
lcms2mt/INSTALL
lcms2mt/Lib/BC/BC.txt
lcms2mt/Lib/MS/MS.TXT
lcms2mt/Makefile.am
lcms2mt/Makefile.in
lcms2mt/Projects/.gitignore
lcms2mt/Projects/BorlandC_5.5/lcms2.rc
lcms2mt/Projects/BorlandC_5.5/lcmsdll.lk
lcms2mt/Projects/BorlandC_5.5/lcmsdll.lst
lcms2mt/Projects/BorlandC_5.5/mklcmsdll.bat
lcms2mt/Projects/VC2010/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2010/jpegicc/jpegicc.vcxproj.filters
lcms2mt/Projects/VC2010/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2010/linkicc/linkicc.vcxproj.filters
lcms2mt/Projects/VC2010/psicc/psicc.vcxproj
lcms2mt/Projects/VC2010/psicc/psicc.vcxproj.filters
lcms2mt/Projects/VC2010/resource.h
lcms2mt/Projects/VC2010/testbed/testbed.vcxproj
lcms2mt/Projects/VC2010/testbed/testbed.vcxproj.filters
lcms2mt/Projects/VC2010/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2010/tiffdiff/tiffdiff.vcxproj.filters
lcms2mt/Projects/VC2010/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2010/tifficc/tifficc.vcxproj.filters
lcms2mt/Projects/VC2010/transicc/transicc.vcxproj
lcms2mt/Projects/VC2010/transicc/transicc.vcxproj.filters
lcms2mt/Projects/VC2012/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2012/jpegicc/jpegicc.vcxproj.filters
lcms2mt/Projects/VC2012/lcms2mt.rc
lcms2mt/Projects/VC2012/lcms2mt.sln
lcms2mt/Projects/VC2012/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2012/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters
lcms2mt/Projects/VC2012/lcms2mt_static/lcms2mt_static.vcxproj
lcms2mt/Projects/VC2012/lcms2mt_static/lcms2mt_static.vcxproj.filters
lcms2mt/Projects/VC2012/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2012/linkicc/linkicc.vcxproj.filters
lcms2mt/Projects/VC2012/psicc/psicc.vcxproj
lcms2mt/Projects/VC2012/psicc/psicc.vcxproj.filters
lcms2mt/Projects/VC2012/resource.h
lcms2mt/Projects/VC2012/testbed/testbed.vcxproj
lcms2mt/Projects/VC2012/testbed/testbed.vcxproj.filters
lcms2mt/Projects/VC2012/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2012/tiffdiff/tiffdiff.vcxproj.filters
lcms2mt/Projects/VC2012/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2012/tifficc/tifficc.vcxproj.filters
lcms2mt/Projects/VC2012/transicc/transicc.vcxproj
lcms2mt/Projects/VC2012/transicc/transicc.vcxproj.filters
lcms2mt/Projects/VC2013/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2013/jpegicc/jpegicc.vcxproj.filters
lcms2mt/Projects/VC2013/lcms2mt.rc
lcms2mt/Projects/VC2013/lcms2mt.sln
lcms2mt/Projects/VC2013/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2013/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters
lcms2mt/Projects/VC2013/lcms2mt_static/lcms2mt_static.vcxproj
lcms2mt/Projects/VC2013/lcms2mt_static/lcms2mt_static.vcxproj.filters
lcms2mt/Projects/VC2013/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2013/linkicc/linkicc.vcxproj.filters
lcms2mt/Projects/VC2013/psicc/psicc.vcxproj
lcms2mt/Projects/VC2013/psicc/psicc.vcxproj.filters
lcms2mt/Projects/VC2013/resource.h
lcms2mt/Projects/VC2013/testbed/testbed.vcxproj
lcms2mt/Projects/VC2013/testbed/testbed.vcxproj.filters
lcms2mt/Projects/VC2013/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2013/tiffdiff/tiffdiff.vcxproj.filters
lcms2mt/Projects/VC2013/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2013/tifficc/tifficc.vcxproj.filters
lcms2mt/Projects/VC2013/transicc/transicc.vcxproj
lcms2mt/Projects/VC2013/transicc/transicc.vcxproj.filters
lcms2mt/Projects/VC2015/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2015/jpegicc/jpegicc.vcxproj.filters
lcms2mt/Projects/VC2015/lcms2mt.rc
lcms2mt/Projects/VC2015/lcms2mt.sln
lcms2mt/Projects/VC2015/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2015/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters
lcms2mt/Projects/VC2015/lcms2mt_static/lcms2mt_static.vcxproj
lcms2mt/Projects/VC2015/lcms2mt_static/lcms2mt_static.vcxproj.filters
lcms2mt/Projects/VC2015/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2015/linkicc/linkicc.vcxproj.filters
lcms2mt/Projects/VC2015/psicc/psicc.vcxproj
lcms2mt/Projects/VC2015/psicc/psicc.vcxproj.filters
lcms2mt/Projects/VC2015/resource.h
lcms2mt/Projects/VC2015/testbed/testbed.vcxproj
lcms2mt/Projects/VC2015/testbed/testbed.vcxproj.filters
lcms2mt/Projects/VC2015/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2015/tiffdiff/tiffdiff.vcxproj.filters
lcms2mt/Projects/VC2015/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2015/tifficc/tifficc.vcxproj.filters
lcms2mt/Projects/VC2015/transicc/transicc.vcxproj
lcms2mt/Projects/VC2015/transicc/transicc.vcxproj.filters
lcms2mt/Projects/VC2017/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2017/jpegicc/jpegicc.vcxproj.filters
lcms2mt/Projects/VC2017/lcms2mt.rc
lcms2mt/Projects/VC2017/lcms2mt.sln
lcms2mt/Projects/VC2017/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2017/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters
lcms2mt/Projects/VC2017/lcms2mt_static/lcms2mt_static.vcxproj
lcms2mt/Projects/VC2017/lcms2mt_static/lcms2mt_static.vcxproj.filters
lcms2mt/Projects/VC2017/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2017/linkicc/linkicc.vcxproj.filters
lcms2mt/Projects/VC2017/psicc/psicc.vcxproj
lcms2mt/Projects/VC2017/psicc/psicc.vcxproj.filters
lcms2mt/Projects/VC2017/resource.h
lcms2mt/Projects/VC2017/testbed/testbed.vcxproj
lcms2mt/Projects/VC2017/testbed/testbed.vcxproj.filters
lcms2mt/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2017/tiffdiff/tiffdiff.vcxproj.filters
lcms2mt/Projects/VC2017/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2017/tifficc/tifficc.vcxproj.filters
lcms2mt/Projects/VC2017/transicc/transicc.vcxproj
lcms2mt/Projects/VC2017/transicc/transicc.vcxproj.filters
lcms2mt/Projects/cppcheck/lcms2.cppcheck
lcms2mt/Projects/mac/LittleCMS/._Info.plist
lcms2mt/Projects/mac/LittleCMS/._LittleCMS.xcodeproj
lcms2mt/Projects/mac/LittleCMS/English.lproj/InfoPlist.strings
lcms2mt/Projects/mac/LittleCMS/Info.plist
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/mariama.mode1v3
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/mariama.pbxuser
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.pbxproj
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.xcworkspace/contents.xcworkspacedata
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.xcworkspace/xcuserdata/User.xcuserdatad/UserInterfaceState.xcuserstate
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.xcworkspace/xcuserdata/User.xcuserdatad/WorkspaceSettings.xcsettings
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcschemes/LittleCMS.xcscheme
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcschemes/testbed.xcscheme
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcschemes/xcschememanagement.plist
lcms2mt/Projects/mac/LittleCMS/LittleCMS_Prefix.pch
lcms2mt/Projects/mac/LittleCMS/TestBed-Info.plist
lcms2mt/README.1ST
lcms2mt/aclocal.m4
lcms2mt/autogen.sh
lcms2mt/compile
lcms2mt/config.guess
lcms2mt/config.sub
lcms2mt/configure
lcms2mt/configure.ac
lcms2mt/depcomp
lcms2mt/doc/LittleCMS2.9 API.pdf
lcms2mt/doc/LittleCMS2.9 Plugin API.pdf
lcms2mt/doc/LittleCMS2.9 tutorial.pdf
lcms2mt/doc/WhyThisFork.txt
lcms2mt/doc/src.zip
lcms2mt/include/Makefile.am
lcms2mt/include/Makefile.in
lcms2mt/include/lcms2mt.h
lcms2mt/include/lcms2mt_plugin.h
lcms2mt/install-sh
lcms2mt/lcms2mt.pc.in
lcms2mt/ltmain.sh
lcms2mt/m4/acx_pthread.m4
lcms2mt/m4/ax_append_compile_flags.m4
lcms2mt/m4/ax_append_flag.m4
lcms2mt/m4/ax_check_compile_flag.m4
lcms2mt/m4/ax_gcc_func_attribute.m4
lcms2mt/m4/ax_require_defined.m4
lcms2mt/m4/libtool.m4
lcms2mt/m4/ltoptions.m4
lcms2mt/m4/ltsugar.m4
lcms2mt/m4/ltversion.m4
lcms2mt/m4/lt~obsolete.m4
lcms2mt/missing
lcms2mt/src/Makefile.am
lcms2mt/src/Makefile.in
lcms2mt/src/cmsalpha.c
lcms2mt/src/cmscam02.c
lcms2mt/src/cmscgats.c
lcms2mt/src/cmscnvrt.c
lcms2mt/src/cmserr.c
lcms2mt/src/cmsgamma.c
lcms2mt/src/cmsgmt.c
lcms2mt/src/cmshalf.c
lcms2mt/src/cmsintrp.c
lcms2mt/src/cmsio0.c
lcms2mt/src/cmsio1.c
lcms2mt/src/cmslut.c
lcms2mt/src/cmsmd5.c
lcms2mt/src/cmsmtrx.c
lcms2mt/src/cmsnamed.c
lcms2mt/src/cmsopt.c
lcms2mt/src/cmspack.c
lcms2mt/src/cmspcs.c
lcms2mt/src/cmsplugin.c
lcms2mt/src/cmsps2.c
lcms2mt/src/cmssamp.c
lcms2mt/src/cmssm.c
lcms2mt/src/cmstypes.c
lcms2mt/src/cmsvirt.c
lcms2mt/src/cmswtpnt.c
lcms2mt/src/cmsxform.c
lcms2mt/src/extra_xform.h
lcms2mt/src/lcms2_internal.h
lcms2mt/src/lcms2mt.def
lcms2mt/testbed/Makefile.am
lcms2mt/testbed/Makefile.in
lcms2mt/testbed/bad.icc
lcms2mt/testbed/bad_mpe.icc
lcms2mt/testbed/crayons.icc
lcms2mt/testbed/ibm-t61.icc
lcms2mt/testbed/new.icc
lcms2mt/testbed/test1.icc
lcms2mt/testbed/test2.icc
lcms2mt/testbed/test3.icc
lcms2mt/testbed/test4.icc
lcms2mt/testbed/test5.icc
lcms2mt/testbed/testcms2.c
lcms2mt/testbed/testcms2.h
lcms2mt/testbed/testplugin.c
lcms2mt/testbed/testthread.cpp
lcms2mt/testbed/toosmall.icc
lcms2mt/testbed/zoo_icc.c
lcms2mt/utils/common/utils.h
lcms2mt/utils/common/vprf.c
lcms2mt/utils/common/xgetopt.c
lcms2mt/utils/delphi/delphidemo.dpr
lcms2mt/utils/delphi/delphidemo.dproj
lcms2mt/utils/delphi/delphidemo.res
lcms2mt/utils/delphi/demo1.dfm
lcms2mt/utils/delphi/demo1.pas
lcms2mt/utils/delphi/lcms2dll.pas
lcms2mt/utils/jpgicc/LICENSE_iccjpeg
lcms2mt/utils/jpgicc/Makefile.am
lcms2mt/utils/jpgicc/Makefile.in
lcms2mt/utils/jpgicc/iccjpeg.c
lcms2mt/utils/jpgicc/iccjpeg.h
lcms2mt/utils/jpgicc/jpgicc.1
lcms2mt/utils/jpgicc/jpgicc.c
lcms2mt/utils/linkicc/Makefile.am
lcms2mt/utils/linkicc/Makefile.in
lcms2mt/utils/linkicc/linkicc.1
lcms2mt/utils/linkicc/linkicc.c
lcms2mt/utils/matlab/icctrans.c
lcms2mt/utils/matlab/lcms_rsp
lcms2mt/utils/psicc/Makefile.am
lcms2mt/utils/psicc/Makefile.in
lcms2mt/utils/psicc/psicc.1
lcms2mt/utils/psicc/psicc.c
lcms2mt/utils/samples/Makefile.am
lcms2mt/utils/samples/Makefile.in
lcms2mt/utils/samples/itufax.c
lcms2mt/utils/samples/mkcmy.c
lcms2mt/utils/samples/mkgrayer.c
lcms2mt/utils/samples/mktiff8.c
lcms2mt/utils/samples/roundtrip.c
lcms2mt/utils/samples/vericc.c
lcms2mt/utils/samples/wtpt.1
lcms2mt/utils/samples/wtpt.c
lcms2mt/utils/tificc/Makefile.am
lcms2mt/utils/tificc/Makefile.in
lcms2mt/utils/tificc/tifdiff.c
lcms2mt/utils/tificc/tificc.1
lcms2mt/utils/tificc/tificc.c
lcms2mt/utils/transicc/Makefile.am
lcms2mt/utils/transicc/Makefile.in
lcms2mt/utils/transicc/transicc.1
lcms2mt/utils/transicc/transicc.c
psi/msvc.mak
psi/os2.mak
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-02-16 13:51:04 -0800
Ray Johnston <ray.johnston@artifex.com>
9ff6b34e461fcbd4ef27fbb6c5c8a15071fe1370

Make ICC profile management thread safe.

The change to ref_count of profiles needs to be protected by a lock if
the profile ref_count could be changed by another thread. Also when
decrementing the ref_count to 0, we cannot free the lock until after
the profile has been unlocked.

New routine gsicc_adjust_profile_rc replaces old (not threadsafe) function
gsicc_profile_reference.

Also add tracing "cname" to the RC_ADJUST_ macro to aid in debugging
with -Z^ debug flag.

Testing had revealed race conditions which are now fixed (eliminate use
of semaphores).

This also changes the gsicc_lcms2art.c interface functions to keep a
list of transforms configured to have differing buffer formats that
include alpha, planar IN/OUT, big_endian IN/OUT, bytes_per_component
IN/OUT which are cloned as needed by threads.

Change gscms_is_threadsafe to return "true" in gsicc_lcms2art.c

TBD: If a link fails to build a thread may hang waiting for the link
profile to become valid if it was not the thread that was building it.
Not a new condition, but exposed when gscms_is_threadsafe returns true.

TBD: Fix error handling / clean-up when links fail to build. Also not
new, but is needed to prevent leaks, and possibly hang conditions.

base/gdevp14.c
base/gscdevn.c
base/gscie.c
base/gscms.h
base/gscscie.c
base/gscspace.c
base/gsicc.c
base/gsicc_cache.c
base/gsicc_lcms2art.c
base/gsicc_manage.c
base/gsicc_manage.h
base/gsicc_monitorcm.c
base/gsicc_nocm.c
base/gsicc_replacecm.c
base/gsmemory.c
base/gsrefct.h
base/gstrans.c
base/gxclist.c
base/gxclrast.c
base/gxcmap.c
base/gxipixel.c
base/lib.mak
lcms2art/include/lcms2art.h
lcms2art/src/cmsxform.c
lcms2art/src/lcms2art.def
xps/xpscolor.c
xps/xpsimage.c
xps/xpstile.c


2018-03-28 15:24:32 +0100
Ken Sharp <ken.sharp@artifex.com>
33701ac07115cb2f634a40ab73a5c127ca870ad8

Correctly set the 'encoding' to none when we apply UTF-8

Bug 699156 " Cyrillic file names"

On Windows GhostXPS, GhostPCL and the windowed executable (gswinxx.exe)
were not setting the 'encoding' or were setting it to an incorrect
'local' encoding.

This led to us incorrectly decoding UTF-8 encoded arguments, in
particular the input filename, which caused ioerrors to result.

pcl/pl/plmain.c
psi/dwmain.c


2018-03-26 20:55:39 +0100
Chris Liddell <chris.liddell@artifex.com>
b24a4bd9bab156443c4667d4266e3deb43f933f7

Bug 699141(redux): use "restrict" on compatible compilers

The definition of gs_restrict was missing for C99 compilers.

Even with compilers that claim C99 compatibility, we honor the configure check
for restrict.

base/stdpre.h


2018-03-26 14:56:37 +0100
Chris Liddell <chris.liddell@artifex.com>
12d2e6e44c4ed919bd38f2a13314f4942decd610

Bug 699154: Fix conditional parenthesis in gstype42.c

base/gstype42.c


2018-03-26 14:35:09 +0100
Chris Liddell <chris.liddell@artifex.com>
8ec5c5ded5fc19cabd95dad385b22a506e59acaf

zfapi.c: another case of is_glyph_index set wrongly

This is related to freetype now a) automatically selecting a Unicode cmap for
every font, if one is available, and b) automatically generating a Unicode cmap
for every font when one is not available.

Logic that we had pushed down to the FAPI/FT interface layer, we now need to
apply earlier.

psi/zfapi.c


2018-03-26 09:21:53 +0100
Chris Liddell <chris.liddell@artifex.com>
6e4ac5e7f1e8ea1835a99f12a7a4e34ebd85261e

Bug 699141: add configure test for __restrict in compiler

It seems that some older compilers that claim to support __restrict really don't
and compilation fails, so check for that in configure.

base/stdpre.h
configure.ac


2018-03-16 14:49:28 +0000
Chris Liddell <chris.liddell@artifex.com>
145c288cc0b1038b14334b92d40b37d27fd732b5

Disable or fix some (benign) compiler warnings for libtiff

base/gsjconf.h
configure.ac
psi/msvc.mak


2018-03-20 14:58:01 +0000
Chris Liddell <chris.liddell@artifex.com>
e3ef00ae7bd46ac4c45bf67cbb03a2342e850dca

Fix PACIFY_VALGRIND build

VALGRIND_HG_DISABLE_CHECKING() doesn't exist in all valgrind versions.

pcl/pl/plmain.c


2018-03-16 14:50:22 +0000
Chris Liddell <chris.liddell@artifex.com>
fde9abbaf12c0a861dd47792e02752d6b9e6b011

Fix a couple of unitialized variable warnings

base/gdevdrop.c
psi/zfont2.c


2018-03-16 14:16:38 +0000
Chris Liddell <chris.liddell@artifex.com>
99deae37f3cf32feac6eefabf17bf34a436c82ab

Fix a "defined but not used" warning

pcl/pcl/rtraster.c


2018-03-16 14:12:16 +0000
Chris Liddell <chris.liddell@artifex.com>
781c6a90b501a7cfcf1cdd337344444e6b388ef6

Address some compiler warnings adding casts

devices/gdevxalt.c


2018-03-16 14:11:42 +0000
Chris Liddell <chris.liddell@artifex.com>
9a3176cae5c0cd4fea05d2369289ec41d44cf842

Fix a couple of unused variable warnings

devices/gdevdsp.c


2018-03-16 14:11:04 +0000
Chris Liddell <chris.liddell@artifex.com>
465b77b4b9187e99aabad1e436d5c588fa565f97

Squash some unitialized variable warnings

contrib/lips4/gdevl4v.c


2018-03-16 10:19:43 +0000
Chris Liddell <chris.liddell@artifex.com>
eb770edd1c4dd9bf6c561f15564e4b8e10cc54b9

Squash compiler warning in ijs code.

ijs/ijs_exec_unix.c


2018-03-16 10:16:49 +0000
Chris Liddell <chris.liddell@artifex.com>
54e6bb1a12448aca3c48cd062946f564d3a9a4d1

Address some compiler warnings in openjpeg

configure.ac
openjpeg/src/lib/openjp2/j2k.c
psi/msvc.mak


2018-03-16 09:57:02 +0000
Chris Liddell <chris.liddell@artifex.com>
d411d72de4d41e0ad436c50d89088dc13e3b3f42

Shared library compiler warnings: lcms2, openjpeg

When linking against the system lcms2 and openjpeg there were compiler
warnings (we don't see building "normally").

base/gsicc_lcms2.c
base/sjpx_openjpeg.c


2018-03-16 09:06:33 +0000
Chris Liddell <chris.liddell@artifex.com>
ee08b05dd809984df8c686231b8c8f215f5815f9

Squash compiler warning in debug code

base/siscale.c


2018-03-16 09:03:55 +0000
Chris Liddell <chris.liddell@artifex.com>
601e3663d23ddb49af248d539d9c90d9fcec8163

For now, conditionally compile out unused structures

Solves compiler warnings.

base/gdevp14.c


2018-03-26 15:16:19 +0100
Ken Sharp <ken.sharp@artifex.com>
f13d74f60441f7f35691fd4de90476057b8535a4

Bug #699153 - fix cppcheck warning

Also fix two tab whitespaces, convert to spaces.

base/gsdevice.c


2018-03-26 02:10:10 +0800
Sebastian Rasmussen <sebras@gmail.com>
41d6119463a5f013ecbe5d55d2eb707a47fdd294

Fix 699142: Adaptive pixels can not be pixel to be predicted.

The fix for 699127 didn't account for the adaptive pixel location
being that of the pixel to be predicted. This is of course invalid,
and this is now recitified.

jbig2dec/jbig2_generic.c


2018-03-26 09:59:27 +0100
Ken Sharp <ken.sharp@artifex.com>
af2cf274d086e9140b388b7b1d92ab7753108491

Coverity ID 26634 - add some return code checks

base/gsstate.c


2018-03-23 08:45:39 +0000
Chris Liddell <chris.liddell@artifex.com>
1a3fdb0a05b50a5ddff2d5d566979708ff350ffa

Add another missing file to the documentation install list

I'd missed off the example device source file.

base/unixinst.mak


2018-03-07 09:59:55 +0000
Chris Liddell <chris.liddell@artifex.com>
59b5259ffa6155c3c9341a268310e3879e96d441

Bring master up to date with 9.23 release branch

(gs923)

base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-22 11:30:03 +0000
Chris Liddell <chris.liddell@artifex.com>
57d33404ce0fab68a909fff501c0b8e2912b9956

Check __STDC_VERSION__ is defined before using it

Not all compilers (and versions) have __STDC_VERSION__

base/stdpre.h


2018-03-22 11:16:09 +0000
Chris Liddell <chris.liddell@artifex.com>
829c4c55f8b0d77ead0c3daf3ab4164c6b7d8365

Fix FAPI's CharString dictionary accessing

Because dictionaries are (generally) made up of sparse arrays (one each for
keys and values), it's not generally safe to simply access indices into those
arrays - which the FAPI code was doing.

Normally, for that type of access, we'd use the dictionary content enumerator
function but, in this case, the FAPI API does not enforce iterating through
the dictionary contents, but allows for "random" accessing the contents.

However, the requirement to handle broken or invalid CharStrings also means we
neatly handle empty slots in the sparse arrays.

So, the only change required here is to use the maximum size of the dictionary
object, rather than the "size" to know how many indices to check.

As an additional safety check, however, also add checks for the key/value
types, and treat an invalid type as an empty slot.

psi/zfapi.c


2018-03-22 11:21:13 +0000
Ken Sharp <ken.sharp@artifex.com>
8ac0975771838c7d8c17f5f2f7223607eb976788

PS interpreter - fix parsing of NChannel Colorants dictionary

The code was previously using dict_index_entry to retrieve entries
from the Colorants dictionary, but it did not account for the function
returning gs_error_undefined when a slot in the dictionary was present
but unused. Since dictionaries are sparse arrays, this is possible.

This commit reworks the code to use dict_first() and dict_next() to
retrieve elements from the dictionary, and starts at the maximum entry
and works down, instead of the previous code which started at 0 and
worked up.

psi/zcolor.c


2018-03-20 21:42:39 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e54754db42c2640c10a73b18779213d16dbd10d0

Bug 697545 : Update functions to return error codes.

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately

base/gsptype1.c
base/gximage1.c
base/gxipixel.c
base/gxpcmap.c


2018-03-21 02:43:52 +0800
Sebastian Rasmussen <sebras@gmail.com>
94d46eea5dada844ac4d9767dfb7a384a408e111

Fix 698839: Remove testcase that cannot be found from testrunner.

jbig2dec/test_jbig2dec.py


2018-03-21 02:38:15 +0800
Sebastian Rasmussen <sebras@gmail.com>
222403964eb437c0b60404fcc11bb879744d263e

Fix 698839: Add hash for testcases that fail to decode anything.

The testrunner stated that the expected hash for 042_13.jb2 and
042_14.jb2 was that of a successfully decoded image. Historically
these two images have caused jbig2dec to segfault, but nowadays
they correctly cause FATAL ERRORs. When FATAL ERRORs are
encountered as hash covering 0 bytes of image data is computed,
so the testrunner now expects this hash instead. Therefore the
check now run successfully.

jbig2dec/test_jbig2dec.py


2018-03-21 02:30:12 +0800
Sebastian Rasmussen <sebras@gmail.com>
430fcce8516a3c38f03e8f81d4d8b3e87a5aff28

Fix 698839: Have the testsuite runner return the result.

Previously the return value was None regardless of test succeeded
or failed. This meant that the test_jbig2dec.py script had an
exit code of 1 not matter the outcome. Now it is 0 upon success
and 1 upon error, as expected by the make check infrastructure.

jbig2dec/test_jbig2dec.py


2018-03-21 00:44:00 +0800
Sebastian Rasmussen <sebras@gmail.com>
3431972e91c51403cf4223f1d5c28b666ea84c6e

Fix 698839: Set correct checksum for amb_{1,2}.jb2 in test suite.

jbig2dec/test_jbig2dec.py


2018-03-20 13:16:40 +0000
Chris Liddell <chris.liddell@artifex.com>
d8d4a64468252f5b632891fa9c8fdf98930fae15

Add missing files to doc install target

These files:

VectorDevices.htm
sample_downscale_device.htm
SavedPages.htm
subclass.htm

were missing from the documentation installation target

base/unixinst.mak


2018-03-20 14:13:00 +0000
Ken Sharp <ken.sharp@artifex.com>
18ec3899047e26109548cb601f0bf830a86d9abe

Coverty ID 94548 - check return value

psi/zupath.c


2018-03-20 13:36:31 +0000
Ken Sharp <ken.sharp@artifex.com>
a9f78155bc0f5050359ea6dfbfb5166e4f72a9cf

Coverity ID 26487 - remove duplicate branch

devices/gdevpdfimg.c


2018-03-20 12:10:15 +0000
Ken Sharp <ken.sharp@artifex.com>
46b6212e1688ba5d49923908d3be3f9329dd705b

PDF interpreter - remove /.gs.pdfobj# entries from pdfmarks

Since we increased the places where we use /.gs.pfgobj# to track the
PDF object number, we have been emitting PDF files from pdfwrite
which contain dictionaries with illegal PDF names.

The '#' in PDF naming is used to escape unprintable characters (eg
space), it must be followed by 2 hex digits, ours isn't.

Trying to fix this in the pdfmark processing proved problematic, so
instead, remove it at the PostScritp level.

Resource/Init/pdf_draw.ps
Resource/Init/pdf_main.ps


2018-03-20 02:28:20 +0800
Sebastian Rasmussen <sebras@gmail.com>
8cf6ddf78db5fc4a453df1a1a9d3ea120ba47609

Fix 698840: Fix typo in exit code in command-line tool.

This was introduced in 301726dd5c9c60c1e54eb0965c1d45b36350ce2e.

Thanks to Max Rees for reporting.

jbig2dec/jbig2dec.c


2018-03-18 14:09:16 +0800
Sebastian Rasmussen <sebras@gmail.com>
71bf7cb0c4aa3d2bb06deac2df675af44b3e4c3b

Fix 699127: JBIG2 adaptive pixels restricted to field.

When decoding generic regions the adaptive pixels must be
restricted to a field, previously this was not validated,
leading to out of buffer accesses.

This is now validated and may generate a fatal error.

jbig2dec/jbig2_generic.c


2018-03-19 13:47:36 +0000
Ken Sharp <ken.sharp@artifex.com>
bb2ea8ca0482cb0bb5632c30e9184e3d19fdc8d2

pdfwrite - ensure correct ICC profile version being written out

Bug #699104 "Identify ICC profiles unsuitable for embedding in output PDF and fall back to device space"

Previously we did not check the minor version number of ICC profiles
when writing an ICCBased colour space. Since PDF versions below 1.7
support either 4.0.0 0r 4.1.0, this could mean that we wrote a version
of profile that was too great for teh PDF version.

Following on from Michael's commit f732ea3a999f73afa46c2cc4ca28b067f671d29c
we can now determine the minor version number of profiles, and we now
use that to decide whether to use the profile as it is, or drop back to
a version 2 profile.

Since falling back to a version 2 profile can cause subtle changes in
colour, we now make the default CompatibilityLevel for PDF output 1.7.
Some PDFSETTINGS convert all colours to device spaces and these have
not been altered (not required). We could have defaulted to PDF 2.0
output, but the code is rather new, and also prevents certain constructs
(eg TransferFunction in the graphics state).

Resource/Init/gs_pdfwr.ps
devices/vector/gdevpdf.c
devices/vector/gdevpdfk.c
doc/VectorDevices.htm


2018-03-19 11:13:13 +0000
Ken Sharp <ken.sharp@artifex.com>
5fe0dbb5de65ca92a0ba8ff4a96447e30e4366e8

pdfwrite - remove special case for GS_UNDEFINED ICC profile colour space

Since commit f732ea3a999f73afa46c2cc4ca28b067f671d29c the cs_data
member of ICC profiles generated internally is correctly set. So we no
longer need to special-case ICC profiles where the cs_data member is
GS_UNDEFINED.

devices/vector/gdevpdfk.c


2018-03-19 10:29:38 +0000
Ken Sharp <ken.sharp@artifex.com>
8078194fd8abe7c9c3088573b9e69a4a967b6ee0

Bug 699122 - valgrind regression

Somewhat to my surprise, calling gs_setcolorspace does not set the
device colour, and leaves 'ccolor_valid' in an undefined state.

Call gs_set_dev_color() to explicitly set the device colour after we
reset the device space to gray in gs_initgraphics()

base/gsstate.c


2018-03-16 13:27:45 +0000
Chris Liddell <chris.liddell@artifex.com>
9b9acd5a8e074bbb47107f6add7b8afb1fe43270

Fix ommission from revised documentation install path

base/unixinst.mak


2018-03-18 12:33:22 -0700
Michael Vrhel <michael.vrhel@artifex.com>
f732ea3a999f73afa46c2cc4ca28b067f671d29c

Bug 699104 make sure data_cs is populated when creating profiles

Also, added a method to return the major and minor version numbers
for use in pdf write.

base/gsciemap.c
base/gsicc_manage.c
base/gsicc_manage.h


2018-03-15 19:14:15 +0000
Ken Sharp <ken.sharp@artifex.com>
269663402c5210dd1a15131a045526e3cd6de479

pdfimage devices - fix up some minor problems

Bug #699119 " pdfimage24 creates bad PDF"

When I removed some extraneous stuff from the output (to simplify it) I
forgot to update the pdfimage devices properly, leading to them trying
to write xref entries for missing data.

In addition, there was a problem writing the Length object of the image
streams.

Ghostscript complained about both of these but rendered the content
correctly, other consumers didn't complain.

devices/gdevpdfimg.c


2018-03-15 11:04:40 +0000
Chris Liddell <chris.liddell@artifex.com>
124b37fc65fe665d8b4a6133142784c4edb3b3bf

lcms2art: byteReverse needs a ContextID

on big endian platforms - fix that.

Reported against 9.23 RC1

lcms2art/src/cmsmd5.c


2018-01-29 15:32:52 +0000
Robin Watts <robin.watts@artifex.com>
e0f461a8a634036bbff938492190c72fcef684ac

Tweak indent of comment.

base/gsicc_lcms2art.c


2018-03-14 19:49:29 +0000
Robin Watts <robin.watts@artifex.com>
40263f15745f9cf9477acc35708bf61a2de46a6b

Simplify image enumerator rectangle logic for scalers.

We store the image size as a rectangle in the image enumerator.
For the purposes of scaling, we also store the rectangle that
needs to be rendered. We expand this slightly to allow for
the support requirements of the scaler, thus giving a rectangle
that is really what we need to decode.

In order to correctly setup the scaler we then need to try to
guess how much expansion was done. My previous attempts at
this guesswork failed.

A simpler solution would appear to be to just save both the
render and decode rectangles stored separately. This simplifies
the logic.

base/gximage.h
base/gxipixel.c
base/gxiscale.c
base/sisparam.h


2018-03-12 18:53:45 +0000
Robin Watts <robin.watts@artifex.com>
088cae9953f3a692201915c91bc87260add91fc6

lcms2art: Split transforms in two.

Each cmsTransform now has a 'core' part and a part that can
be 'cloned' to change the buffer formats.

The plan is to drop cmsChangeBuffersFormat and use this instead
to make sure we truly are thread safe.

lcms2art/include/lcms2art.h
lcms2art/src/cmsalpha.c
lcms2art/src/cmsnamed.c
lcms2art/src/cmsplugin.c
lcms2art/src/cmsps2.c
lcms2art/src/cmsvirt.c
lcms2art/src/cmsxform.c
lcms2art/src/extra_xform.h
lcms2art/src/lcms2_internal.h


2018-03-12 18:53:17 +0000
Robin Watts <robin.watts@artifex.com>
85569e3bd463ff2b67c195dd84ed770d2f86eb8f

Update VS project for lcms2 -> lcms2art change.

windows/ghostscript.vcproj


2018-03-14 19:38:01 +0000
Robin Watts <robin.watts@artifex.com>
ad292af74cbb8e823cf2829d29a35661caf1c49c

Fix typo in Memento_breakpointLocked.

base/memento.c


2018-03-14 16:41:03 +0000
Robin Watts <robin.watts@artifex.com>
34e279b84a6271c37a5a51ccefaccd2362845e73

Revert "Tweak bitmap interpolater patch size."

This reverts commit 38e0c643e62087c089c59c9ad44fc468dd09cd37.

This was shown to cause problems with:

tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf.pdf.psdcmyk.300.1

(or tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf, page 2, tweaked
to rotate by 270).

Reverting for now so I can try to find a less hacky (and hence
less error prone) way of working.

base/gxiscale.c
base/sisparam.h


2018-03-01 15:04:48 +0800
Sebastian Rasmussen <sebras@gmail.com>
36ab38b53695ae4b212507c45ec07f117ff26e2d

Fix 699083: Avoid leak in symbol dictionary parsing upon error.

jbig2dec/jbig2_symbol_dict.c


2018-03-13 12:20:33 +0000
Ken Sharp <ken.sharp@artifex.com>
151aa07a734101182b1861c3113c2539d2d8a485

pdfwrite - correct a function name

stupid typo in function name, its been annoying me for years.

devices/vector/gdevpdtt.c


2018-03-13 10:37:08 +0000
Ken Sharp <ken.sharp@artifex.com>
cb018b64dea61f2d6146652dce349d3fadab1709

Squash a benign compiler warning

devices/vector/gdevpdtt.c


2018-03-13 10:36:45 +0000
Ken Sharp <ken.sharp@artifex.com>
9ad220db0c06b9a22bd757f92edaaf624b701b1b

pdfwrite - don't write device spaces for masks representing glyphs

This came up while looking into ICC profile embedding. If we are
processing a mask bitmap which represents a glyph (eg when creating a
type 3 font for a font which cannot be embedded directly in a PDF) we
do not want to write a device colour.

We probably *never* want to write a device colour in here, but I'm not
certain of that, I am certain that the high level colour will already
have been set if we are processing text though. So in this commit, limit
the change so that we don't write device colours for glyphs.

devices/vector/gdevpdfb.c


2018-03-13 10:33:52 +0000
Ken Sharp <ken.sharp@artifex.com>
f06d2b00d005012379d4a2f6f47aab99b7b13b5c

pdfwrite - reject inappropriate ICC profiles

PDF files cannot include the full possible range of ICC profiles, if
we encounter one of these (eg from an XPS file) then refuse to embed it
and instead return gs_error_rangecheck, so that the calling code will
fall back to a device space representation.

NOTE we currently permit GS_UNDEFINED as a valid data_cs which we really
shouldn't but the current code, when converting a CIEBasedDEF or
CIEBasedDEFG (possibly other CIE spaces) to ICC creates a profile
where data_cs is GS_UNDEFINED (which is 0, so probably not actually
filled in).

devices/vector/gdevpdfk.c


2018-03-06 12:22:23 +0000
Robin Watts <robin.watts@artifex.com>
d6bdb65a51e154402a173182e8d1beccba610ea0

Memento: Add Mutex to protect Memento operations.

Solves problems that Ray was seeing while debugging the multithreaded
integration of our modified LCMS2.

base/memento.c


2018-03-12 14:22:44 +0000
Ken Sharp <ken.sharp@artifex.com>
c6596a021cbe1cd716eaf50e3dd06de646e05572

pdfwrite - avoid use of /.notdef when converting PCL fonts to type 3

Bug #699102 "using -sDEVICE=pdfwrite option generate an incorrect code 128 barcode"

This is actually an Acrobat bug, every other viewer I've tested works as
expected, Acrobat does not.

The problem appears to be related to defining a /.notdef glyph and
encoding it at a position other than 0 in the Encoding. If we do that,
and use the encoded /.notdef glyph, Acrobat quietly replaces it with the
glyph encoded at position 0 in the Encoding of the font.

Because of the way that PCL fonts work, when we are converting PCL
fonts to type 3 PDF fonts, the character (PCL) 0x1D gets assigned the
glyph name /.notdef. The actual Encoding of the glyph is at position
0x1D however, which causes Acrobat to substitute the glyph at Encoding
position 0.

This is obviously wrong. However, since its Acrobat, here we add yet
another heuristic to avoid defining glyphs with the name /.notdef when
creating type 3 PDF fonts from PCL fonts.

No differences expected

devices/vector/gdevpdtt.c


2018-03-07 18:31:23 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
3b3d8f74dc026c4f1af5022a1527d41d21511401

Bug 697545 : Prevent SEGV from gs_make_pattern_common.

Prevent SEGV if memory allocation fails and returns an empty path.

Error created using :-
MEMENTO_FAILAT=9104 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gspcolor.c


2018-03-08 13:21:54 +0000
Robin Watts <robin.watts@artifex.com>
d68b62d7567f20f0f269d096b899bd2409967980

Avoid total image dropout in interplated rescales.

Tests show that the following command causes images to disappear:

gxps -o out.ppm -sDEVICE=ppmraw -72 tests_private/xps/xpsfts-a4/fts_27xx.xps

This is because we scale a 1600 wide image down to 27 pixels across.
As such the weights for each individual pixel round to zero, and we
get nothing displayed.

Adjust for this by still calculating weights as doubles, and carrying
the error across the line. This keeps the total sum of the differences
correct.

base/siscale.c


2018-03-06 21:57:06 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
676dfb338d296aa86630662714fce5f058e31b8f

Bug 697545 : Update functions to return error codes.

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately

pcl/pxl/pxsessio.c


2018-03-06 20:33:02 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
2926860ca8ce519dadf23e44a9b4828da70090c4

Bug 697545 : Update functions to return error codes.

Each parameter handling function has been updated to ensure error codes
are returned and handled appropriately and gs_c_param_list_release is
always called on exit.

pcl/pcl/pcommand.c


2018-03-07 12:16:51 +0000
Chris Liddell <chris.liddell@artifex.com>
cfada4acb65861b4361ad80dbb53f61c5dc94c96

Bump version - prep for release

Resource/Init/gs_init.ps
base/version.mak


2018-03-21 08:44:23 +0000
Chris Liddell <chris.liddell@artifex.com>
a03872ea339d60055fa09dc451ebf37442f467fb

Final changelog for 9.23 release

doc/History9.htm


2018-03-21 08:41:35 +0000
Chris Liddell <chris.liddell@artifex.com>
eb210aecab59f338ef9b8af4523edb3c8bc35092

Dates, changelog and product string for release

base/gscdef.c
base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-20 13:16:40 +0000
Chris Liddell <chris.liddell@artifex.com>
41c92643ce1325893d0f491a49fb2edad1684d17

Add missing files to doc install target

These files:

VectorDevices.htm
sample_downscale_device.htm
SavedPages.htm
subclass.htm

were missing from the documentation installation target

base/unixinst.mak


2018-03-16 13:27:45 +0000
Chris Liddell <chris.liddell@artifex.com>
6ca20f5735e9cde19eee6577059cd9d844e94525

Fix ommission from revised documentation install path

base/unixinst.mak


2018-03-15 19:14:15 +0000
Ken Sharp <ken.sharp@artifex.com>
713d80d0dde40a5d1d1f402e8347997896b9a8f7

pdfimage devices - fix up some minor problems

Bug #699119 " pdfimage24 creates bad PDF"

When I removed some extraneous stuff from the output (to simplify it) I
forgot to update the pdfimage devices properly, leading to them trying
to write xref entries for missing data.

In addition, there was a problem writing the Length object of the image
streams.

Ghostscript complained about both of these but rendered the content
correctly, other consumers didn't complain.

devices/gdevpdfimg.c


2018-03-15 11:04:40 +0000
Chris Liddell <chris.liddell@artifex.com>
7f822afbb52a6b37fc4766f840e714d9f491da81

lcms2art: byteReverse needs a ContextID

on big endian platforms - fix that.

Reported against 9.23 RC1

lcms2art/src/cmsmd5.c


2018-03-15 07:50:41 +0000
Chris Liddell <chris.liddell@artifex.com>
36bc37e414b695b1fa39c7e99be9d83f8628e889

Changelog and product string for 9.23 rc3

base/gscdef.c
doc/History9.htm


2018-03-14 16:41:03 +0000
Robin Watts <robin.watts@artifex.com>
e31e3879532fd23ca2658aea26bf4cadd665687f

Revert "Tweak bitmap interpolater patch size."

This reverts commit 38e0c643e62087c089c59c9ad44fc468dd09cd37.

This was shown to cause problems with:

tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf.pdf.psdcmyk.300.1

(or tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf, page 2, tweaked
to rotate by 270).

Reverting for now so I can try to find a less hacky (and hence
less error prone) way of working.

base/gxiscale.c
base/sisparam.h


2018-03-14 07:47:37 +0000
Chris Liddell <chris.liddell@artifex.com>
56888d7a2e8b9cade1fc9535b67bd9841e2aca6e

Update changelog for 9.23 rc2

doc/History9.htm


2018-03-14 07:45:29 +0000
Chris Liddell <chris.liddell@artifex.com>
f7acb2502eadeff35dc791b52400d1a301059927

Dates etc for 9.23 rc2

base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-13 10:37:08 +0000
Ken Sharp <ken.sharp@artifex.com>
7c9a54209a2758769102361a456353e7e5993821

Squash a benign compiler warning

devices/vector/gdevpdtt.c


2018-03-13 10:33:52 +0000
Ken Sharp <ken.sharp@artifex.com>
353c6caa4b8dea6baae337b30217139e996e9b94

pdfwrite - reject inappropriate ICC profiles

PDF files cannot include the full possible range of ICC profiles, if
we encounter one of these (eg from an XPS file) then refuse to embed it
and instead return gs_error_rangecheck, so that the calling code will
fall back to a device space representation.

NOTE we currently permit GS_UNDEFINED as a valid data_cs which we really
shouldn't but the current code, when converting a CIEBasedDEF or
CIEBasedDEFG (possibly other CIE spaces) to ICC creates a profile
where data_cs is GS_UNDEFINED (which is 0, so probably not actually
filled in).

devices/vector/gdevpdfk.c


2018-03-12 14:22:44 +0000
Ken Sharp <ken.sharp@artifex.com>
23f66c8eec91e8efcbc600d987cf8bde7e3dce4b

pdfwrite - avoid use of /.notdef when converting PCL fonts to type 3

Bug #699102 "using -sDEVICE=pdfwrite option generate an incorrect code 128 barcode"

This is actually an Acrobat bug, every other viewer I've tested works as
expected, Acrobat does not.

The problem appears to be related to defining a /.notdef glyph and
encoding it at a position other than 0 in the Encoding. If we do that,
and use the encoded /.notdef glyph, Acrobat quietly replaces it with the
glyph encoded at position 0 in the Encoding of the font.

Because of the way that PCL fonts work, when we are converting PCL
fonts to type 3 PDF fonts, the character (PCL) 0x1D gets assigned the
glyph name /.notdef. The actual Encoding of the glyph is at position
0x1D however, which causes Acrobat to substitute the glyph at Encoding
position 0.

This is obviously wrong. However, since its Acrobat, here we add yet
another heuristic to avoid defining glyphs with the name /.notdef when
creating type 3 PDF fonts from PCL fonts.

No differences expected

devices/vector/gdevpdtt.c


2018-03-08 13:21:54 +0000
Robin Watts <robin.watts@artifex.com>
1567dba0b505a0bb816e7b2e34f3915165a7d5b3

Avoid total image dropout in interplated rescales.

Tests show that the following command causes images to disappear:

gxps -o out.ppm -sDEVICE=ppmraw -72 tests_private/xps/xpsfts-a4/fts_27xx.xps

This is because we scale a 1600 wide image down to 27 pixels across.
As such the weights for each individual pixel round to zero, and we
get nothing displayed.

Adjust for this by still calculating weights as doubles, and carrying
the error across the line. This keeps the total sum of the differences
correct.

base/siscale.c


2018-03-07 14:40:21 +0000
Chris Liddell <chris.liddell@artifex.com>
7a6acdfce9344574638c2553f605d86f801f7393

News and Changelog for 9.23 rc1

doc/History9.htm
doc/News.htm


2018-03-07 12:19:48 +0000
Chris Liddell <chris.liddell@artifex.com>
c6285cdd7ae7b1c97ffcf0c824234659b03d6d6a

Dates and versions for 9.23 rc1

doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-07 09:59:55 +0000
Chris Liddell <chris.liddell@artifex.com>
0df45c3d11246d773110d5b1a563d7462f3acac1

Revision date and product for release candidate

base/gscdef.c
base/version.mak



Changelog

2018-03-21 08:41:35 +0000
Chris Liddell <chris.liddell@artifex.com>
eb210aecab59f338ef9b8af4523edb3c8bc35092

Dates, changelog and product string for release

base/gscdef.c
base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-20 13:16:40 +0000
Chris Liddell <chris.liddell@artifex.com>
41c92643ce1325893d0f491a49fb2edad1684d17

Add missing files to doc install target

These files:

VectorDevices.htm
sample_downscale_device.htm
SavedPages.htm
subclass.htm

were missing from the documentation installation target

base/unixinst.mak


2018-03-16 13:27:45 +0000
Chris Liddell <chris.liddell@artifex.com>
6ca20f5735e9cde19eee6577059cd9d844e94525

Fix ommission from revised documentation install path

base/unixinst.mak


2018-03-15 19:14:15 +0000
Ken Sharp <ken.sharp@artifex.com>
713d80d0dde40a5d1d1f402e8347997896b9a8f7

pdfimage devices - fix up some minor problems

Bug #699119 " pdfimage24 creates bad PDF"

When I removed some extraneous stuff from the output (to simplify it) I
forgot to update the pdfimage devices properly, leading to them trying
to write xref entries for missing data.

In addition, there was a problem writing the Length object of the image
streams.

Ghostscript complained about both of these but rendered the content
correctly, other consumers didn't complain.

devices/gdevpdfimg.c


2018-03-15 11:04:40 +0000
Chris Liddell <chris.liddell@artifex.com>
7f822afbb52a6b37fc4766f840e714d9f491da81

lcms2art: byteReverse needs a ContextID

on big endian platforms - fix that.

Reported against 9.23 RC1

lcms2art/src/cmsmd5.c


2018-03-15 07:50:41 +0000
Chris Liddell <chris.liddell@artifex.com>
36bc37e414b695b1fa39c7e99be9d83f8628e889

Changelog and product string for 9.23 rc3

base/gscdef.c
doc/History9.htm


2018-03-14 16:41:03 +0000
Robin Watts <robin.watts@artifex.com>
e31e3879532fd23ca2658aea26bf4cadd665687f

Revert "Tweak bitmap interpolater patch size."

This reverts commit 38e0c643e62087c089c59c9ad44fc468dd09cd37.

This was shown to cause problems with:

tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf.pdf.psdcmyk.300.1

(or tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf, page 2, tweaked
to rotate by 270).

Reverting for now so I can try to find a less hacky (and hence
less error prone) way of working.

base/gxiscale.c
base/sisparam.h


2018-03-14 07:45:29 +0000
Chris Liddell <chris.liddell@artifex.com>
f7acb2502eadeff35dc791b52400d1a301059927

Dates etc for 9.23 rc2

base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-13 10:37:08 +0000
Ken Sharp <ken.sharp@artifex.com>
7c9a54209a2758769102361a456353e7e5993821

Squash a benign compiler warning

devices/vector/gdevpdtt.c


2018-03-13 10:33:52 +0000
Ken Sharp <ken.sharp@artifex.com>
353c6caa4b8dea6baae337b30217139e996e9b94

pdfwrite - reject inappropriate ICC profiles

PDF files cannot include the full possible range of ICC profiles, if
we encounter one of these (eg from an XPS file) then refuse to embed it
and instead return gs_error_rangecheck, so that the calling code will
fall back to a device space representation.

NOTE we currently permit GS_UNDEFINED as a valid data_cs which we really
shouldn't but the current code, when converting a CIEBasedDEF or
CIEBasedDEFG (possibly other CIE spaces) to ICC creates a profile
where data_cs is GS_UNDEFINED (which is 0, so probably not actually
filled in).

devices/vector/gdevpdfk.c


2018-03-12 14:22:44 +0000
Ken Sharp <ken.sharp@artifex.com>
23f66c8eec91e8efcbc600d987cf8bde7e3dce4b

pdfwrite - avoid use of /.notdef when converting PCL fonts to type 3

Bug #699102 "using -sDEVICE=pdfwrite option generate an incorrect code 128 barcode"

This is actually an Acrobat bug, every other viewer I've tested works as
expected, Acrobat does not.

The problem appears to be related to defining a /.notdef glyph and
encoding it at a position other than 0 in the Encoding. If we do that,
and use the encoded /.notdef glyph, Acrobat quietly replaces it with the
glyph encoded at position 0 in the Encoding of the font.

Because of the way that PCL fonts work, when we are converting PCL
fonts to type 3 PDF fonts, the character (PCL) 0x1D gets assigned the
glyph name /.notdef. The actual Encoding of the glyph is at position
0x1D however, which causes Acrobat to substitute the glyph at Encoding
position 0.

This is obviously wrong. However, since its Acrobat, here we add yet
another heuristic to avoid defining glyphs with the name /.notdef when
creating type 3 PDF fonts from PCL fonts.

No differences expected

devices/vector/gdevpdtt.c


2018-03-08 13:21:54 +0000
Robin Watts <robin.watts@artifex.com>
1567dba0b505a0bb816e7b2e34f3915165a7d5b3

Avoid total image dropout in interplated rescales.

Tests show that the following command causes images to disappear:

gxps -o out.ppm -sDEVICE=ppmraw -72 tests_private/xps/xpsfts-a4/fts_27xx.xps

This is because we scale a 1600 wide image down to 27 pixels across.
As such the weights for each individual pixel round to zero, and we
get nothing displayed.

Adjust for this by still calculating weights as doubles, and carrying
the error across the line. This keeps the total sum of the differences
correct.

base/siscale.c


2018-03-07 12:19:48 +0000
Chris Liddell <chris.liddell@artifex.com>
c6285cdd7ae7b1c97ffcf0c824234659b03d6d6a

Dates and versions for 9.23 rc1

doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-07 09:59:55 +0000
Chris Liddell <chris.liddell@artifex.com>
0df45c3d11246d773110d5b1a563d7462f3acac1

Revision date and product for release candidate

base/gscdef.c
base/version.mak


2018-02-26 15:48:45 +0100
David Kaspar [Dee'Kej] <dkaspar@redhat.com>
8c206ceeeac12b048aeafc9ea51080b624750ff4

Bug 699068: configure.ac: forcibly disable strict aliasing via CFLAGS

In case user specifies their own CFLAGS that contains -O2, -O3, -Os or
-fstrict-aliasing, the default behaviour to disable the strict
aliasing will be overriden and enabled, which is not correct...

This commit will append the -fno-strict-aliasing option to CFLAGS set
by user, which will effectively force the disabling of strict aliasing.

NOTE: originally the patch issued a warning when appending -fno-strict-aliasing
and I've changed it to a normal checking/result message pattern - it seems less
likely to cause end user confusion/panic

configure.ac


2018-03-05 21:48:02 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
39686173fd26eb6e5eee91202433f5e5f307f61c

Bug 697545 : Update functions to return error codes.

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

base/gscolor.c
base/gsdparam.c
base/gsptype1.c
pcl/pcl/pcbiptrn.c
pcl/pcl/pcpatrn.c
pcl/pcl/pginit.c
pcl/pcl/pglabel.c
pcl/pcl/rtraster.c
pcl/pl/plparams.c
pcl/pxl/pxgstate.c
pcl/pxl/pxink.c
pcl/pxl/pxpthr.c
psi/ztrans.c


2018-02-21 19:59:25 +0100
David Kaspar [Dee'Kej] <dkaspar@redhat.com>
469bd6ecf5b223b3e6e3f32ec5a4900866c35e57

Bug 699057: Makefile.in: @LDFLAGS@ added into GCFLAGS

Previously, the 'gsc' and 'gsx' binaries were not using LDFLAGS when
they were built with shared library. Adding LDFLAGS into GCFLAGS fixes
this issue, and specifying LDFLAGS now works for these binaries as well.

Makefile.in


2018-03-06 10:16:43 +0000
Chris Liddell <chris.liddell@artifex.com>
71e152462e2b47e8e31aec7cf1238934640aa480

Update zlib to 1.2.11

zlib/CMakeLists.txt
zlib/ChangeLog
zlib/Makefile.in
zlib/README
zlib/adler32.c
zlib/as400/bndsrc
zlib/as400/compile.clp
zlib/as400/readme.txt
zlib/compress.c
zlib/configure
zlib/contrib/README.contrib
zlib/contrib/ada/zlib-streams.ads
zlib/contrib/ada/zlib-thin.ads
zlib/contrib/blast/blast.c
zlib/contrib/blast/blast.h
zlib/contrib/delphi/ZLib.pas
zlib/contrib/dotzlib/DotZLib/UnitTests.cs
zlib/contrib/infback9/inftree9.c
zlib/contrib/minizip/configure.ac
zlib/contrib/minizip/iowin32.c
zlib/contrib/minizip/unzip.c
zlib/contrib/minizip/zip.c
zlib/contrib/pascal/zlibpas.pas
zlib/contrib/puff/puff.c
zlib/contrib/vstudio/readme.txt
zlib/contrib/vstudio/vc10/zlib.rc
zlib/contrib/vstudio/vc10/zlibvc.def
zlib/contrib/vstudio/vc11/zlib.rc
zlib/contrib/vstudio/vc11/zlibvc.def
zlib/contrib/vstudio/vc12/miniunz.vcxproj
zlib/contrib/vstudio/vc12/minizip.vcxproj
zlib/contrib/vstudio/vc12/testzlib.vcxproj
zlib/contrib/vstudio/vc12/testzlibdll.vcxproj
zlib/contrib/vstudio/vc12/zlib.rc
zlib/contrib/vstudio/vc12/zlibstat.vcxproj
zlib/contrib/vstudio/vc12/zlibvc.def
zlib/contrib/vstudio/vc12/zlibvc.sln
zlib/contrib/vstudio/vc12/zlibvc.vcxproj
zlib/contrib/vstudio/vc14/miniunz.vcxproj
zlib/contrib/vstudio/vc14/minizip.vcxproj
zlib/contrib/vstudio/vc14/testzlib.vcxproj
zlib/contrib/vstudio/vc14/testzlibdll.vcxproj
zlib/contrib/vstudio/vc14/zlib.rc
zlib/contrib/vstudio/vc14/zlibstat.vcxproj
zlib/contrib/vstudio/vc14/zlibvc.def
zlib/contrib/vstudio/vc14/zlibvc.sln
zlib/contrib/vstudio/vc14/zlibvc.vcxproj
zlib/contrib/vstudio/vc9/zlib.rc
zlib/contrib/vstudio/vc9/zlibvc.def
zlib/crc32.c
zlib/deflate.c
zlib/deflate.h
zlib/examples/gun.c
zlib/examples/gzlog.c
zlib/examples/zran.c
zlib/gzguts.h
zlib/gzlib.c
zlib/gzread.c
zlib/gzwrite.c
zlib/infback.c
zlib/inffast.c
zlib/inflate.c
zlib/inflate.h
zlib/inftrees.c
zlib/msdos/Makefile.dj2
zlib/msdos/Makefile.emx
zlib/old/Makefile.emx
zlib/old/os2/Makefile.os2
zlib/os400/README400
zlib/os400/bndsrc
zlib/os400/make.sh
zlib/os400/zlib.inc
zlib/qnx/package.qpg
zlib/test/example.c
zlib/test/infcover.c
zlib/test/minigzip.c
zlib/treebuild.xml
zlib/trees.c
zlib/uncompr.c
zlib/win32/Makefile.gcc
zlib/win32/Makefile.msc
zlib/win32/README-WIN32.txt
zlib/win32/VisualC.txt
zlib/win32/zlib.def
zlib/win32/zlib1.rc
zlib/zconf.h
zlib/zconf.h.cmakein
zlib/zconf.h.in
zlib/zlib.3
zlib/zlib.3.pdf
zlib/zlib.h
zlib/zlib.map
zlib/zutil.c
zlib/zutil.h


2018-03-06 12:36:11 +0000
Chris Liddell <chris.liddell@artifex.com>
08482c582115a1396d0fd9186011008f889a61c5

Work around a change in the zlib API for 1.2.11

where it's used in the Freetype/zlib interface debugging code.

freetype/src/gzip/zutil.h


2018-03-02 10:54:06 +0000
Ken Sharp <ken.sharp@artifex.com>
3da667d889e54fb1a323769fbb4f93b971d0fff4

CCITT Fax - ensure calculation rounds up

Still Bug #696413, follows on from commit 0221c9

When calculating the number of bytes required to store the encoded lines
we multiply the number of columns byt the number of bits required
for 2 pixels, then divide by 16 to get the required number of bytes.

This commit simply ensures that the division by 16 is rounded *up* and
not down. Previously we could end up dropping up to 7 bits of required
space. Generally this is not likely to be a problem but it is technically
a problem, and can be demonstrated on pathological cases.

base/scfe.c


2018-03-01 18:13:13 +0000
Ken Sharp <ken.sharp@artifex.com>
0221c9e4c43b25375dab6c9d15a777eecf20d261

Fix CCITT Fax Encoder

Bug #696413 "Seg faults found by fuzzing in pdf_store_page_resources (gdevpdfu.c:1663)"

As noted it eh bug report, the problem is that the encoding buffer is
allocated with a size based on the maximum number of bits for horizontal
encoding (6 bits per pixel), but for 2D encoding some of the bits might
use vertical encoding. Vertically encoded bits with an offset of 3 use
7 bits per pixel, not 6.

If we get a line with sufficient 7-bit encodings, where the horizontal
bits are encoded with 6 bits (eg runs of 1 pixel), then we can end up
running off the end of the buffer. Make the allocation assume a maximum
of 7 encoded bits per pixel instead.

base/scfe.c


2018-02-27 20:56:07 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e27f0530e3410547563daf757dc5c121c21d2f1c

Bug 697545 : Fix memory leak in show_proceed.

Fix memory leak and SEGV when gs_newpath returns an error code.

Error created using :-
MEMENTO_FAILAT=9017 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gxchar.c


2018-02-27 21:12:12 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
49974a63cad8c792067fbf63905a271022b0e806

Bug 697545 : Fix memory leaks in hpgl_print_char.

Fix memory leak when pcl_mark_page_for_current_pos returns an error code.
Also prevent path becoming orphaned in cpath_set_rectangle.

Error created using :-
MEMENTO_FAILAT=9010 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gxcpath.c
pcl/pcl/pglabel.c


2018-02-28 17:17:23 +0000
Ken Sharp <ken.sharp@artifex.com>
03194b72312b6777021f0554bdd30fecc89db486

txtwrite - guard against infinite loop

vertical text could result in an advance width of 0, which would cause
us to try and write an infinite number of spaces.

devices/vector/gdevtxtw.c


2018-02-28 14:04:32 +0000
Ken Sharp <ken.sharp@artifex.com>
d57bd7ce641d8134d559f5e8190e2578137e1d39

txtwrite - better dynamic resizing

A better fix for bug #699078, this implemnets the thought I had while
writing up the description of the problem. In this case we check whether
the current 'effective size' of the monospaced font would lead to
the end of the current run of text lying to the right of the 'next' run
of text on this line. If it would, then use the newly calculated
effective size, no matter how small it is, to avoid collisions.

devices/vector/gdevtxtw.c


2018-02-28 09:34:06 +0000
Ken Sharp <ken.sharp@artifex.com>
d0d4e282f98487ca2979edbaf6834d9341bcee53

txtwrite - slacken a restriction on minimum width selection

Bug #699078 " Extracted text is not properly seperated"

Allow the minimum size assigned to the monospaced output to be smaller
than previously (previously we limited it to .75 of the smallest point
size of any used font).

This will reduce the number of horizontal text collisions at the cost
of potentially making the text output wider.

Essentially this is caused by using a monospaced font to represent the
original proportionally spaced input. A sufficiently long run of
characters which are significantly less than the M width could result in
the position being further to the right (when converted to monspaced
text) than the neext horizontal fragment. So we wouldn't try to
space it any further.

Previously we limited the calculation of the minimum character size in
a run to 3/4 of the M space. Here we reduce that to 1/2 which will
permit more flexibility, but as stated, at the potential cost of the
output text being 'wider' (containing more spaces).

devices/vector/gdevtxtw.c


2018-02-26 21:25:19 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
a16736bc4ea251c46f1aa1d3b6176aadf5f0b914

Bug 697545 : Update PCL to return error codes (Patch VI).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pl/plparams.c
pcl/pl/pluchar.c


2018-02-25 20:36:29 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
50f7fc4f7a99d874af86e4a874067ba3a7760c42

Bug 697545 : Update PCL to return error codes (Patch V).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pcl/rtraster.c
pcl/pl/plchar.c
pcl/pl/plht.c
pcl/pl/pllfont.c


2018-02-23 18:02:47 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
0edcf910b80a1656c9441f32bd1770d2600ab915

Bug 697545 : Update PCL to return error codes (Patch IV).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pcl/pginit.c
pcl/pcl/pginit.h
pcl/pcl/pglabel.c
pcl/pcl/pglfill.c
pcl/pcl/pgmand.h
pcl/pcl/pgmisc.c
pcl/pcl/pgpoly.c
pcl/pcl/pgvector.c


2018-02-22 20:34:53 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
9f90d1361564289e6dbe56863a5fe1be1ca28f83

Bug 697545 : Update PCL to return error codes (Patch III).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pcl/pgchar.c
pcl/pcl/pgconfig.c
pcl/pcl/pgdraw.c
pcl/pcl/pgfdata.c
pcl/pcl/pgfont.c
pcl/pcl/pgframe.c


2018-02-23 14:35:57 +0000
Ken Sharp <ken.sharp@artifex.com>
6375e295893a71b5695fba2ca117747e326c8ec2

pdfwrite - gracefully handle inappropriate PDFA command line

If a user sets -dPDFA, but does not set ColorConversionStrategy, and
then processes an input file which has a DeviceN space with an alternate
space which does not match the ProcessColorModel, then we would write
an invalid PDF file (invalid function for the colour space).

Now technically this shouldn't happen, but we can guard against this
specific user error by spotting the problem and returning a rangecheck
error instead, which will cause the earlier code to fall back to
writing a device colour instead.

No diffrences expected.

devices/vector/gdevpdfc.c


2018-02-20 22:13:51 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
03607549d598b14ebbb6d4aea9591e10fc35c6cc

Bug 697545 : Update PCL to return error codes (Patch II).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pcl/pcsfont.c
pcl/pcl/pcsymbol.c
pcl/pcl/pctext.c
pcl/pcl/pctop.c
pcl/pcl/pcuptrn.c


2018-02-20 18:40:37 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
de2c3c2c536d5aff97091b146ed259270228dcb9

Bug 697545 : Update PCL to return error codes (Patch I).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pcl/pccolor.c
pcl/pcl/pcdraw.c
pcl/pcl/pcfontpg.c
pcl/pcl/pcindxed.c
pcl/pcl/pcjob.c
pcl/pcl/pcmacros.c
pcl/pcl/pcpalet.c
pcl/pcl/pcparse.c
pcl/pcl/pcpatrn.c


2018-02-14 17:26:23 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
8f2f27a730fc7ba76847d39fc46d6d7183cd27a3

Bug 697545 : Fix memory leaks during font loading.

Fix memory leaks for numerous allocation events.

Error created using :-
MEMENTO_FAILAT=1564 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gstype42.c
base/gxfapi.c
pcl/pl/plfapi.c
pcl/pl/plfont.c
pcl/pl/pllfont.c


2018-02-18 16:05:18 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
cceb3db394d9547d309f596001b02c63dec4d7f5

Bug 697545 : Fix memory leak in gx_path_new.

During a memory allocation event failure the orginal path would not be
decremented and hence become orphaned.

Error created using :-
MEMENTO_FAILAT=8959 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gxpath.c


2018-02-19 15:43:20 +0000
Ken Sharp <ken.sharp@artifex.com>
3f5736cb8a255cdfe00d59896dc39d050d1db00e

Add more bounds checking to type 2 font interpreter

Bug #699042 "stack out of bounds read in gs_type2_interpret, gstype2.c line 701"

The warning is caused by 'csp' being below the cstack bottom bound.
Adding a check for that prevents this warning. While we're here, add
checks to the bounds of 'transient_array' which wasn't being checked
previously.

base/gstype2.c
base/gxtype1.h


2018-02-19 14:26:29 +0000
Ken Sharp <ken.sharp@artifex.com>
cc2bfef83b1dca09e016e43238f71ca6c7a622b3

PDF interpreter - fix ToUnicode processing of bfrange with high byte set

Bug #699041 "Cyrilic text not respected"

The title is a misnomer, the problem is not Cyrillic fonts as such.

The example file has an unusually complex ToUnicode CMap, which includes
bfrange entries where the CID has a value > 0xFF. The code in pdf_font.ps
to create our internal GlyphNames2Unicode table was adding the 'offset'
(The high byte of the index) to the CID, which basically means we were
adding the high byte twice (the key already included the high byte).

Fix this by simply not adding the offset to the keys.

Its surprisingly hard to find examples of this, I can't immediately see
any in our test suite. I have gone through some of the files which
have been reported as problems with ToUnicode processing in the past
but none of them fall into this condition.

A couple of files show difference, but these are irrelevant, they are of
the 'wrong before, differently wrong now' category.

Resource/Init/pdf_font.ps


2018-02-18 14:18:10 +0000
Ken Sharp <ken.sharp@artifex.com>
eb2aa457387429b84c043430354b8476ac918961

Squash a couple of build warnings

Sort out negation of the PDFA flag

Ensure a variable is initialised under all conceivable circumstances

devices/vector/gdevpdtd.c
devices/vector/gdevpdtt.c


2018-02-16 19:32:11 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f006720c87026a67cdcaeab983fe888d4401cb0e

Bug 697545 : Prevent SEGV by returning error codes.

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

Error created using :-
MEMENTO_FAILAT=8961 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pgconfig.c
pcl/pcl/pgframe.c


2018-02-16 18:56:23 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
833333a6df506ad9525bb797245042442a0f31cb

Bug 697545 : Prevent SEGV in palette_do_reset.

Prevent SEGV when trying to access contents of empty palette.

Error created using :-
MEMENTO_FAILAT=8956 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pcpalet.c


2018-02-16 18:39:30 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
0ebfdae6fceedbbe7036c487916193b4349d4dd3

Bug 697545 : Fix memory leak in alloc_indexed_cspace.

Fix memory leak for allocation event 8953.

Error created using :-
MEMENTO_FAILAT=8954 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pcindxed.c


2018-02-13 15:53:09 -0800
Ray Johnston <ray.johnston@artifex.com>
9f9daedfdf98bab590eba53e34fba76b96307ec0

Fix Bug 698969 SEGV caused by overflow in mark_line_*** functions

Clipping needs to be performed in 64-bit to allow for the original
line segment being larger than can fit in signed 32-bit.

base/gxscanc.c


2018-02-16 10:29:00 +0000
Ken Sharp <ken.sharp@artifex.com>
ad07c06b7f898eeb663ee7eed336c2c602a91551

pdf_info.ps - check for null DescendantFonts after oforce

pdf_info.ps was modified to check for circular references when resolving
indirect objects. Now if we find recursion we return a null.

However, we weren't checking that when resolving DescendantFonts which
could lead to a typecheck error if we had two different CIDFonts on
the same page, and the CIDFonts used the same DescendantFonts array
(which is silly, of course).

toolbin/pdf_info.ps


2018-02-15 10:15:28 -0700
Henry Stiles <henry.stiles@artifex.com>
6a8c1d6be02fc7020ab4cf5cfbecf91790f7dc10

Bug 696654 - PCL/PXL fails to build with system-shared libjpeg.

Remove the HP CLJ 3500/3500/3600 emulation until it can be properly
integrated with libjpeg.

base/gdevpxat.h
base/gdevpxen.h
pcl/pxl/pxl.mak
pcl/pxl/pxptable.c
pcl/pxl/pxsessio.c
pcl/pxl/pxstate.h
pcl/pxl/pxvendor.c
pcl/pxl/pxvendor.h


2018-02-15 14:36:10 +0000
Ken Sharp <ken.sharp@artifex.com>
094aebef5c058ad312e5d2bfd46d897c21fac398

pdfwrite - remove dead code

Commit efb9bf3949617b4c733a6dcce04acd142c50115d changed the flow of
control to avoid going through code which could not work, since it left
a variable unassigned (and didn't do any part of the work that would
be required to give the variable a sensible value).

That left some code unreachable leading to a coverity warning (Coverity
ID 262411). I was unable to find any way to trigger the original
condition, and the code as it stands should at least work, even if it
might be sub-optimal in some cases. So remove the dead code to prevent
the warning, if this needs fixing in future there will need to be more
code written anyway.

devices/vector/gdevpdfb.c


2018-02-15 09:02:01 +0000
Ken Sharp <ken.sharp@artifex.com>
4384f85cbb9383cbeefea80e45e8893a5d64c7af

PDF interpreter - remove a debug pstack

accidentally left some debugging code in place, remove it now.

Resource/Init/pdf_main.ps


2018-02-14 17:01:21 +0000
Ken Sharp <ken.sharp@artifex.com>
7d1b64fe9474d4c1e6d5f4185c77cb42a8ac5bc0

Remove a long obselete C source file

Also remove a documentation reference and Windows project references

doc/Develop.htm
psi/zhsb.c
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-02-14 17:26:23 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
ecf45b80c55bc79c17bed5143426cd9f8060ec2f

Bug 697545 : Fix memory leaks during tt font loading.

Fix memory leak for allocation event numbers 1551, 1552 and 1553.

Error created using :-
MEMENTO_FAILAT=1554 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/plfont.c
pcl/pl/pllfont.c


2018-02-14 15:38:42 +0000
Ken Sharp <ken.sharp@artifex.com>
bb8f0822a31e0e976cb659000532fde2fdbccd8c

PDF interpreter - detect and ignore circular references in Outlines

Bug #699029 "infinite loop on pdfium test file"

If the /Next in an Outline points to any previously encountered
Outline entry, terminate processing of Outlines and warn the user.

Resource/Init/pdf_main.ps


2018-02-14 10:28:37 +0000
Ken Sharp <ken.sharp@artifex.com>
06ceaa2715fcbe2056214b0f958edc7deb4fa085

pdfwrite - improve stack bounds checking on font interpreters

Bug #699020 "stack buffer underflow (read) in gs_type2_interpret / gstype2.c line 567"

The internal type 1 and type 2 font interpreters are only used by
the vector devices (in particular pdfwrite), for rendering we use
FreeType.

This commit improves the bounds checking of the operand stacks used
by these interpreters, to catch more cases of badly formed or
corrupted fonts and throw an error in these cases.

This addresses the stated bug, but should actually prevent a lot
more problems which we haven't yet seen test cases for.

base/gstype1.c
base/gstype2.c
base/gxtype1.h


2018-02-13 12:00:10 +0000
Ken Sharp <ken.sharp@artifex.com>
c1a8dc52c0e320c41d04b6f32086622150962d61

fix commit bcef41ad72a16472a3003d357bf8d8680174ab85

Accidentally left currentdict on the operand stack afetr startup.

Resource/Init/gs_init.ps


2018-02-13 10:48:16 +0000
Chris Liddell <chris.liddell@artifex.com>
16586a6a0d8fac17d5201f102e0775e527d3a529

Bug 699019: bounds check stack access in Type 2 vmoveto

base/gstype2.c


2018-02-13 10:22:56 +0000
Ken Sharp <ken.sharp@artifex.com>
bcef41ad72a16472a3003d357bf8d8680174ab85

PS interpreter - fix setpagedevice with -dDELAYBIND

When a user sets a fixed resolution using -r, then the setpagedevice
code looks for the existence of a /HWResolution key in the page device
dictionary and attempts to remove it using .undef to prevent the
resolution being altered.

However, if DELAYBIND is set, then the .undef operator is removed
before .bindnow is run, which means that, when setpagedevice executes,
the .undef operator is not defined.

So add the same code for .undef as we use for other similar operators
(eg .forceundef), don't remove the definition if DELAYBIND is set, but
do remove it when .bindnow executes.

This is, of course, a security hole, but then the whole DELAYBIND
situation is.

While we are here, add a key /NOBIND with the value false to systemdict.
This is because some ancient, badly-behaved and no longer maintained
software checks this key unconditionally, if its not present it fails
with an undefined error. Setting it to false pacifies that software.

Resource/Init/gs_init.ps


2018-02-13 08:52:32 +0000
Chris Liddell <chris.liddell@artifex.com>
310a0bcaba3527903fc66fed2984f30d0bd4e4ab

Bug 699016: add stack bounds check for Type 1 seac

The macro for checking the stack bounds is now called from both the Type 1 and
Type 2 charstring code, so move it to a common header, and tweak the name to
fit.

base/gstype2.c
base/gxtype1.c
base/gxtype1.h


2018-02-13 08:35:22 +0000
Chris Liddell <chris.liddell@artifex.com>
9bbf14bc7210bc54613b0f64a5ad95368891982a

Bug 699015: bounds check stack for Type 2 callsubr

base/gstype2.c


2018-02-12 21:47:29 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
0e9ba7084176c7834db00927a8326310c6b83a67

Fix memory leak in xps_imp_set_device.

The param list can become orphaned if an error occurs early on in the code.

xps/xpstop.c


2018-02-11 20:44:04 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
5e9639e974afaa89027a5ccd573e50ff98e3ca3f

Bug 697545 : Fix memory leak in pcl_load_built_in_symbol_sets.

Fix memory leak for allocation event number 1266.

Error created using :-
MEMENTO_FAILAT=1267 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pcsymbol.c


2018-02-11 20:20:36 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
3e4c6beff724a4e0078a48e6f5200c23ae73f52b

Bug 697545 : Fix memory leak in pl_top_create_device.

The param list can become orphaned if an error occurs early on in the code.

Error created using :-
MEMENTO_FAILAT=676 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/plmain.c


2018-02-12 15:23:19 +0000
Chris Liddell <chris.liddell@artifex.com>
a4445fe0a312af901a79d6f41ace975a50d88a31

Bug 699012: bounds check point index in Move_Zp2_Point()

base/ttinterp.c


2018-02-12 12:05:44 +0000
Chris Liddell <chris.liddell@artifex.com>
e7abbb92e92ba326b4fc06491bd3c3cde61932b3

Bug 699013: Check glyph has a contour before accessing it.

in Ins_IUP()

base/ttinterp.c


2018-02-12 15:20:23 +0000
Ken Sharp <ken.sharp@artifex.com>
edf3684305414731fbdb9b90de7dbcbab0dace5f

Fix comments

The comments in zinitgrpahics and the PostScript definition of
initgraphics in gs_cspace.ps were incorrect, now that gs_initgraphics
does reset the colour space properly.

However, we do still need the /initgraphics override in gs_cspace.ps
in order to correctly set the colour space which we store in the
'interpreter' graphics state. We only use that to hand back in response
to a currentcolorspace, but we do need it.

Resource/Init/gs_cspace.ps
psi/zgstate.c


2018-02-12 13:47:18 +0000
Ken Sharp <ken.sharp@artifex.com>
b7a0556297296d8355748b9b130de02923a1c4cd

Check for error case in gs_cspace_new_ICC()

If we fail to allocate memory for a new colour space, simply return
NULL, don't try to use the failed allocation!

base/gscspace.c


2018-02-12 12:21:50 +0000
Ken Sharp <ken.sharp@artifex.com>
7a708d9fdcba9efbe21f236830e47eb4f4085672

More work with initgraphics

Firstly, remove the kludgy gs_initgraphics_no_cspace() and have the
PostScript operator zinitgraphics() call gs_initgraphics().

This meant fixing the gs_initgraphics routine; the previous commit
d527031607a881237819835c2b1045c81e24c387 simply overwrote the existing
colour spaces in the graphics state with the new DeviceGray space. This
could lead to memory leaks if the previous colour space had been
reference counted up. So now we call gs_setcolorspace instead, which also
correctly sets the current colour.

This led to the interesting discovery that the null brush in PXL has
never been handled properly by the high level devices. This is
handled by the PXL interpreter setting a DeviceGray colour space, and
then directly editing the device colour 'type' field and setting it to
'typ_null'. This doesn't seem like the best way to proceed to me, I
would have expected us to push the nulldevice, but its what is done.

No in gx_hld_is_hl_color_available() the code simply tested whether
the device color 'ccolor_valid' flag was set. Since the PXL interpreter
simply stomped on the type field, and did not update any of the other
fields, the result of this was unknown. Sometimes we would decide it
was valid, and sometimes not. If we did decide it was valid then we
used the DeviceGray space and colour (0, black) which was also set up
by the null brush code to draw the object, which means that we could
end up drawing objects which should not be drawn.

'Fixed' this by having the code explicitly test for the device color
type being 'null' as well as being valid. In passing, it did appear
to me that we do not always update the ccolor_valid flag in the device
color structure, which may well lead to more problems of this kind.

This does result in a number of differences in the output. Mostly
these are due to the error page now always being rendered in DeviceGray
which results in a slightly (invisible) difference in printed gray text.
A very large number of the Quality Logic files exhibit progressions
due to the fact that we are now correctly processing the null brush.

base/gsstate.c
base/gxhldevc.c
psi/zgstate.c


2018-02-04 18:45:26 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
1af4fced38d9d842195e5635c9e0aa4b5e13f21b

Bug 697545 : Fix memory leak in pcl interpreter.

If an error occurs during pl_set_device then the new interpreter is partially
set up but the old interpreter is still listed as current so the cleanup
code does not reclaim the partially set up memory. The patch ensures the
correct interpreter is cleaned up and also zeros out unset fields to prevent
a SEGV during memory freeing.

Fix memory leak for allocation event number 1265.

Error created using :-
MEMENTO_FAILAT=1266 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pctop.c
pcl/pl/plmain.c


2018-02-10 22:28:04 -0800
Ray Johnston <ray.johnston@artifex.com>
98d8f8d12a40bf36f0acdaefc0c63a7562326cab

Fix compile warning about possible uninitialized procedure pointers

Setting to NULL is OK since it will trigger a SEGV, but it looks
like the code will always set the procedures if it needs the source
colors.

base/gdevmpla.c


2018-02-10 11:43:15 -0800
Ray Johnston <ray.johnston@artifex.com>
2fe4c53757ef143071517216cacdbb228dfc4243

Fix compiler warning: mlut_size

This is OK because mlut_size is only used when 'clut' is non-NULL
but if so, it is initialized in line 1179.

base/gsicc_create.c


2018-02-10 11:28:48 -0800
Ray Johnston <ray.johnston@artifex.com>
d3fb0f876971f604597c10519259520a8035cb58

Fix gcc warning: gscms_is_threadsafe prototype

base/gsicc_cms.h
base/gsicc_lcms2.c
base/gsicc_lcms2art.c


2018-02-06 11:53:24 -0800
Ray Johnston <ray.johnston@artifex.com>
01a71ecbfe576d0a840946a0089f23ce131e995d

Change from CMM_THREAD_SAFE #define to a gscms_is_threadsafe function

In preparation for enabling sharing the profiles and link cache among
rendering threads, switch from a compile time flag to a function that
is returned by the CMS interface module linked in (e.g gsicc_lcms2.c)

This avoids more build machinery to propagate the flag, and ensures
that the flag won't be mis-matched to the CMS in use.

Also flag a few FIXME places identified that relate to multi-threaded
sharing of profiles and the profile link cache. Initially, even though
lcms2art is thread safe, return "false" until the multi-threaded
rendering works.

base/gdevp14.c
base/gsicc_cms.h
base/gsicc_lcms2.c
base/gsicc_lcms2art.c
base/gxcldev.h
base/gxclthrd.c


2018-02-10 10:59:29 +0000
Ken Sharp <ken.sharp@artifex.com>
da66356a665432f998642b2e9c45756f876f0996

PCL interpreter - correctly identify high level devices

Pointed out by Chris, the code in here explicitly tested the name of the
device to decide if it was a high level device. We deprecated that
approach some time ago, replacing it with a spec_op call instead.

The comment said 'this needs a better solution' and this is it.

Should work correctly now with any device which identifies itself as a
high level device.

pcl/pl/plmain.c


2018-02-08 13:57:54 -0700
Henry Stiles <henry.stiles@artifex.com>
4b4a301c90a8905d6b7ba703342ddc9cb1c8ff69

Fix 694689 - Seg faults found by fuzzing.

Allow clients of the decompression routines to pass in a parameter to
indicate no further input or output is expected. The decompression
routines should produce an error if the parameter is set and more
processing is needed. The pattern code uses this to indicate indicate
the final scanline has been processed, it is not needed by the image
code.

pcl/pxl/pximage.c


2018-02-07 17:03:04 -0700
Henry Stiles <henry.stiles@artifex.com>
8e4764d61562a44c77920ee67884ca846184b25c

Add line pointer to the pattern enumerator.

This tracks the scan line position within the pattern while reading,
simplifying bounds checking.

pcl/pxl/pximage.c


2018-02-05 13:28:52 -0700
Henry Stiles <henry.stiles@artifex.com>
faef871274167e12e93fc24026096474d00b794d

Remove pushed argument.

No need to push the filename simply run the file and use a do while
loop.

pcl/pl/plmain.c


2018-02-02 10:35:28 -0700
Henry Stiles <henry.stiles@artifex.com>
f29e2296e81378ed42b93215137361ab586b2393

Warning cleanup.

pcl/pcl/pcpalet.c
pcl/pcl/pcparse.c
pcl/pcl/pglabel.c
pcl/pl/pllfont.c
pcl/pxl/pxtop.c


2018-02-07 21:08:46 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
b808ea741efe357cf71254d9064e782dfd753584

Bug 697545 : Fix memory leak in gs_state_alloc.

The colour allocation code in gs_gstate_alloc was being repeated in the call
to gs_initgraphics leading to the first set of allocated colours becoming
orphaned. Given that gs_initigraphics is always called from gs_gstate_alloc
the duplicate code can be safely removed.

Error created using :-
MEMENTO_FAILAT=419 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsstate.c


2018-02-06 18:04:07 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
98e5b234b27d82e52d660a9e0bfc6c14e3d7a5cd

Bug 697545 : Prevent SEGV in pcpage_do_reset.

Prevent SEGV if memory allocation fails and returns a NULL paper size.

Error created using :-
MEMENTO_FAILAT=1215 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pcpage.c


2018-02-07 15:46:28 +0000
Ken Sharp <ken.sharp@artifex.com>
10dcb4943e552a3d53fbaf0b4e8741258238f7a7

Handle a potential error condition in PXL

Bug #698995 "Fixing error returns in gxicolor.c can cause PXL to enter an infinite loop or seg fault"

This started off as a fix to a scanbuild warning and spiralled somewhat.

Fixing gs_image_class_4_color() so that it didn't ignore an error return
led to the possibility of the PXL interpreter seg faulting or ending up
in an infinte loop.

Initially this turned out to be because gs_initgraphics() was no longer
setting the colour space to the proper default, leading to us trying
to use the very pattern space which failed. That was fixed in the
previous commit.

After that it turned out that in an error condition we were freeing
an image enumerator twice. This didn't seem to cause the PostScript
interpreter a problem, though it seems likely it did really, it simply
didn't exhibit before the interpreter exited. The PXL interpreter
however threw an error in the memory manager rather rapidly.

Fixed that by not calling gx_default_end_image in gx_enum_begin()
when we hit this particular error condition (no handler for an image).

This removes one of the free instances, and seems more reasonable anyway
it seems wrong to end an image we haven't yet begun.

This allows us to now propagate the error up from px_remap_pattern
without causing a seg fault or infinite loop. (finally)

base/gxipixel.c
pcl/pxl/pxink.c


2018-02-07 09:55:41 +0000
Ken Sharp <ken.sharp@artifex.com>
d527031607a881237819835c2b1045c81e24c387

Alter gs_initgraphcis to once again set the colour space and colour

At some time in the past gs_initgraphics was altered for 'colour substitution'
so that it did not reset the colour space and current colour. This is
surprising because the PostScript initgraphics operator is supposed to
do exactly that.

Restoring the code resulted in many seg faults with the PDF interpreter
so this is obviously a requirement, even though I can't see why.

However, leaving gs_initgraphics as it is would mean that (as per the
comment above the procedure) that all the interpreters (clients) would
have to reset the colour space and colour after calling it, which is
entirely unreasonable. Not only that, it hasn't been done leading to
the PXL interpreter printing error pages in the wrong colour.

This commit restores the setting of the colour space and colour to
gs_initgraphics, but introduces a new gs_initgraphics_no_cpsace()
procedure to be called from zinitgraphics, which behaves exactly as
the modified gs_initgraphics did, and does not set the colour space
or colour values.

The PDF interpreter now continues to work and the PXL interpreter now
prints a number of error pages in black where it previously was using a
pattern, grey or in one case green colour.

base/gsstate.c
base/gsstate.h
psi/zgstate.c


2018-02-07 09:49:34 +0000
Ken Sharp <ken.sharp@artifex.com>
28c58b4114ec145b8597372b6e29cec9e1f5df15

Yet more scanbuild warnings

gxhintn.c remove some unnecessary assignemnts

gxicolor.c remove an assignement, add an error check

gximono.c add an error check

gxiscale.c refactor code to remove some unnecessary assignments

gdevpsft.c remove unnecessary assignment

base/gxhintn.c
base/gxicolor.c
base/gximono.c
base/gxiscale.c
devices/vector/gdevpsft.c


2018-01-29 15:32:34 +0000
Robin Watts <robin.watts@artifex.com>
1b1015dc0e07b5269c4ee2009d5b896702550a3a

Tweak scale parameters in structure.

Be consistent with naming. Add PatchHeightOut and TopMarginOut so
we have the complete set. These are required for forthcoming work.

base/gxiscale.c
base/sidscale.c
base/siscale.c
base/sisparam.h
devices/vector/gdevpsdi.c


2018-02-02 12:48:07 +0000
Robin Watts <robin.watts@artifex.com>
38e0c643e62087c089c59c9ad44fc468dd09cd37

Tweak bitmap interpolater patch size.

When we interpolate an image, we restrict the interpolation to
the "patch" of the destination image that is actually visible.
Previously, the calculation of this patch has been inaccurate,
resulting in a larger area being decoded than was actually
needed.

While this extra work was largely mitigated by the "Active" area
detection code, it has meant that the contribution calculations
within the scaler were 'wrapping' the outside pixels in the
region to avoid accessing out of bounds.

This upsets the new library we are working on to do the scaling,
and it's basically inelegant. Instead we fix the destination
patch calculations so that the patch is correctly sized based
upon the available source data. This is safe to do because we
know the source data was already expanded.

base/gxiscale.c
base/sisparam.h


2018-02-06 11:46:56 +0000
Ken Sharp <ken.sharp@artifex.com>
f6005484617ada241d2f5f4deee4808616474831

Address more scanbuild/gcc/clang warnings

gdevkrnlsclass.c Change a while...do into a do...while to see if it
pacifies a 'dereference of NULL pointer' in scanbuild

gsparamx.c Incorrect return code could lead to an earlier error not
being preserved. Fortunately this is currently only called by claptrap.

gsptype1.c remove unnecessary assignments
gssprintf.c " " "
gstype2.c " " "
gstype42.c " " "
gxfill.c " " "

gsptype2.c rejig the code to avoid setting a return code that isn't used.
Add a check on a return code that was missing.

gxchar.c add return code checking
gxcmap.c " " " "

base/gdevkrnlsclass.c
base/gsparamx.c
base/gsptype1.c
base/gsptype2.c
base/gssprintf.c
base/gstype2.c
base/gstype42.c
base/gxchar.c
base/gxcmap.c
base/gxfill.c


2018-02-06 10:30:32 +0000
Ken Sharp <ken.sharp@artifex.com>
16688a8b833cf4e8950265e933604c32b1f2392e

Address more scanbuild/gcc/clang warnings

gp_os2.c free buffer and close file on memory full (as per other
error conditions).

gscicach.c remove unnecessary assignment
gsdparam.c " " " "
gxfapi.c " " " "

gscscie.c check a return code
zicc.c " " " "
zpcolor.c " " " "

mkromfs.c If realloc should fail in process_path, free working memory
print an error and exit as per other error conditions.

zcolor.c ensure depth cannot be 0. This should not be possible, no
existing code causes this, but its best to be safe and it prevents a
possible unassigned pointer dereference (possibly NULL) which is what
scanbuild complains of. Best to catch this in the interpreter.

base/gp_os2.c
base/gscicach.c
base/gscscie.c
base/gsdparam.c
base/gxfapi.c
base/mkromfs.c
psi/zcolor.c
psi/zicc.c
psi/zpcolor.c


2018-02-05 16:09:28 +0000
Ken Sharp <ken.sharp@artifex.com>
650aae633131396b802b2cae6e09afbd5aae6ad6

Coverity ID #261212

This probably showed up because of Ray's work adding return value
checking. Previously there were probably enough places not checking
the return code for Coverity to decide it was deliberate, now it is
raising a warning.

Add a check and take action on an error return.

psi/zcrd.c


2018-02-05 16:08:25 +0000
Ken Sharp <ken.sharp@artifex.com>
d7a5f0a14e873c7f5f557c4b635f4b4f166b41d2

Coverity ID #261211 - unchecked return value

This probably showed up because of Ray's work adding return value
checking. Previously there were probably enough places not checking
the return code for Coverity to decide t was deliberate, now it is
raising a warning.

Add a check of the return code.

devices/vector/gdevpsdi.c


2018-02-05 15:34:58 +0000
Ken Sharp <ken.sharp@artifex.com>
b8e36896913713f46a43dbbc0c0ed83f34ab4f10

Try to squash 3 identical scanbuild warnings

I think scanbuild is deciding that 'depth' could be less than 0, leading
us to not enter the loop which assigns 'obj'. This is not true, the
depth cannot be less than 0.

Try making 'depth' an unsigned int as a hint to scanbuild, and see if
the warning goes away.

psi/zcolor.c


2018-02-05 15:32:44 +0000
Ken Sharp <ken.sharp@artifex.com>
88e7812d362483d07ce63b47ae75c4852fe01a8f

txtwrite - honour error conditions

2 warnings from scanbuild, we were ignoring a potential error return in
two places.

devices/vector/gdevtxtw.c


2018-02-05 11:55:11 +0000
Ken Sharp <ken.sharp@artifex.com>
9c38c79741193010b23dabceb76996488415bd09

Clean up another scanbuild warning

We increment a local variable just before it goes out of scope, which is
clearly pointless.

devices/vector/gdevpsft.c


2018-02-05 11:54:14 +0000
Ken Sharp <ken.sharp@artifex.com>
0b4c59be1793c81e9d8cfeba04e74b6020571f5d

Fix another scanbuild warning

We don't seem to have any test cases which hit this, but it does look
possible from the code that we can end up trying to dereference
p_tile, and we don't check to see if its not NULL, which we do in a
lot of other places in this fucntion.

To be safe, test it first and return an error if its NULL.

devices/vector/gdevpdfv.c


2018-02-05 10:39:21 +0000
Ken Sharp <ken.sharp@artifex.com>
5d9d4bc1bbd272478bb9fd24fc1c0e44b0edc22a

Remove an unused function, clear a scanbuild warning

The function cos_write_stream_from_pipeline was never used, so remove
its definition.

At the same time try to squash a harmless scanbuild warning. We us a
'while(s....' loop to try and find a stream, scanbuild regards this as
implying that 's' might be NULL *initially*, which is not true. This
leads to a 'NULL pointer dereference' warning in the line after the
loop, because scanbuild thinks we can get to s->state with s being an
inital NULL.

Since we already check for s becoming NULL inside the loop, we don't
need to check it in while condition.

devices/vector/gdevpdfo.c


2018-02-05 10:35:16 +0000
Ken Sharp <ken.sharp@artifex.com>
43b2b593743433f45590b02b788c54d6bcf563a7

Prevent potential garbage pointer dereference

Picked up by scanbuild, if pdf_enter_substream failed then pres would be
left uninitialised, but we would then try to dereference it and assign a
value to a member before acting on the error return code.

Change the order of execution to test the return code first.

devices/vector/gdevpdti.c


2018-02-05 09:43:01 +0000
Ken Sharp <ken.sharp@artifex.com>
efb9bf3949617b4c733a6dcce04acd142c50115d

Remove faulty code picked up by scanbuild

scanbuild correctly warned that a variable was uninitialised. In fact
it looks to me like the code that was flagged simply can't work.

Fortunately it isn't exercised by any files in our test suite, and has
never been reported as a bug, so its clearly an uncommon (perhaps even
impossible) case.

All the same, lets fall back to the default handling if we hit it,
because at least that works, which the old code definitely didn't.

devices/vector/gdevpdfb.c


2018-02-05 09:40:50 +0000
Ken Sharp <ken.sharp@artifex.com>
ba6d8c5ec0fa27822041cb3bbc620e531fabcf0a

remove a scanbuild warning

We don't care about errors in this case, we are already aborting due
to an error. So just discard the status return.

devices/vector/gdevpdfj.c


2018-02-03 10:46:23 +0000
Ken Sharp <ken.sharp@artifex.com>
b119c51e5ce8d671bc33e38b7ebf7a5bdf5f9af5

Remove unused variable

another scanbuild warning

base/gsdevice.c


2018-02-03 10:26:18 +0000
Ken Sharp <ken.sharp@artifex.com>
dde422bb086ce0b2f56609fa3fc9af87867fc757

partially revert 07f9da3cb5647b18458cd52d1be35ab5365790eb

This was a scanbuild false positive, the original code was in fact
correct.

base/gdevkrnlsclass.c


2018-02-02 15:29:09 +0000
Ken Sharp <ken.sharp@artifex.com>
fa4941c607680159ed62bfe79b754a099adf5a4e

squash more scanbuild warnings

check some return values.

Remove some initialisations that aren't required.

Remove soem unused variables.

base/gsdparam.c
base/gsfunc0.c
base/gsht.c
base/gsht1.c


2018-02-02 14:43:23 +0000
Chris Liddell <chris.liddell@artifex.com>
3f38e3eeb6e6e7d88abbe1dca7675e237d5274e7

Remove spurious semi-colons introduced in 63f0fcc87e7c

I mistakenly left the trailing semi-colon in the macros defining the contents
of two pairs of structures.

Oddly, this caused a warning on VS2017, but not gcc/clang.

Thanks to Shailesh Mistry for pointing it out.

pcl/pl/pjparse.c


2018-02-02 13:11:05 +0000
Chris Liddell <chris.liddell@artifex.com>
452efeca35ee7e3fe381cae9a71d6efbcce68cd0

Address warning in gdevbit.c

Fix the "missing braces in initializer" warning - the explicit declaration of
the gs_bitrgbtags_device initializer had gotten out of step with the
gx_device_printer_s definition.

devices/gdevbit.c


2018-02-02 14:10:44 +0000
Ken Sharp <ken.sharp@artifex.com>
9036e05dfbcfa7968e00a53ef7ae9f6146740e94

Remove the 'device filter chain'

This was an early attempt to allow the possibility of 'chaining'
devices together. I believe it was never actually completed, although
the stack existed and was carefully preserved in the graphcis state,
the only code which accessed it was '.popdevicefilter'.

No C code or PostScript code ever actually pushed a device onto the
device filter stack, and nothing ever examined the stack to pass
operations through the 'chain'.

Since its been superseded by device subclassing, and didn't actually
seem to do anything anyway, remove it altogether. In addition to
removing clutter this also reduces the amount of 'magic' surrounding
reference counted objects in gstates.

base/gdevp14.c
base/gsgstate.c
base/gsstate.c
base/gxgstate.h
base/lib.mak
doc/Develop.htm
doc/who_owns_what.txt
psi/int.mak
psi/zdfilter.c
psi/ztrans.c
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-02-02 11:55:05 +0000
Ken Sharp <ken.sharp@artifex.com>
154f27478bdf5b27858a9f446433d5b62febb89d

remove some unused code - scanbuild warnings....

base/gsdevice.c


2018-02-02 11:17:19 +0000
Ken Sharp <ken.sharp@artifex.com>
84370aa9d391c37eccd467760c471e99e355a8ec

Fix some debug prints - scanbuild warning fix

The number of parameters and number of format specifiers didn't match,
this would only be apparent when built with DISPLAY_DEBUG defined.

psi/dpmain.c
psi/dwmainc.c


2018-02-02 11:16:11 +0000
Ken Sharp <ken.sharp@artifex.com>
1552615d4ae39a50a5f7bb40e5f481919ef0cb58

Fix memory leak - scanbuild warning

Not really a leak as such, but it prevents the warning.

psi/apitest.c


2018-02-02 11:15:13 +0000
Ken Sharp <ken.sharp@artifex.com>
ab8d4f968c01900e94438575ce33ae7a4fd63167

LCMS2art - fix some warnings from scanbuild

Make three functions static, to avoid 'no prototype' warnings.

lcms2art/src/cmsalpha.c
lcms2art/src/cmssamp.c


2018-02-02 09:45:39 +0000
Ken Sharp <ken.sharp@artifex.com>
0c9d19b947f9ca5bfe6ed1ba221e303d60bfc0cb

Remove the Mitsubishi CP50 colour dot matrix printer device

Recent changes caused this device to enter clist mode more frequently
and our automated testing revealed that in clist mode this device
does not work. It calls a device method which should never be called.

Its possible to remove the call, but we have no way to determine whether
the resulting output actually works.

Given the age of this device (and Mitsubishi have reused the model
number for a different device, so it must be old) we are removing
support for this device and deleting it fro the build.

If someone is still using this device, we'll reinstate support if they
are prepared to test the outptu for us.

base/unix-gcc.mak
configure.ac
devices/contrib.mak
devices/gdevcp50.c
doc/Develop.htm
psi/msvc.mak
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-02-02 08:54:35 +0000
Chris Liddell <chris.liddell@artifex.com>
252527b4257133a722f4f03dce1e8abcbcc3f3c8

Fix jmp_buf related compiler warning (setjmp_.h)

The compiler (gcc/clang) considers the alignment of entries in a structure to
be a run-time "variable", thus gives a warning when that value is used to
size an array used in a globally available data type.

The solution (suggested by Robin) is to use a buffer twice the size of a jmpbuf,
thus guaranteeing we have enough space to offset into the buffer, and get the
required alignment.

base/setjmp_.h


2018-02-01 14:56:31 +0000
Chris Liddell <chris.liddell@artifex.com>
f52a7ccf96f1b9bb90194ba1dd6a50040dd63896

Fix debug flag for TTF loading

Two places were erroneously using PDFDEBUG instead of TTFDEBUG

Resource/Init/gs_ttf.ps


2018-02-01 09:46:21 +0000
Chris Liddell <chris.liddell@artifex.com>
5b546c80e79e6d1f1c6c3a9a71bfb58ee23a328c

Address the popen prototype warning

Only include the hacky popen() prototype if it doesn't already exist in the
standard header files.

Makefile.in
base/pipe_.h
configure.ac


2018-02-01 11:40:20 +0000
Ken Sharp <ken.sharp@artifex.com>
88aea05567f36d4d37c00a51b818c80f88291f6b

Remove another unused procedure from the OpenJPEG interface

base/sjpx_openjpeg.c


2018-01-31 09:56:46 +0000
Chris Liddell <chris.liddell@artifex.com>
63f0fcc87e7c6a0ca38e92b7b3d72f1e936f2d0e

Fix discarded qualifier warnings in pcl/pl/pjparse.c

Create separate structure definitions for the normal and default PJL
environment and PJL font sources data.

The only difference between the two is the default one qualifies string
values as const.

pcl/pl/pjparse.c


2018-01-31 11:59:02 +0000
Chris Liddell <chris.liddell@artifex.com>
4d2f9f48fc272b7bb396f36704de03a7c15d2b3f

Fix _MSC_VER undefined warnings on non-MSC compilers

lcms2art/src/lcms2_internal.h


2018-01-31 10:22:34 +0000
Chris Liddell <chris.liddell@artifex.com>
b272292d9294e88e32d177d8b5e916f8bfaeb78b

Add a zlib specific CFLAGS and avoid discarded const warning

zlib has a table initialization with string literals that gcc
automatically makes const, but the structure definition for the table does not
qualify those entries as const. Hence we get warnings.

This adds ZLIB_CFLAGS and, with a gcc compatible compiler, sets it to:
-Wno-write-strings

which kills that warning.

Done this way because we want to retain that warning in the Ghostscript code.

Makefile.in
base/zlib.mak
configure.ac


2018-01-31 09:34:39 +0000
Chris Liddell <chris.liddell@artifex.com>
aea7d587749819b7e59d24720efe86b1f8555186

Add a TIFF specific CFLAGS and avoid discarded const warning

libtiff has a large table initialization with string literals that gcc
automatically makes const, but the structure definition for the table does not
qualify those entries as const. Hence we get warnings.

This adds TIFF_CFLAGS and, with a gcc compatible compiler, sets it to:
-Wno-write-strings

which kills that warning.

Done this way because we want to retain that warning in the Ghostscript code.

Makefile.in
base/tiff.mak
configure.ac


2018-01-27 23:11:13 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
865c3a83a449dc2c28f58095183b7493ccd970c4

Update error code checking to use hpgl_call within pgdraw.c file. Also
revert error code check in hpgl_draw_current_path to prevent failures
during cluster run.

pcl/pcl/pgdraw.c


2018-01-27 17:50:41 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
4ae64a398e6d5693c1dd4dd9348054cd21ef2443

Check all return code from param_write_float_array.

pcl/pcl/pcommand.c
pcl/pxl/pxsessio.c


2018-01-27 16:50:23 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
d372efa33d9e2550b887154e2d6a3b9d03bc6438

Check all return codes from pxPassthrough_init.

pcl/pxl/pxpthr.c


2018-01-27 16:27:08 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
cc620400517cd76a5276602aea59f1231f934c46

Check all return codes from pcl_enter_graphics_mode.

pcl/pcl/rtgmode.c


2018-01-27 15:18:02 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
db10b7b56e5de12f92c1df83237ec4ff4b0dcf2a

Check all return codes from pcl_end_graphics_mode.

pcl/pcl/pctop.c
pcl/pcl/rtgmode.c


2018-01-26 22:45:54 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
1df8810b79c5ef5979b1cad5ffe22a1fed824871

Update propagation of error codes from pcl_end_page.

pcl/pcl/pcjob.c
pcl/pcl/pcpage.c


2018-01-26 22:17:36 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e63064cfa3142e7a893a1666570f390d83662360

Update pcl_mark_page_for_character to propagate error codes.

pcl/pcl/pcpage.c
pcl/pcl/pcpage.h
pcl/pcl/pctext.c


2018-01-26 21:57:56 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
6f514a99fdb079d76df981a39dcb45f090766849

Update functionality to propagate error codes.

pcl/pcl/pcpage.c
pcl/pcl/pcpage.h
pcl/pcl/pgdraw.c
pcl/pcl/pglabel.c


2018-01-26 21:20:02 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
193d143d1843edb2515138e6b4b9e7c4f5c06aa5

Update functionality to propagate error codes returned from new_page_size.

pcl/pcl/pcpage.c
pcl/pcl/pcpage.h


2018-01-26 17:59:15 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
0d3c2753172bb9e22aa879d7503ec44f4b33e8f4

Update pcl_transform_rect to remove unused memory variable.

pcl/pcl/pcpage.c
pcl/pcl/pcpatxfm.c
pcl/pcl/pcpatxfm.h
pcl/pcl/rtgmode.c


2018-01-31 15:37:17 +0000
Ken Sharp <ken.sharp@artifex.com>
961b01a6e50e640afac0e696f9ce74a677e648ec

Squash more scan build warnings

Remove initialisations which aren't required (sometimes due to multiple
initialisations.

In interp.c, store the error value in the actual return code.

Action error return codes.

Fix a few white space oddities.

psi/dscparse.c
psi/gs.c
psi/imain.c
psi/interp.c
psi/zcie.c
psi/zcolor.c


2018-01-31 14:47:41 +0000
Ken Sharp <ken.sharp@artifex.com>
7220e8e037ccee1c234872d143ec0ca14682604b

Squash some more warnings

scan build this time, none of them serious.

Check some return codes and remove some unused variables.

devices/gdevpdfimg.c
devices/vector/gdevpdf.c
devices/vector/gdevpdfc.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdft.c
devices/vector/gdevpdfu.c
devices/vector/gdevpsdp.c


2018-01-31 09:59:01 +0000
Ken Sharp <ken.sharp@artifex.com>
68fcaea85611267eec9f4bac3443977fe15627dc

squash GCC warnings

remove an unused variable from a (large) macro in gxfilltr.h

remove some unused variables, and an entire unused function in
sjpx_openjpeg.c

remove an unused variable in gdevbit.c

remove an unused variable in gdevjpeg.c

bracket a variable declaration and usage with #ifdef DEBUG to prevent
the compiler warning that the variable is set but not read on non-debug
builds. gdevxps.c

preserve 'const' when passing a memory pointer to a procedure to
avoid a warning about discarding const. zcie.c

base/gxfilltr.h
base/sjpx_openjpeg.c
devices/gdevbit.c
devices/gdevjpeg.c
devices/vector/gdevxps.c
psi/zcie.c


2018-01-31 09:55:34 +0000
Ken Sharp <ken.sharp@artifex.com>
07f9da3cb5647b18458cd52d1be35ab5365790eb

Device subclassing - fix potential problems

Flagged by scan build, the code to work a chain of devices had a
potential problem in walking up and down the chain.

Also flagged by scan build, the create_compositor method checked the
target child device before trying to use it to set the saved target
color info, but didn't check it before trying to set the procs.

base/gdevdflt.c
base/gdevkrnlsclass.c


2018-01-30 11:49:19 -0800
Ray Johnston <ray.johnston@artifex.com>
67daf3d995d83da98988085e68548a4920fe1747

Get rid of some gcc warnings.

Add initializers for variables that confuse gcc. Also get rid of the
clist_reinit_output_file which was only needed for the RETRYING code
and the partial page rendering (this function had unused variable
warnings). THis should have been part of commit 7eda41b.

base/gxclist.c
base/gxclpath.c
base/gxclrast.c


2018-01-30 16:37:58 +0000
Ken Sharp <ken.sharp@artifex.com>
22cf826fe4d0c0206be582d35c99954199dee999

Update copyright notice with new head office address.

Also update copyright dates.

Remove gs_cmdl.ps as we no longer use it, and remove its entry from
psfiles.htm.

Remove xfonts.htm as this feature (xfont support) is long, long gone.

Makefile.in
Resource/CIDFont/ArtifexBullet
Resource/CMap/Identity-UTF16-H
Resource/ColorSpace/DefaultCMYK
Resource/ColorSpace/DefaultGray
Resource/ColorSpace/DefaultRGB
Resource/ColorSpace/TrivialCMYK
Resource/ColorSpace/sGray
Resource/ColorSpace/sRGB
Resource/Decoding/FCO_Dingbats
Resource/Decoding/FCO_Symbol
Resource/Decoding/FCO_Unicode
Resource/Decoding/FCO_Wingdings
Resource/Decoding/Latin1
Resource/Decoding/StandardEncoding
Resource/Decoding/Unicode
Resource/Encoding/CEEncoding
Resource/Encoding/ExpertEncoding
Resource/Encoding/ExpertSubsetEncoding
Resource/Encoding/NotDefEncoding
Resource/Encoding/Wingdings
Resource/Init/FCOfontmap-PCLPS2
Resource/Init/Fontmap.GS
Resource/Init/gs_agl.ps
Resource/Init/gs_btokn.ps
Resource/Init/gs_cff.ps
Resource/Init/gs_cidcm.ps
Resource/Init/gs_ciddc.ps
Resource/Init/gs_cidfm.ps
Resource/Init/gs_cidfn.ps
Resource/Init/gs_cidtt.ps
Resource/Init/gs_cmap.ps
Resource/Init/gs_cspace.ps
Resource/Init/gs_dbt_e.ps
Resource/Init/gs_diskn.ps
Resource/Init/gs_dpnxt.ps
Resource/Init/gs_dps.ps
Resource/Init/gs_dps1.ps
Resource/Init/gs_dps2.ps
Resource/Init/gs_dscp.ps
Resource/Init/gs_epsf.ps
Resource/Init/gs_fapi.ps
Resource/Init/gs_fntem.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_frsd.ps
Resource/Init/gs_icc.ps
Resource/Init/gs_il1_e.ps
Resource/Init/gs_img.ps
Resource/Init/gs_init.ps
Resource/Init/gs_l2img.ps
Resource/Init/gs_lev2.ps
Resource/Init/gs_ll3.ps
Resource/Init/gs_mex_e.ps
Resource/Init/gs_mgl_e.ps
Resource/Init/gs_mro_e.ps
Resource/Init/gs_pdf_e.ps
Resource/Init/gs_pdfwr.ps
Resource/Init/gs_res.ps
Resource/Init/gs_resmp.ps
Resource/Init/gs_setpd.ps
Resource/Init/gs_statd.ps
Resource/Init/gs_std_e.ps
Resource/Init/gs_sym_e.ps
Resource/Init/gs_trap.ps
Resource/Init/gs_ttf.ps
Resource/Init/gs_typ32.ps
Resource/Init/gs_typ42.ps
Resource/Init/gs_type1.ps
Resource/Init/gs_wan_e.ps
Resource/Init/pdf_base.ps
Resource/Init/pdf_draw.ps
Resource/Init/pdf_font.ps
Resource/Init/pdf_main.ps
Resource/Init/pdf_ops.ps
Resource/Init/pdf_rbld.ps
Resource/Init/pdf_sec.ps
Resource/SubstCID/CNS1-WMode
Resource/SubstCID/GB1-WMode
Resource/SubstCID/Japan1-WMode
Resource/SubstCID/Korea1-WMode
arch/arch_autoconf.h.in
arch/windows-arm-msvc.h
arch/windows-x64-msvc.h
arch/windows-x86-msvc.h
base/all-arch.mak
base/assert_.h
base/bench.c
base/bobbin.c
base/bobbin.h
base/claptrap-init.c
base/claptrap-planar.c
base/claptrap.c
base/claptrap.h
base/ctype_.h
base/dirent_.h
base/dos_.h
base/echogs.c
base/errno_.h
base/expat.mak
base/fapi_bs.mak
base/fapi_ft.c
base/fapibstm.c
base/fapiufst.c
base/fcntl_.h
base/freetype.mak
base/gconf.c
base/gconf.h
base/gdbflags.h
base/gdebug.h
base/gdevabuf.c
base/gdevbbox.c
base/gdevbbox.h
base/gdevdbit.c
base/gdevdcrd.c
base/gdevdcrd.h
base/gdevddrw.c
base/gdevddrw.h
base/gdevdevn.c
base/gdevdevn.h
base/gdevdevnprn.h
base/gdevdflt.c
base/gdevdgbr.c
base/gdevdrop.c
base/gdevdsha.c
base/gdevemap.c
base/gdevflp.c
base/gdevflp.h
base/gdevhit.c
base/gdevkrnlsclass.c
base/gdevkrnlsclass.h
base/gdevm1.c
base/gdevm16.c
base/gdevm2.c
base/gdevm24.c
base/gdevm32.c
base/gdevm4.c
base/gdevm40.c
base/gdevm48.c
base/gdevm56.c
base/gdevm64.c
base/gdevm8.c
base/gdevmem.c
base/gdevmem.h
base/gdevmpla.c
base/gdevmpla.h
base/gdevmplt.c
base/gdevmplt.h
base/gdevmr1.c
base/gdevmr2n.c
base/gdevmr8n.c
base/gdevmrop.h
base/gdevmrun.c
base/gdevmrun.h
base/gdevmx.c
base/gdevnfwd.c
base/gdevoflt.c
base/gdevoflt.h
base/gdevp14.c
base/gdevp14.h
base/gdevpccm.c
base/gdevpccm.h
base/gdevpipe.c
base/gdevplnx.c
base/gdevplnx.h
base/gdevppla.c
base/gdevppla.h
base/gdevprn.c
base/gdevprn.h
base/gdevpxat.h
base/gdevpxen.h
base/gdevpxop.h
base/gdevrops.c
base/gdevsclass.c
base/gdevsclass.h
base/gdevvec.c
base/gdevvec.h
base/gen_ordered.c
base/gen_ordered.h
base/genarch.c
base/genconf.c
base/gendev.c
base/genht.c
base/gp.h
base/gp_dosfe.c
base/gp_dosfs.c
base/gp_dvx.c
base/gp_getnv.c
base/gp_mktmp.c
base/gp_msdll.c
base/gp_msdos.c
base/gp_mshdl.c
base/gp_mslib.c
base/gp_mspol.c
base/gp_msprn.c
base/gp_mswin.c
base/gp_mswin.h
base/gp_nsync.c
base/gp_ntfs.c
base/gp_nxpsprn.c
base/gp_os2.c
base/gp_os2.h
base/gp_os2fs.c
base/gp_os2pr.c
base/gp_os9.c
base/gp_paper.c
base/gp_psync.c
base/gp_stdia.c
base/gp_stdin.c
base/gp_strdl.c
base/gp_sysv.c
base/gp_unifn.c
base/gp_unifs.c
base/gp_unix.c
base/gp_upapr.c
base/gp_vms.c
base/gp_wgetv.c
base/gp_win32.c
base/gp_wpapr.c
base/gp_wsync.c
base/gp_wutf8.c
base/gp_wxpsprn.cpp
base/gpcheck.h
base/gpgetenv.h
base/gpmisc.c
base/gpmisc.h
base/gpsync.h
base/gs.mak
base/gs_dll_call.h
base/gs_mgl_e.h
base/gs_mro_e.h
base/gsalloc.c
base/gsalloc.h
base/gsalpha.c
base/gsalpha.h
base/gsalphac.c
base/gsalphac.h
base/gsargs.c
base/gsargs.h
base/gsbitcom.c
base/gsbitmap.h
base/gsbitops.c
base/gsbitops.h
base/gsbittab.c
base/gsbittab.h
base/gsccode.h
base/gsccolor.h
base/gscdef.c
base/gscdefs.h
base/gscdevn.c
base/gscdevn.h
base/gscedata.c
base/gscedata.h
base/gscencs.c
base/gscencs.h
base/gschar.c
base/gschar.h
base/gschar0.c
base/gscicach.c
base/gscicach.h
base/gscie.c
base/gscie.h
base/gsciemap.c
base/gscindex.h
base/gsclipsr.c
base/gsclipsr.h
base/gscms.h
base/gscolor.c
base/gscolor.h
base/gscolor1.c
base/gscolor1.h
base/gscolor2.c
base/gscolor2.h
base/gscolor3.c
base/gscolor3.h
base/gscompt.h
base/gscoord.c
base/gscoord.h
base/gscparam.c
base/gscpixel.c
base/gscpixel.h
base/gscpm.h
base/gscrd.c
base/gscrd.h
base/gscrdp.c
base/gscrdp.h
base/gscrypt1.c
base/gscrypt1.h
base/gscscie.c
base/gscsel.h
base/gscsepr.c
base/gscsepr.h
base/gscspace.c
base/gscspace.h
base/gscssub.c
base/gscssub.h
base/gsdcolor.h
base/gsdevice.c
base/gsdevice.h
base/gsdevmem.c
base/gsdfilt.c
base/gsdfilt.h
base/gsdll.h
base/gsdllwin.h
base/gsdparam.c
base/gsdpnext.h
base/gsdps.c
base/gsdps.h
base/gsdps1.c
base/gsdsrc.c
base/gsdsrc.h
base/gsequivc.c
base/gsequivc.h
base/gserrors.h
base/gsexit.h
base/gsfcid.c
base/gsfcid2.c
base/gsfcmap.c
base/gsfcmap.h
base/gsfcmap1.c
base/gsflip.c
base/gsflip.h
base/gsfname.c
base/gsfname.h
base/gsfont.c
base/gsfont.h
base/gsfont0.c
base/gsfont0c.c
base/gsform1.h
base/gsfunc.c
base/gsfunc.h
base/gsfunc0.c
base/gsfunc0.h
base/gsfunc3.c
base/gsfunc3.h
base/gsfunc4.c
base/gsfunc4.h
base/gsgc.h
base/gsgcache.c
base/gsgcache.h
base/gsgdata.c
base/gsgdata.h
base/gsgstate.c
base/gshsb.c
base/gshsb.h
base/gsht.c
base/gsht.h
base/gsht1.c
base/gsht1.h
base/gshtscr.c
base/gshtx.c
base/gshtx.h
base/gsicc.c
base/gsicc.h
base/gsicc_cache.c
base/gsicc_cache.h
base/gsicc_cms.h
base/gsicc_create.c
base/gsicc_create.h
base/gsicc_lcms2.c
base/gsicc_lcms2art.c
base/gsicc_manage.c
base/gsicc_manage.h
base/gsicc_monitorcm.c
base/gsicc_nocm.c
base/gsicc_profilecache.c
base/gsicc_profilecache.h
base/gsicc_replacecm.c
base/gsimage.c
base/gsimage.h
base/gsimpath.c
base/gsinit.c
base/gsio.h
base/gsiodev.c
base/gsiodevs.c
base/gsiodisk.c
base/gsioram.c
base/gsiorom.c
base/gsiorom.h
base/gsipar3x.h
base/gsiparam.h
base/gsiparm2.h
base/gsiparm3.h
base/gsiparm4.h
base/gsjconf.h
base/gsjmorec.h
base/gslib.c
base/gslib.h
base/gslibctx.c
base/gslibctx.h
base/gsline.c
base/gsline.h
base/gslparam.h
base/gsmalloc.c
base/gsmalloc.h
base/gsmatrix.c
base/gsmatrix.h
base/gsmchunk.c
base/gsmchunk.h
base/gsmd5.c
base/gsmd5.h
base/gsmdebug.h
base/gsmemory.c
base/gsmemory.h
base/gsmemraw.h
base/gsmemret.c
base/gsmemret.h
base/gsmisc.c
base/gsnamecl.c
base/gsnamecl.h
base/gsncdummy.c
base/gsncdummy.h
base/gsnogc.c
base/gsnogc.h
base/gsnotify.c
base/gsnotify.h
base/gsovrc.c
base/gsovrc.h
base/gspaint.c
base/gspaint.h
base/gsparam.c
base/gsparam.h
base/gsparam2.c
base/gsparams.c
base/gsparams.h
base/gsparamx.c
base/gsparamx.h
base/gspath.c
base/gspath.h
base/gspath1.c
base/gspath2.h
base/gspcolor.c
base/gspcolor.h
base/gspenum.h
base/gspmdrv.c
base/gspmdrv.h
base/gspmdrv.rc
base/gsptype1.c
base/gsptype1.h
base/gsptype2.c
base/gsptype2.h
base/gsrect.h
base/gsrefct.h
base/gsromfs0.c
base/gsrop.c
base/gsrop.h
base/gsroprun.c
base/gsroprun1.h
base/gsroprun24.h
base/gsroprun8.h
base/gsropt.h
base/gsroptab.c
base/gsserial.c
base/gsserial.h
base/gsshade.c
base/gsshade.h
base/gssprintf.h
base/gsstate.c
base/gsstate.h
base/gsstrl.h
base/gsstrtok.h
base/gsstruct.h
base/gsstype.h
base/gstext.c
base/gstext.h
base/gstiffio.c
base/gstiffio.h
base/gstparam.h
base/gstrans.c
base/gstrans.h
base/gstrap.c
base/gstrap.h
base/gstype1.c
base/gstype1.h
base/gstype2.c
base/gstype42.c
base/gstypes.h
base/gsuid.h
base/gsutil.c
base/gsutil.h
base/gswin.rc
base/gsxfont.h
base/gx.h
base/gxacpath.c
base/gxalloc.h
base/gxalpha.h
base/gxarith.h
base/gxband.h
base/gxbcache.c
base/gxbcache.h
base/gxbitfmt.h
base/gxbitmap.h
base/gxbitops.h
base/gxblend.c
base/gxblend.h
base/gxblend1.c
base/gxccache.c
base/gxccman.c
base/gxcdevn.h
base/gxchar.c
base/gxchar.h
base/gxchrout.c
base/gxchrout.h
base/gxcht.c
base/gxcid.h
base/gxcie.h
base/gxcindex.h
base/gxclbits.c
base/gxcldev.h
base/gxclfile.c
base/gxclimag.c
base/gxclio.h
base/gxclip.c
base/gxclip.h
base/gxclip2.c
base/gxclip2.h
base/gxclipm.c
base/gxclipm.h
base/gxclipsr.h
base/gxclist.c
base/gxclist.h
base/gxcllzw.c
base/gxclmem.c
base/gxclmem.h
base/gxclpage.c
base/gxclpage.h
base/gxclpath.c
base/gxclpath.h
base/gxclrast.c
base/gxclread.c
base/gxclrect.c
base/gxclthrd.c
base/gxclthrd.h
base/gxclutil.c
base/gxclzlib.c
base/gxcmap.c
base/gxcmap.h
base/gxcolor2.h
base/gxcomp.h
base/gxcoord.h
base/gxcpath.c
base/gxcpath.h
base/gxcspace.h
base/gxctable.c
base/gxctable.h
base/gxcvalue.h
base/gxdcconv.c
base/gxdcconv.h
base/gxdcolor.c
base/gxdcolor.h
base/gxdda.h
base/gxdevbuf.h
base/gxdevcli.h
base/gxdevice.h
base/gxdevmem.h
base/gxdevndi.c
base/gxdevndi.h
base/gxdevrop.h
base/gxdevsop.h
base/gxdht.h
base/gxdhtres.h
base/gxdhtserial.c
base/gxdhtserial.h
base/gxdither.h
base/gxdownscale.c
base/gxdownscale.h
base/gxdtfill.h
base/gxfapi.c
base/gxfapi.h
base/gxfapiu.c
base/gxfapiu.h
base/gxfarith.h
base/gxfcache.h
base/gxfcid.h
base/gxfcmap.h
base/gxfcmap1.h
base/gxfill.c
base/gxfill.h
base/gxfillsl.h
base/gxfilltr.h
base/gxfillts.h
base/gxfixed.h
base/gxfmap.h
base/gxfont.h
base/gxfont0.h
base/gxfont0c.h
base/gxfont1.h
base/gxfont42.h
base/gxfrac.h
base/gxftype.h
base/gxfunc.h
base/gxgetbit.h
base/gxgstate.h
base/gxhintn.c
base/gxhintn.h
base/gxhintn1.c
base/gxhldevc.c
base/gxhldevc.h
base/gxht.c
base/gxht.h
base/gxht_thresh.c
base/gxht_thresh.h
base/gxhtbit.c
base/gxhttile.h
base/gxhttype.h
base/gxi12bit.c
base/gxi16bit.c
base/gxiclass.h
base/gxicolor.c
base/gxidata.c
base/gxifast.c
base/gximag3x.c
base/gximag3x.h
base/gximage.c
base/gximage.h
base/gximage1.c
base/gximage2.c
base/gximage3.c
base/gximage3.h
base/gximage4.c
base/gximask.c
base/gximask.h
base/gximdecode.c
base/gximdecode.h
base/gximono.c
base/gxiodev.h
base/gxiparam.h
base/gxipixel.c
base/gxiscale.c
base/gxline.h
base/gxlum.h
base/gxmatrix.h
base/gxmclip.c
base/gxmclip.h
base/gxobj.h
base/gxoprect.c
base/gxoprect.h
base/gxp1fill.c
base/gxp1impl.h
base/gxpaint.c
base/gxpaint.h
base/gxpath.c
base/gxpath.h
base/gxpath2.c
base/gxpcache.h
base/gxpcmap.c
base/gxpcolor.h
base/gxpcopy.c
base/gxpdash.c
base/gxpflat.c
base/gxrplane.h
base/gxsample.c
base/gxsample.h
base/gxsamplp.h
base/gxscanc.c
base/gxscanc.h
base/gxshade.c
base/gxshade.h
base/gxshade1.c
base/gxshade4.c
base/gxshade4.h
base/gxshade6.c
base/gxstate.h
base/gxstdio.h
base/gxstroke.c
base/gxsync.c
base/gxsync.h
base/gxtext.h
base/gxtmap.h
base/gxttf.h
base/gxttfb.c
base/gxttfb.h
base/gxtype1.c
base/gxtype1.h
base/gxxfont.h
base/gzacpath.h
base/gzcpath.h
base/gzht.h
base/gzline.h
base/gzpath.h
base/gzspotan.c
base/gzspotan.h
base/gzstate.h
base/ijs.mak
base/instcopy
base/jbig2.mak
base/jerror_.h
base/jmemcust.c
base/jmemcust.h
base/jpeg.mak
base/jpegxr.mak
base/lcms2.mak
base/lcms2art.mak
base/lcups.mak
base/lcupsi.mak
base/ldf_jb2.mak
base/lib.mak
base/locale_.h
base/lwf_jp2.mak
base/malloc_.h
base/math_.h
base/md5main.c
base/memento.c
base/memento.h
base/memory_.h
base/mkromfs.c
base/msvccmd.mak
base/msvclib.mak
base/msvctail.mak
base/openjpeg.mak
base/openvms.mak
base/openvms.mmk
base/pack_ps.c
base/pcwin.mak
base/pipe_.h
base/png.mak
base/png_.h
base/ramfs.c
base/ramfs.h
base/sa85d.c
base/sa85d.h
base/sa85x.h
base/saes.c
base/saes.h
base/sarc4.c
base/sarc4.h
base/sbcp.c
base/sbcp.h
base/sbtx.h
base/scanchar.h
base/scantab.c
base/scf.h
base/scfd.c
base/scfdgen.c
base/scfdtab.c
base/scfe.c
base/scfetab.c
base/scfparam.c
base/scfx.h
base/scommon.h
base/sdcparam.c
base/sdcparam.h
base/sdct.h
base/sdctc.c
base/sdctd.c
base/sdcte.c
base/sddparam.c
base/sdeparam.c
base/seexec.c
base/setjmp_.h
base/sfilter.h
base/sfilter2.c
base/sfxboth.c
base/sfxcommon.c
base/sfxfd.c
base/sfxstdio.c
base/shc.c
base/shc.h
base/sidscale.c
base/sidscale.h
base/siinterp.c
base/siinterp.h
base/simscale.c
base/simscale.h
base/siscale.c
base/siscale.h
base/sisparam.h
base/sjbig2.c
base/sjbig2.h
base/sjbig2_luratech.c
base/sjbig2_luratech.h
base/sjpeg.h
base/sjpegc.c
base/sjpegd.c
base/sjpege.c
base/sjpx_luratech.c
base/sjpx_luratech.h
base/sjpx_none.c
base/sjpx_openjpeg.c
base/sjpx_openjpeg.h
base/slzwc.c
base/slzwd.c
base/slzwe.c
base/slzwx.h
base/smd5.c
base/smd5.h
base/smtf.h
base/spdiff.c
base/spdiffx.h
base/spngp.c
base/spngpx.h
base/spprint.c
base/spprint.h
base/spsdf.c
base/spsdf.h
base/spwgd.c
base/spwgx.h
base/srdline.h
base/srld.c
base/srle.c
base/srlx.h
base/ssha2.c
base/ssha2.h
base/sstring.c
base/sstring.h
base/stat_.h
base/std.h
base/stdint_.h
base/stdio_.h
base/stdpre.h
base/stream.c
base/stream.h
base/strimpl.h
base/string_.h
base/strmio.c
base/strmio.h
base/stub.mak
base/szlibc.c
base/szlibd.c
base/szlibe.c
base/szlibx.h
base/szlibxx.h
base/tiff.mak
base/time_.h
base/ttcalc.c
base/ttcalc.h
base/ttcommon.h
base/ttconf.h
base/ttconfig.h
base/ttfinp.c
base/ttfinp.h
base/ttfmain.c
base/ttfmemd.c
base/ttfmemd.h
base/ttfoutl.h
base/ttfsfnt.h
base/ttinterp.c
base/ttinterp.h
base/ttload.c
base/ttload.h
base/ttmisc.h
base/ttobjs.c
base/ttobjs.h
base/tttables.h
base/tttype.h
base/tttypes.h
base/ugcclib.mak
base/unistd_.h
base/unix-aux.mak
base/unix-dll.mak
base/unix-end.mak
base/unix-gcc.mak
base/unixansi.mak
base/unixhead.mak
base/unixinst.mak
base/unixlink.mak
base/valgrind.h
base/version.mak
base/vms_x_fix.h
base/vmsmath.h
base/windows_.h
base/winlib.mak
base/winplat.mak
base/winrtsup.cpp
base/winrtsup.h
base/wrfont.c
base/wrfont.h
base/write_t1.c
base/write_t1.h
base/write_t2.c
base/write_t2.h
base/x_.h
base/zlib.mak
configure.ac
devices/contrib.mak
devices/devs.mak
devices/gdev3852.c
devices/gdev4081.c
devices/gdev8510.c
devices/gdev8bcm.c
devices/gdev8bcm.h
devices/gdevatx.c
devices/gdevbit.c
devices/gdevbj10.c
devices/gdevbjc.h
devices/gdevbjcl.c
devices/gdevbjcl.h
devices/gdevbmp.c
devices/gdevbmp.h
devices/gdevbmpc.c
devices/gdevccr.c
devices/gdevcdj.c
devices/gdevcfax.c
devices/gdevcif.c
devices/gdevclj.c
devices/gdevcljc.c
devices/gdevcmykog.c
devices/gdevcp50.c
devices/gdevcslw.c
devices/gdevdfax.c
devices/gdevdjet.c
devices/gdevdjtc.c
devices/gdevdljm.c
devices/gdevdljm.h
devices/gdevdm24.c
devices/gdevdsp.c
devices/gdevdsp.h
devices/gdevdsp2.h
devices/gdevepsc.c
devices/gdevepsn.c
devices/gdevescp.c
devices/gdevfax.c
devices/gdevfax.h
devices/gdevfpng.c
devices/gdevgprf.c
devices/gdevhl7x.c
devices/gdevicov.c
devices/gdevijs.c
devices/gdevimgn.c
devices/gdevjbig2.c
devices/gdevjpeg.c
devices/gdevjpx.c
devices/gdevl31s.c
devices/gdevlbp8.c
devices/gdevlj56.c
devices/gdevlp8k.c
devices/gdevlxm.c
devices/gdevmeds.c
devices/gdevmeds.h
devices/gdevmgr.c
devices/gdevmgr.h
devices/gdevmiff.c
devices/gdevn533.c
devices/gdevo182.c
devices/gdevokii.c
devices/gdevpbm.c
devices/gdevpcl.c
devices/gdevpcl.h
devices/gdevpcx.c
devices/gdevpe.c
devices/gdevperm.c
devices/gdevphex.c
devices/gdevpjet.c
devices/gdevplan.c
devices/gdevplib.c
devices/gdevplib.h
devices/gdevpm.h
devices/gdevpng.c
devices/gdevpsd.c
devices/gdevpsd.h
devices/gdevpsim.c
devices/gdevpxut.c
devices/gdevpxut.h
devices/gdevrinkj.c
devices/gdevsj48.c
devices/gdevsnfb.c
devices/gdevsppr.c
devices/gdevstc.c
devices/gdevstc.h
devices/gdevstc1.c
devices/gdevstc2.c
devices/gdevstc3.c
devices/gdevstc4.c
devices/gdevtfax.c
devices/gdevtfax.h
devices/gdevtfnx.c
devices/gdevtifs.c
devices/gdevtifs.h
devices/gdevtknk.c
devices/gdevtrac.c
devices/gdevtsep.c
devices/gdevupd.c
devices/gdevwpr2.c
devices/gdevx.c
devices/gdevx.h
devices/gdevxalt.c
devices/gdevxcf.c
devices/gdevxcmp.c
devices/gdevxcmp.h
devices/gdevxini.c
devices/gdevxres.c
devices/gxfcopy.c
devices/gxfcopy.h
devices/minftrsz.c
devices/minftrsz.h
devices/rinkj/evenbetter-rll.c
devices/rinkj/evenbetter-rll.h
devices/rinkj/rinkj-byte-stream.c
devices/rinkj/rinkj-byte-stream.h
devices/rinkj/rinkj-config.c
devices/rinkj/rinkj-config.h
devices/rinkj/rinkj-device.c
devices/rinkj/rinkj-device.h
devices/rinkj/rinkj-dither.c
devices/rinkj/rinkj-dither.h
devices/rinkj/rinkj-epson870.c
devices/rinkj/rinkj-epson870.h
devices/rinkj/rinkj-screen-eb.c
devices/rinkj/rinkj-screen-eb.h
devices/vector/gdevagl.c
devices/vector/gdevagl.h
devices/vector/gdevpdf.c
devices/vector/gdevpdfb.c
devices/vector/gdevpdfb.h
devices/vector/gdevpdfc.c
devices/vector/gdevpdfc.h
devices/vector/gdevpdfd.c
devices/vector/gdevpdfe.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfg.h
devices/vector/gdevpdfi.c
devices/vector/gdevpdfj.c
devices/vector/gdevpdfk.c
devices/vector/gdevpdfm.c
devices/vector/gdevpdfo.c
devices/vector/gdevpdfo.h
devices/vector/gdevpdfp.c
devices/vector/gdevpdfr.c
devices/vector/gdevpdft.c
devices/vector/gdevpdfu.c
devices/vector/gdevpdfv.c
devices/vector/gdevpdfx.h
devices/vector/gdevpdt.c
devices/vector/gdevpdt.h
devices/vector/gdevpdtb.c
devices/vector/gdevpdtb.h
devices/vector/gdevpdtc.c
devices/vector/gdevpdtd.c
devices/vector/gdevpdtd.h
devices/vector/gdevpdte.c
devices/vector/gdevpdtf.c
devices/vector/gdevpdtf.h
devices/vector/gdevpdti.c
devices/vector/gdevpdti.h
devices/vector/gdevpdts.c
devices/vector/gdevpdts.h
devices/vector/gdevpdtt.c
devices/vector/gdevpdtt.h
devices/vector/gdevpdtv.c
devices/vector/gdevpdtv.h
devices/vector/gdevpdtw.c
devices/vector/gdevpdtw.h
devices/vector/gdevpdtx.h
devices/vector/gdevpsdf.h
devices/vector/gdevpsdi.c
devices/vector/gdevpsdp.c
devices/vector/gdevpsds.c
devices/vector/gdevpsds.h
devices/vector/gdevpsdu.c
devices/vector/gdevpsf.h
devices/vector/gdevpsf1.c
devices/vector/gdevpsf2.c
devices/vector/gdevpsfm.c
devices/vector/gdevpsft.c
devices/vector/gdevpsfu.c
devices/vector/gdevpsfx.c
devices/vector/gdevpsu.c
devices/vector/gdevpsu.h
devices/vector/gdevpx.c
devices/vector/gdevtxtw.c
devices/vector/gdevxps.c
devices/vector/opdfread.ps
devices/vector/whitelst.c
devices/vector/whitelst.h
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/GS9_Color_Management.tex
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gdevds32.c
doc/sample_downscale_device.htm
doc/thirdparty.htm
examples/waterfal.ps
gpdl/gpdl.mak
gpdl/psi/gpdlpsi.mak
gpdl/psi/psitop.c
gpdl/pspcl6_gcc.mak
gpdl/pspcl6_msvc.mak
ijs/Makefile.am
ijs/configure.ac
ijs/ijs.c
ijs/ijs.h
ijs/ijs_client.c
ijs/ijs_client.h
ijs/ijs_client_example.c
ijs/ijs_exec_unix.c
ijs/ijs_exec_win.c
ijs/ijs_server.c
ijs/ijs_server_example.c
ijs/unistd_.h
ios/ios_arch-arm.h
ios/ios_arch-x86.h
jbig2dec/config_win32.h
jbig2dec/jbig2.c
jbig2dec/jbig2.h
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith.h
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_arith_iaid.h
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_arith_int.h
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_generic.h
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_halftone.h
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_huffman.h
jbig2dec/jbig2_hufftab.h
jbig2dec/jbig2_image.c
jbig2dec/jbig2_image.h
jbig2dec/jbig2_image_pbm.c
jbig2dec/jbig2_image_png.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_metadata.h
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_mmr.h
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_symbol_dict.h
jbig2dec/jbig2_text.c
jbig2dec/jbig2_text.h
jbig2dec/jbig2dec.c
jbig2dec/memcmp.c
jbig2dec/memento.c
jbig2dec/memento.h
jbig2dec/os_types.h
jbig2dec/pbm2png.c
lib/FCOfontmap-PCLPS3
lib/FCOfontmap-PS3
lib/Fontmap.ATB
lib/Fontmap.ATM
lib/Fontmap.OS2
lib/Fontmap.SGI
lib/Fontmap.Sol
lib/Fontmap.URW-136.T1
lib/Fontmap.URW-136.TT
lib/Fontmap.Ult
lib/Fontmap.VMS
lib/align.ps
lib/caption.ps
lib/cat.ps
lib/cid2code.ps
lib/docie.ps
lib/font2pcl.ps
lib/gs_ce_e.ps
lib/gs_cmdl.ps
lib/gs_il2_e.ps
lib/gs_kanji.ps
lib/gs_ksb_e.ps
lib/gs_lgo_e.ps
lib/gs_lgx_e.ps
lib/gs_wl1_e.ps
lib/gs_wl2_e.ps
lib/gs_wl5_e.ps
lib/gslp.ps
lib/gsnup.ps
lib/image-qa.ps
lib/jispaper.ps
lib/lines.ps
lib/mkcidfm.ps
lib/pdf2dsc.ps
lib/pfbtopfa.ps
lib/ppath.ps
lib/pphs.ps
lib/prfont.ps
lib/ps2ai.ps
lib/ps2epsi.ps
lib/rollconv.ps
lib/stcinfo.ps
lib/stcolor.ps
lib/stocht.ps
lib/traceimg.ps
lib/traceop.ps
lib/uninfo.ps
lib/viewcmyk.ps
lib/viewgif.ps
lib/viewjpeg.ps
lib/viewmiff.ps
lib/viewpbm.ps
lib/viewpcx.ps
lib/viewps2a.ps
lib/viewpwg.ps
lib/viewraw.ps
lib/viewrgb.ps
lib/winmaps.ps
lib/zeroline.ps
pcl/LICENSE
pcl/pcl/pcbiptrn.c
pcl/pcl/pcbiptrn.h
pcl/pcl/pccid.c
pcl/pcl/pccid.h
pcl/pcl/pccolor.c
pcl/pcl/pccoord.h
pcl/pcl/pccprint.c
pcl/pcl/pccsbase.c
pcl/pcl/pccsbase.h
pcl/pcl/pcdict.h
pcl/pcl/pcdither.c
pcl/pcl/pcdither.h
pcl/pcl/pcdraw.c
pcl/pcl/pcdraw.h
pcl/pcl/pcfont.c
pcl/pcl/pcfont.h
pcl/pcl/pcfontpg.c
pcl/pcl/pcfontst.h
pcl/pcl/pcfrgrnd.c
pcl/pcl/pcfrgrnd.h
pcl/pcl/pcfsel.c
pcl/pcl/pcfsel.h
pcl/pcl/pcht.c
pcl/pcl/pcht.h
pcl/pcl/pcident.c
pcl/pcl/pcident.h
pcl/pcl/pcimpl.c
pcl/pcl/pcindxed.c
pcl/pcl/pcindxed.h
pcl/pcl/pcjob.c
pcl/pcl/pcl.mak
pcl/pcl/pcl_top.mak
pcl/pcl/pclookup.c
pcl/pcl/pclookup.h
pcl/pcl/pcmacros.c
pcl/pcl/pcmisc.c
pcl/pcl/pcmtx3.c
pcl/pcl/pcmtx3.h
pcl/pcl/pcommand.c
pcl/pcl/pcommand.h
pcl/pcl/pcpage.c
pcl/pcl/pcpage.h
pcl/pcl/pcpalet.c
pcl/pcl/pcpalet.h
pcl/pcl/pcparam.h
pcl/pcl/pcparse.c
pcl/pcl/pcparse.h
pcl/pcl/pcpatrn.c
pcl/pcl/pcpatrn.h
pcl/pcl/pcpattyp.h
pcl/pcl/pcpatxfm.c
pcl/pcl/pcpatxfm.h
pcl/pcl/pcrect.c
pcl/pcl/pcsfont.c
pcl/pcl/pcstate.h
pcl/pcl/pcstatus.c
pcl/pcl/pcsymbol.c
pcl/pcl/pcsymbol.h
pcl/pcl/pctext.c
pcl/pcl/pctop.c
pcl/pcl/pctop.h
pcl/pcl/pctpm.h
pcl/pcl/pcuptrn.c
pcl/pcl/pcuptrn.h
pcl/pcl/pcursor.c
pcl/pcl/pcursor.h
pcl/pcl/pcwhtidx.c
pcl/pcl/pcwhtidx.h
pcl/pcl/pcxfmst.h
pcl/pcl/pgchar.c
pcl/pcl/pgcolor.c
pcl/pcl/pgconfig.c
pcl/pcl/pgdraw.c
pcl/pcl/pgdraw.h
pcl/pcl/pgfdata.c
pcl/pcl/pgfdata.h
pcl/pcl/pgfont.c
pcl/pcl/pgfont.h
pcl/pcl/pgframe.c
pcl/pcl/pggeom.c
pcl/pcl/pggeom.h
pcl/pcl/pginit.c
pcl/pcl/pginit.h
pcl/pcl/pglabel.c
pcl/pcl/pglfill.c
pcl/pcl/pgmand.h
pcl/pcl/pgmisc.c
pcl/pcl/pgmisc.h
pcl/pcl/pgparse.c
pcl/pcl/pgpoly.c
pcl/pcl/pgstate.h
pcl/pcl/pgvector.c
pcl/pcl/rtgmode.c
pcl/pcl/rtgmode.h
pcl/pcl/rtmisc.c
pcl/pcl/rtmisc.h
pcl/pcl/rtraster.c
pcl/pcl/rtraster.h
pcl/pcl/rtrstcmp.c
pcl/pcl/rtrstcmp.h
pcl/pcl/rtrstst.h
pcl/pl/pjparse.c
pcl/pl/pjparse.h
pcl/pl/pjparsei.c
pcl/pl/pjtop.c
pcl/pl/pjtop.h
pcl/pl/pl.mak
pcl/pl/plalloc.c
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plchar.c
pcl/pl/plchar.h
pcl/pl/plcursor.c
pcl/pl/plcursor.h
pcl/pl/pldebug.h
pcl/pl/pldict.c
pcl/pl/pldict.h
pcl/pl/pldraw.c
pcl/pl/pldraw.h
pcl/pl/plfapi.c
pcl/pl/plfapi.h
pcl/pl/plfont.c
pcl/pl/plfont.h
pcl/pl/plftable.c
pcl/pl/plftable.h
pcl/pl/plht.c
pcl/pl/plht.h
pcl/pl/plimpl.c
pcl/pl/pllfont.c
pcl/pl/pllfont.h
pcl/pl/plmain.c
pcl/pl/plmain.h
pcl/pl/plparams.c
pcl/pl/plparams.h
pcl/pl/plparse.h
pcl/pl/plromfs.mak
pcl/pl/plsymbol.c
pcl/pl/plsymbol.h
pcl/pl/pltop.c
pcl/pl/pltop.h
pcl/pl/pluchar.c
pcl/pl/plufont.c
pcl/pl/plufstlp.c
pcl/pl/plufstlp.h
pcl/pl/plufstlp1.c
pcl/pl/plulfont.c
pcl/pl/plvalue.c
pcl/pl/plvalue.h
pcl/pl/plvocab.c
pcl/pl/plvocab.h
pcl/pl/plwimg.c
pcl/pl/plwimg.h
pcl/pl/plwmainc.c
pcl/pl/plwreg.c
pcl/pl/plwreg.h
pcl/pl/plwres.h
pcl/pl/realmain.c
pcl/pxl/pxasm.ps
pcl/pxl/pxattr.h
pcl/pxl/pxbfont.c
pcl/pxl/pxbfont.h
pcl/pxl/pxbfont.ps
pcl/pxl/pxcet.txt
pcl/pxl/pxdict.h
pcl/pxl/pxdiff.txt
pcl/pxl/pxenum.h
pcl/pxl/pxerrors.c
pcl/pxl/pxerrors.h
pcl/pxl/pxffont.c
pcl/pxl/pxfont.c
pcl/pxl/pxfont.h
pcl/pxl/pxfts.txt
pcl/pxl/pxgstate.c
pcl/pxl/pxgstate.h
pcl/pxl/pximage.c
pcl/pxl/pximpl.c
pcl/pxl/pxink.c
pcl/pxl/pxl.mak
pcl/pxl/pxlib.txt
pcl/pxl/pxoper.h
pcl/pxl/pxpaint.c
pcl/pxl/pxparse.c
pcl/pxl/pxparse.h
pcl/pxl/pxptable.c
pcl/pxl/pxptable.h
pcl/pxl/pxpthr.c
pcl/pxl/pxpthr.h
pcl/pxl/pxsessio.c
pcl/pxl/pxspec.txt
pcl/pxl/pxstate.c
pcl/pxl/pxstate.h
pcl/pxl/pxstream.c
pcl/pxl/pxsymbol.ps
pcl/pxl/pxsymbol.psc
pcl/pxl/pxsymbol.psh
pcl/pxl/pxtag.h
pcl/pxl/pxtop.c
pcl/pxl/pxvalue.c
pcl/pxl/pxvalue.h
pcl/pxl/pxvendor.c
pcl/pxl/pxvendor.h
pcl/tools/cmpi/cmpi.cpp
pcl/tools/pxlasm.py
pcl/tools/pxldis.py
pcl/tools/suite.tcl
psi/bfont.h
psi/btoken.h
psi/dmmain.c
psi/dmmain.r
psi/dpmain.c
psi/dscparse.c
psi/dscparse.h
psi/dstack.h
psi/dwdll.c
psi/dwdll.h
psi/dwimg.c
psi/dwimg.h
psi/dwmain.c
psi/dwmain.rc
psi/dwmainc.c
psi/dwnodll.c
psi/dwreg.c
psi/dwreg.h
psi/dwres.h
psi/dwtext.c
psi/dwtext.h
psi/dwtrace.c
psi/dwtrace.h
psi/dxmain.c
psi/dxmainc.c
psi/estack.h
psi/files.h
psi/ghost.h
psi/gs.c
psi/gsdll.c
psi/gsdll2.rc
psi/gsdll32.rc
psi/gserver.c
psi/gsos2.rc
psi/ialloc.c
psi/ialloc.h
psi/iapi.c
psi/iapi.h
psi/iastate.h
psi/iastruct.h
psi/ibnum.c
psi/ibnum.h
psi/ichar.h
psi/ichar1.h
psi/icharout.h
psi/icid.h
psi/icie.h
psi/icolor.h
psi/iconf.c
psi/iconf.h
psi/icontext.c
psi/icontext.h
psi/icremap.h
psi/icsmap.h
psi/icstate.h
psi/iddict.h
psi/iddstack.h
psi/idebug.c
psi/idebug.h
psi/idict.c
psi/idict.h
psi/idictdef.h
psi/idicttpl.h
psi/idisp.c
psi/idisp.h
psi/idosave.h
psi/idparam.c
psi/idparam.h
psi/idsdata.h
psi/idstack.c
psi/idstack.h
psi/ierrors.h
psi/iesdata.h
psi/iestack.h
psi/ifapi.h
psi/ifcid.h
psi/ifilter.h
psi/ifilter2.h
psi/ifont.h
psi/ifont1.h
psi/ifont2.h
psi/ifont42.h
psi/ifrpred.h
psi/ifunc.h
psi/ifwpred.h
psi/igc.c
psi/igc.h
psi/igcref.c
psi/igcstr.c
psi/igcstr.h
psi/igstate.h
psi/iht.h
psi/iimage.h
psi/iimage2.h
psi/iinit.c
psi/iinit.h
psi/ilevel.h
psi/ilocate.c
psi/imain.c
psi/imain.h
psi/imainarg.c
psi/imainarg.h
psi/imemory.h
psi/iminst.h
psi/iname.c
psi/iname.h
psi/inamedef.h
psi/inameidx.h
psi/inames.h
psi/inamestr.h
psi/inobtokn.c
psi/inouparm.c
psi/int.mak
psi/interp.c
psi/interp.h
psi/iosdata.h
psi/iostack.h
psi/ipacked.h
psi/iparam.c
psi/iparam.h
psi/iparray.h
psi/ipcolor.h
psi/iplugin.c
psi/iplugin.h
psi/ireclaim.c
psi/iref.h
psi/isave.c
psi/isave.h
psi/iscan.c
psi/iscan.h
psi/iscanbin.c
psi/iscanbin.h
psi/iscannum.c
psi/iscannum.h
psi/isdata.h
psi/isstate.h
psi/istack.c
psi/istack.h
psi/istkparm.h
psi/istream.h
psi/istruct.h
psi/itoken.h
psi/iutil.c
psi/iutil.h
psi/iutil2.c
psi/iutil2.h
psi/ivmem2.h
psi/ivmspace.h
psi/main.h
psi/mkfilelt.cpp
psi/msvc.mak
psi/msvc32.mak
psi/msvc64.mak
psi/nsisinst.nsi
psi/oparc.h
psi/opcheck.h
psi/opdef.h
psi/oper.h
psi/opextern.h
psi/os2.mak
psi/ostack.h
psi/psromfs.mak
psi/sfilter1.c
psi/store.h
psi/winint.mak
psi/zalg.c
psi/zarith.c
psi/zarray.c
psi/zbfont.c
psi/zbseq.c
psi/zcfont.c
psi/zchar.c
psi/zchar1.c
psi/zchar2.c
psi/zchar32.c
psi/zchar42.c
psi/zchar42.h
psi/zcharout.c
psi/zcharx.c
psi/zcid.c
psi/zcie.c
psi/zcie.h
psi/zcolor.c
psi/zcolor.h
psi/zcolor1.c
psi/zcolor2.c
psi/zcolor3.c
psi/zcontext.c
psi/zcontrol.c
psi/zcrd.c
psi/zcsindex.c
psi/zcspixel.c
psi/zcssepr.c
psi/zdevcal.c
psi/zdevice.c
psi/zdevice2.c
psi/zdfilter.c
psi/zdict.c
psi/zdouble.c
psi/zdpnext.c
psi/zdps.c
psi/zdps1.c
psi/zdscpars.c
psi/zfaes.c
psi/zfapi.c
psi/zfarc4.c
psi/zfbcp.c
psi/zfcid.c
psi/zfcid0.c
psi/zfcid1.c
psi/zfcmap.c
psi/zfdctd.c
psi/zfdcte.c
psi/zfdecode.c
psi/zfile.c
psi/zfile.h
psi/zfile1.c
psi/zfileio.c
psi/zfilter.c
psi/zfilter2.c
psi/zfimscale.c
psi/zfjbig2.c
psi/zfjpx.c
psi/zfmd5.c
psi/zfont.c
psi/zfont0.c
psi/zfont1.c
psi/zfont2.c
psi/zfont32.c
psi/zfont42.c
psi/zfontenum.c
psi/zform.c
psi/zfproc.c
psi/zfrsd.c
psi/zfrsd.h
psi/zfsample.c
psi/zfsha2.c
psi/zfunc.c
psi/zfunc.h
psi/zfunc0.c
psi/zfunc3.c
psi/zfunc4.c
psi/zfzlib.c
psi/zgeneric.c
psi/zgstate.c
psi/zhsb.c
psi/zht.c
psi/zht1.c
psi/zht2.c
psi/zht2.h
psi/zicc.c
psi/zicc.h
psi/zimage.c
psi/zimage2.c
psi/zimage3.c
psi/ziodev.c
psi/ziodev2.c
psi/ziodevs.c
psi/ziodevsc.c
psi/zmath.c
psi/zmatrix.c
psi/zmedia2.c
psi/zmisc.c
psi/zmisc1.c
psi/zmisc2.c
psi/zmisc3.c
psi/zncdummy.c
psi/zpacked.c
psi/zpaint.c
psi/zpath.c
psi/zpath1.c
psi/zpcolor.c
psi/zpdf_r6.c
psi/zpdfops.c
psi/zrelbit.c
psi/zshade.c
psi/zstack.c
psi/zstring.c
psi/zsysvm.c
psi/ztoken.c
psi/ztrans.c
psi/ztrap.c
psi/ztype.c
psi/zupath.c
psi/zusparam.c
psi/zutf8.c
psi/zvmem.c
psi/zvmem2.c
psi/zwinutf8.c
toolbin/GenSubstCID.ps
toolbin/afmutil.py
toolbin/color/icc_creator/ICC_Creator/CIELAB.h
toolbin/color/icc_creator/ICC_Creator/ICC_Creator.cpp
toolbin/color/icc_creator/ICC_Creator/ICC_Creator.h
toolbin/color/icc_creator/ICC_Creator/ICC_CreatorDlg.cpp
toolbin/color/icc_creator/ICC_Creator/ICC_CreatorDlg.h
toolbin/color/icc_creator/ICC_Creator/icc_create.cpp
toolbin/color/icc_creator/ICC_Creator/icc_create.h
toolbin/color/icc_creator/README.txt
toolbin/encs2c.ps
toolbin/errlist.tcl
toolbin/extractFonts.ps
toolbin/extractICCprofiles.ps
toolbin/gen_ldf_jb2.py
toolbin/genfontmap.ps
toolbin/gitlog2changelog.py
toolbin/gsmake.tcl
toolbin/halftone/gen_ordered/README
toolbin/halftone/gen_ordered/gen_ordered_main.c
toolbin/halftone/gen_stochastic/gen_stochastic.c
toolbin/halftone/thresh_remap/thresh_remap.c
toolbin/headers.tcl
toolbin/jpxtopdf.c
toolbin/leaks.tcl
toolbin/makehist.tcl
toolbin/memory.py
toolbin/ocheck.py
toolbin/pdf_info.ps
toolbin/pre.tcl
toolbin/precheck.tcl
toolbin/split_changelog.py
toolbin/suite.tcl
toolbin/tests/build_revision.py
toolbin/tests/check_all.py
toolbin/tests/check_comments.py
toolbin/tests/check_dirs.py
toolbin/tests/check_docrefs.py
toolbin/tests/cmpi.py
toolbin/tests/compare_checksumdb.py
toolbin/tests/compare_checksums.py
toolbin/tests/dump_checksum.py
toolbin/tests/dump_checksum_plus.py
toolbin/tests/dump_checksum_raw.py
toolbin/tests/fuzzy.c
toolbin/tests/get_baseline_log.py
toolbin/tests/get_baselines.py
toolbin/tests/gscheck_all.py
toolbin/tests/gscheck_fuzzypdf.py
toolbin/tests/gscheck_pdfwrite.py
toolbin/tests/gscheck_raster.py
toolbin/tests/gscheck_testfiles.py
toolbin/tests/gsconf.py
toolbin/tests/gsparamsets.py
toolbin/tests/gssum.py
toolbin/tests/gstestgs.py
toolbin/tests/gstestutils.py
toolbin/tests/gsutil.py
toolbin/tests/make_baselinedb.py
toolbin/tests/make_testdb.py
toolbin/tests/make_two_pdfversions
toolbin/tests/make_two_versions
toolbin/tests/myoptparse.py
toolbin/tests/rasterdb.py
toolbin/tests/revert_baseline
toolbin/tests/revert_pdfbaseline
toolbin/tests/run_nightly.py
toolbin/tests/run_parallel
toolbin/tests/run_regression.py
toolbin/tests/testdiff.py
toolbin/tests/update_baseline.py
toolbin/tests/update_specific
toolbin/tmake.tcl
xps/ghostxps.h
xps/xps.mak
xps/xpsanalyze.c
xps/xpscff.c
xps/xpscolor.c
xps/xpscommon.c
xps/xpscrc.c
xps/xpsdoc.c
xps/xpsfapi.c
xps/xpsfapi.h
xps/xpsfont.c
xps/xpsglyphs.c
xps/xpsgradient.c
xps/xpshash.c
xps/xpsimage.c
xps/xpsjpeg.c
xps/xpsjxr.c
xps/xpsmem.c
xps/xpsopacity.c
xps/xpspage.c
xps/xpspath.c
xps/xpspng.c
xps/xpsresource.c
xps/xpsromfs.mak
xps/xpstiff.c
xps/xpstile.c
xps/xpstop.c
xps/xpsttf.c
xps/xpsutf.c
xps/xpsvisual.c
xps/xpsxml.c
xps/xpszip.c


2018-01-30 08:35:40 +0000
Ken Sharp <ken.sharp@artifex.com>
013b8208180cccf65d3c5ee374b678ceffe39cf7

Documentation - restore docs on image-qa.ps

Commit b223c93caa34ad34dfd33d534529b3f11d067aab was slightly over
enthusiastic and accidentally removed the documentation for the file
image-qa.ps.

Restore it here.

doc/Psfiles.htm


2018-01-29 12:27:04 +0000
Chris Liddell <chris.liddell@artifex.com>
ad8f4138ad44647125424aa4b635aade1a2557ad

Compiler warning in base/gsicc_manage.c

Comparing a pointer to '\0' should be comparing to NULL to check for a valid
string argument,

base/gsicc_manage.c


2018-01-29 16:12:36 +0000
Ken Sharp <ken.sharp@artifex.com>
b223c93caa34ad34dfd33d534529b3f11d067aab

Documentation - correct erroneous information in psfiles.htm

Psfiles.htm incorrectly listed a number of files as being in 'lib'
when in fact they have been moved to 'Resource/Init. In addition
Several files were listed which no longer exist, and some files in
'examples' were not listed or described.

I suspect this listing is still not comprehensive, but at I believe
the information that is there is now at least correct.

doc/Psfiles.htm


2018-01-29 14:05:50 +0000
Ken Sharp <ken.sharp@artifex.com>
d8ec036836a0abcfe3cc677bb88a61bdfd1a65bb

pdfwrite - remove a global from gdevpdtt.c


See bug #693376

In gdevpdtt.c we hold a static gs_glyph standard_glyph_code_for_notdef
which is initially assinged to GS_NO_GLYPH, and is later assigned a
value from the encoding table:

standard_glyph_code_for_notdef =
gs_c_name_glyph((const byte *)".notdef", 7) - gs_c_min_std_encoding_glyph;

However, this is only done if the current value is GS_NO_GLYPH. In effect
standard_glyph_code_for_notdef is a constant. But we can't define it as
a constant because the actual value depends on the contents of a table
which is built at compile time.

This appears to be an attempt to limit the number of times we call
gs_c_name_glyph because that is a relatively expensive operation, and
the actual value returned never changes between builds.

But we don't want to have globals, really, so this commit simply gets
and stores the value when the PDF font resource is created in
font_resource_alloc(). We then can look up the value when we need it.

This is, obviously, slightly slower than a one-time lookup, because
we execute it once for every font. It also uses up a fraction more
memory. However, compared to the performance and memory usage of pdfrwite
the differences are miniscule.

devices/vector/gdevpdtf.c
devices/vector/gdevpdtf.h
devices/vector/gdevpdtt.c


2018-01-28 10:31:26 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e29a7e00401549ebb7c03c8324209489b7c87681

Coverity ID: 259882 Fix typo in pcl_impl_allocate_interp_instance.

Fix typo to allow conditional freeing of pcli->pcs.pids.

pcl/pcl/pctop.c


2018-01-19 14:28:46 +0000
Chris Liddell <chris.liddell@artifex.com>
2b155ebd780b5737aac4e8096c8fbaa5cb78212c

Bug 694260: FAPI: tidy up error return for broken TT glyph

In the event of an error retrieving a TTF glyph, we were storing the negative
error code in the same variable we use to store the glyph length for a valid
glyph, which is an unsigned variable, causing a valgrind error, and potential
security issue reading uninitialized memory.

In fact, other consumers silently cope with this type of problem and
(presumably) use a notdef glyph instead. So this tweaks the error codes to
do the same.

Because we now have to differentiate between different types of error, we
can no longer just use a negative value, so there is an enumerated type for
the error values.

base/fapi_ft.c
base/gxfapi.h
psi/zfapi.c


2016-08-25 09:28:59 +0100
Chris Liddell <chris.liddell@artifex.com>
b82848bc26f47b5b5727d24f03d08eb3679c7243

Add script and arch*.h headers for ios build

This results in a "fat" libgs.a library which can be linked used either for the
simulator or a "real" ios build.

Really, this script just automates/simplifies the process of using our existing
cross-compile support.

The only slightly out of the ordinary part is combining the Intel and arm
libraries into the single fat library.

configure.ac
ios/build_ios_gslib.sh
ios/ios-README.txt
ios/ios_arch-arm.h
ios/ios_arch-x86.h


2018-01-24 19:23:42 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
83f78ff2c85413866f0d4e549fc6a39aa72417e6

Bug 697545 : Fix memory leak in cmsCreateLab2ProfileTHR.

Fix memory leak for allocation event numbers 821 - 854.

Error created using :-
MEMENTO_FAILAT=860 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

lcms2art/src/cmsvirt.c


2018-01-24 18:42:46 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e8501487c929db1bc1a624bf101a3464b447db07

Bug 697545 : Fix memory leak in BuildRGBOutputMatrixShaper.

Fix memory leak for allocation event numbers 787 - 792.

Error created using :-
MEMENTO_FAILAT=795 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

lcms2art/src/cmsio1.c


2018-01-23 18:10:04 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
571200a055310b157f3640742f32564fc2de5697

Bug 697545 : Fix memory leak c_param_write.

Fix memory leak for allocation event number 676.

Error created using :-
MEMENTO_FAILAT=677 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gscparam.c


2018-01-23 18:18:49 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
92ccfa3dcb2ca9fd2273611f7ed2111d3ae319a8

Bug 697545 : Fix memory leak in cmsStageAllocMatrix.

Fix memory leak for allocation event numbers 753 - 754.

Error created using :-
MEMENTO_FAILAT=755 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

lcms2art/src/cmslut.c


2016-12-20 12:30:50 +0100
Tor Andersson <tor.andersson@artifex.com>
0c498888ca6c0bdf4b90d1b3a79a4a185d810a22

Fix clusterpush detection for mupdf repositories.

toolbin/localcluster/clusterpush.pl


2018-01-24 17:02:26 +0100
Tor Andersson <tor.andersson@artifex.com>
bb6abd533cdfed34d076c3320c931d778189c202

Make gitpush.sh script executable.

toolbin/localcluster/gitpush.sh


2018-01-24 15:18:07 +0000
Ken Sharp <ken.sharp@artifex.com>
9010c622cd4d17053ee405bb378ed08bcaa16251

pdfwrite - ensure we have a substream Resource dictionary before using it

Bug #692182 "xps -> pdfwrite SEGVs with softmasked pattern"

After much messing about with this bug over the years, it appears
that most of the bugs have been fixed. However one still remained;
we could attempt to add a ProcSet Resource to a substream, even
though we had not yet allocated a Resource for that substream.

Although it shows up with this file, technically it could
probably happen with any kind of input.

Fixed here by allocating a substream Resource dictionary if we
don't already have one when we want to add the Procsets to it.

No differences expected

devices/vector/gdevpdfi.c


2018-01-24 09:33:20 +0000
Chris Liddell <chris.liddell@artifex.com>
eb5f2a85c5c3f6436df6158d7fba1977be68116f

Bug 698903: bounds check t2 charstring stack in op

Add a stack bounds checking macro for the Type 2 charstring stack, and use it
for the rmoveto op.

base/gstype2.c


2018-01-23 18:15:18 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f5e42eb1dc1cc96bab67990e886756a089a3fa5a

Bug 697545 : Fix memory leak in AllocateToneCurveStruct.

Fix memory leak for allocation event number 741.

Error created using :-
MEMENTO_FAILAT=742 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

lcms2art/src/cmsgamma.c


2018-01-23 18:05:54 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
ebae375c979146fd8c2457e217dcb4e67618a718

Bug 697545 : Fix memory leak in gs_copydevice2.

Fix memory leak for allocation event number 673.

Error created using :-
MEMENTO_FAILAT=674 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsdevice.c


2018-01-23 08:49:04 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
34f29fe8f77a626ef71c1f04fd781dd8b8bacd85

Bug 697545 : Fix pxstate memory leak.

Fix memory leak for allocation event numbers 517 - 520.

Error created using :-
MEMENTO_FAILAT=578 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsfont.c
pcl/pxl/pxstate.c


2018-01-23 16:42:34 +0000
Ken Sharp <ken.sharp@artifex.com>
2ce962cfc20267b3e678d8d1357dfc2643b7a477

pdfwrite - take advantage of GSUB table glyph substitution enhancement

Bug #691574 "vert punctuation is rotated when convert ps to 1.3 pdf"

Commit 7dd033589ce40649ab602fba4c0473aa40c48439 was an enhancement to
apply vertical glyph substitution from a TrueType GSUB table. This is
primarily used when a user specifies a TrueType font to be used as a
replacement for a missing CIDFont (especially in PDF files). Using a
horizontal font as a replacement for a vertical font can result in
punctuation marks at the wrong orientation.

This commit uses the machinery added in that previous commit to apply
the same fix for pdfwrite. Note that this still does not produce
'correct' output, because its still a substitute font being used. It
does produce punctuation marks at the correct orientation now though,
for the limited selection of test files we have. The other relevant
report is 698471, though that was reported against rendering, the same
effect occurs with pdfwrite.

The cluster shows one diff, a progression, which surprises me since I
cannot duplicate the reference output, but I'm not going to complain
since its a progression.

devices/gxfcopy.c
devices/gxfcopy.h
devices/vector/gdevpdtb.c
devices/vector/gdevpdtc.c


2018-01-22 17:14:31 -0700
Henry Stiles <henry.stiles@artifex.com>
de0bad3a42012d57fea6c2d55325c033db7a3ded

Fix Bug 698874 - incorrect text positioning.

The bug title is misleading, this a font selection problem where 1 of
2 fonts with the same attributes must be selected. Experiments
suggest the HP chooses the font which was defined earliest. We
emulate the same effect in our interpreter by creating sequential PJL
font numbers for downloaded fonts and the selection algorithm
prefering lower numbers.

Progression with the test file bug690520.pcl.

pcl/pcl/pcfont.c
pcl/pcl/pcfsel.c
pcl/pcl/pcsfont.c
pcl/pcl/pcstate.h


2018-01-22 11:32:20 -0800
Ray Johnston <ray.johnston@artifex.com>
b5b6ffad4c3e6d12fbb1caf9d0f17d7de77ca3c3

Fix rc_increment for CMM_THREAD_SAFE case (only 1 param, not 2)

Thanks to Michael Vrhel for tripping over this first.

base/gxclthrd.c


2018-01-20 18:12:08 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
8089072692df101c5464e67b3c3a2cebf9b6682d

Bug 697545 : Fix memory leak in gstate_free_contents.

Fix memory leak for allocation event numbers 346 - 348.

Error created using :-
MEMENTO_FAILAT=349 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsstate.c


2018-01-20 13:01:22 -0800
Ray Johnston <ray.johnston@artifex.com>
6adaf9b4d691bfec64d6d6888bb4fed776a2da12

Bug 698867: Don't push texttransparency knockout group for invisible text

The customer's example file had text that was not opaque, but was being
rendered in TextRenderingMode 3 (invisible). Don't push the extra
transparency group for this. Reduces time from 483 seconds to 44 seconds
with default clist params, and with BufferSpace of > 32m down to 14 seconds.
Also reduces page mode (-dBufferSpace=2000m) from 40 minutes to 9 seconds.

base/gdevp14.c


2018-01-20 10:55:29 -0800
Ray Johnston <ray.johnston@artifex.com>
1bc1bfaf123e866695813895d02da0956f79cb31

Minor fix and addition of debugging info for clist cropping.

base/gxclimag.c
base/gxclist.c


2018-01-22 15:20:29 +0000
Ken Sharp <ken.sharp@artifex.com>
eb5d417375e1c7052aeb9f2532d34573bfd07f53

Feature - JPEG Pass through

This commit adds the capability for the PostScript and PDF interpreters
to pass JPEG compressed image data directly to a device (currently the
pdfwrite family of devices) as the original JPEG data.

This allows us to avoid the compression artefacts caused by decompressing
JPEG image data, and then applying JPEG compression again.

This works by having the JPEG decoder inquire (via spec_op) if the
current device would like the original uncompressed data. If so then it
instructs the JPEG stream decoder to call a routine which will use
more spec_ops to pass the uncompressed data to the device.

The interpreter still calls the image methods with the decompressed
data, its up to the device to ignore these calls while handling JPEG
pass-through.

We have to work this way in PostScript, as we must decompress the data
as it arrives in order to find the end of the DCT compressed data. In
addition, this allows the device to change its mind about accepting
compressed data directly if it discovers from the image data that it
is not suitable for preserving unchanged.

This approach does not work with the PXL and XPS interpreters. These
interpreters appear to completely decompress the JPEG data before
starting an image, unlike the PostScript and PDF interpreters where the
image methods are called as the stream is decopressed.

As a result this feature is disabled for these interpreters.

Resource/Init/gs_pdfwr.ps
base/gxdevsop.h
base/sdct.h
base/sdctd.c
devices/vector/gdevpdfb.h
devices/vector/gdevpdfi.c
devices/vector/gdevpdfj.c
devices/vector/gdevpdfx.h
devices/vector/gdevpsdf.h
devices/vector/gdevpsdi.c
devices/vector/gdevpsdp.c
doc/VectorDevices.htm
pcl/pxl/pximage.c
pcl/pxl/pxvendor.c
psi/int.mak
psi/zfdctd.c
xps/xpsjpeg.c
xps/xpstiff.c
xps/xpstile.c


2018-01-21 14:53:08 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f858f560061560cbd3670509206dfdd98fea4d07

Bug 697545 : Fix memory leak in px_state_alloc.

Fix memory leak for allocation event numbers 515 and 516.

Error created using :-
MEMENTO_FAILAT=517 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pxl/pxstate.c


2018-01-20 22:17:57 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
9e0509877950e3ffef5c576472ff12a3e3fb37b3

Bug 697545 : Fix memory leak of hpgl_parser_state.

Fix memory leak for allocation event number 420.

Error created using :-
MEMENTO_FAILAT=421 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pcommand.c
pcl/pcl/pgparse.c


2018-01-20 21:29:08 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
0177158989db4de55199e1b482cbffb033c4a213

Bug 697545 : Fix memory leak in pcl_impl_allocate_interp_instance.

Fix memory leak for allocation event numbers 328 - 417.

Error created using :-
MEMENTO_FAILAT=419 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pctop.c


2018-01-20 20:02:53 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
3278973da5d771e3fc56d1a4295c3bdb3a1a51b5

Bug 697545 : Fix memory leak in file_prepare_stream.

Fix memory leak for allocation event number 357.

Error created using :-
MEMENTO_FAILAT=358 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/sfxcommon.c


2018-01-20 19:07:34 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
43711760b611b1a8e17f3490e3b58914508098f9

Bug 697545 : Fix memory leak in gs_nulldevice.

Fix memory leak for allocation event number 355.

Error created using :-
MEMENTO_FAILAT=356 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsdevice.c


2018-01-19 10:01:22 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
76aea30116ea14ebb2238d34251e44a7e547ebf0

Bug 697545 : Fix memory leak in gs_gstate_alloc.

Fix memory leak for allocation event numbers 330 - 334. The path, clip_path and
effective_clip_path are initialised at the start of gs_gstate_alloc during the
call to gstate_alloc so this redundant code can be removed.

Error created using :-
MEMENTO_FAILAT=348 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsstate.c


2018-01-20 14:34:13 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
b09da43f803fda306d3eb8eca99d825f70156db7

Bug 697545 : Fix memory leak in gp_enumerate_files_init.

Fix memory leak for allocation event numbers 199 and 200.

Error created using :-
MEMENTO_FAILAT=201 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gp_unifs.c


2018-01-17 20:02:32 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
76c335c7672e3841055d6c6effc2ae61715c8b6a

Bug 697545 : Fix memory leak in gs_enumerate_files_init.

Fix memory leak for allocation event numbers 183 and 184.

Error created using :-
MEMENTO_FAILAT=185 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsiodev.c


2018-01-18 12:06:11 +0000
Chris Liddell <chris.liddell@artifex.com>
4b8eb0c07b84667b0e3f5ab47f328767012781bf

Bug 691224 : Remove the long non-functional DISKFONTS feature.

This feature (allowing Type 1 fonts to be loaded into VM without CharStrings
and individual CharStrings read from the font file on demand) only ever worked
with very specifically formatted Type 1 fonts (those coming from the also long
dead and gone bdftops.ps tool). Any significant variation from that format
would not work.

As we no longer use fonts derived from BDF (and BDF are very much a thing of the
past!), DISKFONTS has not worked for a *long* time, hence removing it.

In addition, even on printers, memory is no longer quite the issue it was, nor
are the core Postscript fonts as widely used or relied upon as they were.

Resource/Init/gs_diskf.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps
Resource/Init/gs_type1.ps
doc/Psfiles.htm
doc/Use.htm
doc/gs-vms.hlp
man/gs.1
psi/int.mak
psi/psromfs.mak


2018-01-18 12:39:00 -0800
Ray Johnston <ray.johnston@artifex.com>
f3e26b054b866678512cd6c0c2e2daba9f4c17db

Bug 697856: Reduce clist buffer memory usage for worst case files.

The band_height is chosen based on number of bytes per scan line, and
a fudge factor if the page uses transparency. For pages with a large
number of raster lines, the number of bands could cause the space
needed for the band "states" to exceed the space remaining in the
buffer. This was handled by doubling the BufferSpace until there
was enough space for the band states. Improve by increasing the space
available more gradually. For one of the worst case files, Bug689581.pdf,
this reduces the memory needed from 40Mb to 24Mb.

base/gdevprn.c


2018-01-17 17:33:48 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
c470009cbf8be2aaed7b4b438307479959949625

Bug 697545 : Fix memory leak in pl_main_delete_instance.

Fix memory leak for allocation event number 28.

Error created using :-
MEMENTO_FAILAT=183 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/plmain.c


2018-01-17 12:54:59 -0800
Ray Johnston <ray.johnston@artifex.com>
3c90c6e03844713000f0e300e371487fa49980f5

Fix bug 697843: Use after free in pdf14_device_finalize

The trans_group_parent_cmap_procs (misnamed because it has a LOT of
parent color info along with the cmap procs) needs to be allocated
in stable_memory to prevent a dangling pointer being seen during the
pdf14_device_finalize during alloc_restore_all because the parent
color info may be freed before the pdf14 device itself.

base/gdevp14.c


2018-01-17 11:43:55 -0800
Ray Johnston <ray.johnston@artifex.com>
bfda8d1f442e3c8e81018833c3698ffcb63535fb

Fix (some) missing dependencies

Noticed during other work, but not committed as part of those fixes
since this is unrelatd.

devices/devs.mak


2018-01-17 11:18:42 -0800
Ray Johnston <ray.johnston@artifex.com>
c998242a1168320aba8efb909189654f153b8dd3

Fix bug 698306: consecutive pushpdf14devicefilter leads to SEGV

If we get to pushpdf14devicefilter with the pdf14 device, the closedevice
will forward the close to the target, but if the pdf14 device hasn't
been disabled, the opendevice won't forward to the target. Call the
pdf14_disable_device to make sure the pdf14_open_device will forward.

base/gdevp14.c
psi/int.mak
psi/ztrans.c


2018-01-17 12:29:00 +0000
Chris Liddell <chris.liddell@artifex.com>
f0fe2481a2e9b0b632a1d4e804a5a1d27fe9c017

Prevent undefined error with -DDEBUG

The procedure for dumping VM stats with -DDEBUG and -DINITDEBUG was not being
bound, so the .<operator> internal operators we now undefine after
initialization were missing by the time the procedure was called.

Now, simply bind the procedure

Resource/Init/gs_init.ps


2018-01-16 20:04:30 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
6e7149bae6bd5c2a7b5acff50ba6600b3beb3818

Bug 697545 : Memory squeezing fix for double freeing of ToneCurve.

Avoid SEGV by removing unnecessary freeing of ToneCurve.

Error created using :-
MEMENTO_FAILAT=751 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

lcms2art/src/cmsio1.c


2018-01-16 19:41:55 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
1bbf91df4b8df650f3efe0effd37cf1cf91c9657

Bug 697545 : Memory squeezing fix for mutex in lcms2art code

Prevent SEGV by checking for NULL mutex pointer before attempting
to use or destroy it.

lcms2art/src/cmserr.c


2018-01-15 17:26:37 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
3aeff79d28e832aefcd005c99ae67304c927b3d3

Bug 697545 : Fix memory leaks and SEGVs.

Prevent table being orphaned due to early memory allocation failures. Remove
cleanup code to prevent double freeing iodev entries. Prevent SEGV when ramfs
state fails to allocate.

Error created using :-
MEMENTO_FAILAT=25 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsiodev.c
base/gsioram.c


2018-01-16 11:18:27 +0000
Chris Liddell <chris.liddell@artifex.com>
d250ce572e7f2e067693a19de8d38b6612b73501

Fix segfault with "all devices" test.

Turns out there's a group of devices that actually open a file as they are being
closed, which causes problems if we've already freed up the I/O device table,
which commit 2e86e7f64e added.

So, rejig the Postscript interpreter's I/O device table init/finit functions to
allow later freeing of the table (whilst keeping the two consistent in their
parameters).

psi/iinit.c
psi/iinit.h
psi/imain.c


2018-01-16 10:47:14 +0000
Ken Sharp <ken.sharp@artifex.com>
e62df8bbd78e8db1cb254a6ab4c2ebf1232c6c7e

Reduce severity of memory debug problem detection

Bug #698849 "gs_abort with Bad object"

The error occurs because of the combination of -Z? and -dLastPage. In
order to do First/Last Page processing, we insert a subclassing device
ahead of the regular device (ppmraw in this case).

The subclassing works by making a new device structure, copying the
existing device to it, and replacing the content of the existing
device structure. This is done to maintain coherency of gsave/grestore
and save/restore; the structures maintain pointers to the device in
the graphics state structure, so we can't simply move it.

When subclassing, we change the declared size of the structure (ssize)
but we don't (can't!) change the size that the memory manager allocated
in the first place. This leads to a mismatch between the declared size
of the structure and the allocated size. I mentioned this in the
original commit for subclassing, but noted that in normal use there is
nowhere that actually checks.

However, if you set -Z? then additional checks are done on memory
validity, and this discrepancy is flagged. It also raises an abort,
presumably because this is seen as serious enough to stop and
investigate.

I don't want to remove this check altogether, as it may still be useful,
but we don't want to abort now because this might be a benign change
caused by subclassing.

So here, pull the size != ssize check out separately from the other
consistency checks, and if it is not true raise a warning, but do
*not* abort the process.

psi/ilocate.c


2018-01-15 11:41:01 -0800
Ray Johnston <ray.johnston@artifex.com>
4d730d2087680cff4e3b153536922406bfcf4493

Fix bug 698823. Segfault with psdrgb and transparency_example.ps

The psdrgb device has max_components == 3, but the pdf14 device was
using spot_colors to set it more than that (transparency_example.ps
doed not set PageSpotColors so it was -1, leading to underflow).
If page_spot_colors is the default -1, then don't use it, and also
limit the num_components to max_components for the device.

base/gdevp14.c


2018-01-15 08:14:02 -0800
Ray Johnston <ray.johnston@artifex.com>
afe8e5468db1f875432aa711676eaf4007d13daa

Fix opening of files > 2GB on Windows built with VS after VS2013

For whatever reason, even on 64 bit builds, Visual Studio changed
behaviour and the compiler/run-time now invoke __fstat64i32 for
fstat. This returns an error if the file size can't fit in int32
(the older fstat just returned a negative number, ignoring overflow)
Change to use __fstat64 which works on VS 2005 so it should be
fine. I also tested this build on an ancient Dell with 760Mb RAM
running Windows XP SP3 and it runs fine, so __fstat64 is not a
problem going back that far.

base/stat_.h


2018-01-15 17:22:38 +0000
Ken Sharp <ken.sharp@artifex.com>
b199f558834d0fbd365cccc426eed0fdc3e035c7

pdfwrite - Fix the detection of type 3 descendants in composite fonts

Bug #698844 "ps2pdf creates unusually large PDF files starting with version 9.21"
Bug #698647 "PCL5 - Downloadfont not as T3 Font interpreted"
Bug #607462 "Ghostscript falls into infinite loop with pdfwrite"

The actual problem was that a Type 0 composite font with a single
descendant was used with stringwidth and the space glyph. This was not
detected by pdf_text_begin() and so the glyph was cached, but it was not
added to any type 3 font, it was simply processed as a stringwidth.

Later the same glyph from the same font was used in earnest, pdfwrite
noticed it didn't have a copy of the glyph and set up to capture the
CharProc. But the glyph was present in the glyph cache which meant the
CharProc wasn't executed, leading to an infinite loop.

The fix applied prevented caching type 3 fonts, but that caused problems
with cases where we wanted to convert a font to type 3, so the fix
was extended to only prevent caching of input type 3 fonts, not
synthesised ones.

However, this still caused problems with programs which used type 3 fonts
with glyphshow. Because we did not cache the glyphs we would detect each
glyph use through glyphshow as a new glyph, and so there would be no
glyph reuse, leading to large slow PDF files.

Here we extend the check on descendants of type 3 fonts so that if no
font change takes place, we still check the 'current' descendant to
see if its type 3. If a type 3 descendant is detected then we skip
caching the glyph which prevents the whole problem.

No differences expected.

devices/vector/gdevpdtt.c


2018-01-15 14:06:34 +0000
Chris Liddell <chris.liddell@artifex.com>
99a839311c7d7e1dab919bd88f7632c5e230708f

Remove hamrless/pointless no-op assignment from previous commit

psi/zfapi.c


2018-01-15 13:48:27 +0000
Chris Liddell <chris.liddell@artifex.com>
ead0b5bee31a6e2756749a5c8fb6508e49b64703

Bug 698856: Ensure is_glyph_index flag is consistently set

The is_glyph_index is (now) set as a local variable, then copied to
the structure before the ps_get_glyphname_or_cid() function returns.

A couple of branches in the code were still setting the structure value directly
meaning the local variable was wrong.

psi/zfapi.c


2018-01-15 08:17:46 +0000
Chris Liddell <chris.liddell@artifex.com>
2e86e7f64ed169345c9fb49b9c9eaf0a1bf78720

Bug 698842: cleanup the io_dev table and contents

This is slightly complicated as (in the Ghostscript case) the table can be
freed explicitly, or by the garbager.

base/gdevpipe.c
base/gp_mshdl.c
base/gp_msprn.c
base/gp_os2pr.c
base/gsiodev.c
base/gsiodevs.c
base/gsiodisk.c
base/gsioram.c
base/gsiorom.c
base/gslib.c
base/gxiodev.h
base/lib.mak
pcl/pl/pl.mak
pcl/pl/plmain.c
psi/iinit.c
psi/iinit.h
psi/imain.c
psi/int.mak
psi/zdevcal.c
psi/ziodev.c
psi/ziodev2.c
psi/ziodevs.c
psi/ziodevsc.c


2018-01-12 08:48:21 +0000
Chris Liddell <chris.liddell@artifex.com>
d0829c3cc4d64594499035d664c918acc9047d70

Update to latest CMap release from Adobe

From:
https://github.com/adobe-type-tools/cmap-resources

Resource/CMap/78-EUC-H
Resource/CMap/78-EUC-V
Resource/CMap/78-H
Resource/CMap/78-RKSJ-H
Resource/CMap/78-RKSJ-V
Resource/CMap/78-V
Resource/CMap/78ms-RKSJ-H
Resource/CMap/78ms-RKSJ-V
Resource/CMap/83pv-RKSJ-H
Resource/CMap/90ms-RKSJ-H
Resource/CMap/90ms-RKSJ-V
Resource/CMap/90msp-RKSJ-H
Resource/CMap/90msp-RKSJ-V
Resource/CMap/90pv-RKSJ-H
Resource/CMap/90pv-RKSJ-V
Resource/CMap/Add-H
Resource/CMap/Add-RKSJ-H
Resource/CMap/Add-RKSJ-V
Resource/CMap/Add-V
Resource/CMap/Adobe-CNS1-0
Resource/CMap/Adobe-CNS1-1
Resource/CMap/Adobe-CNS1-2
Resource/CMap/Adobe-CNS1-3
Resource/CMap/Adobe-CNS1-4
Resource/CMap/Adobe-CNS1-5
Resource/CMap/Adobe-CNS1-6
Resource/CMap/Adobe-CNS1-7
Resource/CMap/Adobe-GB1-0
Resource/CMap/Adobe-GB1-1
Resource/CMap/Adobe-GB1-2
Resource/CMap/Adobe-GB1-3
Resource/CMap/Adobe-GB1-4
Resource/CMap/Adobe-GB1-5
Resource/CMap/Adobe-Japan1-0
Resource/CMap/Adobe-Japan1-1
Resource/CMap/Adobe-Japan1-2
Resource/CMap/Adobe-Japan1-3
Resource/CMap/Adobe-Japan1-4
Resource/CMap/Adobe-Japan1-5
Resource/CMap/Adobe-Japan1-6
Resource/CMap/Adobe-Japan2-0
Resource/CMap/Adobe-Korea1-0
Resource/CMap/Adobe-Korea1-1
Resource/CMap/Adobe-Korea1-2
Resource/CMap/B5-H
Resource/CMap/B5-V
Resource/CMap/B5pc-H
Resource/CMap/B5pc-V
Resource/CMap/CNS-EUC-H
Resource/CMap/CNS-EUC-V
Resource/CMap/CNS1-H
Resource/CMap/CNS1-V
Resource/CMap/CNS2-H
Resource/CMap/CNS2-V
Resource/CMap/ETHK-B5-H
Resource/CMap/ETHK-B5-V
Resource/CMap/ETen-B5-H
Resource/CMap/ETen-B5-V
Resource/CMap/ETenms-B5-H
Resource/CMap/ETenms-B5-V
Resource/CMap/EUC-H
Resource/CMap/EUC-V
Resource/CMap/Ext-H
Resource/CMap/Ext-RKSJ-H
Resource/CMap/Ext-RKSJ-V
Resource/CMap/Ext-V
Resource/CMap/GB-EUC-H
Resource/CMap/GB-EUC-V
Resource/CMap/GB-H
Resource/CMap/GB-V
Resource/CMap/GBK-EUC-H
Resource/CMap/GBK-EUC-V
Resource/CMap/GBK2K-H
Resource/CMap/GBK2K-V
Resource/CMap/GBKp-EUC-H
Resource/CMap/GBKp-EUC-V
Resource/CMap/GBT-EUC-H
Resource/CMap/GBT-EUC-V
Resource/CMap/GBT-H
Resource/CMap/GBT-V
Resource/CMap/GBTpc-EUC-H
Resource/CMap/GBTpc-EUC-V
Resource/CMap/GBpc-EUC-H
Resource/CMap/GBpc-EUC-V
Resource/CMap/H
Resource/CMap/HKdla-B5-H
Resource/CMap/HKdla-B5-V
Resource/CMap/HKdlb-B5-H
Resource/CMap/HKdlb-B5-V
Resource/CMap/HKgccs-B5-H
Resource/CMap/HKgccs-B5-V
Resource/CMap/HKm314-B5-H
Resource/CMap/HKm314-B5-V
Resource/CMap/HKm471-B5-H
Resource/CMap/HKm471-B5-V
Resource/CMap/HKscs-B5-H
Resource/CMap/HKscs-B5-V
Resource/CMap/Hankaku
Resource/CMap/Hiragana
Resource/CMap/Hojo-EUC-H
Resource/CMap/Hojo-EUC-V
Resource/CMap/Hojo-H
Resource/CMap/Hojo-V
Resource/CMap/Identity-H
Resource/CMap/Identity-V
Resource/CMap/KSC-EUC-H
Resource/CMap/KSC-EUC-V
Resource/CMap/KSC-H
Resource/CMap/KSC-Johab-H
Resource/CMap/KSC-Johab-V
Resource/CMap/KSC-V
Resource/CMap/KSCms-UHC-H
Resource/CMap/KSCms-UHC-HW-H
Resource/CMap/KSCms-UHC-HW-V
Resource/CMap/KSCms-UHC-V
Resource/CMap/KSCpc-EUC-H
Resource/CMap/KSCpc-EUC-V
Resource/CMap/Katakana
Resource/CMap/NWP-H
Resource/CMap/NWP-V
Resource/CMap/RKSJ-H
Resource/CMap/RKSJ-V
Resource/CMap/Roman
Resource/CMap/UniCNS-UCS2-H
Resource/CMap/UniCNS-UCS2-V
Resource/CMap/UniCNS-UTF16-H
Resource/CMap/UniCNS-UTF16-V
Resource/CMap/UniCNS-UTF32-H
Resource/CMap/UniCNS-UTF32-V
Resource/CMap/UniCNS-UTF8-H
Resource/CMap/UniCNS-UTF8-V
Resource/CMap/UniGB-UCS2-H
Resource/CMap/UniGB-UCS2-V
Resource/CMap/UniGB-UTF16-H
Resource/CMap/UniGB-UTF16-V
Resource/CMap/UniGB-UTF32-H
Resource/CMap/UniGB-UTF32-V
Resource/CMap/UniGB-UTF8-H
Resource/CMap/UniGB-UTF8-V
Resource/CMap/UniHojo-UCS2-H
Resource/CMap/UniHojo-UCS2-V
Resource/CMap/UniHojo-UTF16-H
Resource/CMap/UniHojo-UTF16-V
Resource/CMap/UniHojo-UTF32-H
Resource/CMap/UniHojo-UTF32-V
Resource/CMap/UniHojo-UTF8-H
Resource/CMap/UniHojo-UTF8-V
Resource/CMap/UniJIS-UCS2-H
Resource/CMap/UniJIS-UCS2-HW-H
Resource/CMap/UniJIS-UCS2-HW-V
Resource/CMap/UniJIS-UCS2-V
Resource/CMap/UniJIS-UTF16-H
Resource/CMap/UniJIS-UTF16-V
Resource/CMap/UniJIS-UTF32-H
Resource/CMap/UniJIS-UTF32-V
Resource/CMap/UniJIS-UTF8-H
Resource/CMap/UniJIS-UTF8-V
Resource/CMap/UniJIS2004-UTF16-H
Resource/CMap/UniJIS2004-UTF16-V
Resource/CMap/UniJIS2004-UTF32-H
Resource/CMap/UniJIS2004-UTF32-V
Resource/CMap/UniJIS2004-UTF8-H
Resource/CMap/UniJIS2004-UTF8-V
Resource/CMap/UniJISPro-UCS2-HW-V
Resource/CMap/UniJISPro-UCS2-V
Resource/CMap/UniJISPro-UTF8-V
Resource/CMap/UniJISX0213-UTF32-H
Resource/CMap/UniJISX0213-UTF32-V
Resource/CMap/UniJISX02132004-UTF32-H
Resource/CMap/UniJISX02132004-UTF32-V
Resource/CMap/UniKS-UCS2-H
Resource/CMap/UniKS-UCS2-V
Resource/CMap/UniKS-UTF16-H
Resource/CMap/UniKS-UTF16-V
Resource/CMap/UniKS-UTF32-H
Resource/CMap/UniKS-UTF32-V
Resource/CMap/UniKS-UTF8-H
Resource/CMap/UniKS-UTF8-V
Resource/CMap/V
Resource/CMap/WP-Symbol


2018-01-13 13:10:08 +0000
Robin Watts <robin.watts@artifex.com>
3b0c7a01433c16f007dd3d92c04edc19bfb79970

Revert GhostPDL.sln due to stray commit

I use VS2017 for profiling, so had converted the solution file.
It should not have been committed, but slipped through. Reverting
it here.

windows/GhostPDL.sln


2018-01-13 10:45:32 +0000
Ken Sharp <ken.sharp@artifex.com>
112021a361e9300d9cd0cde0bfc9e691a6e5d0d7

pdf_info.ps - gracefully handle circular Resource references

Although not strictly part of Ghostscript, pdf_info.ps is used by
customers and this is reasonably easy to improve.

When checking for transparency, pdf_info.ps uses the Ghostscript
PDF interpreter to do the work. However, other aspects of its operation
(Media Sizes, Font use) aren't available from the PDF interpreter.

When detecting Font usage, pdf_info.ps walks the Page Resource chain,
and any the Resource chains of any Pattern or XObject Resources used
on that page, as well as the Resources for any Annots (and also any
XObject or Pattern Resources used by the Annots). If any of these
Resource chains contains a circular reference (which they absolutely
should not) then pdf_info will enter a loop and process unwil it
exceeds the execution stack limit, throwing an error.

In this commit we borrow the technique used by the PDF interpreter, we
create a dictionary and every object which we inspect has its object
number stored in that dictionary. Whenever we encounter a new object
we first check to see if its number is in that dictionary. If it is, we
know we've seen it before and this is (possibly) a circular reference.

Even if it is not a circular reference, we've already checked that chain
so we don't need to check it again.

This isn't cluster checked.

toolbin/pdf_info.ps


2017-12-23 21:19:22 -0800
Ray Johnston <ray.johnston@artifex.com>
3012651caace0d2d4dd26631e0e10d81fdeab181

Fix Bug 698729: White lines with LeadingEdge=3 and InterpolateControl>1

Images are always painted in X from left to right, but for landscape the
lines come in the original order, so if dy is negative we need to back up
the starting Y coordinate (scaled_y) by the (scaled_h - 1).

base/gxiscale.c


2018-01-12 09:52:20 -0800
Ray Johnston <ray.johnston@artifex.com>
3110ffa4ee4de170248317813e2e5e5f2d84e75c

Fix errors: Interpolated images + overprint + devn device

When using the overprint compositor, the underlying device may be able
to handle copy_alpha_hl_color (planar devices) so forward to it even
when the overprint compositor isn't active and use the correct
overprint_copy_alpha_hl_color for the generic_procs.

Fix regression errors with psdcmyk device from files in
tests_private/comparefiles: Bug688308.ps T2CharString.eps and
from tests_private/ps/ps3cet: 09-47N.PS 10-08.PS 10-14.PS 10-16.PS
11-01.PS 11-02.PS 11-03.PS 11-04.PS 11-05.PS 11-06.PS 11-07.PS
11-09.PS 11-10.PS 11-11.PS 11-12.PS 11-14.PS 11-15.PS 11-16.PS
11-17.PS 11-18.PS 11-19.PS 11-21.PS 11-22.PS 11-26D.PS 11-28.PS
12-02.PS 12-04.PS 12-06.PS 12-07D.PS 12-08D.PS 12-11.PS 12-12.PS
12-13.PS 13-01.PS 13-02.PS 13-05.PS 13-16.PS 13-17.PS 13-19.PS
13-20.PS 13-22.PS 13-26.PS 13-27.PS 13-28.PS 13-29.PS 21-11.PS

base/gsovrc.c


2018-01-12 08:23:09 -0800
Ray Johnston <ray.johnston@artifex.com>
1508f69d9ed68baac7e659e6089edbf12c9717a9

Fix devn color affecting psdcmyk tests/pdf/Bug6901014_launch_leaflet.pdf p2

The image interpolation uses copy_alpha_hl_color so when InterpolateControl=-1
is used with this file in clist mode, playback ends up calling the
default_no_copy_alpha_hl_color function which throws an "undefined" error. If
this proc is seen, instead pass to copy_alpha which can work as long as the
devn color can be packed into a chunky color which is the case as long as the
num_components is <= 8, which is useful enough to make it worth trying. If
the num_components is too large, the copy_alpha will throw a "rangecheck".

base/gxclrast.c


2018-01-02 11:32:10 -0800
Michael Vrhel <michael.vrhel@artifex.com>
d6a0412e281b786847ec96acc0ba85ffa22bf04d

Switch to lcms2 Artifex version for CMM

MuPDF is using Artifex's thread-safe version of lcms2. This commit switches gs to using that
same version. Having gs take advantage of the thread-safe capabilities will be in a different
commit.

Makefile.in
base/gscms.h
base/gsicc_cache.c
base/gsicc_cms.h
base/gsicc_lcms.c
base/gsicc_lcms2.c
base/gsicc_lcms2art.c
base/gsicc_manage.c
base/lcms2art.mak
base/lib.mak
base/msvclib.mak
base/openvms.mak
base/ugcclib.mak
base/unix-gcc.mak
base/unixansi.mak
base/winlib.mak
configure.ac
devices/gdevpsd.c
devices/gdevrinkj.c
devices/vector/gdevpx.c
lcms2/README.1ST
lcms2/doc/LittleCMS2.8 API.pdf
lcms2/doc/LittleCMS2.8 Plugin API.pdf
lcms2/doc/LittleCMS2.8 tutorial.pdf
lcms2/include/Makefile.am
lcms2art/.travis.yml
lcms2art/AUTHORS
lcms2art/COPYING
lcms2art/ChangeLog
lcms2art/INSTALL
lcms2art/Lib/BC/BC.txt
lcms2art/Lib/MS/MS.TXT
lcms2art/Makefile.am
lcms2art/Makefile.in
lcms2art/Projects/.gitignore
lcms2art/Projects/BorlandC_5.5/lcms2.rc
lcms2art/Projects/BorlandC_5.5/lcmsdll.lk
lcms2art/Projects/BorlandC_5.5/lcmsdll.lst
lcms2art/Projects/BorlandC_5.5/mklcmsdll.bat
lcms2art/Projects/VC2010/jpegicc/jpegicc.vcxproj
lcms2art/Projects/VC2010/jpegicc/jpegicc.vcxproj.filters
lcms2art/Projects/VC2010/linkicc/linkicc.vcxproj
lcms2art/Projects/VC2010/linkicc/linkicc.vcxproj.filters
lcms2art/Projects/VC2010/psicc/psicc.vcxproj
lcms2art/Projects/VC2010/psicc/psicc.vcxproj.filters
lcms2art/Projects/VC2010/resource.h
lcms2art/Projects/VC2010/testbed/testbed.vcxproj
lcms2art/Projects/VC2010/testbed/testbed.vcxproj.filters
lcms2art/Projects/VC2010/tiffdiff/tiffdiff.vcxproj
lcms2art/Projects/VC2010/tiffdiff/tiffdiff.vcxproj.filters
lcms2art/Projects/VC2010/tifficc/tifficc.vcxproj
lcms2art/Projects/VC2010/tifficc/tifficc.vcxproj.filters
lcms2art/Projects/VC2010/transicc/transicc.vcxproj
lcms2art/Projects/VC2010/transicc/transicc.vcxproj.filters
lcms2art/Projects/VC2012/jpegicc/jpegicc.vcxproj
lcms2art/Projects/VC2012/jpegicc/jpegicc.vcxproj.filters
lcms2art/Projects/VC2012/lcms2art.rc
lcms2art/Projects/VC2012/lcms2art.sln
lcms2art/Projects/VC2012/lcms2art_DLL/lcms2art_DLL.vcxproj
lcms2art/Projects/VC2012/lcms2art_DLL/lcms2art_DLL.vcxproj.filters
lcms2art/Projects/VC2012/lcms2art_static/lcms2art_static.vcxproj
lcms2art/Projects/VC2012/lcms2art_static/lcms2art_static.vcxproj.filters
lcms2art/Projects/VC2012/linkicc/linkicc.vcxproj
lcms2art/Projects/VC2012/linkicc/linkicc.vcxproj.filters
lcms2art/Projects/VC2012/psicc/psicc.vcxproj
lcms2art/Projects/VC2012/psicc/psicc.vcxproj.filters
lcms2art/Projects/VC2012/resource.h
lcms2art/Projects/VC2012/testbed/testbed.vcxproj
lcms2art/Projects/VC2012/testbed/testbed.vcxproj.filters
lcms2art/Projects/VC2012/tiffdiff/tiffdiff.vcxproj
lcms2art/Projects/VC2012/tiffdiff/tiffdiff.vcxproj.filters
lcms2art/Projects/VC2012/tifficc/tifficc.vcxproj
lcms2art/Projects/VC2012/tifficc/tifficc.vcxproj.filters
lcms2art/Projects/VC2012/transicc/transicc.vcxproj
lcms2art/Projects/VC2012/transicc/transicc.vcxproj.filters
lcms2art/Projects/VC2013/jpegicc/jpegicc.vcxproj
lcms2art/Projects/VC2013/jpegicc/jpegicc.vcxproj.filters
lcms2art/Projects/VC2013/lcms2art.rc
lcms2art/Projects/VC2013/lcms2art.sln
lcms2art/Projects/VC2013/lcms2art_DLL/lcms2art_DLL.vcxproj
lcms2art/Projects/VC2013/lcms2art_DLL/lcms2art_DLL.vcxproj.filters
lcms2art/Projects/VC2013/lcms2art_static/lcms2art_static.vcxproj
lcms2art/Projects/VC2013/lcms2art_static/lcms2art_static.vcxproj.filters
lcms2art/Projects/VC2013/linkicc/linkicc.vcxproj
lcms2art/Projects/VC2013/linkicc/linkicc.vcxproj.filters
lcms2art/Projects/VC2013/psicc/psicc.vcxproj
lcms2art/Projects/VC2013/psicc/psicc.vcxproj.filters
lcms2art/Projects/VC2013/resource.h
lcms2art/Projects/VC2013/testbed/testbed.vcxproj
lcms2art/Projects/VC2013/testbed/testbed.vcxproj.filters
lcms2art/Projects/VC2013/tiffdiff/tiffdiff.vcxproj
lcms2art/Projects/VC2013/tiffdiff/tiffdiff.vcxproj.filters
lcms2art/Projects/VC2013/tifficc/tifficc.vcxproj
lcms2art/Projects/VC2013/tifficc/tifficc.vcxproj.filters
lcms2art/Projects/VC2013/transicc/transicc.vcxproj
lcms2art/Projects/VC2013/transicc/transicc.vcxproj.filters
lcms2art/Projects/VC2015/jpegicc/jpegicc.vcxproj
lcms2art/Projects/VC2015/jpegicc/jpegicc.vcxproj.filters
lcms2art/Projects/VC2015/lcms2art.rc
lcms2art/Projects/VC2015/lcms2art.sln
lcms2art/Projects/VC2015/lcms2art_DLL/lcms2art_DLL.vcxproj
lcms2art/Projects/VC2015/lcms2art_DLL/lcms2art_DLL.vcxproj.filters
lcms2art/Projects/VC2015/lcms2art_static/lcms2art_static.vcxproj
lcms2art/Projects/VC2015/lcms2art_static/lcms2art_static.vcxproj.filters
lcms2art/Projects/VC2015/linkicc/linkicc.vcxproj
lcms2art/Projects/VC2015/linkicc/linkicc.vcxproj.filters
lcms2art/Projects/VC2015/psicc/psicc.vcxproj
lcms2art/Projects/VC2015/psicc/psicc.vcxproj.filters
lcms2art/Projects/VC2015/resource.h
lcms2art/Projects/VC2015/testbed/testbed.vcxproj
lcms2art/Projects/VC2015/testbed/testbed.vcxproj.filters
lcms2art/Projects/VC2015/tiffdiff/tiffdiff.vcxproj
lcms2art/Projects/VC2015/tiffdiff/tiffdiff.vcxproj.filters
lcms2art/Projects/VC2015/tifficc/tifficc.vcxproj
lcms2art/Projects/VC2015/tifficc/tifficc.vcxproj.filters
lcms2art/Projects/VC2015/transicc/transicc.vcxproj
lcms2art/Projects/VC2015/transicc/transicc.vcxproj.filters
lcms2art/Projects/VC2017/jpegicc/jpegicc.vcxproj
lcms2art/Projects/VC2017/jpegicc/jpegicc.vcxproj.filters
lcms2art/Projects/VC2017/lcms2art.rc
lcms2art/Projects/VC2017/lcms2art.sln
lcms2art/Projects/VC2017/lcms2art_DLL/lcms2art_DLL.vcxproj
lcms2art/Projects/VC2017/lcms2art_DLL/lcms2art_DLL.vcxproj.filters
lcms2art/Projects/VC2017/lcms2art_static/lcms2art_static.vcxproj
lcms2art/Projects/VC2017/lcms2art_static/lcms2art_static.vcxproj.filters
lcms2art/Projects/VC2017/linkicc/linkicc.vcxproj
lcms2art/Projects/VC2017/linkicc/linkicc.vcxproj.filters
lcms2art/Projects/VC2017/psicc/psicc.vcxproj
lcms2art/Projects/VC2017/psicc/psicc.vcxproj.filters
lcms2art/Projects/VC2017/resource.h
lcms2art/Projects/VC2017/testbed/testbed.vcxproj
lcms2art/Projects/VC2017/testbed/testbed.vcxproj.filters
lcms2art/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
lcms2art/Projects/VC2017/tiffdiff/tiffdiff.vcxproj.filters
lcms2art/Projects/VC2017/tifficc/tifficc.vcxproj
lcms2art/Projects/VC2017/tifficc/tifficc.vcxproj.filters
lcms2art/Projects/VC2017/transicc/transicc.vcxproj
lcms2art/Projects/VC2017/transicc/transicc.vcxproj.filters
lcms2art/Projects/cppcheck/lcms2.cppcheck
lcms2art/Projects/mac/LittleCMS/._Info.plist
lcms2art/Projects/mac/LittleCMS/._LittleCMS.xcodeproj
lcms2art/Projects/mac/LittleCMS/English.lproj/InfoPlist.strings
lcms2art/Projects/mac/LittleCMS/Info.plist
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/mariama.mode1v3
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/mariama.pbxuser
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.pbxproj
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.xcworkspace/contents.xcworkspacedata
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.xcworkspace/xcuserdata/User.xcuserdatad/UserInterfaceState.xcuserstate
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.xcworkspace/xcuserdata/User.xcuserdatad/WorkspaceSettings.xcsettings
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcschemes/LittleCMS.xcscheme
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcschemes/testbed.xcscheme
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcschemes/xcschememanagement.plist
lcms2art/Projects/mac/LittleCMS/LittleCMS_Prefix.pch
lcms2art/Projects/mac/LittleCMS/TestBed-Info.plist
lcms2art/README.1ST
lcms2art/aclocal.m4
lcms2art/autogen.sh
lcms2art/compile
lcms2art/config.guess
lcms2art/config.sub
lcms2art/configure
lcms2art/configure.ac
lcms2art/depcomp
lcms2art/doc/LittleCMS2.9 API.pdf
lcms2art/doc/LittleCMS2.9 Plugin API.pdf
lcms2art/doc/LittleCMS2.9 tutorial.pdf
lcms2art/doc/WhyThisFork.txt
lcms2art/doc/src.zip
lcms2art/include/Makefile.am
lcms2art/include/Makefile.in
lcms2art/include/lcms2art.h
lcms2art/include/lcms2art_plugin.h
lcms2art/install-sh
lcms2art/lcms2art.pc.in
lcms2art/ltmain.sh
lcms2art/m4/acx_pthread.m4
lcms2art/m4/ax_append_compile_flags.m4
lcms2art/m4/ax_append_flag.m4
lcms2art/m4/ax_check_compile_flag.m4
lcms2art/m4/ax_gcc_func_attribute.m4
lcms2art/m4/ax_require_defined.m4
lcms2art/m4/libtool.m4
lcms2art/m4/ltoptions.m4
lcms2art/m4/ltsugar.m4
lcms2art/m4/ltversion.m4
lcms2art/m4/lt~obsolete.m4
lcms2art/missing
lcms2art/src/Makefile.am
lcms2art/src/Makefile.in
lcms2art/src/cmsalpha.c
lcms2art/src/cmscam02.c
lcms2art/src/cmscgats.c
lcms2art/src/cmscnvrt.c
lcms2art/src/cmserr.c
lcms2art/src/cmsgamma.c
lcms2art/src/cmsgmt.c
lcms2art/src/cmshalf.c
lcms2art/src/cmsintrp.c
lcms2art/src/cmsio0.c
lcms2art/src/cmsio1.c
lcms2art/src/cmslut.c
lcms2art/src/cmsmd5.c
lcms2art/src/cmsmtrx.c
lcms2art/src/cmsnamed.c
lcms2art/src/cmsopt.c
lcms2art/src/cmspack.c
lcms2art/src/cmspcs.c
lcms2art/src/cmsplugin.c
lcms2art/src/cmsps2.c
lcms2art/src/cmssamp.c
lcms2art/src/cmssm.c
lcms2art/src/cmstypes.c
lcms2art/src/cmsvirt.c
lcms2art/src/cmswtpnt.c
lcms2art/src/cmsxform.c
lcms2art/src/extra_xform.h
lcms2art/src/lcms2_internal.h
lcms2art/src/lcms2art.def
lcms2art/testbed/Makefile.am
lcms2art/testbed/Makefile.in
lcms2art/testbed/bad.icc
lcms2art/testbed/bad_mpe.icc
lcms2art/testbed/crayons.icc
lcms2art/testbed/ibm-t61.icc
lcms2art/testbed/new.icc
lcms2art/testbed/test1.icc
lcms2art/testbed/test2.icc
lcms2art/testbed/test3.icc
lcms2art/testbed/test4.icc
lcms2art/testbed/test5.icc
lcms2art/testbed/testcms2.c
lcms2art/testbed/testcms2.h
lcms2art/testbed/testplugin.c
lcms2art/testbed/testthread.cpp
lcms2art/testbed/toosmall.icc
lcms2art/testbed/zoo_icc.c
lcms2art/utils/common/utils.h
lcms2art/utils/common/vprf.c
lcms2art/utils/common/xgetopt.c
lcms2art/utils/delphi/delphidemo.dpr
lcms2art/utils/delphi/delphidemo.dproj
lcms2art/utils/delphi/delphidemo.res
lcms2art/utils/delphi/demo1.dfm
lcms2art/utils/delphi/demo1.pas
lcms2art/utils/delphi/lcms2dll.pas
lcms2art/utils/jpgicc/LICENSE_iccjpeg
lcms2art/utils/jpgicc/Makefile.am
lcms2art/utils/jpgicc/Makefile.in
lcms2art/utils/jpgicc/iccjpeg.c
lcms2art/utils/jpgicc/iccjpeg.h
lcms2art/utils/jpgicc/jpgicc.1
lcms2art/utils/jpgicc/jpgicc.c
lcms2art/utils/linkicc/Makefile.am
lcms2art/utils/linkicc/Makefile.in
lcms2art/utils/linkicc/linkicc.1
lcms2art/utils/linkicc/linkicc.c
lcms2art/utils/matlab/icctrans.c
lcms2art/utils/matlab/lcms_rsp
lcms2art/utils/psicc/Makefile.am
lcms2art/utils/psicc/Makefile.in
lcms2art/utils/psicc/psicc.1
lcms2art/utils/psicc/psicc.c
lcms2art/utils/samples/Makefile.am
lcms2art/utils/samples/Makefile.in
lcms2art/utils/samples/itufax.c
lcms2art/utils/samples/mkcmy.c
lcms2art/utils/samples/mkgrayer.c
lcms2art/utils/samples/mktiff8.c
lcms2art/utils/samples/roundtrip.c
lcms2art/utils/samples/vericc.c
lcms2art/utils/samples/wtpt.1
lcms2art/utils/samples/wtpt.c
lcms2art/utils/tificc/Makefile.am
lcms2art/utils/tificc/Makefile.in
lcms2art/utils/tificc/tifdiff.c
lcms2art/utils/tificc/tificc.1
lcms2art/utils/tificc/tificc.c
lcms2art/utils/transicc/Makefile.am
lcms2art/utils/transicc/Makefile.in
lcms2art/utils/transicc/transicc.1
lcms2art/utils/transicc/transicc.c
psi/msvc.mak
psi/os2.mak
psi/zicc.c
psi/ztrans.c
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-01-12 10:56:29 +0000
Ken Sharp <ken.sharp@artifex.com>
b5ac1a6e73af59d5106bf68ed3ab1a456a1c26dc

PS interpreter - don't use findresource for Idiom Recognition in bind

The current implementation of idiom recognition uses findresource in
the definition of the bind operator to check all existing IdiomSets
for a candidate to substitute.

This is, in fact, wrong. The PLRM (p135 3rd Edition) states that :

"This matching by value occurs only for IdiomSet instances that are
defined in VM; bind does not consider instances that are in not in VM
but only in external storage."

and:

To ensure that the instances in VM are consistent with the external
ones, the interpreter automatically invokes findresource to load
external IdiomSet instances into VM at the beginning of each job and at
certain other times."

We were not loading the IdiomSet resources into VM, and we were searching
external resources during bind.

Not only is this incorrect, but because findresource ends up calling
filenameforall on every directory in the search path, its also very
slow.

While normally we don't expect to see many occurences of bind during the
course of a job, the customer supplied file did multiple binds on every
page, and had > 50,000 pages. This led to a fourfold decrease in
performance compared to Acrobat Distiller.

Here we load the external resources into gobal VM at startup, and we
now *only* search instances in VM. This is more correct going by the
spec, and improves the performance by the desired factor of 4 for the
customer. It provides a small benefit on cluster testing, which is
expected as this only affects PostScript input.

No differences expected.

Resource/Init/gs_ll3.ps


2018-01-11 19:58:11 +0000
Robin Watts <robin.watts@artifex.com>
338c13198e658b084bbe45930e4837c31102b61f

ROP Fix: Fix misindexing of scolors/tcolors.

More evidence that this isn't used much.

base/gsroprun8.h


2018-01-11 18:34:51 +0000
Robin Watts <robin.watts@artifex.com>
c6fda7403e881ec53f2da6bb6f97f2e647ef523c

ROPs: Squash scan build warnings.

base/gsroprun24.h
base/gsroprun8.h


2018-01-10 21:27:32 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
fc5f089b580040fb70a662e44721fe2fb457ecfa

Bug 697545 : Fix new_font_defaults memory leak.

Fix memory leak for allocation event numbers 165 - 180.

Error created using :-
MEMENTO_FAILAT=181 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/pjparse.c


2018-01-10 21:10:43 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
30ca563d890a503fe4411a404d09c36839120114

Bug 697545 : Fix new_font_envir memory leak.

Fix memory leak for allocation event numbers 146 - 161.

Error created using :-
MEMENTO_FAILAT=162 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/pjparse.c


2018-01-11 17:43:44 +0000
Robin Watts <robin.watts@artifex.com>
6a706f687ae99626ef5b16b71e5df6a05c202e33

ROP fix: Correctly set scolors/tcolors S and T data case.

We weren't setting S and T colors in this particular case of
the code, which would have shown errors if we'd ever called
it with S and T being 1 bit data arrays to choose between
scolors[0] and [1] etc.

It appears that no code in our entire regression suite actually
calls the S and D both being data case anyway, as proved by
cluster testing this code with an "abort();" line inserted!

base/gdevmr8n.c


2018-01-11 17:40:41 +0000
Robin Watts <robin.watts@artifex.com>
aa8accce0a3f3d323dc45f6bf510a3ddfa76d10d

ROP code: Correction

Don't look for transparency when depth is 1 (it shouldn't be
used anyway).

Correct transparency handling in 8 bit (it was using 0xffffff
as the color to check for in this mode). Oddly this wasn't
producing diffs, which suggests that nothing is exercising
this code in 8 bit.

base/gsroprun.c


2018-01-10 20:52:35 -0800
Ray Johnston <ray.johnston@artifex.com>
eb59c64085552ef0f98c1afdaae3c39ad4e5d421

Fix stale pointer de-reference during GC due to restore.

If a CIEBasedDEF or DEFG colorspace was set in a save level, a restore
would free the Table memory, but the pgs->icc_profile_cache still had
a (stale) pointer to that area. Fix by copying the Table to memory that
is not subject to save/restore (stable_memory). Rely on the GC to free
up the previous table data since we have no idea what allocator was
used for it (from PostScript it would be local or global VM). Seen with:
-Z:?@$ -r300 -sDEVICE=psdcmyk -o x.psd tests_private/comparefiles/Bug688308.ps

psi/zcie.c


2018-01-11 12:03:30 +0000
Robin Watts <robin.watts@artifex.com>
9b3b93ca92f8b9370d4cb5a4e6176df1a06afeda

ROP optimisation: Map more rops onto one another.

Establish an ordering on rops ("unused" < "constant" <
"bitmap" < "1 bit bitmap") and swap orders such that S
is always >= T.

This cuts the number of cases down a bit more.

base/gsroprun.c


2018-01-02 08:48:33 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
c56dff6dea636c89b7c24bbec7b28f15171d7810

Bug 697545 : Fix pjl_envir memory leak.

Fix memory leak for allocation event numbers 89 - 143.

Error created using :-
MEMENTO_FAILAT=144 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/pjparse.c


2017-12-31 14:57:30 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
411530608129ad6dd2078557a7f3d0a3425a9db8

Bug 697545 : Fix new_pjl_defaults memory leak.

Fix memory leak for allocation event numbers 32 - 89.

Error created using :-
MEMENTO_FAILAT=90 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/pjparse.c


2018-01-10 17:15:38 +0000
Robin Watts <robin.watts@artifex.com>
623d2ceee814622b5a75e13120165d8a2f4a2d35

ROP transparency optimisation.

If a transparent ROP uses a constant input that is
transparent, then it's a NOP.

base/gsroprun.c


2018-01-08 19:10:01 +0000
Robin Watts <robin.watts@artifex.com>
151cb32d94b5790fae44f48763e19c519ac742cb

Miscellaneous fixes to roprun code.

Fold some more rops down to simpler ones.

Remove some functions that are no longer required. Allow
for NOP ROPs to short circuit all the work.

Also, fix what looks like a problem in the setup for 1bit ROPs.
(Doesn't actually seem to have caused a problem but the new
code is more readable).

Avoid intermixing rop_operand * and gx_color_index *'s.

base/gdevm1.c
base/gdevmr8n.c
base/gsroprun.c
base/gsroprun24.h
base/gsroprun8.h
base/gsropt.h


2018-01-09 16:38:04 +0000
Robin Watts <robin.watts@artifex.com>
3927036c14c12857be7dbf98dc777631a365977e

Fix problem with bitrgbtags and ROPs.

With bitrgbtags, we can get called to do 24 bit rop operations
with transparency, with colors like 0x01ffffff.

The transparency rop code is supposed to spot 0xffffff as meaning
"be transparent", but the tag in the top byte confuses it.

Accordingly, mask off stray bits in the colors before using them.

The same potentially happens for an 8 bit + tags device so we cope
with that too.

base/gdevmr8n.c


2018-01-09 07:19:35 -0800
Ray Johnston <ray.johnston@artifex.com>
a8612bfd86f7753fceb738364b2808a4ad9d3bdf

Fix SEGV DEBUG build with -ZA (tests_private/comparefiles/Bug688308.ps)

base/gsalloc.c


2018-01-08 12:04:57 +0000
Robin Watts <robin.watts@artifex.com>
9b38e9780bf5cbb9dbf41131efa80887826c59b4

Enable the use of the RUN_ROP code.

I thought this had been done years ago :(

Fix a typo that was causing cluster differences, squash some
warnings, and fix the scolors/tcolors cases to index as
gx_color_index *'s rather than byte *'s.

Presumably these are the reasons this didn't get enabled before.
Cluster shows no differences now.

Tests with running 600dpi grashopp.pcl to ppm show this saves
~5.5%.

base/gdevmr8n.c
base/gsroprun.c
base/gsroprun24.h
base/gsropt.h
base/lib.mak


2017-12-11 19:11:04 +0100
David Kaspar [Dee'Kej] <dkaspar@redhat.com>
731559c56907f223c9f0763d512fae7e4d13e1a0

Bug 698814: use --docdir= configure parameter

Previously, the Ghostscript was using custom path to the documentation
(as docdir=$(gsdatadir)/doc). This was causing that value of --docdir=
parameter of ./configure was accepted, but not used at all.

This commit fixes this issue, by using docdir=@docdir@@VERSIONED_PATH@
instead. However, as a side effect this results in default path for
documentation to changed to this (with --prefix=/usr):

/usr/share/doc/ghostscript/<version>/

To stay backward compatible, a symlink is automatically created to
point from the old location (/usr/share/ghostscript/<version>/doc) to
the new location.

NOTE: Trying to fix this issue with the location of documentation
staying as it was would require some hacking inside the Autoconf
itself, which is not desirable.

Makefile.in
base/unixinst.mak


2017-12-11 17:27:39 +0100
David Kaspar [Dee'Kej] <dkaspar@redhat.com>
0da8eed54f24cf3dcb5f950c742a8072b7c7e01a

Bug 698813: do not install examples/ by default anymore

Those files in the examples/ folder are for testing purposes,
and not really good examples for people trying to learn PostScript.

However, we are keeping the 'make install-examples' target for people
who still wishes to use those files for some reason.

base/unixinst.mak


2017-11-29 16:42:45 +0100
David Kaspar [Dee'Kej] <dkaspar@redhat.com>
eb3f2ab6f3c5c1d113a8314c0251ca1e50b1196b

Bug 698795: --without-versioned-path option introduced

Using this option will result in Ghostscript being installed into a
paths which do not contain its version in them, which can be useful
on some distributions.

As a result of using this option, the Ghostscript's search path will
be updated as well, to include correct files locations.

This option is disabled by default, and configure's help page states
that using this option is dangerous, risky and unsupported.

Makefile.in
configure.ac


2018-01-06 18:27:24 +0000
Robin Watts <robin.watts@artifex.com>
3c120a33a91c9251c9a9e409680e92d9625a92da

Back out stray change in last commit.

windows/GhostPDL.sln


2018-01-05 17:04:59 +0000
Robin Watts <robin.watts@artifex.com>
47d4d0779563983ab79362acbf3522758ce7a09c

Optimise some image_render_mono cases.

Split a case within image_render_mono into separate portrait
and landscape cases. Use fill rectangle rather than fill_trap
to save time, and avoid halftoning where possible.

This saves us about 15% runtime in 1000pages.pcl.

base/gximono.c
windows/GhostPDL.sln


2018-01-04 17:53:56 +0000
Robin Watts <robin.watts@artifex.com>
d356025602f3f9f9a1e656bd14430cd95c059548

Tiny additional tweaks to compose groups.

Measurable differences, but only just.

base/gxblend.c


2018-01-04 15:56:55 +0000
Robin Watts <robin.watts@artifex.com>
75f389e6b8a2f2bf15ab3044ae4e1ef185061e8d

pdf14 compose group (masked group) optimisation.

The common case is for the mask (if there is one) to entirely
cover the group we are masking. We can avoid needless
checking in this case.

This is the case the apple airprint performance test file
hits and saves > 4% pam, 5% ppm, and 9% pgm.

base/gxblend.c


2017-12-29 17:43:01 +0000
Robin Watts <robin.watts@artifex.com>
193e3b87bc711d30be0c2c41f6b3e61f49c92b22

Fix problem with parsing non 8 bit arguments.

A problem was reported on IRC, pointing out that we fail to
correctly parse single char switches when we are using
GS_ARG_ENCODING_UTF16LE.

This is because arg_next was failing to convert non-indirected
arguments correctly.

Fixed here.

base/gsargs.c


2017-12-29 13:17:49 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
5907bf4f455cca68cbb405116e3c98d14a5a59d6

Bug 697545 : Fix pjl_state line buffer memory leak.

Fix memory leak for allocation event number 30.

Error created using :-
MEMENTO_FAILAT=31 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/pjparse.c


2017-12-29 14:37:20 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
9ba8351735da67a3064710136499340810c120c1

Bug 697545 : Fix pl_main_languages_init interp memory leak.

Fix memory leak for allocation event number 28, the interp_client_data is
not set so this memory will not be recovered via the normal route of
pl_deallocate_interp_instance.

Error created using :-
MEMENTO_FAILAT=29 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/plmain.c


2017-12-29 15:34:32 +0000
Robin Watts <robin.watts@artifex.com>
2b940da204752545813c475488a0a7afd7b55fc7

Fix LCMS2 optimisation bug

Found this while importing the optimisations here into the MuPDF
version of LCMS. When copying for identity transformations,
allow for extra bytes too.

GS clearly doesn't exercise this routine in this way.

lcms2/src/cmsxform.c


2017-12-23 10:50:11 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
906314509273578d4fb5382a8d922ccb2b7adb10

Bug 697545 : Fix gs_fapi_init memory leak.

Fix memory leak for allocation event number 13.

Error created using :-
MEMENTO_FAILAT=14 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/plmain.c


2017-12-13 17:28:11 -0800
Michael Vrhel <michael.vrhel@artifex.com>
9a089895193d71ad6ad70a91cbf9fe02a121261c

Introduce ColorAccuracy setting

Set the level of accuracy that should be used. A setting of 0 will result in less accurate
color rendering compared to a setting of 2. However, the creation of a transformation
will be faster at a setting of 0 compared to a setting of 2. Default setting is 2.

base/gsdparam.c
base/gsicc_cms.h
base/gsicc_lcms2.c
base/gsicc_manage.c
base/gsicc_manage.h
base/gslibctx.c
base/gslibctx.h
doc/Use.htm


2017-12-28 13:56:37 +0000
Ken Sharp <ken.sharp@artifex.com>
4fb32aef42d267948d97243e7f5512a2b37431b0

XPS interpreter - when discarding an ICC profile for an image, NULL hte pointer

Possibly Bug #698834 " xps dump"

Its not at all clear what the bug reporter sees as a problem, but when
I run the file to the display the XPS interpreter warns that it is
discarding an ICC profile because it has the wrong number of
components (profile has 4 in, 3 out components, image claims to be
RGB).

This counts the profile reference down by 1 but doesn't set the pointer
to the profile, saved in the image structure, to NULL leading to us
trying to free a garbage pointer later.

Setting the pointer to NULL solves the problem, and may fix the bug
report, if that's what the reporter is complaining about.

xps/xpsimage.c


2017-12-21 19:41:20 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
32cc4f267175dcc7a0dac0219e8e042ec9918cd9

Bug 697545 : Fix main instance memory leak.

Fix memory leak for allocation event number 12.

Error created using :-
MEMENTO_FAILAT=13 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/plmain.c


2017-12-20 14:20:13 +0000
Ken Sharp <ken.sharp@artifex.com>
3b24fd02b2bbeaef3d2e0374023fa330a9cddeac

Add 'gs_restrict' to function prototypes to match functions

Also add gs_restrict to some functions, because they are assigned to
function pointers that expect gs_restrict pointers.

base/gxblend.c
base/gxblend.h


2017-12-19 16:15:17 +0000
Robin Watts <robin.watts@artifex.com>
ac7e8dfb78a2b3ae2875f64e6feb6f4dce5300b4

More tweaking to pdf14_fill_rect cases.

Ensure that the gray/rgb/cmyk cases for AirPrint all go through
routines that have been hand tweaked.

base/gxblend.c


2017-12-19 18:22:28 +0000
Robin Watts <robin.watts@artifex.com>
f00a08ec0a7f2fedbc2a7d14c603ec22758ed81c

Avoid shadowing a variable in mark_fill_rect_add3_common.

base/gxblend.c


2017-12-19 15:21:55 +0000
Chris Liddell <chris.liddell@artifex.com>
28c4beb74e779da37c4e7aa7f149750a98c09a73

Remove obsolete font files:

NimbusSans-BoldOblique (replaced with NimbusSans-BoldItalic)
NimbusSans-Oblique (replaced with NimbusSans-Italic)

Resource/Font/NimbusSans-BoldOblique
Resource/Font/NimbusSans-Oblique


2017-12-19 13:23:42 +0000
Robin Watts <robin.watts@artifex.com>
9d1e45d36064249220ca2f51280770aaaab3a971

Common up optimised cases of group blending.

Additive and Subtractive make no difference (modulo rounding) when
dealing with normal mode blends. As such we can halve the number
of optimised routines required.

base/gxblend.c


2017-12-19 10:16:16 +0000
Ken Sharp <ken.sharp@artifex.com>
1143a7aba79e6316ccfb5fc2b0943dcd7a64a48f

pdfwrite - drop unusable Matte from SMask when doing colour conversion

Bug #698817 "ColorConversionStrategy=Gray breaks image with smask"

SMask images can have a Matte entry which is a preblended colour. It
must have the same number of components as the parent image. If we are
doing colour conversion then we can't unconditionally use the existing
Matte value, as it may have the wrong number of components for the
converted image.

In fact Matte values are optional and rare. Even rarer are Matte entires
which have any actual effect. We can't use the value (unless the parent
image was already in the target colour space, and we can't realistically
convert the Matte to another space.

So here we test the color conversion strategy, if the image colour space
is not the same as the target, then we simply discard the Matte entry.
This isn't 'correct', but then nothing will be, and this stops Acrobat
from whinging and refusing to render the image at all.

devices/vector/gdevpdfi.c


2017-12-19 09:05:22 +0000
Ken Sharp <ken.sharp@artifex.com>
6e77c8f647fecaa1a31116fbcd59ad26fb650905

pdfimage - eliminate a compiler warning

Check a return code to eliminate a compiler warning.

devices/gdevpdfimg.c


2017-12-18 20:59:39 +0000
Robin Watts <robin.watts@artifex.com>
fbf0e1c9f7014b602f9dd94e8fac37b21dffc798

Add CMYK optimised core to image rendering.

Add irii_inner_32bpp_4spp_1abs to go along with others. This one
is hit in the AirPrint test file when going to CMYK.

base/gxiscale.c


2017-12-13 15:37:53 +0000
Robin Watts <robin.watts@artifex.com>
f34cae2ebb2c85c13787fd828eb6194e32cb19d2

Optimise image_render_interpolate_icc.

Split out the core of the routine into a function call. The
guts of the original routine go into irii_inner_template,
which can be static instantiated as required.

I had hoped that merely instantiating this 3 times would be
enough to optimise the routines, but in the end I had to
manually cut the core down for the 2 cases that the AirPrint
test file hits.

base/gxiscale.c
windows/GhostPDL.sln


2017-12-18 16:38:31 +0000
Ken Sharp <ken.sharp@artifex.com>
9fb23615725e8a2d6a722814a348094a48a41c36

pdfimage - support the '%d' output format specifier

It hadn't occurred to me that anyone would want to do this, so I hadn't
implemented it. On reflection its probably useful, and it should
(finally) solve the all devices regression report problem.

At the same time, add the file to the Windows solution so that we get
debug information in it.

devices/gdevpdfimg.c
windows/ghostscript.vcproj


2017-12-18 15:09:02 +0000
Robin Watts <robin.watts@artifex.com>
561327c559cd8fa6cb5840a80806cff38ef9aa0b

Manual optimisation of AirPrint hotspot.

compose_group_nonknockout_nonblend_add_isolated_mask_common_solid
takes a significant amount of time in the AirPrint test file.
Unroll it manually and optimise to avoid needless planar -> chunky
-> planar copying.

base/gxblend.c


2017-12-18 11:27:32 +0000
Ken Sharp <ken.sharp@artifex.com>
51f279ece4f34c17119a543725c5aee3ca4f8d1d

Fix pattern code for devices handling patterns by subclassing new device

The pattern code permits for us to use an 'internal' accumulator or for
a device to declare it can handle patterns itself. When a device handles
patterns we pass spec_ops to the device to delineate the pattern
operations.

It can happen that when the pattern terminates we (g)restore back to a
point before the internal pattern accumulator device was pushed into
the graphics state. To handle that possibility we push a pointer to the
device onto the exec stack and use that stored pointer to tell the
pattern accumulator device when the pattern terminates, even if it is
no longer the current device at that time.

Unfortunately this conflicts with the ability for other devices to
handle patterns. The code uses that same stored device pointer to
indicate whether we are using the internal accumulator or not. If the
stored pointer is NULL then we are not using the internal accumulator.

But this assumed that, if we aren't using the internal accumulator, that
the current device is the one which declared it could handle the pattern.
This is dangerous anyway, because there's not restriction on how fat
back we might have restored, and its possible (if unlikely) that the
device now in the graphics state isn't the one that can handle
patterns. In addition, if the underlying device handles patterns by
subclassing itself with a new pattern handling device, then when we
restore back, even though the device is the one which stated it could
handle patterns, its not the one we want to inform of the pattern
termination.

We handle this simply by getting the current device after the 'start'
notification. I think its reasonable to assume that the device now in
place is the one which expects to receive the 'close' message. We
then store that device on the exec stack. When we get to the cleanup
routine, if we decide we are not using the internal accumulator, then
we call the new stored device to handle it.

I think ideally we should store a flag for whether we are using the
internal accumulator, but it wouldn't be any more efficient.

psi/zpcolor.c


2017-12-18 09:11:05 +0000
Ken Sharp <ken.sharp@artifex.com>
15d80a143b71b9b61d007e2abb67a74a5f753cea

pdfimage - change the way files are closed

The 'all devices' regression test persists in throwing errors and
seg faulting with these devices when closing. I can't reproduce the
problem on Linux.

So instead of preventing the gdevprn code from closing the file, prevent
the stream code from closing the file instead, and allow the gdevprn
code to perform normally.

Hopefully this will solve the problem.....

devices/gdevpdfimg.c


2017-12-18 09:08:58 +0000
Ken Sharp <ken.sharp@artifex.com>
9de2f57c80bc9e6a25e3fd570a5c1df3321404eb

Check for the existence of _MSV_VER before testing its value

On Linux _MSC_VER is not defined, and so leads to a warning everywhere
that stdpre.h is included.

This just eliminates the warning.

base/stdpre.h


2017-12-16 11:01:40 +0000
Ken Sharp <ken.sharp@artifex.com>
8af42f2da3425a634ec78d8a0add1658778e2226

Define gs_restrict as a synonym for the compiler 'restrict' definition

Using the 'restrict' tag tells the compiler that it can safely assume
no aliasing of pointers is involved, allowing for even higher levels
of optimisation. However since this is a non-standard extension
(though widely supported) the exact definition varies.

We know of 'restrict', '__restrict', '__restrict__' and 'cdecl(restrict)'

The Visual Studio cdecl causes problems with us simply using 'restrict'
and #defining it in stdpre.h because stdlib.h includes the cdecl. If
we include stdpre.h before stdlib.h then the compiler tries to expand
'cdecl(resgister)' to 'cdecl(__register)' and that fails.

The only way to accommodate all the various options is to use something
other than the 'restrict' keyword, and to #define that as required for
the different compilers.

This commit introduces the 'gs_restrict' keyword and that is #defined
in stdpre.h to be appropriate for whatever compiler is in use (the
default is to define it to nothing). This means that wherever we want
to use the restrict capability, we must include stdpre.h.

base/claptrap-planar.c
base/claptrap.c
base/claptrap.h
base/ets.c
base/ets.h
base/gxblend.c
base/gxblend1.c
base/gxscanc.c
base/gxscanc.h
base/siscale.c
base/stdpre.h


2017-12-15 21:01:31 +0000
Robin Watts <Robin.Watts@artifex.com>
b35aa4c4e4a8e77395b45051ca2621e6823c5623

Add optimised LCMS transform operations.

Add a full set of optimised functions for {1,3,4} -> {1,3,4}
channels in either 1 or 2 byte form. This should cover all
the cases we'll hit in gs until we start using spots.

lcms2/src/cmsxform.c


2017-12-16 16:10:48 -0800
Ray Johnston <ray.johnston@artifex.com>
e8e7034a9714191315313daa4a45ce626a9f6cf7

Fix bug 698816: Performance with transparency due to commit 3a9d6eb

Tracked this down to the push_transparency_group logic not skipping the
allocation of the buffer when "idle" was set. This reduced 32-bit Windows
9.22 from 45.9 seconds to 19.9 seconds.

Even more good news, HEAD (SHA 3f9c130f 32-bit Windows) from 37.5 seconds to
11.9 seconds.

base/gdevp14.c


2017-12-15 19:07:07 +0000
Robin Watts <Robin.Watts@artifex.com>
3f9c130f778167b2f0486bef1c3a2d027433ec57

Optimise pdf14_fill_rectangle for CMYK

Add optimised CMYK case.

base/gxblend.c


2017-12-15 11:50:32 +0000
Robin Watts <Robin.Watts@artifex.com>
0333c58af9a48a14a0e9323732332104e577dc85

Optimise pdf14_fill_rectangle.

Optimisations for the common case as seen in Airprint
test file.

base/gxblend.c


2017-12-15 09:54:15 +0000
Robin Watts <Robin.Watts@artifex.com>
9b35281f914bb77f5e68070fb6ce4e32e955dcc8

Add new optimised case for pdf14_fill_rect

mark_fill_rect_additive_nospots_common_no_alpha_g.

For the Airprint test case.

base/gxblend.c


2017-12-14 20:06:37 +0000
Robin Watts <robin.watts@artifex.com>
3dfca86e11ea2143525758325ea0feff06e42a52

Further optimisations to image_render_color_icc.

Split it into 3 routines; portrait, landscape and skew.

base/gxicolor.c


2017-12-14 18:42:14 +0000
Robin Watts <robin.watts@artifex.com>
e0ebcde1ce879cf74fb9d8b53670478d5d03717b

Optimise image_render_color_icc.

Avoid using the color_samples hack, as this merely results in us
first copying bytes into a new buffer, only to effectively
memcmp it. Just use the bytes directly.

We lose potential problems with strict aliasing here, and gain
the benefit of only having to check n bytes rather than
GS_IMAGE_MAX_COLOR_COMPONENTS bytes each time.

This gives us a noticable speedup on the Airprint test file.

base/gxicolor.c


2017-12-15 15:08:40 +0000
Ken Sharp <ken.sharp@artifex.com>
2655f09c04ee2678df98c58764390e9e79bfc254

PCLm fixes

rename the device to 'pclm' because none of our devices use capital
letters.

Mirror the fix for sclose in the PCLm device (didn't realise this was
a separate function to the pdfimage devices)

remove the unused writehex function

devices/gdevpdfimg.c


2017-12-15 13:06:47 +0000
Ken Sharp <ken.sharp@artifex.com>
3cdca3a2c6cfe74a62797d486ce6c69afd9eacd0

pdfimage devices - remove UUID code

The uuid was a holdover from an early incarnation of the code, it
was dropped later but the code lingered....

devices/gdevpdfimg.c


2017-12-15 11:21:49 +0000
Ken Sharp <ken.sharp@artifex.com>
44d4d979c25eaea76c2d08aceec058f92ee3ed83

Make pdfimage devices work on Linux

Because the devices usurp the FILE * created by the gdevprn code and
turn it into a stream, we must set the stored pointer to NULL after
closing or freeing the stream in order to avoid gdev_prn_close()
attempting to close the underlying file again, which causes an error
on Linux.

Also remove some routines we no longer use.

devices/gdevpdfimg.c


2017-12-13 14:19:43 +0000
Robin Watts <robin.watts@artifex.com>
86322b1ccb1e67cf99672945f1d77925b2902872

Tweak gx_build_blended_image_row.

Move from an array index based scheme to a pointer arithmetic
based scheme. Saves us lots of multiplications per pixel.

This may not make much difference on x86, but on ARM, where
pointer arithmetic is largely free, this should help more.

base/gdevp14.c
base/gxblend.h
base/gxblend1.c


2017-12-14 15:27:11 +0000
Robin Watts <robin.watts@artifex.com>
899255deef5a92bf36269d0ef3fa355401fe170f

Further optimisations to bitmap scaler.

Use hand unrolled loops rather than static inline optimised ones.
Fix some debugging. Add CMYK case. Add some restricts. Make the
zoom_y case explicit in it's reuse of values.

base/siscale.c


2017-12-14 12:45:08 +0000
Robin Watts <robin.watts@artifex.com>
16eb526bc113a9c783f824ea6940857e302acc3d

Add restrict qualifier to stdpre.h header.

Sprinkle it through the blending code. This should never hurt
and may well help. We should be using it as a matter of course,
especially in performance critical routines.

base/gxblend.c
base/gxblend.h
base/stdpre.h


2017-12-14 12:00:51 +0000
Ken Sharp <ken.sharp@artifex.com>
34286be72308b7cba275bbf423e589997e9e683e

Fix compiler warnings after pdfimage device commit

devices/devs.mak
devices/gdevpdfimg.c


2017-11-02 08:24:59 +0000
Ken Sharp <ken.sharp@artifex.com>
7a13371ec8dc077c4a3b28f6935206fe06fc534e

New devices - pdfimage and PCLm

These devices render input to a bitmap (or in the case of PCLm
multiple bitmaps) then wraps the bitmap(s) up as the content of
a PDF file. For PCLm there are some additional rules regarding
headers, extra content and the order in which the content is
written in the PDF file.

The aim is to support the PCLm mobile printing standard, and
to permit production of PDF files from input where the graphics
model differs significantly from PDF (eg PCL and RasterOPs).

Devices are named pdfimage8, pdfimage24, pdfimage32 and PCLm.

Currently produce valid PDF files with a colour depth of 8 (Gray),
24 (RGB) or 32 (CMYK), the PCLm device only supports 24-bit RGB.

Devices supports the DownScaleFactor switch to implement
page level anti-aliasing

-sCompression can be set to None, LZW, Flate, JPEG or RLE (LZW
is not supported on PCLm, None is only available on PCLm for
debugging purposes).

The PCLm device supports -dStripHeight to set the vertical height
of the strips of image content, as required by the specification.

For JPEG compression the devices support both the JPEGQ and
QFactor controls, exactly as per the jpeg and jpeggray devices.

base/unixansi.mak
configure.ac
devices/devs.mak
devices/gdevpdfimg.c
devices/vector/gdevpdfe.c
doc/Devices.htm
psi/msvc.mak
psi/os2.mak


2017-12-13 17:55:16 +0000
Robin Watts <robin.watts@artifex.com>
099ba1f50e2af5d43a9f007575e78e3605d008be

LCMS2 tweak: Spot identity transformations

Spot identity transformations and handle them as efficiently as
possible. (i.e. avoid unpack/null transform/repack).

lcms2/src/cmsopt.c
lcms2/src/cmsxform.c
lcms2/src/lcms2_internal.h


2017-12-13 09:25:09 +0000
Robin Watts <robin.watts@artifex.com>
92f0c389ebddf4125dc770f71f4d74187275fd7f

Add 2 more optimised blend cases for Airprint test case.

The Airprint Presentation test file hits the
compose_group_nonknockout_nonblend_add_isolated_mask_common case
hardest. Add 2 more specialisations of this that cope with
shape = 255 and alpha == shape == 255.

This saves us just over half a second (of 13.2) on my desktop PC.

base/gxblend.c


2017-12-11 19:52:43 +0000
Robin Watts <robin.watts@artifex.com>
b5189a84ddf0ca1454b10bb4a9926cd4f8c4f0eb

Add PWGDecode filter.

And lib/viewpwg.ps to use it.

Makefile.in
base/lib.mak
base/spwgd.c
base/spwgx.h
base/unix-gcc.mak
lib/viewpwg.ps
psi/int.mak
psi/msvc.mak
psi/zfilter.c
windows/ghostscript.vcproj


2017-12-12 17:57:05 +0000
Robin Watts <robin.watts@artifex.com>
0bdb35346b5a9636bc6c1ca629401ba21232d9bb

Bug 698808: Fix stack overflow in new scan converter.

Remove some code to split lines. This is no longer needed
due to the fix for bug 698805, and avoids us getting into the
stack overflow situation.

base/gxscanc.c


2017-12-12 01:37:14 -0800
Michael Vrhel <michael.vrhel@artifex.com>
2eb66278cb71b4f97b09300d7c405b8228ebeaf6

Segv fix for XPS files with trans out to sep device

When going out to a separation device, PCL and XPS should set
PageSpotColors to 0. For PCL this lets the sep device know
that there are not any spot colors on the page.

For XPS the situation is a bit more complex. XPS files with named colors
are very rare. I have never seen one in the wild. Supporting
the separation of them will require work in the XPS interpreter
to keep track of the colorants (the names of which are in the colorant
tags of the ICC profile) and make sure that the values are properly
mapped to the colorant positions on the output device. We will also
want to do a pre-parser to count the number of independent colorants
on the page to ensure proper set up of the device. This is needed
especially if the page has transparency as the pdf14 device expects to
have this information. Again running into them in the wild is not going to
occur. If for some reason it does become an issue in the future,
we can invest the time in doing the above. In the meantime if they
are encountered they will be remapped to equivalent CMYK colors instead
of causing a segv.

pcl/pl/plmain.c


2017-12-12 18:31:00 +0000
Robin Watts <robin.watts@artifex.com>
ac1fb2a0580fac884cbf8e07aba4834498a5927a

Fix typo in bug fix for 698805.

base/gxscanc.c


2017-12-12 09:19:41 +0000
Chris Liddell <chris.liddell@artifex.com>
0aa901ed39ae5c2a8fbf1107dbbd7d3813cab2ee

Check for gdevcups.c before including the cups device

Previously, we were checking for the cups directory, which won't work reliably
if the build machine also has the cups libraries installed.

configure.ac


2017-12-12 16:58:00 +0000
Robin Watts <robin.watts@artifex.com>
ed2c6957a2ed53aac51e0b7d4209e62f096b8d73

Bug 698805: Fix NULL pointer dereference in new scan converter.

Again caused by an integer overflow.

signed sy, ey can differ by more than 0x80000000, which means
when we subtract them, we can end up with a result with a different
sign.

Fix by using a safer test.

base/gxscanc.c


2017-12-01 14:43:43 -0800
Ray Johnston <ray.johnston@artifex.com>
ac241e31c931858e562dc0a4cd88db31e012c2cf

Fix bug 698662. Elements shifted horizontally when clist is used.

The scurveto clist path reading logic assumed that if the first value
A, was 0, the previous curve entry was vertical, but the writing logic
checked for B == 0 and decided to use h*curveto, so if A was also 0,
the reading logic would assume vertical.

base/gxclpath.c


2017-12-08 13:43:36 -0800
Michael Vrhel <michael.vrhel@artifex.com>
43a84c5d99d14881773b78b58892e9b049b938d9

Bug 698794 detect alpha data in PNG image

We were making the decision as to the presence/absence of
the alpha data in the PNG image a little early. There
was one more step related to png_set_tRNS_to_alpha

xps/xpspng.c


2017-11-30 18:41:42 -0500
Robin Watts <Robin.Watts@artifex.com>
4ee9656472805dc39a6ed3a8bd097dd04e497c19

Fix PCL init routines to return error code.

And fix calling loop to honour error code. Interestingly
this calling routine was already set up to do most of the
hard work here. I wonder if this was once done already?

pcl/pcl/pccolor.c
pcl/pcl/pccprint.c
pcl/pcl/pcfont.c
pcl/pcl/pcfrgrnd.c
pcl/pcl/pcjob.c
pcl/pcl/pcmacros.c
pcl/pcl/pcmisc.c
pcl/pcl/pcommand.c
pcl/pcl/pcommand.h
pcl/pcl/pcpage.c
pcl/pcl/pcpalet.c
pcl/pcl/pcparse.c
pcl/pcl/pcparse.h
pcl/pcl/pcpatrn.c
pcl/pcl/pcrect.c
pcl/pcl/pcsfont.c
pcl/pcl/pcstatus.c
pcl/pcl/pcsymbol.c
pcl/pcl/pctext.c
pcl/pcl/pcuptrn.c
pcl/pcl/pcursor.c
pcl/pcl/pgchar.c
pcl/pcl/pginit.c
pcl/pcl/pginit.h
pcl/pcl/rtgmode.c
pcl/pcl/rtmisc.c
pcl/pcl/rtraster.c


2017-12-05 13:31:25 +0000
Ken Sharp <ken.sharp@artifex.com>
5c851a410c3469860a171420240eb92331dcda9e

pdfwrite - colour conversion changes

Bug #698723 "convert rgb pdf to cmyk with icc profile yields wrong black"

When converting to a base space colour, and applying the transfer
function, don't use the old-fashioned colour conversion routines but
instead use the ICC profile colour management.

With this change in place, the CMYK components in the output file are
the same as those when rendering to TIFF CMYK output.

I am convinced there is more work to do in this area.

devices/vector/gdevpdfg.c


2017-12-05 13:27:27 +0000
Ken Sharp <ken.sharp@artifex.com>
775e9d28f78b4b0b5b41a24f4c9fc7f19a9326e3

pdfwrite - correct a device method

Correct the CMYK colour mapping method to use CMYK and not RGB....

devices/vector/gdevpdf.c


2017-12-01 17:05:07 -0500
Robin Watts <Robin.Watts@artifex.com>
6edda68e00965c0794fdd408cbc02c1729c374ff

Rejig gs_fapi_ft_ensure_open to avoid error cleanup SEGV.

Also, aesthetics.

base/fapi_ft.c


2017-12-01 14:06:12 -0500
Robin Watts <Robin.Watts@artifex.com>
3d6009573b3562d97f03c0fb6b1463ed0e4d133f

Memory squeezing fix in pl_load_tt_font.

Fix SEGVs due to memory failures while loading a tt font.

Error created using :-
MEMENTO_FAILAT=1402 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null
./pcl/examples/owl.pcl

Tweaked version of a commit from Shelley.

pcl/pl/plfont.c


2017-11-30 18:40:42 -0500
Robin Watts <Robin.Watts@artifex.com>
cc5b750951ee94b2d7e0615dde0122af973f49bb

Memento: Fix type of signal handler function.

base/memento.c


2017-12-02 13:11:42 +0000
Ken Sharp <ken.sharp@artifex.com>
7d9b9cc6ff0fafed282257fd1bf1ba815726a50e

PDF interpreter - another case of incorrect ICCBased profiles

More cases like those tackled in commit
df5b3426d31f79c13a735dff9118e9798ce97af9 for bugs #696690 and 696120

Again we have an ICCBased colour space where the /N alue does not match
the actual number of components in the ICC profile. Previously we had
only seen this with images, the customer file uses a 'cs' operator
which we weren't catching.

No differences expected.

Resource/Init/pdf_ops.ps


2017-11-16 16:41:22 +0100
David Kaspar [Dee'Kej] <dkaspar@redhat.com>
615b31526d06fcdac7abb9e37deac3ce5fb214b6

man/de - all man pages converted to UTF-8 (from ISO-8859-1)

man/de/dvipdf.1
man/de/gsnd.1
man/de/pdf2ps.1
man/de/printafm.1
man/de/ps2ascii.1
man/de/ps2ps.1


2017-12-01 15:16:19 +0000
Chris Liddell <chris.liddell@artifex.com>
69f4ea2d9d86b9eccf5e3477e4dc9d7d51e1d2d8

Remove obsolete check_source.py tool....

and its configuration file (testing.cfg.example).

Bug 698780 (related)

toolbin/tests/check_source.py
toolbin/tests/testing.cfg.example


2017-11-27 10:30:52 +0100
David Kaspar [Dee'Kej] <dkaspar@redhat.com>
efc24229b0ba4b2f6a39fe89a4c9c576dbe7e124

Bug 698784: Fix the alias for Helvetica-Narrow-Bold-Oblique

Init/Fontmap.GS:

There was a misalignment between the filename of the
NimbusSansNarrow-BdOblique and its /Fontname in the T1 font itself.

Filename: NimbusSansNarrow-BdOblique
/Fontname: /NimbusSansNarrow-BoldOblique

This worked correctly if the fonts were located directly in
/usr/share/ghostcript/Resources/Font folder on the filesystem.

However, on Fedora we are using /usr/share/fonts/urw-base35/ folder,
which is part of Ghostscript's Search Path. In this case it was
causing the Ghostscript being unable to locate the correct font, thus
crashing while opening any document containing Helvetica Narrow Bold
Oblique font...

*In addition*, rename the font file so it matches.

Resource/Font/NimbusSansNarrow-BoldOblique
Resource/Init/Fontmap.GS
psi/psromfs.mak


2017-12-01 13:54:02 +0000
Chris Liddell <chris.liddell@artifex.com>
8d0ca41749ec3070c6a5c660ab0225b42bcb9eb3

Bug 698741: where the comment says "decrement", actually decrement

The comment stated we'd move to the end of the row, and work backwards, but
the code was still working forwards, leading to a buffer overrun.

base/gxicolor.c


2017-11-24 22:26:59 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
caa10a82fcf313dab7426250f59517936fa34964

Bug 697545 : Memory squeezing fix for double freeing of ToneCurve.

Avoid SEGV by removing unnecessary freeing of ToneCurve.

Error created using :-
MEMENTO_FAILAT=751 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

lcms2/src/cmsio1.c


2017-11-25 19:08:28 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
346f1d67dc363195885dd041ede2abb0422c4455

Bug 697545 : Memory squeezing fix for gs_enumerate_files_next.

Prevent SEGV by checking for NULL pointer before attempting to
use it.

base/gsiodev.c


2017-11-24 19:27:50 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
d2977a7891f5c84526eefdd25b2167e052fa9c90

Bug 697545 : Memory squeezing fix for pjl resources.

Prevent SEGV by checking for NULL pointer before attempting to
free it.

pcl/pl/pjparse.c


2017-11-24 15:45:16 +0000
Robin Watts <robin.watts@artifex.com>
96030033df28fb89732f58ae4df463f7fc06be5b

Add '-DCLUSTER' mechanism to builds.

For autobuild use --enable-cluster option to configure/autogen.sh.

For windows builds, use CLUSTER=1.

This nobbles pdfwrite to use a '0' time in the produced files.
This enables us to md5sum intermediate files.

Thanks to Chris for his help with the configure minefield.

Makefile.in
configure.ac
devices/vector/gdevpdf.c
psi/msvc.mak


2017-11-24 19:06:41 +0000
Robin Watts <robin.watts@artifex.com>
949ce4cf61f2ccf1ff39dd2c854aec9f9dad5068

Tiny stylistic tweak.

pcl/pl/plmain.c


2017-11-24 19:06:26 +0000
Robin Watts <robin.watts@artifex.com>
33babeb40a9e73e0cfb1d3b30574e305fa6ee7c7

Squash warning.

pcl/pl/plmain.h


2017-11-23 22:21:15 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
8b82d6f99ffda116b328e3ae65c58ee5e056e490

Bug 697545 : Memory squeezing fix for mutex in cms code

Prevent SEGV by checking for NULL mutex pointer before attempting
to use or destroy it.

lcms2/src/cmserr.c


2017-11-23 22:17:55 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
a46d319b6edc2bc07b14fbf155b5101bf884fe27

Bug 697545 : Memory squeezing fix in pl_main_delete_instance

Prevent SEGV by checking for NULL value before dereferencing.

pcl/pl/plmain.c


2017-11-23 17:00:06 +0000
Ken Sharp <ken.sharp@artifex.com>
adfedfa4de0457ecacf5814d4a315fcaee00561d

OpenType fonts - regard fonts with multiple GSUB tables as invalid

Bug #697627 "IO in gs_notify_all function"

The bug title is a misnomer; the actual problem is that we have a badly
corrupted font which appears to have 2 GSUB tables. This causes us to
allocate two chunks of memory to hold the tables, losing the original
reference when we allocate the second, and also to register the font
to have the GSUB table released twice.

Trying to release the same memory twice leads to us trying to access
invalid memory, and therefore to a seg fault.

So if we find we have a GSUB, and we've already allocated memory for a
GSUB table, just throw an error.

Chris thinks it may be possible to legally have multiple GSUB tables, if
we ever find such a thing we'll have to rethink this.

base/gstype42.c


2017-11-23 09:40:36 +0000
Chris Liddell <chris.liddell@artifex.com>
3ad236df1e509d0326a1fa31c98e068b5712fd75

Bug 698773: Cope with "charstring" of invalid type

This file has a font whose CharStrings dictionary contains:
/space 3 def

Ideally, when we hit such a case, we should fallback to the .notdef glyph,
unfortunately, it also has:
/.notdef 0 def

We *should* throw an error since this is clearly totally invalid, but other
interpreters *appear* to simply ignore the problem. So, we opt to return an
empty charstring.

psi/zfapi.c


2017-11-23 13:32:26 +0000
Ken Sharp <ken.sharp@artifex.com>
f32c03a2daad2d2e0e859bd6fc7547b68bd8bed9

Do not ignore errors from the device's fill_rectangle_hl_color method

Spotted by Robin while fixing indeterminisms, we currently ignore any
error return from this method in pattern_accum_fill_rectangle_hl_color()
when it calls its target device. Adding a check and error propagation is
simple enough, but that then reveals problems with the high level
devices.

There are, in fact, several problems here. Firstly, the mem* devices
which are used to render pattern tiles (amongst other things) are
based on forwarding devices. When we send a spec_op we forward this to
the 'underlying' device. This is a problem if the spec_op is querying
whether the device can handle hl_color, because if it can then the
caller may proceed to use hl_color methods. But the mem* devices cannot
handle these methods and obviously can't forward them to the underlying
device, resulting in an error. Fixed this one by using the default
spec_op method instead of the forwarding one. In future this may require
further attention.

The NULL device doesn't implement fill_rectangle_hl_color. In fact, with
the changes elsewhere it doesn't need to, but really we should simply
handle this in the same way as fill_rectangle and return, all the null
device does is bit bucket all operations. For completeness, implement
such a method.

gx_erase_colored_pattern() didn't do a restore (to match its save) if
an error occurred. Again, with the other changes this is no longer
triggered, but it does seem wrong so lets fix it.

In gx_pattern_load() and pattern_paint_prepare(), avoid erasing the
background of the tile if the pattern instance is for a device which
handles patterns itself (eg pdfwrite). Once again, not really required
now that the mem* devices don't pass on the spec_op to the underlying
device, but it saves us bothering with erasing a rectangle which we are
going to throw away anyway.

Finally, the point of the whole exercise, in
pattern_accum_fill_rectangle_hl_color(), check the return code from the
target device's fill_rectangle_hl_color and if its an error, return it.

base/gdevmem.c
base/gdevnfwd.c
base/gxpcmap.c
psi/zpcolor.c


2017-11-22 21:29:04 +0000
Robin Watts <robin.watts@artifex.com>
1cfc56251773304fb102237ff8a63c5576f08fe7

Rewritten version of squeeze2html.pl

This works with the latest memento, and gives nicer results in
the browser.

Invoke using something like:

MEMENTO_SQUEEZEAT=1 membin/gs -sDEVICE=ppmraw -o /dev/null
in.pdf |& perl toolbin/squeeze2html.pl -q | gzip -9c > out.html.gz

toolbin/squeeze2html.pl


2017-11-22 17:57:23 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
276a386da36926cf36942528146b4294a5ff9d6d

Coverity IDs 127198, 127199

Check return values and handle errors accordingly.

pcl/pcl/pctext.c


2017-11-22 18:02:26 +0000
Robin Watts <robin.watts@artifex.com>
dd35e58feccf543129bc108857b16fd43d627d02

Fix indeterminism caused by buffer overrun in thresholding.

Running:

gs -sOutputFile=out%d.pbm -dMaxBitmap=400000000 -sDEVICE=pbmraw -r300
-sDEFAULTPAPERSIZE=letter -dNOPAUSE -dBATCH -K2000000 -dClusterJob
-dJOBSERVER /home/marcos/cluster/tests_private/pdf/uploads/Bug698519.pdf

then catting out{1,2,3,4,5}.pbm together and md5summing it gives a
different result to running the above job direct to out.pbm.

After much nightmarish debugging, it transpires that this is because
the special case in the SSE thresholding code that spots the 200%
scale case is being triggered incorrectly.

The image is 1753 pixels wide, which would be 3506 pixels at 200%.
We actually display it at 3507 pixels. The code was triggering the
200% case by calculating a scale_factor value of fixed_half (128).

The rounding here was causing a false positive.

Instead, we skip the calculation and check by directly comparing
source and dest sizes.

base/gxicolor.c
base/gximono.c


2017-11-21 12:48:54 -0800
Ray Johnston <ray.johnston@artifex.com>
362ec9daadb9992b0def3520cd1dc6fa52edd1c4

Fix bug 697459 Buffer overflow in fill_threshold_buffer

There was an overflow check for ht_buffer size, but none for the larger
threshold_buffer. Note that this file didn't fail on Windows because the
combination of the ht_buffer and the size of the (miscalculated due to
overflow) threshold_buffer would have exceeded the 2Gb limit.

base/gxht_thresh.c
base/gxipixel.c


2017-11-21 19:27:19 +0000
Robin Watts <robin.watts@artifex.com>
68fa913b5bc06a4250115f52835cadc5493aab12

Avoid warning.

base/gdevp14.c


2017-11-21 19:24:04 +0000
Robin Watts <robin.watts@artifex.com>
853737363b7b7cd1eab4da68ba8f83b7dfb5f453

clist tweak: Pass &var to macros if the value of var is updated.

Otherwise it's hard for someone unfamiliar with the macros to see
what is going on.

base/gxclbits.c
base/gxcldev.h
base/gxclimag.c
base/gxclpath.c
base/gxclrect.c
base/gxclutil.c


2017-11-21 17:40:53 +0000
Robin Watts <robin.watts@artifex.com>
ce5c3f42d8bd062da65d592abdaaeea90b901970

Ensure that single component planar devices can cope with hl_color.

As part of tracking down indeterminisms in the cluster, I found that:

gs -sBandListStorage=file -sOutputFile=out%d.psd -dMaxBitmap=10000
-sDEVICE=psdcmyk -r300 -Z: -sDEFAULTPAPERSIZE=letter -dNOPAUSE
-dBATCH -K2000000 -dClusterJob -dJOBSERVER -ZL
tests_private/pdf/sumatra/586_-_missing_images_gs_SMask_not_applied.pdf

was hitting a case where we were writing a pattern tile into the
clist that hadn't been initialised at all. This was because all
the writes to the pattern accumulator went through
pattern_accum_fill_rectangle_hl_color. This passes the hl_color
data to the memory devices fill_rectangle_hl_color function, and
fills the mask with 1s.

The mask was being entirely filled with 1s and so was being discarded
as unnecessary. Unfortunately the devices fill_rectangle_hl_color
entrypoint was left as the default which does nothing by raise an
error.

The fix here is to ensure that when we open a planar device, we
always add in a suitable fill_rectangle_hl_color function, even
when the device is superficially the same as a chunky one.

Thanks are due to Michael and Ray for their help with tracking this
down.

base/gdevmpla.c


2017-11-21 16:46:18 +0000
Ken Sharp <ken.sharp@artifex.com>
19ebb5f1f497b6f2d50fe13d17d3e627dfb6c868

PS interpreter - restore the flushpage operator

Michael Katzmann, working at the Library of Congress, is using
Ghostscript in a custom application, which also involves a barcode
reader and an SQL database.

Currently this resides in an RPM at:

http://engineering.nlsbph.org/repo/fedora/fedora/updates/27/SRPMS/AddressCard-3.17-LoC.fc27.src.rpm

but its not usable without the barcode reader and SQL database....
For reasons which are not completely clear to me, he wants to use
flushpage to update the display part way through the operation.

We suspect that it would be possible to avoid this, but it would
probably require some programming effort on the users part, and since
flushpage doesn't look like a likely candidate for abuse, we've decided
just to restore it.

Resource/Init/gs_init.ps


2017-11-21 14:13:21 +0000
Ken Sharp <ken.sharp@artifex.com>
37a9d25214efcabe0f36ed4cf6e91c58fcdbfa2d

PDF interpreter - move a default value to be compatible with all xref types

The commit df5b3426d31f79c13a735dff9118e9798ce97af9 which works around
PDF files where the /N value and the actual ICC profile colour space
number of components do not match.

Unfortunately, I made a minor error when creating this, which wasn't
exposed by the test files on hand at the time. I set the default value
of ICCProfileNError to false when processing an xref of type 'orig'
(ie not an xref stream) which means that for PDF files which use xref
streams the value was not defined, leading to an error.

Move the initial declaration to pdfopenfile instead so that it works
no matter what type of xref we have,.

Resource/Init/pdf_main.ps


2017-11-05 16:16:46 -0800
Ray Johnston <ray.johnston@artifex.com>
1d7893955cf4231c092045affc32e26ad2b6de32

Fix bug 696845 SEGV with --saved-pages-test and transparency

When a file pushes a pdf14devicefilter (or other compositor) it will
still be the currentdevice after the filter is popped when the saved
pages printing occurs. We need to check if the device is a forwarding
device (as compositors will be when deactivated) and use the target
device to print the saved pages.

Also, if a device uses the gx_default_dev_spec_op, it will return 0
from the supports_saved_pages call even when it is a printer device.
In gdev_prn_forwarding_dev_spec_op, check for a zero return and return
true (1). A device that is a printer device that doesn't support saved
page printing needs to return < 0 to prevent this.

Add a finalize method for gx_device_printer so we can free up the saved-
pages-list when the device is freed, but not when the device is closed
which can happen if it needs to close due to put_params. Also the
return code from the output_page in gx_saved_page_params_process was
ignored. Both seen with the file Bug687111.ps and the psdcmyk device.

Also for devn devices, such as psdcmyk, we need to save the separation
(spot color) names collected during the execution of setcolorspace in
the gx_saved_page and set them in the devn_params when rendering. These
are not handled by the paramlist.

Disable --saved-pages= and --saved-pages-test with PCL and XPS since it
was never completely implemented and the partial implementation causes
many errors when tested with --saved-pages-test. Note that while the
--saved-pages-test option is still accepted as a parameter, it is ignored
so that regression testing with --saved-pages-test can run.

Regression shows 3343 "diffs", but bmpcmp doesn't show any diffs.

base/gdevp14.c
base/gdevprn.c
base/gdevprn.h
base/gxclist.h
base/gxclpage.c
base/lib.mak
examples/transparency_example.ps
pcl/pl/plmain.c
psi/imain.c
psi/imainarg.c


2017-11-20 14:33:03 +0000
Robin Watts <robin.watts@artifex.com>
1b64014143a8a571e5dbff3346c6ad902603dda1

Fix release/debug difference.

In searching for the indeterminism in 11-14.PS, I found that I could
run the same command line in release and debug builds on peeved, and
get different results:

touch out1.pgm ref1.pgm && rm out*.pgm ref*.pgm &&
bin/gs -sOutputFile=ref%d.pgm -dMaxBitmap=10000 -sDEVICE=pgmraw -r300
-Z: -sDEFAULTPAPERSIZE=letter -dNOPAUSE -dBATCH -K2000000 -dClusterJob
-dJOBSERVER %rom%Resource/Init/gs_cet.ps cutdown >& ~/log &&
debugbin/gs -sOutputFile=out%d.pgm -dMaxBitmap=10000 -sDEVICE=pgmraw
-r300 -Z: -sDEFAULTPAPERSIZE=letter -dNOPAUSE -dBATCH -K2000000
-dClusterJob -dJOBSERVER %rom%Resource/Init/gs_cet.ps cutdown
>& ~/log2 && md5sum ref*.pgm out*.pgm && less ~/log ~/log2

After cutting down the file as much as I could, Chris reduced it
simply to:

3E9 3E9 moveto 1 1 lineto stroke showpage

Thanks for this!

Tracing through the code, I discovered that the difference came down
to check_diff_overflow, where the release build was assuming that if
v1 > v0, v0 - v1 < 0, which is acceptable because v0 - v1 has
overflown, at which point C says the value is unpredictable.

The fix is to detect the overflow before it happens.

base/gxpflat.c


2017-11-20 13:51:16 +0000
Ken Sharp <ken.sharp@artifex.com>
cea5d8a72dab953fe84ab8f7280003d377559fff

pdfwrite - Fix typo in on=-page checks for annotations with PDF/X

Bug #698765 "PDF/X Compliance Check Fails with Ghostscript generated PDF"

The upper-right y bound check was incorrect, leading to an incorrect
decision that an annotation was off the page.

devices/vector/gdevpdfm.c


2017-11-20 09:51:27 +0000
Ken Sharp <ken.sharp@artifex.com>
f9d41654ff0f52b6f42e5eff3215cf183261cffa

Coverity ID 203245 - remove redundant NULL check

The changes which fixed the device method API mean that its no longer
required to check that dev is not NULL in this routine.

base/gdevsclass.c


2017-11-17 15:42:17 +0000
Robin Watts <Robin.Watts@artifex.com>
7b04e4d7b85769169db94f1b0ed72474211ba27a

Add another PACIFY_VALGRIND section

Avoid warnings in 586_-_missing_images_gs_SMask_not_applied.pdf

base/gxclist.c


2017-11-17 15:26:10 +0000
Ken Sharp <ken.sharp@artifex.com>
c5f770b5c64cf7a2f3a0f3c447c089a089a695d1

Documentation - Restore the documentation on DELAYBIND and friends

Since we've reinstated DELAYBIND, reinstate the documentation to go
with it. Also include the helpers .bind and .bindnow.

doc/Language.htm
doc/Use.htm


2017-11-16 20:37:41 +0000
Robin Watts <Robin.Watts@artifex.com>
d9c9bea4ecf31e06bcf52d433b632ce0b6b1b239

Fix buffer overrun in gp_enumerate_files_next.

If pattern="*" and patlength = 1, then pathead = 1.

When we look for any following subdirectory, the code attempts
to look for the next subdirectory name. To do this it starts
searching from the byte after the position of the current '/'.
Unfortunately, if the string ends at the current wildcard, we
don't have a '/', we have a NUL terminator. This means the
current code starts looking just after that.

In code terms this means the current code accesses at
pattern + pathead + 1, without checking pattern[patthead] first.
This is a simple fix.

We also take this opportunity to simplify a couple of while loop
conditions. The extra negation is too much for my tiny brain to
cope with.

base/gp_unifs.c


2017-11-16 20:01:57 +0000
Robin Watts <Robin.Watts@artifex.com>
f27b751a1662c3ca8ef64c164cf3f9a400dd416b

Add SINGLE_OBJECT_MEMORY_BLOCKS_ONLY logic.

If SINGLE_OBJECT_MEMORY_BLOCKS_ONLY is defined at
build time, then we restrict every clump/chunk to
have just a single object in it. This makes
valgrind debugging easier as the allocation given
for when 'undefined' values were created is far
more likely to be correct.

base/gsalloc.c
base/gsmchunk.c


2017-11-16 20:00:01 +0000
Robin Watts <Robin.Watts@artifex.com>
1e1b4dc73087212abd1c6c9bee3192a1fc6bf630

Add some PACIFY_VALGRIND to quash some warnings.

11-14.PS trips some valgrind warnings where we
write structures into the clist without having
cleared the padding in the structures.

base/gsptype1.c
base/gxclimag.c
base/gxclist.c
base/gxpcmap.c


2017-11-16 21:51:13 +0000
Ken Sharp <ken.sharp@artifex.com>
e93a58466a78aab89e065bdae2d6b77db5620692

pdfwrite - fix instance UUID

Bug #698757 "Instance UUID truncated"

Should have spotted and fixed this at the same time as Bug #697977
but missed it. As noted in the bug report its practically the same code
and had the exact same problem.

devices/vector/gdevpdfe.c


2017-11-16 13:38:59 +0000
Ken Sharp <ken.sharp@artifex.com>
b76dc2d704fcc00edc8c1fd8ae19d01a36e22c49

ps2write - fix string splitting for output formatting

Bug #698708 "Ghostscript loops"

When writing output for ps2write, we limit the output width to 255
characters. If a string is longer than that we try to split it on
PostScript tokens. If we can't do that then we just break at 255
characters and stick in a newline.

The logic in here however was flawed however, it failed to update the
pointer 'p' which points to the character currently being processed
and did not reset the width count to 0 when the string was output.

This could lead to us in an infinite loop.

devices/vector/gdevpdfu.c


2017-11-16 11:29:47 +0000
Ken Sharp <ken.sharp@artifex.com>
01ce294445f7988f51f63108d53a89df003f2b1e

Fix tiffsep1 device after device API repair

commit dd820be was over-enthusiastic with the tiffsep1 device, and tried
to use the device procs accessor on a device struct member other than
'procs' with predictably unfortunate effects.

devices/gdevtsep.c


2017-11-16 10:28:28 +0000
Ken Sharp <ken.sharp@artifex.com>
fa499a5809aab45b2891b5c8b2363d1bca890757

PS interpreter - add warnings for DELAYBIND and WRITESYSTEMDICT

We've seen people using these options in an inappropriate fashion
and with SAFER set as well. Clearly there is confusion about how to use
these.

If the user selects SAFER, and selects an option which is liable to
make it possible for PostScript to evade the SAFER file system access
restrictions, then emit a warning reminding the user to 'lock' the
unsafe option down.

Also restore the old behaviour of DELAYBIND and remove the
REALLYDELAYBIND switch. We have heard from the 'pstoedit' maintainer
and that tool requires the use of both DELAYBIND and WRIESYSTEMDICT.

Resource/Init/gs_init.ps


2017-11-15 16:49:41 +0000
Ken Sharp <ken.sharp@artifex.com>
dd820bbe7f53e051add94dbcdc779dae1820e0d6

Device method repair - use accessors throughout

A lot of places accessed device methods directly, instead of using the
accessor macros. Update all the code to use the accessors.

base/gdevdflt.c
base/gdevmpla.c
base/gdevnfwd.c
base/gdevp14.c
base/gdevprn.c
base/gdevsclass.c
base/gdevvec.c
base/gsdevice.c
base/gsdparam.c
base/gsicc_manage.c
base/gxclist.c
base/gxclrect.c
base/gxcmap.c
base/gxdevice.h
base/gxfapi.c
base/gxfill.c
base/gxp1fill.c
base/gxpcmap.c
devices/gdevdsp.c
devices/gdevplib.c
devices/gdevtifs.c
devices/gdevtsep.c
devices/gdevwpr2.c


2017-11-12 11:10:49 +0000
Ken Sharp <ken.sharp@artifex.com>
c9951359bde5c4e72a20624788a47a97872db090

Repair the device API - device methods should never be NULL

The original intention of the device API was that device methods (with
the odd exception of fill_rectangle) must not be NULL. That appears
to have been broken with the introduction of the transparency
compositor, with the result that the code now:

1) has to check for methods being NULL sometimes, because that causes
crashes.

2) Uses a device method being NULL to determine code paths.

We want to return the device method design, because having to check for
NULL methods before calling is wasteful.

In this commit:

define default methods for all the methods that previously did not have
one.

Modify gx_device_fill_in_procs to include those defaults in the device
methods which it checks for NULL and replaces.

Finding all the places where the code path differs if a device method
is NULL, alter to check against the default method instead.

Remove NULL checks where they are no longer required. Device whose
'procs' get copied directly (clist) must have defaults for all methods.

Fix gx_copy_device_procs so that we only special case (don't replace
the method) for those few methods where it matters that the subclassing
device must have the default method if the subclassed device does. Long
term we should change the code not to rely on this!

Remove a couple of macros that were not required or plain dumb.

base/gdevdflt.c
base/gdevmem.c
base/gdevnfwd.c
base/gdevp14.c
base/gdevprn.c
base/gdevsclass.c
base/gdevvec.c
base/gscspace.c
base/gsdevice.c
base/gsdparam.c
base/gsicc_manage.c
base/gsovrc.c
base/gspaint.c
base/gstrans.c
base/gxblend1.c
base/gxclist.c
base/gxclrect.c
base/gxdevice.h
base/gxfapi.c
base/gxiscale.c
base/gxp1fill.c


2017-11-14 20:27:07 +0000
Robin Watts <robin.watts@artifex.com>
e2565e030eb37a25459671cfa9119715f3a0aae4

New "planr" device. 1 bit per component, RGB, planar device.

base/gdevmem.c
base/unix-gcc.mak
devices/devs.mak
devices/gdevplan.c
psi/msvc.mak


2017-11-15 19:17:05 +0000
Robin Watts <robin.watts@artifex.com>
a8b1611e7613781cd5c2c7defa2c5315254d9d1d

Fix operation of 1bpc, 3 component halftones.

In the chunky world, it makes no sense to deal with 3 bit rgb as
this doesn't pack neatly into a byte. You'd do it by handling
4 bit chunks.

Accordingly, parts of Ghostscript are written to assume that you'd
not do anything this crazy.

Unfortunately, in the planar world, a 1 bpc, 3 component device
does make (some) sense. Sadly, stuff like the halftone generation
gets deeply confused by this.

Here we fix 2 specific instances of this problem. In the halftone
generation, we generate 3bit chunky halftones as 4 bit ones, and in
the planar_copy_color routines, we assume that 3 bit data is
actually 4 bit (as a) it probably comes from these routines, and
b) if it doesn't it'd be packed as 4 bit in any sane world).

base/gdevmpla.c
base/gxcht.c


2017-11-15 17:08:58 +0000
Robin Watts <robin.watts@artifex.com>
fac14b8c25422529acded1e9e920eb20190db340

clusterpush.pl: Add smoke option

toolbin/localcluster/clusterpush.pl


2017-11-15 17:26:35 +0000
Robin Watts <robin.watts@artifex.com>
ae6f20152ab1e0860952dbeee979ef2c0f195269

Fix st_device_vector_max_ptrs.

This should be +4, not +3, but this value appears to be pretty
much unused, so nothing matters at the moment. It is used by
st_device_psdf_max_ptrs, but nothing uses that either.

We may remove both of these definitions in future.

base/gdevvec.h


2017-11-15 17:12:09 +0000
Robin Watts <robin.watts@artifex.com>
bb5726a74bbfbbd2e17b344eb4bc0385d514d4c1

Memento: Add Memento_sequence

base/memento.c
base/memento.h


2017-11-15 09:03:27 +0000
Ken Sharp <ken.sharp@artifex.com>
d046e24bd2894cf80785bede733006dd53746a07

PostScript interpreter - silence compiler warning

Prototype a function to silence a compiler warning. Also, make the
function static since it isn't used elsewhere.

psi/zarith.c


2017-11-13 11:05:04 +0000
Robin Watts <robin.watts@artifex.com>
143a892226b79676f5f8853f63532f9e6f4e8f5e

Avoid buffer overflow in GraphicsAlphaBits cdoe with planar device.

In GraphicsAlphaBits, we get the pixels from the underlying device
(in chunky format). The buffer we get that data into was sized
according to get_device_raster(dev, false), which (for a planar
device) returns the size for line of planar data. We want the
size for one line of chunky data, so use get_device_raster_chunky
instead.

base/gdevdbit.c


2017-11-13 09:07:03 +0000
Ken Sharp <ken.sharp@artifex.com>
5fe97ce30de048027da19a85bc574a8adfcf2116

pdfwrite - fix an error handling problem

Bug 698735 "Ghostscript: SEGV in pdfwrite with -Z@"

This was, unfortunately, caused by the shift to cleaning up memory
instead of relying on the garbage collector.

When an error occurred writing the metadata, the code simply exited
back to the caller, it did not close the temporary stream it was
writing the metadata to.

Due to the way that 'asides' are handled this led to the wrong stream
being closed, and a pointer retained to a closed stream. The result
was the seg fault.

There may well be other conditions like this still present.

devices/vector/gdevpdfe.c


2017-11-11 19:28:10 +0000
Chris Liddell <chris.liddell@artifex.com>
db2415d2b117946e5ec1d46936a134940f99c21d

Bug 698733: make vector device memory stable

The pcl/xl device (gdevpx.c) was using "normal" Postscript global memory for
its own use, and the vector base device on which it is based. That means the
memory it allocated could disappear with the end-of-job restore in the
Postscript interpreter.

Change it so it uses stable memory which is still garbage collected, and still
subject to relocation, but is *not* subject to Postscript save/restore
operation.

devices/vector/gdevpx.c


2017-11-03 08:52:50 -0700
Ray Johnston <ray.johnston@artifex.com>
c535ebb24602ff14a375a1590a9df6bd8bb7e9c4

Fix bug 695877: SEGV when display callback not set.

Change most of the device procs to return gs_error_Fatal when the callback
hasn't been set. The open is allowed to be called before it is set, but any
operations other than fill_rect (allowed for due to fillpage) and close will
now return Fatal errors. This allows the device to be "fake opened" by gs_init
before the parameters are processed and the display callback is set and the
device is opened for actual use.

devices/gdevdsp.c


2017-11-08 14:04:42 +0000
Ken Sharp <ken.sharp@artifex.com>
ea81364fdda57ce2c82007a150add5949a1c5788

PS interpreter - fix detection of overflow on 64-bit integer multiply

Bug 698722 "Erroneous Range-Check causes wrong arithmetic results"

The work here was actually done by Robin Watts, ably assisted by
Paul Gardiner.

The previous code failed to properly detect an overflow condition,
because the cast of MAX_PS_INT to a double reduces the precision to
only 52 bits for the integer portion, meaning it was possible for
very large numbers not to be detected as > MAX_PS_INT.

psi/zarith.c


2017-11-08 10:04:03 +0000
Ken Sharp <ken.sharp@artifex.com>
e1aead165e05e98ae765d6569f39ced839d4298e

Guard against divide-by-zero exceptions in the halftone code

Bug #697663 "FPE in gx_compute_cell_values()"
Bug #698332 "FPE (Division by zero) in pick_cell_size()"

These have the same root cause, in pick_cell_size() we can end up with
halftone cell parameters which are (I think) improperly initialised.

Certainly its possible to get to the point where we divide using one
of the parameters, and if its 0 we get an error. I suspect that the
halftone may be badly broken even when its not 0, but both these files
are the result of fuzzing, so I doubt its possible to have a real
working file get to this point.

Guard against the divide-by-zero errors by checking that both the
parameters are non-zero (its permissible for one to be 0 I believe)

base/gshtscr.c


2017-11-06 13:27:19 +0000
Robin Watts <robin.watts@artifex.com>
1fb022758a35502b8e299248dd37207c1abc3ffe

Optimise pdf14_copy_planes

Call code derived from pdf14_compose_group rather than
breaking everything down to rectangles.

base/gdevp14.c
base/gxblend.c
base/gxblend.h


2017-11-06 18:37:39 +0000
Robin Watts <robin.watts@artifex.com>
25d1c5f42b748af8d4d331a7b40ce9863e302332

Fix misalignment in pdf14_copy_planes.

In the case where x/y get clipped, we can fail to account for
this.

base/gdevp14.c


2017-11-03 18:53:27 -0700
Ray Johnston <ray.johnston@artifex.com>
8f36ee7a64c9ec95eb6657d06c602d0e4bb6f232

Fix -Z? vs. -Zv output for pattern transparency debug.

base/gdevp14.c
base/gsptype1.c
base/gxpcmap.c


2017-11-03 17:42:52 +0000
Robin Watts <robin.watts@artifex.com>
ee863835be136e21d3a4c4bcbe28e6e050e1bc1a

Check for a failed allocation before using the buffer.

base/gdevp14.c


2017-11-03 17:42:21 +0000
Robin Watts <robin.watts@artifex.com>
cc95eea7e6e5b5efb53446c8bcb482b748e9072e

Squash a warning in pdf14.

base/gdevp14.c


2017-11-03 17:41:33 +0000
Robin Watts <robin.watts@artifex.com>
a953768a82d685e575c17feeebf3ea4468a319f3

Fix bad free pdf14 (wrong gs_memory_t)

Michael spotted that:

gs -sDEVICE=tiff24nc -Z$?@ -r300 -o out%d.tif -f .
./MyTests/Advertising-PowerPoint-A4.pdf

gave a warning saying that a trans pattern being freed from
the cache wasn't owned by the supplied memory pointer.

Indeed the free should have been using memory->stable_memory.
Here we commit the nice fix whereby the buffer keeps a pointer
to the memory with which it was allocated.

This simplifies the pdf14_buf_free calls too.

Credit to Ray for finding the cause/identifying the fix.

base/gdevp14.c
base/gdevp14.h


2017-11-03 15:27:50 +0000
Robin Watts <robin.watts@artifex.com>
3c9f8491ecb5cfa382608c47f5a35ad2bce00edc

Bug 694918: Fix buffer overrun in image_simple_expand.

If truly crazy values of x_extent are used, the fixed point
representation can wrap around and we can start accessing out
of the buffer.

Check for such stupid values and nobble us to do no harm.

base/gxifast.c


2017-11-02 12:07:16 -0700
Ray Johnston <ray.johnston@artifex.com>
1ea664170c68539a035279425447f7ce10e130ff

Add support to viewpbm.ps for GRAYSCALE and RGB_ALPHA and fix logic for FITPAGE

The RAW_DUMP with RAW_DUMP_AS_PAM emits RGB_ALPHA and GRAYSCALE but these
were not supported. Display RGB_ALPHA as CMYK for now.

Also if SCALE was specified, the ifelse for FITPAGE was inverted.

lib/viewpbm.ps


2017-11-02 11:51:48 -0700
Ray Johnston <ray.johnston@artifex.com>
4c1f9b28eab25b519d0a14401ec6bbcf01813e12

Fix RAW_DUMP (minor omissions/typos when blending was refactored.

Resource/Init/pdf_main.ps
base/gxblend.c
base/gxblend.h
base/gxblend1.c


2017-10-27 08:03:36 -0700
Ray Johnston <ray.johnston@artifex.com>
8200f59f1b5aab852e23322587dda7c182fc195b

Fix Bug696372: Transparency with DeviceN not coping with bad PDF's

When a PDF with transparency stops interpretation due to an error, the
grestore may have popped the pgs so that the pdf14 compositor is no
longer the currentdevice. The logic in pad14_spot_get_color_comp_index
assumed that the device was a pdf14_device and got a bogus pointer to
devn_params. Instead, use the device's ret_devn_params function to get
the actual pointer.

Also, the poppdf14devicefilter would execute without the pdf14 device
as the currentdevice. Save the annots_gstate explicitly in pdf_main
showpagecontents so it can be set back before doing annots and the
poppdf14devicefilter.

This also required gs_setgstate to always do gs_do_set_overprint since
the setgstate may have skipped over states with the overprint compositor.
This caused "drawn_comps" to not be set correctly for the pdf14
compose_group.

Fixups for 696372 fix commit (also ne->be last line of commit msg)

Resource/Init/pdf_main.ps
base/gdevp14.c
base/gsstate.c


2017-11-02 17:54:57 +0000
Robin Watts <robin.watts@artifex.com>
1626f36c9b6ae68abad7818be7cfb2a95f4ecffe

Bug 698713: Further graphicsAlphaBits + new scan converter fix.

Previous I ensured that when using graphicsAlphaBits, the new scan
converter would restrict its output rectangles/traps to fit
within y % max_fill_band pixels at a time as required.

I forgot that the base 'y' value taken for this was not necessarily
aligned to a max_fill_band multiple. Fixed here.

base/gxscanc.c


2017-11-01 20:08:13 +0000
Robin Watts <robin.watts@artifex.com>
30ba3e3a163f729f2d05561e688dc54df6afa2e1

LCMS2: Add optimised 3x16bit -> 1x16bit cached transform.

lcms2/src/cmsxform.c


2017-11-01 21:15:42 +0000
Robin Watts <robin.watts@artifex.com>
d68b31cc315e7e687d0b55a5068b7514d7f73f5f

LCMS2: Refind transform routine on buffer change.

lcms2/src/cmsxform.c
lcms2/src/lcms2_internal.h


2017-11-01 17:23:17 +0000
Robin Watts <robin.watts@artifex.com>
4ef5c30e68bbb33b952db1b70508e7412bf79f0f

Reintroduce and update LCMS optimisations.

lcms2/src/cmsxform.c
lcms2/src/extra_xform.h
windows/ghostscript.vcproj


2017-10-31 19:37:10 +0000
Robin Watts <robin.watts@artifex.com>
1ab17bc53362ea34b61050429c51c575539bf2b9

Avoid clearing cm_comps arrays in cmap functions.

This goes against commit 99c48263b9 by Ray (dating from Nov 1 2009)
to fix Bug 690713 and solve some indeterminisms.

My belief is that this SHOULD be fixed in the devices, not in the
callers. Accordingly I have backed that out, and changed the
cmyk_cs_to_psdcmyk_cm function (the only one I can find that does
not set everything to be 0).

The cluster now shows this running with no diffs.

base/gxcmap.c
devices/gdevpsd.c


2017-11-01 12:07:53 +0000
Robin Watts <robin.watts@artifex.com>
b3c0fafa490932cc43009c53c7f8a17598fe78d7

Tweak map_XXXX_subclass functions.

To cope with subclassed devices, we no longer simply call:

pprocs = dev_proc(dev, get_color_mapping_procs);
pprocs->map_cmyk(dev, ...)

etc. The 'done thing' is to run up the the dev->parent pointers
as far as we can, and to get the color mapping procedures from
that. These color mapping procedures then need to be called
using the dev pointer from which they were fetched.

To do this, we provide get_color_mapping_procs_subclass
and map_XXX_subclass functions that pickle the dev search.

The only downside to this is that we end up doing the search
up the tree twice (or more than twice in the case where we
make several mapping calls).

Here we therefore tweak these functions so that
get_color_mapping_procs_subclass returns both the procs AND
the dev to use when calling them in a structure, and the
map_XXX_subclass functions now take that structure.

Broadly, this change shouldn't actually alter any operation,
other than being slightly more efficient.

There are a few wrinkles:

1) in gsicc_replacecm.c, we were fetching the procs using the
dev chasing function, but calling them using the unchased dev
value. Fixed here to use the matching dev value in both cases.

2) In a couple of places, we have special handling for forwarding
devices. I am not convinced that we handle subclassed forwarding
devices correctly (or devices that forward to subclassed devices).
I have marked these areas with FIXMEs, but they are no worse
now than they were before.

base/gdevdflt.c
base/gdevdgbr.c
base/gdevnfwd.c
base/gscspace.c
base/gsicc_replacecm.c
base/gsovrc.c
base/gspaint.c
base/gxcmap.c
base/gxdcolor.c
base/gxdevcli.h


2017-10-31 17:52:12 +0000
Robin Watts <robin.watts@artifex.com>
961b14dd7e686a1543541070a1ba943590ef2bf9

Optimise handle_colors in gxiscale.c

Avoid per-pixel work by doing as much as possible up front.

base/gxiscale.c


2017-10-31 15:52:49 +0000
Robin Watts <robin.watts@artifex.com>
de645ba2116ecfc71d0fdcea84944735736d0278

Avoid looking up the profile for every pixel of an image.

base/gxiscale.c


2017-10-31 13:07:23 +0000
Robin Watts <robin.watts@artifex.com>
f7b61e0cc56206b6811eee85c4cfd6a0963194e0

Pass device_profile into color concretizing functions.

base/gdevp14.c
base/gscdevn.c
base/gscms.h
base/gscolor2.c
base/gscpixel.c
base/gscsepr.c
base/gscspace.h
base/gsicc.c
base/gsicc_cache.c
base/gsicc_cache.h
base/gxcmap.c
base/gxcspace.h
base/gxiscale.c
devices/vector/gdevpdfg.c


2017-10-27 20:24:32 +0100
Robin Watts <robin.watts@artifex.com>
31cb4cf7aa88784219f6fc2be362a66df2f67289

Tweak cmap functions for speed.

In looking at the Advertising-PowerPoint-A4.pdf file, I noted that
cmap_gray_direct and cmap_gray_halftoned were taking a noticable
amount of time. This commit attempts to alleviate that.

Various observations:

1) Avoid unnecessary loop in cmap_gray_halftoned (and similar functions).

In some of the code, we do:

for (i = 0; i < n; i++)
if (i == k)
do_something_with(i)

why not just use:

if (k < n)
do_something_with(k)

2) Typically functions like cmap_gray_direct do a load of work,
culminating in trying to encode a color value. If that encoding fails,
it would fallback to trying to use a cmap_gray_halftoned, which would
do all the work a second time.

Tweak the code to avoid the call, and hence the repetition.

The downside to this is that the work is typically of the form:

for (i = 0; i < n; i++)
cv[i] = frac2cv(some_calculation_involving(cm_comps[i]));

and in order to be able to avoid the call to cmap_gray_halftoned, we
need to make it:

for (i = 0; i < n; i++) {
cm_comps[i] = some_calculation_involving(cm_comps[i]);
cv[i] = frac2cv(cm_comps[i]);
}

i.e. we have to do more stores than before. This can hurt us in some
cases, but it seems like a worthwhile win, especially in light of 3).

3) A lot of the work in these functions involves mapping colors through
the effective_transfer functions. This happens in code of the form:

for (i = 0; i < n; i++) {
cm_comps[i] = gx_map_color_frac(pgs, cm_comps[i], effective_transfer[i]);
}

If effective_transfer[i] is identity (as it almost always is), then
this whole loop is a nop.

We make some steps to optimise for this case by having the
gx_map_color_frac macro check for effective_transfer[i] being
gs_identity_transfer before calling it, but this doesn't help us
avoid the loop/load/store.

We therefore extend pgs with a count of the number of
'effective_transfer's that are non identity (essentially a flag
that enables us to know if we can skip this loop or not),
and use that to optimise our work.

base/gsht.c
base/gxcmap.c
base/gxgstate.h


2017-10-30 19:31:47 +0000
Robin Watts <robin.watts@artifex.com>
de651aaa531a7eb6fa99c1ef97682ebe22a3cda7

Further optimisations in pdf14_mark_fill_rectangle.

Normal blend mode case is always worth optimising.

base/gxblend.c
base/gxblend.h


2017-10-31 14:11:24 +0000
Robin Watts <robin.watts@artifex.com>
fda23c007c3acb96198648c3f4a65438ce449b63

Squash warnings.

psi/zcolor.c
psi/ztrans.c


2017-10-30 11:08:09 +0000
Ken Sharp <ken.sharp@artifex.com>
76b922b5d3071288edbf8f0cccdbbd2b0ae34742

PDF interpreter - try and catch yet more cases of circular references

No bug report for this one, the customer requested destruction of the
PDF file after analysis, and there was no way to reduce the file to the
point where nothing sensitive remained.

The problem is that a Form XObject referenced a number of Image XObjects
one of which contained a DecodeParms array, where the second element
referenced the original Form XObject. This circular reference leads to
an error.

Here we maintain a dictionary (initially empty) on the stack which we
populate with object numbers as we recursively dereference objects.
When we start a new composite object we copy the array into a new array
which we discard on completion. This is to prevent false detection of
circular references if we dereference multiple composite objects at the
same level (eg if we deal with multiple images, each of which perhaps
contained a reference to the same colour space).

We now issue an error quoting the object number being circularly
referenced, replace the object with a null object and continue.

No differences expected.

Resource/Init/pdf_base.ps


2017-10-27 18:08:34 +0100
Robin Watts <robin.watts@artifex.com>
ecb0181ae2c6c64f876f741ef1da2980324442ca

Use integer maths for bitmap interpolation internals.

We calculate the weights using doubles still, but store them as
integers. This means all the inner loops avoid FP.

base/siscale.c


2017-10-27 16:53:51 +0100
Robin Watts <robin.watts@artifex.com>
b62bfe2c7d166bfe8f3743e122abc755d96bec9c

Unpack/Unroll the inner loops of Mitchell scaler.

base/lib.mak
base/siscale.c


2017-10-26 12:53:29 +0100
Robin Watts <robin.watts@artifex.com>
81561e6e04f49a4b3b9599cc09ba2cde4407e936

Optimise clip_fill_rectangle and family.

Avoid testing for transpose each time, and cope with the common
single rectangle case more efficiently.

This gives a 20% speedup in testing with my cutdown
Advertising-Powerpoint-A4.pdf file going to 1200dpi, 1bpc cmyk.

The only one called here is clip_fill_rectangle, but push the
same optimisations through clip_fill_rectangle_hl_color,
clip_copy_mono, clip_copy_planes etc to help other devices.

base/gxclip.c


2017-10-26 16:00:18 +0100
Ken Sharp <ken.sharp@artifex.com>
0d2177ac781235aa67cde3b6fc9d85030c50a8a9

pdfwrite - take action on an error.

Don't ignore the potential error return from gx_path_current_point()

devices/vector/gdevpdte.c


2017-10-25 15:04:28 +0100
Ken Sharp <ken.sharp@artifex.com>
f13a659f9700fac0a0f47007c1eaacddd5c7f208

improve commit d9d74def0095641f20b46716c929bc6f88154490

There were a couple of places that returned 0 which, after the goto
change, return code. Its just barely possible that code might not be
0, so set it to 0 first.

devices/vector/gdevpdte.c


2017-10-25 14:57:12 +0100
Ken Sharp <ken.sharp@artifex.com>
d9d74def0095641f20b46716c929bc6f88154490

pdfwrite - revisit clipped text and commit 46ef6bc80bd7388883a00aa866af38fe8f05d45b

Bug #698693 "clipped text is selectable in pdf"

Commit 46ef6bc80bd7388883a00aa866af38fe8f05d45b fixed bug 697442, in
that case we needed to completely process text which had been
deliberately placed off the page (and tehrefore outside the clip).

In that bug the text used glyphshow, which meant that it could not use
stringwidth to measure the width of the string, and perform accurate
positioning. So instead it placed the current point off the page,
used glyphshow to draw the text, and then currentpoint to find the
displacement.

By not fully processing the text we did not correctly update currentpoint
and so the text was misplaced. This was fixed by fully processing
the text, but altering a copy of the text enumerator's 'operation'
field so that the text was not added to the page (clearing TEXT_DO_DRAW)

However, there are still places (process_text_modify_width) which can
add the text in, and those look directly at the text enumerator
operation flags.

So here we still copy the operation flags, but we then modify the copy
held in the text enumerator, so that any subsequent processor will
be able to see that the text should not be drawn. At the end of the
function we restore the flags in the enumerator. This has meant a few
places executing a 'goto' in order to reset the flags, instead of simply
returning as previously.

A few test files show extremely minor (1 pixel) positioning differences.

devices/vector/gdevpdte.c


2017-10-24 07:19:39 -0600
Henry Stiles <henry.stiles@artifex.com>
140e1cb28a6ad42e2ded8381af8b53421923e0e1

Fix bug #694630 - Fuzzing Segmentation Fault.

Along with soft fonts, the built in fonts should not be restored when
a macro call completes. The segmentation fault in the report was
caused by a dangling reference to a deleted font after restoring the
built in font dictionary. Also, removes a stale comment.

pcl/pcl/pcsfont.c


2017-10-24 12:13:23 +0100
Chris Liddell <chris.liddell@artifex.com>
434234ef22fd28217045c6485672c93a9685a607

Have configure set memory manager alignment.

For certain Unix derivatives (HP-UX, Solaris, and AIX) we have to use 64 bit
memory alignment - configure will now spot if we are building on and for those
platforms, and set the alignment appropriately.

Cross compiling still defaults to 32 bit, and if 64 bit alignment is required,
it must set explicitly.

configure.ac


2017-10-21 11:01:12 +0100
Ken Sharp <ken.sharp@artifex.com>
5889736af797dcba1d46af11a84b765340f6c3c4

PDF interpreter - improve commit 9e8d2e

We should use .endtransparencytextgroup to close the group started by
.begintransparencytextgroup, not .endtransparencygroup

Oddly this doesn't actually seem to cause any problems, but its not
right.

Resource/Init/pdf_draw.ps


2017-10-20 14:40:21 -0700
Ray Johnston <ray.johnston@artifex.com>
6495e38f2dbaeedcaedf84f15c96e78aab6773c4

Remove useless test in PDF interpreter transparency code

This test was always true since we always have .begintransparencygroup
It was changed in 2008 from a check for .inittransparencymask which was
created back in 2006. It was probably a test in case the PDF interpreter
was running on a system that may not include the pdf14 compositor, but
that is only a guess.

Resource/Init/pdf_ops.ps


2017-10-20 16:14:41 +0100
Ken Sharp <ken.sharp@artifex.com>
9e8d2e156aa3ea039f531e6ea378add4ea6e268c

PDF interpreter - fix annotations with transparency and text

Since the introduction of '.begintransparencytextgroup' the synthesis
of missing Appearances for annotations involving text has been broken.

Approximately since January 2017.

Introducing '.begintransparencytextgroup' fixes the problem.

Resource/Init/pdf_draw.ps


2017-10-20 14:16:44 +0100
Chris Liddell <chris.liddell@artifex.com>
2fc463d0efbd044a8232611f0898eeb12b72a970

Bug 698676: have filenameforall permission check use "reduced" path

Prevents working around SAFER file access permissions.

CVE-2017-15652

psi/zfile.c


2017-10-19 13:01:46 +0100
Robin Watts <robin.watts@artifex.com>
684f73e8deefacb2aa5d2277f3154b68809b2ab7

Bug 698672: Fix new scanconverter/alphabits interaction.

The alphabits mechanism relies on the scan converter not
writing trapezoids so tall as to cause its line buffers
to flush too early.

This is achieved by honoring the max_band_height field in
the device header. Previously the new scan converter was
ignoring this. Here we alter the code to pay attention to
it.

base/gxscanc.c


2017-10-17 12:19:19 -0700
Ray Johnston <ray.johnston@artifex.com>
cc9a66978c56fdfff61bc3b1166955e5506470a9

Fix bug 693304. Restore with pdf14 can cause SEGV

The pdf14 compositor device is retained but the mask_stack (and other
elements of the pdf14_ctx need to be in stable memory to prevent
dangling references after a restore.

base/gdevp14.c


2017-10-18 17:01:01 +0100
Chris Liddell <chris.liddell@artifex.com>
6d048c85f5c75e7539e8b5fc42f5fd856986cc6e

Bug 698669: remove reference to removed example file

Some time ago, we removed the example file chess.ps due to questions over the
license for the font it used.

But the makefile gubbins to "install" the example files wasn't changed to suit,
and on HP-UX (but so far, nothing else!) caused "make install" to error out.

base/unixinst.mak


2017-10-18 14:14:11 +0100
Chris Liddell <chris.liddell@artifex.com>
7da09aaf701bd4ff2acea55aacce84a22455aead

Bug 698647: pdfwrite: avoid cached glyphs for Type 3 font input only

The original fix in 8360852efab5643d93cc3b040832075e199cd205 wrongly assumed
that the changed code only came into effect for Type 3 font *input* where,
in reality, it's for any font for which we have to create a Type 3 in the
output.

The change to disable the use of the cache should only apply to Type 3 input
where we want to force the execution of the BuildGlyph/BuildChar proc so
pdfwrite can capture it.

In all other cases, we need to leave the cache in play.

devices/vector/gdevpdtt.c


2017-10-17 10:16:51 +0100
Ken Sharp <ken.sharp@artifex.com>
9219b1e5febd646f6d87bc424b41237a50529d0d

Page selection device - fix overprint compositor usage

Bug #698568 "Ghostscript segmentation fault when doing page selection"

The PostScript interpreter uses the current device in the graphics
state, and calls the create_compositor() method when overprint is
set to true.

This may or may not insert a new compositor device into the graphics
state, and whether it does or not is controlled by the return from
the method. If the device is the same as the one in the graphics state
then we don't set a new device, if its different then we set the
returned device.

The page selection device wasn't initialising this parameter, and if
we were skipping the page we didn't call the child device method,
which meant we returned an uninitialised pointer to the caller. Since
this was unlikely to be the same as the current device, we ended up
trying to set the device in the graphics state to an uninitialised
pointer, with predictably disastrous results.

The simple fix is to initialise the pointer to the current device in
the graphics state. If we call the child method, and it wants a new
compositor then it will overwrite it, if it doesn't, or we are skipping
the page, then we return the current device and nothing changes.

No differences expected.

base/gdevflp.c


2017-10-13 11:16:40 +0100
Ken Sharp <ken.sharp@artifex.com>
05432a551f887d7526b2bf3c65f3f1740cb3cc48

PDF interpreter - Improve annotation appearance generation

Bug #698627 "PDF 2.0 tests Polygon annotation"
Bug #698629 "PDF 2.0 tests Polyline annotation"
Bug #698630 "PDF 2.0 tests Ink annotation"

This commit refactors the code previously committed for Circle and
Square annotations to make it more general. Adds support for the Polygon,
PolyLine and Ink with /Path array (new to PDF 2.0). Adds support for
transparency in Annotations (some limited support was available before).
Adds the /Line annotation type and implements the Line Ending (/LE)
array, but not other aspects of the Line annotation (these may be added
at a later date).

Bug #698628 "PDF 2.0 tests Redact annotation"

We specifically don't generate an Appearance for Redact annotations, but
will render one if supplied. This annotation is really an interactive
feature, not relevant to print.

Predictably this commit causes differences as we now generate substitute
appearances for more annotation types when the appearance is missing.

Resource/Init/pdf_draw.ps
Resource/Init/pdf_main.ps


2017-10-12 14:16:40 +0000
Chris Liddell <chris.liddell@artifex.com>
9196c7ff8c41f1b256d58696158cd6b99e238459

Always force unsigned chars for Luratech

configure.ac


2017-10-09 13:14:23 +0100
Robin Watts <robin.watts@artifex.com>
6b076c380d4479aa64375baaad59dba6729e2c8f

Fix problems caused by pdf14_compose_group tuning.

It seems that has_mask == 0 does not equate to maskbuf != NULL.

Assuming that mask_mask == 0 => maskbuf == NULL causes problems in
tests_private/pdf/sumatra/fireworks_with_radial_shading.pdf (300dpi
clist renderings in particular) and in
tests_private/pdf/uploads/Bug697212.pdf (all renderings).

base/gxblend.c


2017-10-10 10:14:04 +0100
Ken Sharp <ken.sharp@artifex.com>
f64fa48dc792230244f20f115b8dbe3545f484da

Documentation - remove references to .runandhide

We removed a number of PostScript operators from accessibility after
the interpreter is running as part of the security overhaul. One of
these was .runandhide but we accidentally left a couple of references
in the documentation (the main part of the documentation was correctly
updated).

So remove the references here, and update the documentation to note the
potential risks in using -dNOSAFER with a save object on the exec
stack.

doc/Language.htm
doc/Use.htm


2017-09-12 10:32:51 +0100
Chris Liddell <chris.liddell@artifex.com>
dab8018a344409710b989c31575e6e0e4eb243ce

Bring master up to date with gs922 branch

Update docs dates etc for release

Changelog and news

Update dates/product for 9.22rc2

Changelog for 9.22rc2

Dates, product, changelog for 9.22 release

base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
psi/int.mak
psi/msvc.mak


2017-10-09 11:08:07 +0100
Ken Sharp <ken.sharp@artifex.com>
11f058b7fea07b2a5d2677be3f057cc5ee3e9023

PDF Interpreter - support the /Circle annotation type without an appearance

Bug #698626 "PDF 2.0 tests Circle annotation"

We didn't synthesise an appearance for annotations of type /Circle
when they had no appearance stream. This commit adds that support.

Rather surprisingly, there do not appear to be any files in our test
suite which exercise this. Doubly surprising since I thought all the
release 2 PDF 2.0 FTS files were included and its one of these that
is quoted in the bug report.

Resource/Init/pdf_draw.ps


2017-10-07 13:33:03 +0100
Ken Sharp <ken.sharp@artifex.com>
6db482c183959dbccdc865d8a27cb53b054d3dc1

PDF Interpreter - support the /Square annotation type with no /Appearance

Bug #698625 "PDF 2.0 tests Square annotation type"

We didn't synthesise an appearance for annotations of type /Square
when they had no appearance stream. This commit adds that support.

Rather surprisingly, there do not appear to be any files in our test
suite which exercise this. Doubly surprising since I thought all the
release 2 PDF 2.0 FTS files were included and its one of these that
is quoted in the bug report.

Resource/Init/pdf_draw.ps


2017-10-06 17:23:59 +0100
Ken Sharp <ken.sharp@artifex.com>
83ef35dce760f68019afd1b07bac8118cd9837a2

PDF and PS Interprters and ps2write - fix type 6 halftones & transfers

Bug698621 "PDF 2.0 tests not applying transfer function from halftone"

The halftones in question are defined (by the PDF interpreter) as type
6 halftones, ie file-based threshold arrays.

Rather to my surprise, the reason this didn't work turns out to be
because the PostScript interpreter has never supported transfer functions
with type 6 halftones.

So; add support for transfer functions in type 6 halftones. This exposed
a problem with ps2write (and potentially pdfwrite) when emitting these
transfer functions, instead of simply specifying the object number of
the function, we were writing it out decorated with "/TransferFunction"
which caused ps2write output to fail. So fix that here too.

Remove the 'OBSELETE' comment from the halftone structure, I don't know
who thought this was obselete, but it really does not seem to be.

base/gsht1.c
base/gxht.h
devices/vector/gdevpdfg.c
psi/zht2.c


2017-10-06 14:52:03 +0100
Robin Watts <robin.watts@artifex.com>
45a826638bfc6309a829b38ecf14ff9c21f438ca

Tune pdf14_compose_group inlining.

Pick specific inlinings based upon examination of the data
from the TRACK_COMPOSE_GROUPS defines.

base/gxblend.c


2017-10-05 19:25:41 +0100
Robin Watts <robin.watts@artifex.com>
7b6bce45b1a85266a40844436ea386c4129515f4

Add TRACK_COMPOSE_GROUPS development code.

This enables us to track which combinations of options
are used, and how frequently.

base/gxblend.c


2017-10-05 19:28:23 +0100
Robin Watts <robin.watts@artifex.com>
5e1675e95b0574f9a5f469458e849e1837c33983

Further tweaks to pdf14_mark_fill_rectangle

Avoid having to check for src_alpha == 0 every time around
the loop.

base/gxblend.c


2017-10-05 19:29:07 +0100
Robin Watts <robin.watts@artifex.com>
8c72c12c30553b76b4e2b23261529ec4c6d49b43

Further tweaks to pdf14_preserve_backdrop

Attempt to avoid blanking tag plane when we're about to copy
into it.

base/gxblend1.c


2017-10-05 19:26:15 +0100
Robin Watts <robin.watts@artifex.com>
affab3b5889ce7b8bcb38d0c7c938b907d1e8253

Fix typo.

base/gxblend.c


2017-10-05 14:37:37 +0100
Robin Watts <robin.watts@artifex.com>
882e0bfed09e839d53287164ebf4aa99ca5f116a

Optimise pdf14_mark_fill_rectangle using inlining.

Same tricks as used for pdf14_compose_group.

base/gdevp14.c
base/gxblend.c
base/gxblend.h
base/lib.mak


2017-10-04 17:01:24 +0100
Robin Watts <robin.watts@artifex.com>
77cdf72595643da5d17e84fb72d8f58ccfe3d038

Avoid duplicating code in art_pdf_composite_pixel_alpha8_inline.

We can spot that blend_mode == BLEND_MODE_Normal in the caller,
and set first_spot to 0 in that case. Then we always drop
straight through to the code at the end, and omit the complex
blend call. Reduces code, doesn't change the speed.

base/gxblend.c


2017-10-04 16:54:59 +0100
Robin Watts <robin.watts@artifex.com>
aaccd9b5942aae6738ac02874e627b9e8677f965

Instantiate some more 'optimised' routines for pdf14_group_compose.

The last one of these is the one that gets hammered in the
normal_blend_test.pdf file.

base/gxblend.c


2017-10-04 16:54:23 +0100
Robin Watts <robin.watts@artifex.com>
3dba9682de0b69a8822507a1c11d9f782c33b4c9

Tweak art_pdf_composite_pixel_alpha_8_inline.

Normal blending allows us to not only skip the art_blend_pixel_8_inline
call, but also to simplify the calculations.

base/gxblend.c


2017-10-04 16:52:03 +0100
Robin Watts <robin.watts@artifex.com>
67bae85a6f46190262cf8a6ad6c37c7aff2e6cc5

Introduce forceinline define.

It seems MSVC thinks it knows best about what to inline and what not to.

Use new 'forceinline' define to persuade it to actually do what it is
told. On all non-MSVC compilers this just maps to inline.

base/gxblend.c
base/stdpre.h


2017-10-04 00:39:53 +0100
Robin Watts <robin.watts@artifex.com>
a9f06af39ced9a69f5841ceef3f5e921c34ea5a7

Further optimisation in pdf14_compose_group.

Avoid memcpy's when unnecessary in some of the subfunctions,
by having a 'dst' pointer that points to the results. If
the results are supposed to be the same as the src, don't
copy the source, just reset the dst pointer.

If the dst pointer is set to NULL, then don't copy the results
at all, as it'll be the current values unchanged.

base/gxblend.c


2017-10-03 19:50:33 +0100
Robin Watts <robin.watts@artifex.com>
29e07d407e997a596f682cffa2069e5cea9e3fb4

Use inlining on pdf14_compose_group functions.

We move pdf14_compose_group into gxblend.c to enable us to
make the constituent functions static inlines.

base/gxblend.c
base/gxblend.h
base/gxblend1.c
base/lib.mak


2017-10-03 19:09:00 +0100
Robin Watts <robin.watts@artifex.com>
65c442f7b2c1a91816f9026553004d66dde147ec

Tweak art_pdf_composite_knockout_group_8.

Another case where we can avoid a memcpy by corrupting the source
data we are passed.

base/gxblend.c
base/gxblend.h


2017-10-03 18:45:30 +0100
Robin Watts <robin.watts@artifex.com>
7ef1126569bbdd405f7ef38eb5cd7e4928321f4f

Further optimisations to compose_group.

compose_group calls both art_pdf_recomposite_group_8 and
art_pdf_composite_group_8 next to one another. Both end
(in most cases) by doing an identical call to
art_pdf_composite_pixel_alpha_8.

Tweak the code so that this call happens from the calling
routine (and thus we only have a single call to the routine).
This makes no difference now, but potentially saves when
we start inlining.

The tweaks here to art_pdf_recomposite_group_8 to avoid
using a temporary array, *do* avoid a copy in the common case.

base/gxblend.c
base/gxblend.h
base/gxblend1.c


2017-10-03 18:09:05 +0100
Robin Watts <robin.watts@artifex.com>
8d2a3a5b0f8280449d75ea99ddcadb69259370b6

Tweak art_pdf_recomposite_group_8.

Avoid having to memcpy the input components in the common case,
at the expense of corrupting src[n_chan] in the difficult
case. This is fine, because our only caller never accesses
src[n_chan] again.

base/gxblend.c
base/gxblend.h
base/gxblend1.c


2017-10-03 15:05:38 +0100
Robin Watts <robin.watts@artifex.com>
ab6acb21bfc42194650ff90243e0737b43d81919

Start inlining optimisation of compose_group.

base/gxblend1.c


2017-10-03 13:41:20 +0100
Robin Watts <robin.watts@artifex.com>
8f2d625c260f174d2daa54508f0ff0147c4ad334

Tweak art_pdf_composite_knockout_group_8.

This function has 2 branches, both of which end up with the same
call to art_pdf_knockout_composite_pixel_alpha_8. Tweak the
code so that we only need do one.

No speedup expected, but this paces the way for inlining later.

base/gxblend.c


2017-10-02 20:32:46 +0100
Robin Watts <robin.watts@artifex.com>
83cd299b98510dc87cd3aa27f57a060b268e05ee

Do not overcopy bytes for pdf14 blending.

base/gxblend.c


2017-10-03 16:56:43 +0100
Robin Watts <robin.watts@artifex.com>
88152e5c620bda7d25cd351c765751c619019a58

Tweak art_pdf_composite_pixel_alpha_8.

art_pdf_composite_pixel_alpha_8 is used to blend src and
destination pixels together with a given blend mode.

In the general case, we have n colour compoents, of which the
first n-s are process ones, and the next s are spots (followed
by alpha).

In some cases, we need to blend the first n-s with the given blend
mode, and the remaining s in Normal mode.

This is currently achieved in the code by making 2 different calls
down to art_pdf_composite_pixel_8 for each section of the pixel
(with different 'n' values).

Unfortunately, due to alpha being assumed to be held as the nth
component, this means we need to do a dance where we stash away
a components value, copy the alpha in, call the routine, then
restore the alpha afterwards.

To avoid this, we modify art_pdf_composite_pixel_alpha_8 to take
another int parameter, specifying the position of the first
component that needs to be blended with the Normal mode.

This enables us to simplify the outer routines that call this so
that we have a single call, rather than 3. It also means we don't
recaulate 'scale' etc twice.

I am not expecting any significant speedups from this alone, but
it simplifies the code so that hopefully we might get some in
later commits.

base/gdevp14.c
base/gxblend.c
base/gxblend.h
base/gxblend1.c
base/gxp1fill.c


2017-10-03 16:55:59 +0100
Robin Watts <robin.watts@artifex.com>
5cc958e9c318ffd51223d6794df389b3c19d1aa1

Tweak pdf14 compose group function towards optimisation.

The plan here is to move towards optimised inner loops. The
initial version of these inner loops will be done using
static inline templating. This initial commit won't give
much (if any) improvement, but starts us on the road.

base/gxblend1.c


2017-10-02 17:42:34 +0100
Robin Watts <robin.watts@artifex.com>
b26279df55a77fe2252de803a0e23ff4f703d609

Tweak art_pdf_composite_group_8.

Avoid 2 different calls down to art_pdf_composite_pixel_alpha_8
when 1 will suffice. No expected speed benefit yet.

base/gxblend.c


2017-10-02 14:48:54 +0100
Robin Watts <robin.watts@artifex.com>
463928c19de23164ec61e0fdea119195fa1450f4

Inline versions of art_pdf_union_mul_8 and art_blend_pixel_8.

base/gxblend.c
base/gxblend.h


2017-08-01 12:40:53 +0100
Robin Watts <robin.watts@artifex.com>
4505a7fa04bc89a3f9463b0bcf069210771a8a42

Fix psd spot color handling in bmpcmp.

toolbin/bmpcmp.c


2017-10-05 11:21:40 +0100
Ken Sharp <ken.sharp@artifex.com>
4f830ad24611ea8c88f78e77dd3b250ee3c55251

PDF interpreter - remove accidental debugging

Left some debugging in the SpotFunction array commit, remove it.

Resource/Init/pdf_draw.ps


2017-10-05 11:11:06 +0100
Ken Sharp <ken.sharp@artifex.com>
75463b045f4ea314f1d22b1b63be5e3709ec59aa

PDF Interpreter - support PDF 2.0 SpotFunction arrays

Bug #698620 "PDF 2.0 tests invalid halftones"

This was an oversight on my part, I missed new functionality when
reading the PDF 2.0 specification.

The SpotFunction in a type 1 Halftone can now be a name, function or (new)
an array of names. If its an array we are supposed to check the entries
in turn selecting the first one we recognise. If we don't recognise any
then we should use the default.

Resource/Init/pdf_draw.ps


2017-10-04 15:48:07 +0100
Robin Watts <robin.watts@artifex.com>
3d6168d9bdfe60f77bc60a270945c67e36ac02a3

Tweak pdf14_preserve_backdrop (for speed).

First the current code clears the backdrop, then we copy into it.

In many cases we overwrite exactly the area we just cleared. Spot
this, and avoid it.

We *could* optimise this further in cases where we aren't overwriting
exactly the same region. Wait to see if this is justified.

base/gxblend1.c


2017-10-04 20:07:06 +0100
Robin Watts <robin.watts@artifex.com>
a2532236a8f85101c3d0377dde163071745c53bf

Tweak pdf14_preserve_backdrop (for clarity).

Reduce duplicated code.

Also, ensure that the debugging code that dumps planes actually
dumps the plane that the file modifies.

base/gxblend1.c


2017-10-04 17:15:10 +0100
Ken Sharp <ken.sharp@artifex.com>
df32585f91bb6b1023fef42545cae2419b0e10db

PDF interpreter - permit 0 size font scaling, render nothing

Bug #698619 "PDF 2.0 tests 'zero sized text'"

The PDF 2.0 specification permits font scale of 0 (!), but nothing
should be rendered....

We can't have a font scale of 0, because it breaks our arithmetic, so
we set it to a tiny value, unfortunately this still means that stroking
text rendering modes printed some small garbage.

After a lot of effort with the PDF interpreter, I concluded that there
was no reasonable way to address this in PostScript, as we didn't
retain the font size anywhere and had no reasonable, non-volatile,
place to store it (it needs to respect gsave and grestore).

So in the end I added it to the graphics state and created two new
operators to read and write it (and undefined them after startup).
Its an unfortunately brute-force approach, but it has the benefit of
actually working.

Resource/Init/gs_init.ps
Resource/Init/pdf_ops.ps
base/gsstate.c
base/gsstate.h
base/gxgstate.h
psi/int.mak
psi/zgstate.c


2017-10-04 14:07:11 +0100
Chris Liddell <chris.liddell@artifex.com>
3ea417610c5f0526251ed391bfd117a81c9801e1

Version and dates for jbig2dec release

jbig2dec/CHANGES
jbig2dec/config_win32.h
jbig2dec/configure.ac
jbig2dec/jbig2dec.1


2017-10-03 16:50:56 +0100
Robin Watts <robin.watts@artifex.com>
4a7815f3b929a05ec8b5aaac965d62d5d370dcbe

Fix incorrect group alpha calculation.

In pdf14_compose_group, in the tos_isolated case, for simple
blends, we call art_pdf_composite_group_8 to apply blend_mode
to both process and spots. A side effect of this call is to
update the contents of nos_alpha_g_ptr.

In more complex blends, we split the process and spots into
2 different calls to the same function. The current code
however passes nos_alpha_g_ptr to both however, resulting in
it being updated twice.

Fixed here by making one of them take NULL.

base/gxblend1.c


2017-10-03 10:01:14 +0100
Chris Liddell <chris.liddell@artifex.com>
71e8599455a7befc7a14f6cd1353c9231fb93d48

Bug 698615: pdf_add_ToUnicode() correct size of buffer

We allocate a buffer to store the Unicode value, but failing to account for
the fact that the Unicode value is two bytes, rather than a byte

devices/vector/gdevpdte.c


2017-10-02 16:32:25 +0100
Ken Sharp <ken.sharp@artifex.com>
a015666f7b532c1d9266c4cdef3427e0b50fea90

PDF interpreter - fix default /Decode for Lab images

When we get an image with no /Decode array we create a default one for
it by looking at the image colour space.

For Lab we use the /Range array, but unfortunately this only covers the
a and b channels, not the L. However, L always ranges from 0 - 100 so
here we just pull the Range array apart, add in that range, and create
a new array for the /Decode.

Resource/Init/pdf_draw.ps


2017-09-28 18:04:20 -0600
Henry Stiles <henry.stiles@artifex.com>
9e01cbd5e2d5ce41ae98ea20722ec9a7d452b9e9

Fix buffer overflow regression.

The commit to address 694653 (3749bc274) was incorrect, the
font_data_size variable is not necessarily the size of the buffer.

pcl/pcl/pcsfont.c


2017-09-28 10:08:16 +0100
Ken Sharp <ken.sharp@artifex.com>
eb24ad936776bf69f987e90aad8c7fca78fc2b14

Documentation - spruce up WhatIsGS.htm

Remove references to the obselete GhostSVG

Remove references to MuPDF and MuXPS, MuPDF can easily stand alone now
and its not really part of the Ghostscript family.

doc/WhatIsGS.htm


2017-09-27 08:34:10 -0700
Ray Johnston <ray.johnston@artifex.com>
7e342b5978eb9df875a91980554835362412200d

Revert commit a5a2862d

Even though the commit fixed bug 695280, we noticed that it caused PS
and PDF clist image logic to sometimes take the slow "default" handling
instead of the high-level image path.

To restore the fix for PCL, we could remove the rop3_uses_T altogether,
but we don't know if this will impact PCL performance.

Re-opening bug 695280.

base/gxclimag.c


2017-09-27 16:35:18 +0100
Ken Sharp <ken.sharp@artifex.com>
40deeb89508e1072a4e93441ea58d6332d10fe4c

Documentation - remove reference to obselete switch

Missed this when removing the implementation, PDFDontUseObjectNum is no
longer supported, so remove it from the documentation.

doc/VectorDevices.htm


2017-09-26 13:30:16 -0700
Ray Johnston <ray.johnston@artifex.com>
9bc74fe17f4699ae160564ba3fb281344d53dba6

Fix bug 698560. Transparent pattern-clist playback affected target device

If a transparent pattern was stored as a pattern-clist, changes to the
pdf14_device during playback were applied to the upper level device, but
not restored after the playback. This fixes a long standing problem with
Bug692217.pdf (ELEMENTARY card was to light gray).

base/gdevp14.c


2017-09-22 16:06:18 +0100
Ken Sharp <ken.sharp@artifex.com>
8dd5ae8b9ea8dcae7775edb879f2949e2ee55be5

PDF interpreter - clamp Box to MediaBox, even when MediaBox is negative

When applying the various 'Box' values from a PDF file, we need to clamp
them to the MediaBox values, so that we don't try and extend the final
output to be larger than the Media (this appears to be Acotbat's
behaviour).

But we also need to account for the fact that the media (and therefore
the content) may not lie up and right. Its possible for the media to
be defined with negative height or width.

We deal with that by scaling/translating the CTM, but we weren't
taking it into account when calculating the actual media size, which led
to us calculating the wrong size.

This is more complicated, but we only do it once per page, so the
performance penalty is insignificant.

Resource/Init/pdf_main.ps


2017-09-22 12:36:22 +0100
Chris Liddell <chris.liddell@artifex.com>
819b79e75d8198d16b13c631d6842953f2c6ab81

Bug 698581: Pscript5Idiom: add missing conditional (and bind)

One of the procedures which Pscript5Idiom "patches" was missing an ifelse
meaning, when that idiom was hit, an unexecuted procedure was left on
the stack.

For efficiency and consistency, also bind the entire procedure.

Resource/IdiomSet/Pscript5Idiom


2017-09-22 10:55:10 +0100
Chris Liddell <chris.liddell@artifex.com>
4a0b2e60e3ed23ec1f7f7e0390ce449bef03b8e4

Simpify confusing stack manipulations

The existing code was not wrong, but did several unnecessary stack manipulations
that made it less efficient but, more importantly, confusing.

Also, remove trailing whitespace.

Resource/Init/pdf_ops.ps


2017-09-21 11:27:37 +0100
Chris Liddell <chris.liddell@artifex.com>
000915310197a25ff4acc97f0fa476085698d8fd

Remove pointless free

In an error condition, we were freeing the object that had failed to allocate.

Not a problem with our memory manager, but might cause confusion reading the
code (it did for me!).

base/gdevp14.c


2017-09-21 18:34:32 +0100
Chris Liddell <chris.liddell@artifex.com>
6f9ba1282eeb2537248fea11b686eefffc5b86fc

Fix errors with 6b06b8c854

The stack manipulations with the previous commit were not quite right.

Resource/Init/pdf_ops.ps


2017-09-19 10:41:21 -0700
Michael Vrhel <michael.vrhel@artifex.com>
6b06b8c85451bdf022f1684f633a85980e7c62ee

Bug 698559 avoid double alpha application

When we have a softmask present in the graphic state, we
wrap up the fill or stroke with an isolated transparency
group in the interpreter. After the group is pushed we
should set the opacityalpha and the shapealpha to 1 to
avoid a double application of alpha at the rect-fill level and
the group composition level.

Resource/Init/pdf_ops.ps
base/gxblend1.c


2017-09-21 10:13:16 +0100
Ken Sharp <ken.sharp@artifex.com>
8d57c8c54bd4fe8b5582a31dca69d034743eeacb

pdfwrite - fix compiler warnign

Cast a pointer correctly to avoid a compiler warning.

devices/vector/gdevpdfe.c


2017-09-20 16:48:27 +0100
Robin Watts <robin.watts@artifex.com>
c1ba880345f3c17f828e28d4c42f38798eab73c2

Fix stroke/fill mismatches in 09-37.PS

When 'accurate curves' are requested, ensure we use the same
curve -> line decomposition for both strokes and fills.

base/gxfill.c


2017-09-20 18:33:52 +0100
Robin Watts <robin.watts@artifex.com>
d9f068ae6d612f09dd37915edd56381c6a9167b7

Fix new scan converter glitch with CATX4547.pdf

Page 11 of this file contains details on the revolvers cylinder
rendered by filling zero width vertical lines. For example:

0.165 0.068 0 0.187 scn
506.47 162.99 m
506.47 167.99 l
506.47 162.99 l
f

The new scan converter was incorrectly eliding this. Fixed by
tweaking the edgebuffer filtering logic for any-part-of-a-pixel
mode.

base/gxscanc.c


2017-09-19 18:01:27 +0100
Robin Watts <robin.watts@artifex.com>
fb95f670d3e54befca541dd35c2d7c2fe690ffbd

Fix in*fill etc test files.

The new scan converter has been assuming that anything with an
x coord < 0 is off screen. While this is true for almost every
device I can think of, it need not be true for the hit detection
device used for infill/instroke operations.

Fixed to use INT_MIN here.

base/gxscanc.c


2017-09-20 15:37:19 +0100
Ken Sharp <ken.sharp@artifex.com>
29d1b0b1152324699f63ecf411bf7d590085c403

pdfwrite - fix UTF16 to UTF8 conversion

There was a signed/unsigned error in the arguments to this routine,
which meant that bytes with the top bit set caused the whole UTF16
short to become negative as well.

Fixed here.

devices/vector/gdevpdfe.c


2017-09-19 17:43:25 +0100
Chris Liddell <chris.liddell@artifex.com>
c49536553df8eef02c6b0fbf1a46eeb2d086859d

Write initial device error to stderr

As the "Unable to open the initial device, quitting." occurs outside the
Postscript error handling auspices, and causes Ghostscript to quit in a
possibly unexpected way, write it to stderr rather than stdout.

Resource/Init/gs_init.ps


2017-09-19 13:59:56 +0100
Ken Sharp <ken.sharp@artifex.com>
085fc4933e5169176124922925f6cc6b454ac03e

PS interpreter - set EPSCrop when EPSFitPage is set

Bug #698555 "using DEVICE[WIDTH|HEIGHT]POINTS results in blank image"

The reporter had not set -dEPSCrop which resulted in no PageSize
request being sent to the interpreter (because EPS files are note
permitted to set PageSize). Which defeats the use of PageSize Policy
13 to scale the page.

Since anyone using EPSFitPage clearly wants to scale the page to the EPS
BoundingBox, we may as well set EPSCrop in case they don't.

NB the original reporter had not set -dFIXEDMEDIA either...

Resource/Init/gs_init.ps


2017-09-17 18:34:59 +0100
Ken Sharp <ken.sharp@artifex.com>
fc08a2810b1594ce865190763a7831704c00846d

pdfwrite - properly process Octal 134 '\' in pdfmark UTF16 string

Bug #698552 "Some PDF outline UTF-16 text is broken"

The escape processing wasn't catering for an escaped escape '\\' which
led to us writing the escaped escape direclty and corrupted the remainder
of the string. We normaly don't use short escapes but write ocral,
because some versions of Acrobat can't handle the short escapes.

This commit just processes the '\\' properly, as per the other
escapes.

devices/vector/gdevpdfm.c


2017-09-17 11:46:03 +0100
Ken Sharp <ken.sharp@artifex.com>
275d9547b89aa17dc3a3d9441f712dfdfd344201

Coverity ID 172798

We hadn't assigned the return value to the variable 'code' but were
using it (asigned earlier in the code) to action a return.

Fixed by actually assigning the value to the variable.

base/gxshade1.c


2017-09-16 23:34:04 +0100
Ken Sharp <ken.sharp@artifex.com>
ce4bbbde09d087fe3af7036c1fc3f0a38f30c19e

PDF interpreter - more work on images with invalid /Mask

Commit 119ec77d4e44e3861a376323ed14466b28b2f4bf fixed one case of a
/Mask array with invalid values by treating DeviceGray the same as
/Indexed. However, while that worked for the particular file in question
(Bug #697919) it caused a regression with Bug689717 which I somehow
missed at the time.

This commit treats DeviceGray differently to Indexed spaces and
clamps the value to either 0 or 1 for 1 BPC images. This seems to work
as per Acrobat for both files.

Resource/Init/pdf_draw.ps


2017-09-15 18:24:44 -0500
Robin Watts <Robin.Watts@artifex.com>
7914df697a40314e35847f4e1faca5c964c19e84

Bug 696399: Fix buffer overflow in image scaling.

Patch calculation that overflows when x_extent is very
negative.

base/gxifast.c


2017-09-15 14:28:28 -0700
Robin Watts <Robin.Watts@artifex.com>
176f0c2f9632b2167cbdd3a3ab44435af3b0bb64

Remove stray memsets left in from previous commit.

The "Bug 698427: Fix ignoring errors that lead to division by
zero." commit contained stray memsets.

base/gxshade1.c


2017-09-15 13:04:06 -0700
Robin Watts <Robin.Watts@artifex.com>
11a0bc253157ff84be1ef8d065d3ccbf8d377280

Bug 698427: Fix ignoring errors that lead to division by zero.

By ignoring error return values, we continue running with
uninitialised data, leading to division by zero.

base/gxshade1.c


2017-09-15 10:58:11 -0500
Robin Watts <Robin.Watts@artifex.com>
887026173a2200dba9cb5eed39200f8f1e44cc7a

Coverity #135034: Simplify code.

The while loop is not strictly required (but it does match
the other cases). Simplified here.

base/gxscanc.c


2017-09-15 10:47:54 -0500
Robin Watts <Robin.Watts@artifex.com>
d7804bfc4d6bdd863137073bdc4f935c960a8f1d

Coverity #135037: Fix unused variable.

Don't read a value we don't use.

base/gxscanc.c


2017-09-05 14:52:07 +0100
Chris Liddell <chris.liddell@artifex.com>
e289916162ce817275e05c536525954028e7d2bc

Coverity ID# 135035

Remove pointless "upgraded_copypage" code properly.

The previous commit for this removed code that it should not have done

base/gdevprn.c


2017-09-15 13:42:00 +0100
Chris Liddell <chris.liddell@artifex.com>
b3de06e71037a6abcf4546fa7d53a00a3ce47cc3

Revert "Coverity ID# 135035"

This reverts commit 05c3de8915fafb65b96ba0860523a7a79e2577e2.

base/gdevprn.c


2017-09-14 22:40:30 +0100
Chris Liddell <chris.liddell@artifex.com>
b76a38bc57de9085474474fc3de5ec295c9aec21

Remove man pages for removed (obsolete) tools

(Reported against 9.22 rc1)

doc/gs-vms.hlp
man/de/font2c.1
man/de/wftopfa.1
man/font2c.1
man/gs.1
man/wftopfa.1


2017-09-14 07:01:32 +0100
Chris Liddell <chris.liddell@artifex.com>
6bf33a5d01518dcba8e957299a91a68d871f2b0b

White space issues reported against 9.22 rc1

It seems newer gcc versions (6.4.x and later) report indentation "problems".

Also, add a cast to ensure bitshift op is done on an unsigned value.

base/gsbitops.c
base/gsicc_create.c
base/gxclread.c
contrib/gdevbjca.c
contrib/gdevdj9.c
devices/gdevepsc.c
pcl/pxl/pxpaint.c
psi/dscparse.c
psi/zcrd.c


2017-09-14 06:41:33 +0100
Chris Liddell <chris.liddell@artifex.com>
d26d2bb23f2d8867d99d5f1fa08a37d3f131e1ad

Bug 698532: replace ijs/ltmain.sh symlink with file

ijs/ltmain.sh


2017-09-13 08:43:38 +0100
Chris Liddell <chris.liddell@artifex.com>
cadd9e5faede555fade5e7e8f447de8f40e5c5e9

Remove reference to old wisc site in Readme.htm
S

doc/Readme.htm


2017-09-12 10:27:23 +0100
Chris Liddell <chris.liddell@artifex.com>
67b24cbd748db9d96061f476f42c87bd452a496e

Bump version number for release

Resource/Init/gs_init.ps
base/version.mak


2017-09-12 11:17:15 +0100
Ken Sharp <ken.sharp@artifex.com>
95cb9ab7b4ef15bf60bd074220906f9eda145916

Remove unused variable 'pdev' to silence compiler warning

base/gdevp14.c


2017-10-04 09:50:33 +0100
Chris Liddell <chris.liddell@artifex.com>
ba50b3c6061d35275b7067204da6f032fb46cf62

Dates, product, changelog for 9.22 release

base/gscdef.c
base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2017-10-03 10:01:14 +0100
Chris Liddell <chris.liddell@artifex.com>
dcba89978e3cd6e8e55b44e0830594a385a8e07e

Bug 698615: pdf_add_ToUnicode() correct size of buffer

We allocate a buffer to store the Unicode value, but failing to account for
the fact that the Unicode value is two bytes, rather than a byte

devices/vector/gdevpdte.c


2017-10-02 16:32:25 +0100
Ken Sharp <ken.sharp@artifex.com>
5751e508f72238c1fcaad1a4c284aa875542dd70

PDF interpreter - fix default /Decode for Lab images

When we get an image with no /Decode array we create a default one for
it by looking at the image colour space.

For Lab we use the /Range array, but unfortunately this only covers the
a and b channels, not the L. However, L always ranges from 0 - 100 so
here we just pull the Range array apart, add in that range, and create
a new array for the /Decode.

Resource/Init/pdf_draw.ps


2017-09-28 18:04:20 -0600
Henry Stiles <henry.stiles@artifex.com>
3c2974bcd2e638be13c0ec814342a1a35ca0872b

Fix buffer overflow regression.

The commit to address 694653 (3749bc274) was incorrect, the
font_data_size variable is not necessarily the size of the buffer.

pcl/pcl/pcsfont.c


2017-09-28 11:37:57 +0100
Chris Liddell <chris.liddell@artifex.com>
f1d39c92bff2de2d7b270a419a907c935ea626a6

Changelog for 9.22rc2

doc/History9.htm


2017-09-28 11:35:58 +0100
Chris Liddell <chris.liddell@artifex.com>
b1eda05a9fa7327e76b9a4af980d05da9e926e7f

Update dates/product for 9.22rc2

base/gscdef.c
base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2017-09-28 10:08:16 +0100
Ken Sharp <ken.sharp@artifex.com>
d59e4b57e1807e934ed1dde51e628f84dfb8caa7

Documentation - spruce up WhatIsGS.htm

Remove references to the obselete GhostSVG

Remove references to MuPDF and MuXPS, MuPDF can easily stand alone now
and its not really part of the Ghostscript family.

doc/WhatIsGS.htm


2017-09-27 08:34:10 -0700
Ray Johnston <ray.johnston@artifex.com>
a6830a293f9a69caf50777bb6ee7b553589c0a08

Revert commit a5a2862d

Even though the commit fixed bug 695280, we noticed that it caused PS
and PDF clist image logic to sometimes take the slow "default" handling
instead of the high-level image path.

To restore the fix for PCL, we could remove the rop3_uses_T altogether,
but we don't know if this will impact PCL performance.

Re-opening bug 695280.

base/gxclimag.c


2017-09-27 16:35:18 +0100
Ken Sharp <ken.sharp@artifex.com>
c10d5ada53245dac13436d663d3dbe265bc9e11a

Documentation - remove reference to obselete switch

Missed this when removing the implementation, PDFDontUseObjectNum is no
longer supported, so remove it from the documentation.

doc/VectorDevices.htm


2017-09-26 13:30:16 -0700
Ray Johnston <ray.johnston@artifex.com>
ccaaa1fd02f1cedf221bd6a34e5eb0ef64ef8f3f

Fix bug 698560. Transparent pattern-clist playback affected target device

If a transparent pattern was stored as a pattern-clist, changes to the
pdf14_device during playback were applied to the upper level device, but
not restored after the playback. This fixes a long standing problem with
Bug692217.pdf (ELEMENTARY card was to light gray).

base/gdevp14.c


2017-09-22 16:06:18 +0100
Ken Sharp <ken.sharp@artifex.com>
c470609a95c3ba5d531da463df7a98da01998452

PDF interpreter - clamp Box to MediaBox, even when MediaBox is negative

When applying the various 'Box' values from a PDF file, we need to clamp
them to the MediaBox values, so that we don't try and extend the final
output to be larger than the Media (this appears to be Acotbat's
behaviour).

But we also need to account for the fact that the media (and therefore
the content) may not lie up and right. Its possible for the media to
be defined with negative height or width.

We deal with that by scaling/translating the CTM, but we weren't
taking it into account when calculating the actual media size, which led
to us calculating the wrong size.

This is more complicated, but we only do it once per page, so the
performance penalty is insignificant.

Resource/Init/pdf_main.ps


2017-09-22 12:36:22 +0100
Chris Liddell <chris.liddell@artifex.com>
ad87c56e9e88907854d4c37f1a80d8f5d06fb8a7

Bug 698581: Pscript5Idiom: add missing conditional (and bind)

One of the procedures which Pscript5Idiom "patches" was missing an ifelse
meaning, when that idiom was hit, an unexecuted procedure was left on
the stack.

For efficiency and consistency, also bind the entire procedure.

Resource/IdiomSet/Pscript5Idiom


2017-09-22 10:55:10 +0100
Chris Liddell <chris.liddell@artifex.com>
9ae11d7a06c216eae554bcc7696028e69c4bc7ee

Simpify confusing stack manipulations

The existing code was not wrong, but did several unnecessary stack manipulations
that made it less efficient but, more importantly, confusing.

Also, remove trailing whitespace.

Resource/Init/pdf_ops.ps


2017-09-21 11:27:37 +0100
Chris Liddell <chris.liddell@artifex.com>
d644437adb7833a2c511d143c13e757383106378

Remove pointless free

In an error condition, we were freeing the object that had failed to allocate.

Not a problem with our memory manager, but might cause confusion reading the
code (it did for me!).

base/gdevp14.c


2017-09-21 18:34:32 +0100
Chris Liddell <chris.liddell@artifex.com>
8760a38e4ca49ce403cb362ecb4d6b4d247587f1

Fix errors with 6b06b8c854

The stack manipulations with the previous commit were not quite right.

Resource/Init/pdf_ops.ps


2017-09-19 10:41:21 -0700
Michael Vrhel <michael.vrhel@artifex.com>
cc966e7f9029c27abc896431a3c4910b40d915ef

Bug 698559 avoid double alpha application

When we have a softmask present in the graphic state, we
wrap up the fill or stroke with an isolated transparency
group in the interpreter. After the group is pushed we
should set the opacityalpha and the shapealpha to 1 to
avoid a double application of alpha at the rect-fill level and
the group composition level.

Resource/Init/pdf_ops.ps
base/gxblend1.c


2017-09-21 10:13:16 +0100
Ken Sharp <ken.sharp@artifex.com>
c03add9e9caaa4958928f74a6ca4f2b71915063c

pdfwrite - fix compiler warnign

Cast a pointer correctly to avoid a compiler warning.

devices/vector/gdevpdfe.c


2017-09-20 16:48:27 +0100
Robin Watts <robin.watts@artifex.com>
2285580852e74940a4596b754739ba45a03b40d0

Fix stroke/fill mismatches in 09-37.PS

When 'accurate curves' are requested, ensure we use the same
curve -> line decomposition for both strokes and fills.

base/gxfill.c


2017-09-20 18:33:52 +0100
Robin Watts <robin.watts@artifex.com>
0803369908a0b4b24b215881e4c4a4ecc5de61c2

Fix new scan converter glitch with CATX4547.pdf

Page 11 of this file contains details on the revolvers cylinder
rendered by filling zero width vertical lines. For example:

0.165 0.068 0 0.187 scn
506.47 162.99 m
506.47 167.99 l
506.47 162.99 l
f

The new scan converter was incorrectly eliding this. Fixed by
tweaking the edgebuffer filtering logic for any-part-of-a-pixel
mode.

base/gxscanc.c


2017-09-19 18:01:27 +0100
Robin Watts <robin.watts@artifex.com>
03ac50df18eb12d40de1615d18730fdd077f605b

Fix in*fill etc test files.

The new scan converter has been assuming that anything with an
x coord < 0 is off screen. While this is true for almost every
device I can think of, it need not be true for the hit detection
device used for infill/instroke operations.

Fixed to use INT_MIN here.

base/gxscanc.c


2017-09-20 15:37:19 +0100
Ken Sharp <ken.sharp@artifex.com>
4bb7249ce9320c566da5dac3901c41c7965d37d8

pdfwrite - fix UTF16 to UTF8 conversion

There was a signed/unsigned error in the arguments to this routine,
which meant that bytes with the top bit set caused the whole UTF16
short to become negative as well.

Fixed here.

devices/vector/gdevpdfe.c


2017-09-19 17:43:25 +0100
Chris Liddell <chris.liddell@artifex.com>
f2f9ed2897a4cf166c1df50422b2e82ad2422947

Write initial device error to stderr

As the "Unable to open the initial device, quitting." occurs outside the
Postscript error handling auspices, and causes Ghostscript to quit in a
possibly unexpected way, write it to stderr rather than stdout.

Resource/Init/gs_init.ps


2017-09-19 13:59:56 +0100
Ken Sharp <ken.sharp@artifex.com>
5fc5b64a6cd3917326479d3d3a0546dca0feef3c

PS interpreter - set EPSCrop when EPSFitPage is set

Bug #698555 "using DEVICE[WIDTH|HEIGHT]POINTS results in blank image"

The reporter had not set -dEPSCrop which resulted in no PageSize
request being sent to the interpreter (because EPS files are note
permitted to set PageSize). Which defeats the use of PageSize Policy
13 to scale the page.

Since anyone using EPSFitPage clearly wants to scale the page to the EPS
BoundingBox, we may as well set EPSCrop in case they don't.

NB the original reporter had not set -dFIXEDMEDIA either...

Resource/Init/gs_init.ps


2017-09-17 18:34:59 +0100
Ken Sharp <ken.sharp@artifex.com>
6e317f178c7fe7c81b573598f848acf8487e4e45

pdfwrite - properly process Octal 134 '\' in pdfmark UTF16 string

Bug #698552 "Some PDF outline UTF-16 text is broken"

The escape processing wasn't catering for an escaped escape '\\' which
led to us writing the escaped escape direclty and corrupted the remainder
of the string. We normaly don't use short escapes but write ocral,
because some versions of Acrobat can't handle the short escapes.

This commit just processes the '\\' properly, as per the other
escapes.

devices/vector/gdevpdfm.c


2017-09-17 11:46:03 +0100
Ken Sharp <ken.sharp@artifex.com>
122808aa46118d483c2fe431d5382c88cdd6e735

Coverity ID 172798

We hadn't assigned the return value to the variable 'code' but were
using it (asigned earlier in the code) to action a return.

Fixed by actually assigning the value to the variable.

base/gxshade1.c


2017-09-16 23:34:04 +0100
Ken Sharp <ken.sharp@artifex.com>
087abbc55390499ca27823afbe7d1b62b4ff4f8e

PDF interpreter - more work on images with invalid /Mask

Commit 119ec77d4e44e3861a376323ed14466b28b2f4bf fixed one case of a
/Mask array with invalid values by treating DeviceGray the same as
/Indexed. However, while that worked for the particular file in question
(Bug #697919) it caused a regression with Bug689717 which I somehow
missed at the time.

This commit treats DeviceGray differently to Indexed spaces and
clamps the value to either 0 or 1 for 1 BPC images. This seems to work
as per Acrobat for both files.

Resource/Init/pdf_draw.ps


2017-09-15 18:24:44 -0500
Robin Watts <Robin.Watts@artifex.com>
f1ccd5e2c82eb137abb7af000e93447653093a4d

Bug 696399: Fix buffer overflow in image scaling.

Patch calculation that overflows when x_extent is very
negative.

base/gxifast.c


2017-09-15 14:28:28 -0700
Robin Watts <Robin.Watts@artifex.com>
a768ec17b12e44b20d555f3c2fc2c5dcde3d9f0b

Remove stray memsets left in from previous commit.

The "Bug 698427: Fix ignoring errors that lead to division by
zero." commit contained stray memsets.

base/gxshade1.c


2017-09-15 13:04:06 -0700
Robin Watts <Robin.Watts@artifex.com>
45e4bcf4992c6c22e942730f5df393fc6b4cab63

Bug 698427: Fix ignoring errors that lead to division by zero.

By ignoring error return values, we continue running with
uninitialised data, leading to division by zero.

base/gxshade1.c


2017-09-15 10:58:11 -0500
Robin Watts <Robin.Watts@artifex.com>
1b18e15f10532d584c6fc2191e1b2a3f8e5ba7e5

Coverity #135034: Simplify code.

The while loop is not strictly required (but it does match
the other cases). Simplified here.

base/gxscanc.c


2017-09-15 10:47:54 -0500
Robin Watts <Robin.Watts@artifex.com>
6fb9174c1517143158781ed37e0c6d6eb9321808

Coverity #135037: Fix unused variable.

Don't read a value we don't use.

base/gxscanc.c


2017-09-05 14:52:07 +0100
Chris Liddell <chris.liddell@artifex.com>
228ac64b768ac3df1bcd5f63e3f353f8fd01e372

Coverity ID# 135035

Remove pointless "upgraded_copypage" code properly.

The previous commit for this removed code that it should not have done

base/gdevprn.c


2017-09-15 13:42:00 +0100
Chris Liddell <chris.liddell@artifex.com>
3f9d3e1392236fef4658c8dcad15385670d6831e

Revert "Coverity ID# 135035"

This reverts commit 05c3de8915fafb65b96ba0860523a7a79e2577e2.

base/gdevprn.c


2017-09-14 22:40:30 +0100
Chris Liddell <chris.liddell@artifex.com>
12ff84c1ff077c737b0a194761a370de079943fd

Remove man pages for removed (obsolete) tools

(Reported against 9.22 rc1)

doc/gs-vms.hlp
man/de/font2c.1
man/de/wftopfa.1
man/font2c.1
man/gs.1
man/wftopfa.1


2017-09-14 07:01:32 +0100
Chris Liddell <chris.liddell@artifex.com>
7df9b3d9b0dabd9854731fab796d5d458cf743f7

White space issues reported against 9.22 rc1

It seems newer gcc versions (6.4.x and later) report indentation "problems".

Also, add a cast to ensure bitshift op is done on an unsigned value.

base/gsbitops.c
base/gsicc_create.c
base/gxclread.c
contrib/gdevbjca.c
contrib/gdevdj9.c
devices/gdevepsc.c
pcl/pxl/pxpaint.c
psi/dscparse.c
psi/zcrd.c


2017-09-14 06:41:33 +0100
Chris Liddell <chris.liddell@artifex.com>
9e56aafaf2fc8fe3ffeefc0d13fa8c1b033ddec8

Bug 698532: replace ijs/ltmain.sh symlink with file

ijs/ltmain.sh


2017-09-13 08:43:38 +0100
Chris Liddell <chris.liddell@artifex.com>
98e115748ec4b16c610396b9444c1d82d263a30c

Remove reference to old wisc site in Readme.htm
S

doc/Readme.htm


2017-09-12 11:17:15 +0100
Ken Sharp <ken.sharp@artifex.com>
4241a4b3a7099cddac36d13f6c67054483eb7511

Remove unused variable 'pdev' to silence compiler warning

base/gdevp14.c


2017-09-12 11:16:30 +0100
Chris Liddell <chris.liddell@artifex.com>
29be703c9762714a47f67947d6dfb9efd6c6bc29

Changelog and news

doc/History9.htm
doc/News.htm


2017-09-12 10:32:51 +0100
Chris Liddell <chris.liddell@artifex.com>
85e04afbc2c80c8c6b129aff2741cbdf4d41ff67

Update docs dates etc for release

doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/font2c.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
man/wftopfa.1
psi/int.mak
psi/msvc.mak


2017-09-12 10:30:01 +0100
Chris Liddell <chris.liddell@artifex.com>
43561187cdb501ac1c6184082065647253d9336c

Product string and date for release

base/gscdef.c
base/version.mak



Version 9.22 (2017-10-04)

This is the sixteeth full release in the stable 9.x series.

Highlights in this release include:

  • Ghostscript can now consume and produce (via the pdfwrite device) PDF 2.0 compliant files.

  • The main focus of this release has been security and code cleanliness. Hence many AddressSanitizer, Valgrind and Coverity issues have been addressed.

  • The usual round of bug fixes, compatibility changes, and incremental improvements.

For a list of open issues, or to report problems, please visit bugs.ghostscript.com.

Incompatible changes

  • The planned device API tidy (still!) did not happen for this release, due to time pressures, but we still intend to undertake the following: We plan to somewhat tidy up the device API. We intend to remove deprecated device procs (methods/function pointers) and change the device API so every device proc takes a graphics state parameter (rather than the current scheme where only a very few procs take an imager state parameter). This should serve as notice to anyone maintaining a Ghostscript device outside the canonical source tree that you may (probably will) need to update your device(s) when these changes happen. Devices using only the non-deprecated procs should be trivial to update.

Changelog

2017-10-03 10:01:14 +0100
Chris Liddell <chris.liddell@artifex.com>
dcba89978e3cd6e8e55b44e0830594a385a8e07e

Bug 698615: pdf_add_ToUnicode() correct size of buffer

We allocate a buffer to store the Unicode value, but failing to account for
the fact that the Unicode value is two bytes, rather than a byte

devices/vector/gdevpdte.c


2017-10-02 16:32:25 +0100
Ken Sharp <ken.sharp@artifex.com>
5751e508f72238c1fcaad1a4c284aa875542dd70

PDF interpreter - fix default /Decode for Lab images

When we get an image with no /Decode array we create a default one for
it by looking at the image colour space.

For Lab we use the /Range array, but unfortunately this only covers the
a and b channels, not the L. However, L always ranges from 0 - 100 so
here we just pull the Range array apart, add in that range, and create
a new array for the /Decode.

Resource/Init/pdf_draw.ps


2017-09-28 18:04:20 -0600
Henry Stiles <henry.stiles@artifex.com>
3c2974bcd2e638be13c0ec814342a1a35ca0872b

Fix buffer overflow regression.

The commit to address 694653 (3749bc274) was incorrect, the
font_data_size variable is not necessarily the size of the buffer.

pcl/pcl/pcsfont.c


2017-09-28 11:35:58 +0100
Chris Liddell <chris.liddell@artifex.com>
b1eda05a9fa7327e76b9a4af980d05da9e926e7f

Update dates/product for 9.22rc2

base/gscdef.c
base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2017-09-28 10:08:16 +0100
Ken Sharp <ken.sharp@artifex.com>
d59e4b57e1807e934ed1dde51e628f84dfb8caa7

Documentation - spruce up WhatIsGS.htm

Remove references to the obselete GhostSVG

Remove references to MuPDF and MuXPS, MuPDF can easily stand alone now
and its not really part of the Ghostscript family.

doc/WhatIsGS.htm


2017-09-27 08:34:10 -0700
Ray Johnston <ray.johnston@artifex.com>
a6830a293f9a69caf50777bb6ee7b553589c0a08

Revert commit a5a2862d

Even though the commit fixed bug 695280, we noticed that it caused PS
and PDF clist image logic to sometimes take the slow "default" handling
instead of the high-level image path.

To restore the fix for PCL, we could remove the rop3_uses_T altogether,
but we don't know if this will impact PCL performance.

Re-opening bug 695280.

base/gxclimag.c


2017-09-27 16:35:18 +0100
Ken Sharp <ken.sharp@artifex.com>
c10d5ada53245dac13436d663d3dbe265bc9e11a

Documentation - remove reference to obselete switch

Missed this when removing the implementation, PDFDontUseObjectNum is no
longer supported, so remove it from the documentation.

doc/VectorDevices.htm


2017-09-26 13:30:16 -0700
Ray Johnston <ray.johnston@artifex.com>
ccaaa1fd02f1cedf221bd6a34e5eb0ef64ef8f3f

Fix bug 698560. Transparent pattern-clist playback affected target device

If a transparent pattern was stored as a pattern-clist, changes to the
pdf14_device during playback were applied to the upper level device, but
not restored after the playback. This fixes a long standing problem with
Bug692217.pdf (ELEMENTARY card was to light gray).

base/gdevp14.c


2017-09-22 16:06:18 +0100
Ken Sharp <ken.sharp@artifex.com>
c470609a95c3ba5d531da463df7a98da01998452

PDF interpreter - clamp Box to MediaBox, even when MediaBox is negative

When applying the various 'Box' values from a PDF file, we need to clamp
them to the MediaBox values, so that we don't try and extend the final
output to be larger than the Media (this appears to be Acotbat's
behaviour).

But we also need to account for the fact that the media (and therefore
the content) may not lie up and right. Its possible for the media to
be defined with negative height or width.

We deal with that by scaling/translating the CTM, but we weren't
taking it into account when calculating the actual media size, which led
to us calculating the wrong size.

This is more complicated, but we only do it once per page, so the
performance penalty is insignificant.

Resource/Init/pdf_main.ps


2017-09-22 12:36:22 +0100
Chris Liddell <chris.liddell@artifex.com>
ad87c56e9e88907854d4c37f1a80d8f5d06fb8a7

Bug 698581: Pscript5Idiom: add missing conditional (and bind)

One of the procedures which Pscript5Idiom "patches" was missing an ifelse
meaning, when that idiom was hit, an unexecuted procedure was left on
the stack.

For efficiency and consistency, also bind the entire procedure.

Resource/IdiomSet/Pscript5Idiom


2017-09-22 10:55:10 +0100
Chris Liddell <chris.liddell@artifex.com>
9ae11d7a06c216eae554bcc7696028e69c4bc7ee

Simpify confusing stack manipulations

The existing code was not wrong, but did several unnecessary stack manipulations
that made it less efficient but, more importantly, confusing.

Also, remove trailing whitespace.

Resource/Init/pdf_ops.ps


2017-09-21 11:27:37 +0100
Chris Liddell <chris.liddell@artifex.com>
d644437adb7833a2c511d143c13e757383106378

Remove pointless free

In an error condition, we were freeing the object that had failed to allocate.

Not a problem with our memory manager, but might cause confusion reading the
code (it did for me!).

base/gdevp14.c


2017-09-21 18:34:32 +0100
Chris Liddell <chris.liddell@artifex.com>
8760a38e4ca49ce403cb362ecb4d6b4d247587f1

Fix errors with 6b06b8c854

The stack manipulations with the previous commit were not quite right.

Resource/Init/pdf_ops.ps


2017-09-19 10:41:21 -0700
Michael Vrhel <michael.vrhel@artifex.com>
cc966e7f9029c27abc896431a3c4910b40d915ef

Bug 698559 avoid double alpha application

When we have a softmask present in the graphic state, we
wrap up the fill or stroke with an isolated transparency
group in the interpreter. After the group is pushed we
should set the opacityalpha and the shapealpha to 1 to
avoid a double application of alpha at the rect-fill level and
the group composition level.

Resource/Init/pdf_ops.ps
base/gxblend1.c


2017-09-21 10:13:16 +0100
Ken Sharp <ken.sharp@artifex.com>
c03add9e9caaa4958928f74a6ca4f2b71915063c

pdfwrite - fix compiler warnign

Cast a pointer correctly to avoid a compiler warning.

devices/vector/gdevpdfe.c


2017-09-20 16:48:27 +0100
Robin Watts <robin.watts@artifex.com>
2285580852e74940a4596b754739ba45a03b40d0

Fix stroke/fill mismatches in 09-37.PS

When 'accurate curves' are requested, ensure we use the same
curve -> line decomposition for both strokes and fills.

base/gxfill.c


2017-09-20 18:33:52 +0100
Robin Watts <robin.watts@artifex.com>
0803369908a0b4b24b215881e4c4a4ecc5de61c2

Fix new scan converter glitch with CATX4547.pdf

Page 11 of this file contains details on the revolvers cylinder
rendered by filling zero width vertical lines. For example:

0.165 0.068 0 0.187 scn
506.47 162.99 m
506.47 167.99 l
506.47 162.99 l
f

The new scan converter was incorrectly eliding this. Fixed by
tweaking the edgebuffer filtering logic for any-part-of-a-pixel
mode.

base/gxscanc.c


2017-09-19 18:01:27 +0100
Robin Watts <robin.watts@artifex.com>
03ac50df18eb12d40de1615d18730fdd077f605b

Fix in*fill etc test files.

The new scan converter has been assuming that anything with an
x coord < 0 is off screen. While this is true for almost every
device I can think of, it need not be true for the hit detection
device used for infill/instroke operations.

Fixed to use INT_MIN here.

base/gxscanc.c


2017-09-20 15:37:19 +0100
Ken Sharp <ken.sharp@artifex.com>
4bb7249ce9320c566da5dac3901c41c7965d37d8

pdfwrite - fix UTF16 to UTF8 conversion

There was a signed/unsigned error in the arguments to this routine,
which meant that bytes with the top bit set caused the whole UTF16
short to become negative as well.

Fixed here.

devices/vector/gdevpdfe.c


2017-09-19 17:43:25 +0100
Chris Liddell <chris.liddell@artifex.com>
f2f9ed2897a4cf166c1df50422b2e82ad2422947

Write initial device error to stderr

As the "Unable to open the initial device, quitting." occurs outside the
Postscript error handling auspices, and causes Ghostscript to quit in a
possibly unexpected way, write it to stderr rather than stdout.

Resource/Init/gs_init.ps


2017-09-19 13:59:56 +0100
Ken Sharp <ken.sharp@artifex.com>
5fc5b64a6cd3917326479d3d3a0546dca0feef3c

PS interpreter - set EPSCrop when EPSFitPage is set

Bug #698555 "using DEVICE[WIDTH|HEIGHT]POINTS results in blank image"

The reporter had not set -dEPSCrop which resulted in no PageSize
request being sent to the interpreter (because EPS files are note
permitted to set PageSize). Which defeats the use of PageSize Policy
13 to scale the page.

Since anyone using EPSFitPage clearly wants to scale the page to the EPS
BoundingBox, we may as well set EPSCrop in case they don't.

NB the original reporter had not set -dFIXEDMEDIA either...

Resource/Init/gs_init.ps


2017-09-17 18:34:59 +0100
Ken Sharp <ken.sharp@artifex.com>
6e317f178c7fe7c81b573598f848acf8487e4e45

pdfwrite - properly process Octal 134 '\' in pdfmark UTF16 string

Bug #698552 "Some PDF outline UTF-16 text is broken"

The escape processing wasn't catering for an escaped escape '\\' which
led to us writing the escaped escape direclty and corrupted the remainder
of the string. We normaly don't use short escapes but write ocral,
because some versions of Acrobat can't handle the short escapes.

This commit just processes the '\\' properly, as per the other
escapes.

devices/vector/gdevpdfm.c


2017-09-17 11:46:03 +0100
Ken Sharp <ken.sharp@artifex.com>
122808aa46118d483c2fe431d5382c88cdd6e735

Coverity ID 172798

We hadn't assigned the return value to the variable 'code' but were
using it (asigned earlier in the code) to action a return.

Fixed by actually assigning the value to the variable.

base/gxshade1.c


2017-09-16 23:34:04 +0100
Ken Sharp <ken.sharp@artifex.com>
087abbc55390499ca27823afbe7d1b62b4ff4f8e

PDF interpreter - more work on images with invalid /Mask

Commit 119ec77d4e44e3861a376323ed14466b28b2f4bf fixed one case of a
/Mask array with invalid values by treating DeviceGray the same as
/Indexed. However, while that worked for the particular file in question
(Bug #697919) it caused a regression with Bug689717 which I somehow
missed at the time.

This commit treats DeviceGray differently to Indexed spaces and
clamps the value to either 0 or 1 for 1 BPC images. This seems to work
as per Acrobat for both files.

Resource/Init/pdf_draw.ps


2017-09-15 18:24:44 -0500
Robin Watts <Robin.Watts@artifex.com>
f1ccd5e2c82eb137abb7af000e93447653093a4d

Bug 696399: Fix buffer overflow in image scaling.

Patch calculation that overflows when x_extent is very
negative.

base/gxifast.c


2017-09-15 14:28:28 -0700
Robin Watts <Robin.Watts@artifex.com>
a768ec17b12e44b20d555f3c2fc2c5dcde3d9f0b

Remove stray memsets left in from previous commit.

The "Bug 698427: Fix ignoring errors that lead to division by
zero." commit contained stray memsets.

base/gxshade1.c


2017-09-15 13:04:06 -0700
Robin Watts <Robin.Watts@artifex.com>
45e4bcf4992c6c22e942730f5df393fc6b4cab63

Bug 698427: Fix ignoring errors that lead to division by zero.

By ignoring error return values, we continue running with
uninitialised data, leading to division by zero.

base/gxshade1.c


2017-09-15 10:58:11 -0500
Robin Watts <Robin.Watts@artifex.com>
1b18e15f10532d584c6fc2191e1b2a3f8e5ba7e5

Coverity #135034: Simplify code.

The while loop is not strictly required (but it does match
the other cases). Simplified here.

base/gxscanc.c


2017-09-15 10:47:54 -0500
Robin Watts <Robin.Watts@artifex.com>
6fb9174c1517143158781ed37e0c6d6eb9321808

Coverity #135037: Fix unused variable.

Don't read a value we don't use.

base/gxscanc.c


2017-09-05 14:52:07 +0100
Chris Liddell <chris.liddell@artifex.com>
228ac64b768ac3df1bcd5f63e3f353f8fd01e372

Coverity ID# 135035

Remove pointless "upgraded_copypage" code properly.

The previous commit for this removed code that it should not have done

base/gdevprn.c


2017-09-15 13:42:00 +0100
Chris Liddell <chris.liddell@artifex.com>
3f9d3e1392236fef4658c8dcad15385670d6831e

Revert "Coverity ID# 135035"

This reverts commit 05c3de8915fafb65b96ba0860523a7a79e2577e2.

base/gdevprn.c


2017-09-14 22:40:30 +0100
Chris Liddell <chris.liddell@artifex.com>
12ff84c1ff077c737b0a194761a370de079943fd

Remove man pages for removed (obsolete) tools

(Reported against 9.22 rc1)

doc/gs-vms.hlp
man/de/font2c.1
man/de/wftopfa.1
man/font2c.1
man/gs.1
man/wftopfa.1


2017-09-14 07:01:32 +0100
Chris Liddell <chris.liddell@artifex.com>
7df9b3d9b0dabd9854731fab796d5d458cf743f7

White space issues reported against 9.22 rc1

It seems newer gcc versions (6.4.x and later) report indentation "problems".

Also, add a cast to ensure bitshift op is done on an unsigned value.

base/gsbitops.c
base/gsicc_create.c
base/gxclread.c
contrib/gdevbjca.c
contrib/gdevdj9.c
devices/gdevepsc.c
pcl/pxl/pxpaint.c
psi/dscparse.c
psi/zcrd.c


2017-09-14 06:41:33 +0100
Chris Liddell <chris.liddell@artifex.com>
9e56aafaf2fc8fe3ffeefc0d13fa8c1b033ddec8

Bug 698532: replace ijs/ltmain.sh symlink with file

ijs/ltmain.sh


2017-09-13 08:43:38 +0100
Chris Liddell <chris.liddell@artifex.com>
98e115748ec4b16c610396b9444c1d82d263a30c

Remove reference to old wisc site in Readme.htm
S

doc/Readme.htm


2017-09-12 11:17:15 +0100
Ken Sharp <ken.sharp@artifex.com>
4241a4b3a7099cddac36d13f6c67054483eb7511

Remove unused variable 'pdev' to silence compiler warning

base/gdevp14.c


2017-09-12 10:32:51 +0100
Chris Liddell <chris.liddell@artifex.com>
85e04afbc2c80c8c6b129aff2741cbdf4d41ff67

Update docs dates etc for release

doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/font2c.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
man/wftopfa.1
psi/int.mak
psi/msvc.mak


2017-09-12 10:30:01 +0100
Chris Liddell <chris.liddell@artifex.com>
43561187cdb501ac1c6184082065647253d9336c

Product string and date for release

base/gscdef.c
base/version.mak


2017-09-12 10:14:45 +0100
Ken Sharp <ken.sharp@artifex.com>
56ca27c9a95d7917baebd42b04cb08be872d1e39

PDF interpreter - handle invalid XRefStm in hybrid PDF file

Bug #698519 "Invalid XRefStm exits with error"

Just wrap the 'readpdf15xref pop' in a stopped if the user has not set
PDFSTOPONERROR, also add mark/cleartomark to clean up the stack.

Resource/Init/pdf_main.ps


2017-09-11 09:30:59 -0700
Ray Johnston <ray.johnston@artifex.com>
a1cd439519aa07b5f70b1b044342d90377c1188e

Coverity ID 94477 and 158386

94477 suggests a potential access (as an array pcc[i]) past the singelton
address which could occur if pgs->color_component_map.num_components > 1
Copy the "all" value to an array to prevent the issue.

158386 was a mistake, fixed. Two differences show up with bitrgbtags, but
they look the same to me.
tests_private/comparefiles/Altona_Technical_v20_x4.pdf
tests_private/comparefiles/eci_altona-test-suite-v2_technical2_x4.pdf

base/gdevp14.c


2017-09-11 16:22:29 +0100
Ken Sharp <ken.sharp@artifex.com>
9e92e379d04979de614bbdb89a0af5f4aff187cb

Coverity ID 107344 and 107345, again....

When testing the return value from ftell() don't assign it to an
unsigned int....

Warning from clang this time

devices/gdevgprf.c


2017-09-11 09:31:52 +0100
Ken Sharp <ken.sharp@artifex.com>
49d8d66c80d04bd7bfcae0c50e31b18355408e71

Coverity ID 94485 revisited

another place to check that fw is not negative. Missed the fact there
were two instances with the first commit.

devices/minftrsz.c


2017-09-11 09:31:01 +0100
Ken Sharp <ken.sharp@artifex.com>
954ed1df4b60bd9b3fc57b56cb7503cb950e05b9

Coverity IDs 107344, 107345 revisited

Check return values from ftell() as well as fseek()

devices/gdevgprf.c


2017-09-11 08:22:41 +0100
Ken Sharp <ken.sharp@artifex.com>
988e56308515118b723d868e50e8b5836d43f803

Coverity ID 171512

Check return values from seek and propagate errors if encountered.

pcl/pl/plparams.c


2017-09-11 08:20:27 +0100
Ken Sharp <ken.sharp@artifex.com>
c35b385f02e007fe1edf086d8b5175af4a9836f9

Coverity IDs 171513 and 171514

prevent potential divide by zero errors. Instead, propagate error
return codes.

base/gen_ordered.c


2017-09-10 12:40:14 -0700
Ray Johnston <ray.johnston@artifex.com>
d94fd9bd9cb69a998c812eb2f04fdc0083895ae5

Adjust .genordered 50% gray level to be on an desirable boundary

Customer needs 50% gray level with 45 degree Angle and DotShape 8
to be a checkerboard pattern with no stray dots. Add a check to force
the step at 50% to be an even number of dots. Tested for Frequency
from 30 to 150 (at 600 dpi).

psi/zht2.c


2017-09-07 15:38:19 +0100
Ken Sharp <ken.sharp@artifex.com>
dc8eb2a822bda44aab546e0bf7a0e35e3115696b

Coverity ID 94999

I don't believe its actually possible to end up at the if (swap)
without setting run, because the few cases in the switch where we
don't set run, we go back to the top, swap the source and texture,
and then do the switch again, so somehow we will end up setting run

But its cheap to initialise it, and it will silence Coverity, and it
guards against any possible future problem.

base/gsroprun.c


2017-09-05 16:53:52 +0100
Chris Liddell <chris.liddell@artifex.com>
ff5828a537fbf8b58095f5147b2acd59a6330941

Compiler warning: discaring const

The fix for coverity ID# 127201 introduced a compiler warning due to an
accessor macro (ctm_only) implicitly adding const. Make the local variable
const, too.

base/gxipixel.c


2017-09-05 15:46:03 +0100
Chris Liddell <chris.liddell@artifex.com>
6846f1d5d8c7f5512fc385b3b9e2fa95cc720c53

Coverity ID# 94891

Add a cast to make integer division explicit.

base/gsdparam.c


2017-09-07 13:35:35 +0100
Ken Sharp <ken.sharp@artifex.com>
534257c41de66f040fa548b47f2bf5950cb5a3cb

Coverity ID 94819

No structural changes, just change a couple of pointer type declarations
I think this should satisfy Coverity and there doesn't seem to be any
actual problem here.

base/gxclthrd.c


2017-09-07 12:11:47 +0100
Ken Sharp <ken.sharp@artifex.com>
f12500705c692b0ad51156081901fcd3457a5601

Coverity ID 158370

Again we shouldn't be able to get to the flagged code with 'raster'
being uninitialised, because 'data', which is initialised to 0 would
have to be updated, and that would mean raster was updated as well.

But since we already initialise data its cheap to initialise raster too.

base/gximag3x.c


2017-09-07 11:36:59 +0100
Ken Sharp <ken.sharp@artifex.com>
627b0c8a1228830917bb2420edb4613550dd4ef1

Coverity ID 94819

The comments on clist_end_page() state that it returns negative for an
error, 0 for success and positive for success with a low memory warning.

In fact it always returns 0.

This means we don't conform to the comments, and discard any errors that
occur.

This commit reformats the code to reduce the number of tests and to
store the error codes, as well as adding the potential to return
something other than 0.

base/gxclist.c


2017-09-07 10:09:04 +0100
Ken Sharp <ken.sharp@artifex.com>
be04e2ac2389e6fcc2ccf7b50434678c7aefa19d

Coverity ID 94571

Its not obvious whether raster can ever be 0 here, it clearly never is
during our tests, and I think it should not be possible, but just in
case we'll guard the division with a check.

base/gsimage.c


2017-09-07 08:51:31 +0100
Ken Sharp <ken.sharp@artifex.com>
24bbc1ed3d0553964dd5086b08062442071e4ef5

Fix memory leak

An error exit would leave 'filter' and 'screen_blur' allocated, and
therefore a memory leak.

base/gen_ordered.c


2017-09-06 15:51:33 -0700
Ray Johnston <ray.johnston@artifex.com>
30e336aee9812ca3610931f86ea641d82022c8ca

Second fix for missing FULL_FILE_NAME_LENGTH

Previous commit fixed the RAW_SCREEN_DUMP=1 case, but broke the normal
case. Also added #ifndef RAW_SCREEN_DUMP around the setting in gen_odrered.h
so that the preprocesor flag could be set via the command line.

Lastly, add base/gen_ordered.h to the Headers section of the .vcproj

base/gen_ordered.h
toolbin/halftone/gen_ordered/gen_ordered.vcproj


2017-09-06 14:23:05 -0700
Ray Johnston <ray.johnston@artifex.com>
a92188b76f30c5840ce8b0716e5c70e9791fb6eb

Fix RAW_SCREEN_DUMP for gen_ordered standalone

In refactoring, I missed that FUL_FILE_NAME_LENGTH was needed if
RAW_SCREEN_DUMP was > 0 (RAW_SCREEN_DUMP is #define'd in genordered.h,
so put the definition there.).

base/gen_ordered.h
toolbin/halftone/gen_ordered/gen_ordered_main.c


2017-09-06 19:08:24 +0100
Ken Sharp <ken.sharp@artifex.com>
6b085aa479bcf0c8cb426c0b51fe7f98faba72ff

Coverity ID 94886

Remove a NULL pointer check, there's no possible way the pointer
can be NULL at this point. Or if there is, its because a NULL
pointer was passed in as an argument, and we will seg fault earlier
in this function anyway, so no point in checking it here.

base/gxfill.c


2017-09-06 19:06:22 +0100
Ken Sharp <ken.sharp@artifex.com>
754e99239371ec4aa06a9728ae65028ac22c440c

Coverity ID 94627

Guard the dereference of pdht with a NULL pointer test, to avoid a
potential seg fault.

base/gxdevndi.c


2017-09-06 16:31:48 +0100
Ken Sharp <ken.sharp@artifex.com>
6857ef647312daa24eb47417b09d823e8b59831d

Coverity ID 141334

Add some error checking

base/gxclip.c


2017-09-06 15:58:28 +0100
Ken Sharp <ken.sharp@artifex.com>
198924f4c94c561543f5838900e21ed761a886a5

Coverity ID 95001

We can only get back here by jumping to the label 'top'. ymax is not
used between this point and the last 'goto top', and it is then
recalculated before being used.

So the assignment is indeed pointless.

base/gxacpath.c


2017-09-06 15:11:56 +0100
Ken Sharp <ken.sharp@artifex.com>
0808c9eec2a92db3176b3eac0520f48a2119ddf9

Coverity IDs 164020, 164022, 164025

We don't need to check if dot_grid.data is NULL.

Testing a == 0 && b == 0 after testing a nd b individually can't be
correct. Test for both being zero first.

In the case of an error, we could attempt to free memory that had not
been allocated. Prevent this by checking dot_level_pos is non-NULL.

base/gen_ordered.c


2017-09-06 14:37:21 +0100
Ken Sharp <ken.sharp@artifex.com>
05768db75e90f56c6fda33c9c14515a3e0b6aeaa

Addition to commit 18f009a08f1eac4708188b516d375356a502a3b1

Forgot to initialise the pointer to NULL before starting.

base/gdevp14.c


2017-09-06 10:03:40 +0100
Ken Sharp <ken.sharp@artifex.com>
18f009a08f1eac4708188b516d375356a502a3b1

Coverity IDs 138751, 141130, 141131, 158373

138751 - The code assumes that a separating device has an ICC profile
but doesn't check. Add a check and return an error if it doesn't.

141130 - initialise a structure member

141131 - check and action return codes

158373 put #if DEBUG round some code that's only present to provide a
breakpoint location in debuggers. (and told Coverity to ignore this)

base/gdevp14.c


2017-09-05 15:28:19 +0100
Chris Liddell <chris.liddell@artifex.com>
61856e04852124491a47fa6379f1c3ad296f3366

Coverity ID# 122660

NULL pointer check - the code branch above already does so, looks like a simple
ommission

base/gxiscale.c


2017-09-05 15:21:23 +0100
Chris Liddell <chris.liddell@artifex.com>
1b9ea22b3456a24e356d3f5a68036cecbb28af56

Coverity ID# 126580

Explicitly promote an unsigned char value to a long.

base/gxclrect.c


2017-09-05 15:12:09 +0100
Chris Liddell <chris.liddell@artifex.com>
28e95004b508a3f4cd73552d92f7f4cd699c645b

Coverity ID# 127201

Fix potential NULL pgs (graphics state) pointer dereference. I suspect this can
never occur, but it's cheap and should silence coverity

base/gxipixel.c


2017-09-05 14:52:07 +0100
Chris Liddell <chris.liddell@artifex.com>
05c3de8915fafb65b96ba0860523a7a79e2577e2

Coverity ID# 135035

Remove pointless "upgraded_copypage" code.

base/gdevprn.c


2017-09-05 14:18:10 +0100
Ken Sharp <ken.sharp@artifex.com>
9a6045cc4c7843ee8608c1d4a2fb76e8a10a6581

Coverity ID 95054

Explicitly initialise a member of the new 'order' structure.

base/gxdhtserial.c


2017-09-05 13:36:45 +0100
Chris Liddell <chris.liddell@artifex.com>
7dd033589ce40649ab602fba4c0473aa40c48439

Bug 698471: apply vertical substitute glyphs in TTF fonts

We weren't applying vertical glyph substition (from the gsub table).

base/gstype42.c
psi/zfapi.c


2017-09-05 13:23:24 +0100
Chris Liddell <chris.liddell@artifex.com>
f753769041467a1c88084d6d26c2755d7174691d

Bug 698486: memory leaks from fontconfig calls

Address most of the memory leaks stemming from the use of fontconfig.

In this case, just destroying the fontconfig context.

base/gp_unix.c


2017-09-04 09:39:18 +0100
Chris Liddell <chris.liddell@artifex.com>
8b249d3ebd8058f2961770e21c72e1ac703cc12f

Coverity ID 139142: etc.c modulo by zero

Only calculate tmline when it will actually be used. The calculation uses
y % tmheight, but only the ETS_RSTYLE_THRESHOLD case is called with
tmheight != 0

base/ets.c


2017-09-05 12:16:38 +0100
Ken Sharp <ken.sharp@artifex.com>
463854833474dc3ae642e17707e50c451ada1fec

Coverity ID 94994

Check a return value and action it.

base/gxp1fill.c


2017-09-05 11:41:38 +0100
Ken Sharp <ken.sharp@artifex.com>
aa75f905024bdf13882c30e543d64e285e22aad1

Coverity ID 158395

I think its not currently possible to trigger this, as it would require
setting up the device pointer incorrectly before entering this routine.
However Coverity is correct that it appears possible to end up doing
a NULL pointer dereference, so add a guard to maek sure that can't
happen.

base/gzspotan.c


2017-09-05 10:45:14 +0100
Ken Sharp <ken.sharp@artifex.com>
06b5a54361525363bdc163b88f965f0d1a295087

Coverity ID 94914

Remove an unnecessary copy of a variable, its unconditionally
overwritten immediately after. Comment that.

base/sfilter2.c


2017-09-05 09:58:24 +0100
Ken Sharp <ken.sharp@artifex.com>
3f40707f85296c0abf798c9c32c79db33affbddc

Coverity IDs 94554 and 94551

We weren't checking the return values from gp_fseek_64 or fstat() and
in a couple of places weren't even able to return an error anyway
(void function).

So check the error returns from the C run-time and add error handling
as required in order too report these.

base/sfxcommon.c
base/sfxstdio.c
base/stream.h


2017-09-04 19:02:39 +0100
Ken Sharp <ken.sharp@artifex.com>
ac6c349f54b09df7b2f8cf606b8fe7e62291c2e0

Coverity ID 94959

We were failing to free a couple of allocated buffers in the event of an
error. The other error test all free both buffers properly.

devices/rinkj/rinkj-epson870.c


2017-09-04 17:26:45 +0100
Ken Sharp <ken.sharp@artifex.com>
a11bd1f982f8a8491a4c1ab45aa5535426d01dca

Coverity IDs 94868, 94936, 158371

Initialise some arrays, these are sparsely populated by the code and
potentially possible to access uninitialised data.

devices/rinkj/evenbetter-rll.c


2017-09-04 17:01:14 +0100
Ken Sharp <ken.sharp@artifex.com>
538f12d7bdd292c4798161a5d49ba2f3bcfebbe3

Alter the fix for Coverity ID 94726

Ray objected to my original change, because the debug output would not
be a valid file. So instead we choose to lose the information that
logbits2 is non-zero and drop the if clause.

devices/gdevplib.c


2017-09-04 16:57:32 +0100
Ken Sharp <ken.sharp@artifex.com>
e0d49f799157f2d0ba1ea4969cc225a15d108cf7

Coverity IDs 94478 and 94485

The first is a clear typo, the code below this point is the same as the
code modified in this commit.

The second one is less clear, but I think its reasonable, if there is
no '0' (-1 return from next_zero()) then we can't make the feature
larger by darkening to the right, so darken to the left.

devices/minftrsz.c


2017-09-04 16:27:32 +0100
Ken Sharp <ken.sharp@artifex.com>
f7d9662c5737d42942dbe1f5d4e74a9d00838b56

Coverity ID 94479

The macro used here says it shouldn't be used for run-time calculations.
However this code does use it, I'm not certain for what purpose. Since
it clearly is possible to get a negative shift, add a guard to the
values to make sure that can't happen.

Since this code is conditionally compiled out, anyone who compiled it
in and finds a problem can easily fix it.

devices/gdevxcmp.c


2017-09-04 15:56:29 +0100
Ken Sharp <ken.sharp@artifex.com>
0462b654d8a57688c1b811a4e04ad8a7aaf0dab9

Coverity ID 127202

Check the stored graphics state and if its 0, use the default method.

Remove the now redundant later check on pgs being 0 before use.

devices/gdevx.c


2017-09-04 15:16:42 +0100
Ken Sharp <ken.sharp@artifex.com>
2c5d0e0970e60d9d4c61865d61fb39629dfd6623

Coverity IDs 94503, 94506, 94523, 94536

A number of pointless comparisons, checking that a signed 32-bit variable
had a value less than the maximum for a signed 32-bit integer.

Remove them all.

devices/gdevupd.c


2017-09-04 14:32:22 +0100
Ken Sharp <ken.sharp@artifex.com>
ae7f71a161803d10f263585e8b2e5087835f51b8

Coverity IDs 94719, 94889, 94912, 94967, 95088, 101187

Return an error instead of storing it (where it gets lost)

As per gdevpsd.c and gdevprf.c refactor the #if conditional compiled
code to remove a variable and get rid of Coverity warning.

In the 'build_cmyk_raster_line_fromplanar* routines, pass the params as
a pointer instead of copying the whole 500+ byte structure around.

Finally, not a Coverity warning but a compiler warning; remove an unused
variable.

devices/gdevtsep.c


2017-09-04 13:47:16 +0100
Ken Sharp <ken.sharp@artifex.com>
413cefabb9888c0810e1c4c23e603fa4e69c7c1d

Coverity IDs 94856 and 94719

If we get an error from param_read_name, then just return it.

The AddLut lookup is less obvious. Clearly the size of the LUT read from
the config file should not be less than 0, but there's no clear upper
limit (other than an unsigned integer). However a 4Gb config file seems
unlikely. The only example we have has ~23 values for each plane, so a
limit of 256 entries seems reasonable. If anyone complains its easy to
increase and we can ask the user what a reasonable limit should be.

devices/gdevrinkj.c


2017-09-04 13:12:27 +0100
Ken Sharp <ken.sharp@artifex.com>
1cf6a2a71851e507716bd5c82c8c991239ac04e0

Coverity ID 94728

As with gdevgprf.c, refactor the #if conditional compilation so that we
don't need a variable, and remove the Coverity warning.

devices/gdevpsd.c


2017-09-04 12:12:06 +0100
Ken Sharp <ken.sharp@artifex.com>
cdceb9e93516264fcdae965e5eeb0e733bad76ee

Coverity IDs 94596, 94726

A debug print was identical in both the if and else clauses. Not really
important since its debug, but change the else to match others of the
same type.

line_ptrs was calculated and altered in the loop invocation, but its
then immediately overwritten in the loop body, making it pointless.

devices/gdevplib.c


2017-09-04 11:29:50 +0100
Ken Sharp <ken.sharp@artifex.com>
11e90b8945a54e4e16c702a4ba4ed19cef47f4a2

Coverity ID 158390

Since line is recalculated inside the loop on every iteration, there's
no point in calculating it in the loop definition.

devices/gdevphex.c


2017-09-04 10:47:04 +0100
Ken Sharp <ken.sharp@artifex.com>
615d7caf21e957fe3716ef9264def280df20beb7

Coverity IDs 121444, 121445, 121449

More problems with intermediate promotion to int, probably caused when
gx_color_index went from 32 to 64 bits.

devices/gdevpbm.c


2017-09-04 10:29:55 +0100
Ken Sharp <ken.sharp@artifex.com>
65ef52484c9a973f5fcb72b258cf1bf5a4653a75

Coverity ID 158391

Initialise 'backtable'. The code does later fill in some entries in
backtable, but it doesn't fill all of them and I can see no coherence
between the filling in code and the code that reads data from it. It
really does look like its possible to read uninitialised data here.

devices/gdevmgr.c


2017-09-03 17:14:41 +0100
Ken Sharp <ken.sharp@artifex.com>
5f73a2c82f0cbd0d0965709066ebdf13cc0b9c9d

Coverity ID 94489

The spec says that it must be 3 bytes, and uses a 16 bit shift example
(suggesting it is stored in the Brother driver as 24 bits).

For us its a short, so rather than copy the brother code, set it to 0 to
avoid any confusion over whether shifting a short right by 16 results in
all 0 or all 1.

devices/gdevhl7x.c


2017-09-03 11:48:54 +0100
Ken Sharp <ken.sharp@artifex.com>
4e122728ecf07941e15f75fc7feaec57eeb54e90

Coverity IDs 107340, 107341, 107343, 107344, 107345, 121455

Considerable rework of error checking in this device.

Firstly add error return checks on fseek and fwrite. Alter functions to
return those errors. Alter the parent functions to check the errors,
repeat until we bubble up to the top level.

Coverity claims that ftell() can return a negative value, which as far
as I can see is not true. However, by casting the return value to an
unsigned type, and altering the variable types appropriately, I think
we should eliminate this warning.

Refactor conditionally compiled code to eliminate a variable and get
rid of a dead code warning.

devices/gdevgprf.c


2017-09-02 18:31:11 +0100
Ken Sharp <ken.sharp@artifex.com>
18d430f97d95d5919fb9ea06b63423c8367548b9

Coverity ID 94722

Change the way memory allocation and free'ing is done so that we no
longer check row_first, which is always 0. THis should mean that we
don't need to check min_feature_data before passing it to
min_feature_size_process(), it is allocated in min_feature_size_init()
and we do actually now check the return value from there to ensure
there are no errors which could leave min_feature_data uninitialised.

devices/gdevfax.c


2017-09-02 17:19:00 +0100
Ken Sharp <ken.sharp@artifex.com>
4b07f41941f75fc54cd6937ff18426402ab9af36

Coverity IDs 94575 and 94722

Remove some dead code, refactor and add error checking to avoid a NULL
pointer dereference

devices/gdevdjtc.c


2017-09-02 16:33:06 +0100
Ken Sharp <ken.sharp@artifex.com>
6a4506040593416d23930049e41e806336335e67

Coverity ID 94526

Add some error checking on file handling, and report ioerrors if they
fail.

devices/gdevdfax.c


2017-09-02 15:09:25 +0100
Ken Sharp <ken.sharp@artifex.com>
998dd6a53f17104decc8533d5978023fdd008c21

Coverity ID 94814 and 94980

I wasn't able to find a way to reproduce this, because it relies on
a particular sequence of lines/points. We must fill the data buffer to
the point where another line or curve will not fit, and then the next
curve or line must be a 'POINTS_NONE'.

In this case we will not flush the accumulated points, which means we
will not reset the counter, but we will then still go on to save the
current co-ordinates in the data buffer, which will cause an overflow.

Fixed by reducing the 'full' check slightly, so that we still have one
line/curve slot open in the data buffer. If we get a POINTS_NONE then
we check to see if we have already gone past the slop. If we have, simply
reduce the counter by one which will cause us to overwrite the previous
points. Since this must have also been a POINTS_NONE, this just means
in effect that we have combined consecutive ones.

I'm not certain its even possible to get consecutive POINTS_NONE, but
its best to be safe.

This should silence Coverity, and fixes the genuine (if hard to
reproduce) potential problem.

devices/vector/gdevpx.c


2017-09-02 11:02:23 +0100
Ken Sharp <ken.sharp@artifex.com>
3a98b6855660c84b2fa5529cc25bdbdc4b2b9d7a

Coverity ID 94943

I think this code is incorrect, because this routine *always* maps
CMYK to CMYK, so there's no need to test the colour depth.

Also, it always gets provided with a CMYK buffer, not an RGB one so it
actually can't write off the end of the buffer. But the declaration
was wrong, so fix that here to avoid the warning.

devices/gdevcdj.c


2017-09-02 10:55:51 +0100
Ken Sharp <ken.sharp@artifex.com>
065b5cc15cea365c3fa5a1f3133416a0db228082

Coverity ID 95019

This code was unreachable, its even commented as such. So lets just
remove it.

devices/gdevcdj.c


2017-09-02 10:54:06 +0100
Ken Sharp <ken.sharp@artifex.com>
a48211dc97ef345261e7e9a08818dd274b07040e

Coverity ID 94736

Guard against a NULL pointer dereference. If we didn't recognise the
pritner type, then it was possible to attempt to use a NULL pointer.

devices/gdevcdj.c


2017-09-02 10:50:34 +0100
Ken Sharp <ken.sharp@artifex.com>
77fae933e126cb3b3aad9faa30a659294ed8a44a

Coverity ID 94708

The original code in here was correctly noted by Coverity as being
dead, because the division by BJC_RESOLUTION_BASE meant that we were
always comparing 0 with 0.

In addition, the use of bit shifting meant that the resolution wasn't
tested against a simple multiple of 90 dpi, but against powers of 2
times 90 dpi, which rapidly led to ridiculous values.

I'm not certain what the original limits should have been here, and
I don't have a bjc device to test against, but the code as it stood was
clearly incorrect, and this at least stands some chance or working.

devices/gdevcdj.c


2017-09-02 10:28:44 +0100
Ken Sharp <ken.sharp@artifex.com>
1e6e40715f9038b177cf4649945af38b4b21e83c

Coverity ID 121443

This was supposed to be in the earlier commit but somehow fell off...

devices/vector/gdevpx.c


2017-09-02 09:59:30 +0100
Ken Sharp <ken.sharp@artifex.com>
f2a4735118b9558a76adf46e7bb6f814a74ffb38

Coverity ID 94703

param_string_from_string cannot return an error so don't try to
check it.

devices/vector/gdevpx.c


2017-09-02 09:51:33 +0100
Ken Sharp <ken.sharp@artifex.com>
ca09b00d27d7a855c0e7cbf55c26b5e287262cca

Coverity IDs 121437, 121438 and 121443

Not certain if these are really a potential problem, but a type cast
safely resolves any potential for error.

I suspect this is a hang over from when gs_color_index was a 32-bit
value instead of 64.

devices/vector/gdevpx.c


2017-09-02 09:40:14 +0100
Ken Sharp <ken.sharp@artifex.com>
34ac92ae1741e4d8573162efbd25520bc8796424

pdfwrite - remove unused code

This code was left over from transfer function the /Apply work, but is
no longer used. It was also raising warnings with scan-build and
didn't work properly anyway (which is why its unused).

So remove it.

devices/vector/gdevpsdf.h
devices/vector/gdevpsdi.c
devices/vector/gdevpsds.c
devices/vector/gdevpsds.h


2017-08-31 16:11:15 +0100
Ken Sharp <ken.sharp@artifex.com>
4129543f9f51ccaf97d8429a9e66e348394e95b0

PDF interpreter - add support for Choice fields in Widget annotations

Bug 698461 "PDF files with filled forms are not rendered correctly if they have drop-down lists"

We didn't support Choice fields in either AcroForms or Widget annotations
which leads to these not being rendered if they have no Appearance (in
the case of widget annotations) or not rendered at all in the case of
AcroForms.

This commit adds simple support for single selection Choice fields, we
may want to improve this later.

Resource/Init/pdf_draw.ps
devices/vector/gdevpsds.c


2017-08-30 16:36:20 +0100
Chris Liddell <chris.liddell@artifex.com>
e547f2490aa40a4f8e35bb15e6815e7d6f1be22a

clang warning in color mapping code

We were bit shifting -1 (i.e. -1 << x) which is, strictly speaking undefined.

Where what was meant was meant was -(1 << x).

base/gxcmap.c


2017-08-30 16:28:08 +0100
Chris Liddell <chris.liddell@artifex.com>
dafd08a54332f66760b8d667a4b59f42bd4edf1f

clang warnings in the TTF code.

There was a type mismatch: we were using a boolean to track if an error had
occurred, but in most places we were treating it as a gs error code (int type).

Change the type to int, and tweak the couple of places where it was treated as
a bool.

base/gxttfb.c
base/gxttfb.h


2017-08-25 10:54:42 +0100
Chris Liddell <chris.liddell@artifex.com>
ff70cedd80fd037414abb8a17cd1988d92da2ad6

This is a combination of 7 commits.

from the openjpeg-2.2.0-update branch

1) OpenJPEG 2.2.0 initial commit
0b5fc7368721af148d85ef8dac2e018de10cfe91

2) Zap the openjpeg stuff we don't need
e90bbccd19cb266b55de28ebfd16d024b6e67373

3) Add predefined openjpeg headers.
71242c9a04bb76b8b17fc489d62a91d04c1ad60c

4) Import patches from Sumatra's tree.
8b89e4b5750069172522ecf85e69d094b5e567e7

5) update makefiles, interface and vcproj files for new openjpeg version
456cbe1c76659b0ab022f6ca3f67cc63b253b05f

6) Avoid getenv call in openjpeg
202a0318a7b3a397fcd5d015dcad4293474f464c

7) Bug 698135: Import security fix for OpenJPEG
8057698a5f7833499fdf8d2529162841920e354a

base/openjpeg.mak
base/sjpx_openjpeg.c
openjpeg/.gitignore
openjpeg/.travis.yml
openjpeg/CHANGELOG.md
openjpeg/NEWS.md
openjpeg/THANKS.md
openjpeg/src/CMakeLists.txt
openjpeg/src/lib/openjp2/CMakeLists.txt
openjpeg/src/lib/openjp2/bench_dwt.c
openjpeg/src/lib/openjp2/bio.c
openjpeg/src/lib/openjp2/bio.h
openjpeg/src/lib/openjp2/cidx_manager.c
openjpeg/src/lib/openjp2/cidx_manager.h
openjpeg/src/lib/openjp2/cio.c
openjpeg/src/lib/openjp2/cio.h
openjpeg/src/lib/openjp2/dwt.c
openjpeg/src/lib/openjp2/dwt.h
openjpeg/src/lib/openjp2/event.c
openjpeg/src/lib/openjp2/event.h
openjpeg/src/lib/openjp2/function_list.c
openjpeg/src/lib/openjp2/function_list.h
openjpeg/src/lib/openjp2/image.c
openjpeg/src/lib/openjp2/image.h
openjpeg/src/lib/openjp2/indexbox_manager.h
openjpeg/src/lib/openjp2/invert.c
openjpeg/src/lib/openjp2/invert.h
openjpeg/src/lib/openjp2/j2k.c
openjpeg/src/lib/openjp2/j2k.h
openjpeg/src/lib/openjp2/jp2.c
openjpeg/src/lib/openjp2/jp2.h
openjpeg/src/lib/openjp2/libopenjp2.pc.cmake.in
openjpeg/src/lib/openjp2/mct.c
openjpeg/src/lib/openjp2/mct.h
openjpeg/src/lib/openjp2/mqc.c
openjpeg/src/lib/openjp2/mqc.h
openjpeg/src/lib/openjp2/mqc_inl.h
openjpeg/src/lib/openjp2/openjpeg.c
openjpeg/src/lib/openjp2/openjpeg.h
openjpeg/src/lib/openjp2/opj_clock.c
openjpeg/src/lib/openjp2/opj_clock.h
openjpeg/src/lib/openjp2/opj_codec.h
openjpeg/src/lib/openjp2/opj_common.h
openjpeg/src/lib/openjp2/opj_config.h
openjpeg/src/lib/openjp2/opj_config.h.cmake.in
openjpeg/src/lib/openjp2/opj_config_private.h
openjpeg/src/lib/openjp2/opj_config_private.h.cmake.in
openjpeg/src/lib/openjp2/opj_includes.h
openjpeg/src/lib/openjp2/opj_intmath.h
openjpeg/src/lib/openjp2/opj_inttypes.h
openjpeg/src/lib/openjp2/opj_malloc.c
openjpeg/src/lib/openjp2/opj_malloc.h
openjpeg/src/lib/openjp2/opj_stdint.h
openjpeg/src/lib/openjp2/phix_manager.c
openjpeg/src/lib/openjp2/pi.c
openjpeg/src/lib/openjp2/pi.h
openjpeg/src/lib/openjp2/ppix_manager.c
openjpeg/src/lib/openjp2/raw.h
openjpeg/src/lib/openjp2/t1.c
openjpeg/src/lib/openjp2/t1.h
openjpeg/src/lib/openjp2/t1_generate_luts.c
openjpeg/src/lib/openjp2/t1_luts.h
openjpeg/src/lib/openjp2/t2.c
openjpeg/src/lib/openjp2/t2.h
openjpeg/src/lib/openjp2/tcd.c
openjpeg/src/lib/openjp2/tcd.h
openjpeg/src/lib/openjp2/tgt.c
openjpeg/src/lib/openjp2/tgt.h
openjpeg/src/lib/openjp2/thix_manager.c
openjpeg/src/lib/openjp2/thread.c
openjpeg/src/lib/openjp2/thread.h
openjpeg/src/lib/openjp2/tls_keys.h
openjpeg/src/lib/openjp2/tpix_manager.c
windows/ghostscript.vcproj


2017-08-31 09:40:51 +0100
Ken Sharp <ken.sharp@artifex.com>
d1dbe825e2fefed1156d0f5e02e6b4d5f20a7781

pdfwrite - address compiler warnings

A couple of benign compiler warnings, assigning to an unused variable

Also add some white space because the construction seems to confuse
scan-build.

devices/vector/gdevpdfg.c
devices/vector/gdevpsds.c


2017-08-30 15:36:10 +0100
Ken Sharp <ken.sharp@artifex.com>
794c559e34192d96b772950f854600add9c86651

PDF interpreter - make sure Stamp appearance synthesis cannot have 0 scale

One of the new PDF 2.0 Quality Logic files exhibited a problem with
synthesising a missing Appearance for some Stamp annotations; the
scale factor could be calculated as 0.

This commit makes the minimum scale value 1

Resource/Init/pdf_draw.ps


2017-08-30 10:18:19 +0100
Ken Sharp <ken.sharp@artifex.com>
782ca576c8582457b063481a4315f7b767ec4546

PDF interpreter - fix implementation of HTO

I implemented HTO by using the existing sethalftonephase without an
example to look at. It turns out that sethalftonephase uses
.setscreenphase which expects three integers while HTO consists of
an array of 2 reals.

We already manufacture the third integer (the texture) and use aload to
extract the two reals. This commit uses transform to apply the CTM and
then cvi to convert the HTO numbers to something that makes a difference
and is legal.

Fixes the error and the resulting file (rendered at 1bpp) does show a
difference in the halftone at 300 dpi or better.

Resource/Init/pdf_draw.ps


2017-08-29 14:04:28 +0100
Ken Sharp <ken.sharp@artifex.com>
050f12a7c1c9b6e17fd6253924ce5929861cd99f

PDF interpreter - Properly clamp real arguments for /Indexed spaces

Bug #698434 "real operands to /Indexed spaces not properly limited (PDF 2.0)"

The quality Logic PDF 2.0 test file fts_14_1422.pdf tests /Indexed
colour spaces with real value to see if the notes in Section 8.6.6.3
regarding real values are adhered to. Previously we simply set such
values to the lowest integer (truncated the fractional part) which is
wrong according to both the PDF and PostScript specifications.

The PDF specification specifically states that 0.5 rounds *up* while
the PostScript Language Reference Manual (unusually) doesn't state
exactly what 'nearest' means.

Since it was wrong for both before I've chosen to apply the same rules
for both PDF and PostScript, 0.5 and above rounds up, other reals round
down. Values outside the range 0->hival are clamped to either 0 or
hival whichever is nearer (this was already done in fact).

psi/zcolor.c


2017-08-29 10:37:23 +0100
Ken Sharp <ken.sharp@artifex.com>
ed962af64e86887b0c2ca614c877bb743315d414

PDF Interpreter - Paint one pixel for Patterns with BBox width/height of 0

Bug #698431 "PDF 2.0 - Patterns with BBox where width or height = 0 should paint 1 pixel"

The ISO32000-2:2017 specification explicitly states (See section 8.7.3.1
Table 74 and section 8.7.4.3 Table 77) that a Pattern with a BBox where
the width or height is 0 should still paint one pixel.

We achieve this here by detecting the condition where width or height in
a Pattern BBox is exactly 0, and add a tiny amount to the urx or ury
to ensure that one pixels is touched, and therefore painted.

Resource/Init/pdf_draw.ps


2017-08-28 15:28:01 +0100
Ken Sharp <ken.sharp@artifex.com>
93b7c164f969787767da98ea3cb4b3efdb6ffc32

fix previous commit

Commit e239afa0924503e131b0445bf2624da90f7c93d1 accidentally broke
ps2write for files with a halftone, but no transfer function. We do need
to check to see if the transfer function is present before trying to
emit it!

For safety, set the character array to NULLs before we start.

devices/vector/gdevpdfg.c


2017-08-28 14:38:02 +0100
Ken Sharp <ken.sharp@artifex.com>
e239afa0924503e131b0445bf2624da90f7c93d1

pdfwrite - fix 2 scan-build warnings

devices/vector/gdevpdfg.c


2017-08-28 14:31:37 +0100
Ken Sharp <ken.sharp@artifex.com>
f06cb1ba2d51c44cd27cbf12e2011d15e49cd3ad

PDF Interpreter - Handle recursive /Prev entries in trailer dictionaries

Bug #698409 "PDF xref loop causes denial of service"

This commit creates an array and stores the offset of each /Prev as it
is encountered while processing xrefs. Each Prev is also compared
against every preceding offset already stored in the array. If we get
a match then we have recursion and we break out. The file may not render
correctly, and we issue the usual warning.

For complex reasons it was necessary to create the array and store it in
the current dictionary rather than simply leave it on the stack, so we
undef it again after use.

Resource/Init/pdf_main.ps


2017-08-26 10:39:51 +0100
Ken Sharp <ken.sharp@artifex.com>
347f334e934356746f7cc63e478fee41a2c4a8dd

pdfwrite - fix a couple of compiler warnings

Nothing serious, but the code wasn't checking some error returns. We
should do that so fixed here.

devices/vector/gdevpdfg.c


2017-08-26 10:03:00 +0100
Ken Sharp <ken.sharp@artifex.com>
56aa7b23cbb3cea465ba962ce57157e3a6101e3a

pdfwrite - add code to apply transfer functions instead of preserving

With the release of the PDF 2.0 specification transfer functions have
been deprecated in graphics states. This means we can no longer simply
preserve transfer functions as we have done in the past, and removing
them can lead to unexpected results (Quark XPress is notorious for
using transfer functions inadvisably). So this commit alters the colour
handling code fairly extensively in order to allow transfer functions
to be applied.

In order to achieve this there are conditions under which we are forced
to convert colour spaces, as its not possible to apply the transfer
function reasonably to the base space (CIEBased colour spaces are an
example of this). In this case we will use the ProcessColorModel in
effect at the time as the space to convert to.

Its also (unfortunately) the case that when the input is a PDF file,
the PDF file uses transparency and the PDF file has transfer functions
set in the graphics state, that some kinds of operation (soft mask
groups for example) cannot have the transfer function simply applied.
This can result in surprising output. In these (admittedly rare) cases
removing the transfer function causes differently incorrect output.
There is no realistic way for us to take a PDF file like this and
produce an equivalent PDF file which does not contain transfer function.
Worse, we can't even detect this condition in advance.

This concludes the work required to support PDF 2.0 creation, and
Ghostscript should now be able to create and consume PDF 2.0 files
though additional work may be required, and we may choose to add
more functionality (eg Document Parts processing) in the future.

devices/vector/gdevpdfg.c
devices/vector/gdevpdfi.c
devices/vector/gdevpdfp.c
devices/vector/gdevpdft.c
devices/vector/gdevpsdf.h
devices/vector/gdevpsdi.c
devices/vector/gdevpsds.c
devices/vector/gdevpsds.h
doc/VectorDevices.htm


2017-08-23 16:41:14 -0700
Ray Johnston <ray.johnston@artifex.com>
bd8b456c088516e622659fb58c1079ef0d4aa21f

Fixes for .genordered

The zgenordered function created the "THRESH_STRING" length string
which would be rejected by sethalftone since the Width * Height was
not equal to the length of the Thresholds string.

Rather than a compile time switch, the .genordered param dict now
has /OutputType, one of /Type3, /ThreshString, or /TOSArray.

The supercell code still had a "realloc". This was replaced by the
simple ALLOC, memcpy, FREE equivalent.

There were still several places that used naked printf. Changed to
respect the "verbose" value or to use EPRINTF* macros. This required
a couple of new macros.

Lastly, add DITHERSC (SuperCellSize) and DITHERLEVELS (Levels) as
options in the gen_ordered_example.ps

base/gen_ordered.c
doc/Language.htm
psi/int.mak
psi/zht2.c
toolbin/halftone/gen_ordered/gen_ordered_example.ps


2017-08-22 11:27:38 -0700
Ray Johnston <ray.johnston@artifex.com>
1a9c68e70e338c31a1fbfce6c3750123c6dda319

Move gen_ordered.c from toolbin to base.

Modify to strip non LIB_BUILD functions from gen_ordered.c and
move gen_ordered.[ch] to base. Main now in gen_ordered_main.c with
project file referencing ../../../base/ for gen_ordered.[ch].
Modify the project file appropriately and add a simple Makefile for
unix.

base/gen_ordered.c
base/gen_ordered.h
base/lib.mak
base/msvclib.mak
base/openvms.mak
base/ugcclib.mak
base/unix-gcc.mak
base/unixansi.mak
psi/int.mak
psi/msvc.mak
psi/os2.mak
toolbin/halftone/gen_ordered/Makefile
toolbin/halftone/gen_ordered/README
toolbin/halftone/gen_ordered/gen_ordered.vcproj
toolbin/halftone/gen_ordered/gen_ordered_main.c


2017-08-19 14:36:59 -0600
Henry Stiles <henry.stiles@artifex.com>
37c454cb7f70fd27f14dd2c1b9c63528b3a237ab

Fix debug -dNOCACHE command line option.

In the last PL API change the code to disbable the cache was
accidentally removed.

xps/xpstop.c


2017-08-22 13:43:00 +0100
Chris Liddell <chris.liddell@artifex.com>
3d3fbafe4a8d1a74a3edb3acbe844da66e1176a2

Bug 698392: add a type check to transparency enum_param()

We were using a ref parameter as a name object without checking its type first

psi/ztrans.c


2017-08-22 13:32:02 +0100
Chris Liddell <chris.liddell@artifex.com>
e61805f2b5559647c0a9122cde508e278f331071

Bug 698391: check base_space pointer before de-referencing

in gs_pattern1_remap_color()

base/gxpcmap.c


2017-08-22 13:38:26 +0100
Ken Sharp <ken.sharp@artifex.com>
a8621022595d5af20f14e87f6ced620dbca43bad

pdfwrite - don't attempt to use the image-to-mask device unless its present

Bug #698390 "gswin32/64 crashes during PDF conversion"

This looks like a simple oversight, other places where we attempt to
use methods from the mask device we first check to see if we have a
mask device present, which we do not in this case. This commit simply
checks the presence of the mask device and doesn't attempt to use it
if we have not installed one.

No differences expected

devices/vector/gdevpdfd.c


2017-08-18 16:10:45 +0100
Chris Liddell <chris.liddell@artifex.com>
e0a921ea3457ae4fea740c4af532e9c103ee9366

Fix FAPI memory leaks.

Noticed while chasing down other memory issues.

Two issues, as it turns out:

Firstly, descendants of a composite font were not having the notify method set, so
we can free the FAPI related memory for the font.

Secondly, the Freetype incremental interface object created for each font was not
freed along with the font object.

base/fapi_ft.c
base/gxfapi.c


2017-08-21 17:05:09 +0100
Ken Sharp <ken.sharp@artifex.com>
7a9d86b5ed28862b671bfb65d3a4d0622ec745c1

XPS Interpreter - fix a formatting mistake

No impact, but it silences a compiler warning. Accidentally introduced
in commit 6162bbb7b804a0c70a35f218e59fa6c3118cd6a2

xps/xpszip.c


2017-08-21 09:46:42 +0100
Ken Sharp <ken.sharp@artifex.com>
6162bbb7b804a0c70a35f218e59fa6c3118cd6a2

Coverity IDs 158378, 158393

Add some limit checks to see if they silence Coverity. Also revisit the
check added in commit c5bf24912f589c881be44408e110ebdbb2fcd5b9 to
correct the limit check.

Coverity complains about reading values from a file format and then
using them without validating them. Its hard to see how to validate
values which can legitimately range over the whole space available. If
we add checks for that, then Coverity complains that the checks are
pointless (which is true of course).

In these cases, however, we are reading unsigned shorts into signed
integers, so we can add a (pointless, really) test to ensure that the
integer value lies in the range of a short. This should satisfy the
'tainted scalar' complaints and also should silence the overflow
warnings when using the values to allocate memory.

Normally I wouldn't do this as is costs performance, but we only execute
this code once when we open the file, so its negligible.

xps/xpszip.c


2017-08-19 14:53:28 +0100
Ken Sharp <ken.sharp@artifex.com>
c5bf24912f589c881be44408e110ebdbb2fcd5b9

Coverity IDs 158372 - 4, 158384

This is an attempt to work-around Coverity complaining about a 'tainted
scalar' or 'tainted argument'. This is caused by reading a 16-bit value
from the Zip central directory and then using it without checking the
bounds. Since the legal bounds are 0 - 2^16 its rather hard to see how
we can bounds check this....

If this doesn't silence the warnings tomorrow, or creates new ones
complaining that the bounds check is pointless (this has happened with
Coverity before) then I'll undo this commit and just tell Coverity
to ignore the warning.

xps/xpszip.c


2017-08-19 10:54:59 +0100
Ken Sharp <ken.sharp@artifex.com>
c57ea7b20d39f0e56432c9cc7bbb7f59fcc544e9

Coverity ID 158375

The function xps_set_nocache() is pointless, it doesn't do anything at
all, it merely retrieves a value from the PCL state stored in the
current instance. I suspect the value retrieved is garbage, since this
is XPS, not PCL, but since we never even use it, its irrelevant.

Whatever the original thinking behind this function was, its not doing
anything useful, so simply remove it.

xps/xpstop.c


2017-08-19 10:28:25 +0100
Ken Sharp <ken.sharp@artifex.com>
c552209d54f69152332795bd833fb3d655e79c48

Coverity ID 158394

I don't actually think the Coverity warning is possible, but I cannot be
absolutely certain, so its simpler just to explicitly set the contents
of these two arrays to a fixed 0 before we start. Its a low overhead if
we do it at the start of the routine.

devices/vector/gdevpsf2.c


2017-08-18 16:08:53 +0100
Ken Sharp <ken.sharp@artifex.com>
57bb7d00e180439440ab1be775fad94e13d340ff

PDF interpreter - Cover some cases of illegal /Parent entries

Bug #698372

The PDF file has a Page with an invlalid /Parent (it references the Page
object). Attempting to use that Page object fails when tracking Resources.

This commit alters the object storage introduced with the PDF unique
font identification so that *any* dictionary with a /Type gets its
object number stored inside it. We can then compare the object and the
Parent when tracking resources and refuse to follow a self-referencing
object.

No differences expected

Resource/Init/pdf_base.ps
Resource/Init/pdf_main.ps


2017-08-17 15:46:17 +0100
Chris Liddell <chris.liddell@artifex.com>
39648c6aafbe7ff790dd4dddf577def1fa7b1f07

Bug 698363: bounds check against length of loca table

In the FAPI code retrieving the glyph data, we weren't checking that the glyph
index was inside the loca table (i.e. that it was less than or equal to the
number of glyphs available in the font).

psi/zfapi.c


2017-08-16 15:12:14 +0100
Chris Liddell <chris.liddell@artifex.com>
2b138093cf78d9f72596a764d4225b5022ed9d9c

Bug 698356: Add reference counting for SMask ICC profiles

Previously, we didn't properly reference count the ICC profiles for
soft masks because we simply swapped in the ones for the mask, and swapped out
the ones "in force" at the time into temporary storage, then swapped them back
when the SMask was complete.

That works fine *if* the PDF is well formed, and thus the SMask completes. But
it causes havoc if the PDF is invalid and causes an error during the processing
of the SMask.

We'll now properly reference count the profiles.

base/gdevp14.c


2017-08-12 16:24:54 -0700
Ray Johnston <ray.johnston@artifex.com>
f6cabb1a7264e81a4b80a515717f7cc8938f1145

Add .gen_ordered operator to PS and htsc_gen_ordered to gs lib

If GS_LIB_BUILD is #defined, gen_ordered.c API can be called from GS to
allow for addittion of a PS operator to make a HalftoneType 3 (threshold
array based halftone) controlled by parameters from a dictionary.

The result is can be used by sethalftone or as a HalftoneType 5 halftone.

Also some warnings cleaned up and add checks for ALLOC fail.

Add a gen_ordered parameter to control verbosity of printing The default
is 0, which is error messages only. Error messages are generated to
stderr (using the EPRINTF* macro).

Add documentation of these two new operators in doc/Lagnuage.htm

Add an example toolbin/halftone/gen_ordered/gen_ordered_example.ps
of usage of ,genordered and some related rendering options.

Other parsers (PCL or XPS) may call htsc_set_default_params and
htsc_gen_ordered as well to make ordered dither halftone generation
more flexible, but the integration into non-PS parsers is left for
later.

Makefile.in
base/lib.mak
base/msvclib.mak
base/openvms.mak
base/ugcclib.mak
base/unix-gcc.mak
base/unixansi.mak
doc/Language.htm
psi/int.mak
psi/msvc.mak
psi/os2.mak
psi/zht2.c
toolbin/halftone/gen_ordered/gen_ordered.c
toolbin/halftone/gen_ordered/gen_ordered.h
toolbin/halftone/gen_ordered/gen_ordered_example.ps


2017-08-11 10:43:52 -0700
Ray Johnston <ray.johnston@artifex.com>
e64f5a2eaeb5c667bfc6bf584f4d7655c8b6b959

Refactor gen_ordered to allow for use by an application (ghostscript).

Also Refactor htsc_save_tos to extract htsc_mask_to_tos to convert
final_mask.data to turn_on_sequence.

If GS_LIB_BUILD is #defined, the "main" and functions that write files
will not be included, and all but a few of the functions will be made
static. Exported functions are:
htsc_set_default_params
htsc_gen_ordered

Also ALLOC and FREE are used to allow the use of a memory allocator
(such as ghostscript's) and PRINTF and EPRINTF macros are used to
allow for redirection of messages.

toolbin/halftone/gen_ordered/gen_ordered.c
toolbin/halftone/gen_ordered/gen_ordered.h
toolbin/halftone/gen_ordered/gen_ordered.vcproj


2017-08-15 16:56:58 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
376e4a546024d9d5f22d1f0a76294d5605ad82be

Bug 694680: Prevent SEGV due to uninitialised structure.

Changing compression within an image is unimplemented but for
now we return an error.

However, changing to eNoCompression is allowed since no
uninitialised structures are encountered.

pcl/pxl/pximage.c


2017-08-15 09:20:34 +0100
Ken Sharp <ken.sharp@artifex.com>
5628bd182819bafe965cbf86649e678a6701f818

pdfwrite - remove obselete code

Originally included as part of the colour management rework, this was
never actually needed, so remove it.

devices/vector/gdevpsds.c
devices/vector/gdevpsds.h


2017-08-15 09:19:27 +0100
Ken Sharp <ken.sharp@artifex.com>
55e3ee85c171a0d7e563535c77d69a8773f17265

Fix some spurious code in the CUPS device, flagged by the compiler

Somehow a few lines of code were duplicated, fortunately this was
benign, but lets remove the nonsense lines anwyay.

cups/gdevcups.c


2017-08-11 08:30:24 -0700
Michael Vrhel <michael.vrhel@artifex.com>
ffa47bc975171d8839af1cf8fb9677c173cff0e6

Bug 696386 Fuzzing

Take slow path if we have a 16bit indexed image

base/gxi12bit.c


2017-08-10 17:39:05 -0700
Michael Vrhel <michael.vrhel@artifex.com>
fb37a099ccc86c2af63794167ccc1799c6fc06a0

Clean up warning in gen_ordered.c

The comment about what the levels of quantization
were when no size was given for the macro cell was
not correct

toolbin/halftone/gen_ordered/gen_ordered.c


2017-08-10 17:17:39 -0700
Michael Vrhel <michael.vrhel@artifex.com>
723d2a565e726cc6f29f4d32f202c29a995b4e37

Bug 698344 gen_ordered.c

Fix case for -r600 -l144 -a45 -q64 -s8
A problem where we only need to take
one dot location for our first quantization level (there were
not multiple dots set to get that level)

toolbin/halftone/gen_ordered/gen_ordered.c


2017-08-10 13:15:15 -0700
Michael Vrhel <michael.vrhel@artifex.com>
f08687ffb24f641f7ed788ccf152752cd502df88

Fix ambiguity in creation of turn on sequence

When dot profile values are the same due to tiling,
force decision as to which one to turn on next based
upon distance to center of dot mask.

toolbin/halftone/gen_ordered/gen_ordered.c


2017-08-09 14:58:02 -0700
Michael Vrhel <michael.vrhel@artifex.com>
a664e0d6601c80388cd8af765400ce071ee8f967

Fix minor offset issue in gen_ordered.c

toolbin/halftone/gen_ordered/gen_ordered.c


2017-08-07 17:12:54 +0100
Ken Sharp <ken.sharp@artifex.com>
913acc7c63921770e755a39fca3f768dda49be5d

PDF interpreter - PDF 2.0 - basic support for UTF-8 strings

I'm sure this will require more work in future, but for now this is at
least as good as our support for UTF-16 strings.

Resource/Init/pdf_draw.ps
Resource/Init/pdf_ops.ps


2017-08-07 13:44:06 +0100
Ken Sharp <ken.sharp@artifex.com>
2efe17a30ff9a72f0698add0bd8708f3ef1d3b99

PDF interpreter - fix typos

two typos in error messages, 'endjobj' should be 'endobj'

Resource/Init/pdf_base.ps


2017-08-07 13:37:59 +0100
Ken Sharp <ken.sharp@artifex.com>
9a5e5e3c396fb18bcd21158c4f44596eed69e5d0

PDF interpreter - PDF 2.0 support - per page OutputIntents

The only way previously to handle *any* OutputIntents array was to
specify UsePDFX3Profile and give the array index of the required
profile.

This is too inflexible as each page can have a different array, so the
indices may be different on each page. Add a new switch -dUseOutputIntent
which takes a string argument.

If we have set -dUseOutputIntent, then check teh document level and each
page for an array of OutputIntents. If found, check each OutputIntent
dictionary for a OutputConditionIdentifier and compare it with the
specified string. If the OutputConditionidentifier is 'Custom' then use
the value of the Info key instead.

Resource/Init/pdf_main.ps
doc/Use.htm


2017-08-07 10:07:06 +0100
Ken Sharp <ken.sharp@artifex.com>
04fd73cadbf91e7a9cf0dee0129384ce23aa3000

PDF interpreter - PDF 2.0 support add UseBlackPtComp

Michael already implemented the use of black point compensation, and
we have a PostScript operator to turn it on and off already (GS
defaults to on).

This just hooks up the PDF 2.0 graphics state entry to the existing
framework. Note that the PDF entry is a boolean whereas our existing
PostScript operator takes 0 or 1, so there's a little fiddling to get
that right.

Resource/Init/gs_init.ps
Resource/Init/pdf_draw.ps
Resource/Init/pdf_ops.ps
psi/zcolor3.c


2017-08-07 10:04:27 +0100
Ken Sharp <ken.sharp@artifex.com>
dcc9ea12638e99917b28b49c120a52c8e309d9fa

PDF interpreter - support for PDF 2.0 add HTO

I doubt we will ever see a Halftone Origin for real. According to the
specification its like a halftone phase but with a different co-ordinate
system.

For now simply treat its as a halftone phase, if anyone ever complains
we can address it, because they will be able to supply an example to
work from.

Resource/Init/pdf_draw.ps


2017-08-06 12:24:21 -0700
Ray Johnston <ray.johnston@artifex.com>
478a0a862d2593199bcae599e46bdc97b525bb12

Bug 698334: LeadingEdge parameter problems.

Because -dLeadingEdge=# sets the value in systemdict, we need to return
this parameter from gx_default_get_param and gx_default_get_params so that
the systemdict value will get sent to the device (putdeviceprops).

Also found that the JPEG device was using LeadingEdge, but not stripping
off the "LEADINGEDGE_SET" bit. Fix by anding with LEADINGEDGE_MASK.

Lastly, the cups device put_params needs to be able to accept a null
parameter type as the default put_params can.

base/gsdparam.c
cups/gdevcups.c
devices/gdevjpeg.c


2017-08-06 02:23:55 +0800
Sebastian Rasmussen <sebras@gmail.com>
d91d4273f38fb8a527ff342d360cee8aaf468896

Allow for symbol dictionary with 0 symbols.

jbig2dec/jbig2_symbol_dict.c


2017-05-14 17:50:32 +0800
Sebastian Rasmussen <sebras@gmail.com>
b5a27404ff64c427d8bcdbd16742ab15a4f6cda5

Plug leak of parameter info in command-line tool.

jbig2dec/jbig2dec.c


2017-05-14 17:44:45 +0800
Sebastian Rasmussen <sebras@gmail.com>
1d939952cc3262c8e7b31247046f4e7d9c2d7394

Do not grow page if page height is known.

Previously an encountered region segment could cause the page
height to be increased if the segment height/position occurred
outside of the page boundaries. This happened regardless of
whether the page height was previously known or unknown.

jbig2dec/jbig2_page.c


2017-08-05 11:23:25 +0100
Ken Sharp <ken.sharp@artifex.com>
22dca483140d23a73ab7db835e7d923a91745b6f

pdfwrite - begin support for PDF 2.0

Permit CompatibilityLevel to be 2.0 for production of PDF 2.0. We may
eventually make this the default.

Don't write ProcSet resources when creating PDF 2.0
Don't write a Producer etc in the Info dict when creating PDF 2.0
Don't write DOCINFO pdfmarks in the Info dict when creating PDF 2.0
Don't write CharSet key in font dictionaries when creating PDF 2.0
Write FontDescriptor, Widths, FirstChar and LastChar for base 14 fonts
when creating PDF 2.0

Don't write Transfer functions in graphics states when creating PDF 2.0.
We need to add the ability to 'apply' transfer functions for proper
support here.

Need to add support for BlackPointCompensation and (possibly) per-page
OutputIntents when the PDF itnerpreter has been upgraded to support
these.

devices/vector/gdevpdf.c
devices/vector/gdevpdfb.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfi.c
devices/vector/gdevpdfm.c
devices/vector/gdevpdfp.c
devices/vector/gdevpdft.c
devices/vector/gdevpdfv.c
devices/vector/gdevpdtd.c
devices/vector/gdevpdtt.c


2017-08-01 15:57:17 +0100
Chris Liddell <chris.liddell@artifex.com>
dcda07a31c90ff1ece5a92961eb83b58ffc44be4

Bug 697232: URW++ font update from 2017/07/27

Adds blue zones for the top features of numbers in:
NimbusSans-Italic
NimbusSans-Regular

Resource/Font/NimbusSans-Italic
Resource/Font/NimbusSans-Regular


2017-08-04 09:22:36 +0100
Ken Sharp <ken.sharp@artifex.com>
cd1c10382c868b8bd8dba9b52ea7fca970f95eaa

pdfwrite - initialise some new downscale parameters

Bug #698329 "Floating point exception in s_IScale_init()"

Commit a936cf76a33389610b558ffaf5de7389265fd657 to fix Bug #693684
"Add InterpolateControl parameter to limit image interpolation." added
a new parameter 'abs_interp_limit' but omittted to initialise the
variable in pdfwrite's use of the filter.

This led to an unuinitialised variable, which could eventually cause a
divide by zero fault.

It seems this parameter is only used when scaling up, so this commit
simply sets it to the minimum value of 1. At the same time initialise
a couple of other parameters too, these are probably unused and in any
event should be initialised by the filter code, but its best to be safe.

devices/vector/gdevpsdi.c


2017-08-02 13:41:59 +0100
Ken Sharp <ken.sharp@artifex.com>
ca1ec9b486ddba3f921355fd1d775f27f4871356

PDF interpreter - remove the PDFDontUseObjectNum switch

This was implemented to allow us to restore the default behaviour if
it caused problems. No real problems reported, so lets get rid of
(yet another) of our many, many command line switches.

Resource/Init/pdf_font.ps


2017-07-29 18:18:58 +0100
Robin Watts <robin.watts@artifex.com>
cdd2b1bcafdc9108f843183a22360ffbc65525a1

Bug 698034: Fix various problems with MFS downscaling to cmyk.

Firstly, the mfs buffer was not large enough.

Secondly, the downscaling logic in down_core4_mfs was broken - fixed
by copying it from down_core4.

Thirdly, the sense of the mfs was inverted (we had forced the white
spots to be zero).

All in all, my finest work. :(

Fixed here.

base/gxdownscale.c


2017-07-27 13:22:50 -0700
Ray Johnston <ray.johnston@artifex.com>
8321323b7c31828d79c0aa1b5c0312f156a53192

Fix Bug 695333: PDF 1.4 transparency did not support Spot Color clist devices

Not just the tiffsep device named in the bug, but the psdcmyk device would
also fail if the clist was used. This file needs to be in the regression suite.

Fix by adding a pdf14_clist_copy_planes proc that forwards to the underlying
clist device. NB: The pdf14 rendering device already had a copy_planes device
which is used in page mode or during clist playback.

base/gdevp14.c


2017-07-28 15:58:38 +0100
Ken Sharp <ken.sharp@artifex.com>
8b721623f5fee0150822f7ead66ca5820d74e568

Fix a couple of documentation typos

doc/Use.htm


2017-07-28 13:37:17 +0100
Ken Sharp <ken.sharp@artifex.com>
7454690eb64cb71c13e957fc47e9881463d01ba4

Coverity ID 158374 - cater for anerror return

This probably isn't possible, we're getting a repeat form so the original
form must be already stored, but its worth the error check.

devices/vector/gdevpdfi.c


2017-07-28 12:06:01 +0100
Ken Sharp <ken.sharp@artifex.com>
afa8fb82aea663e3da2d7e0e297ca9bc401a1912

Coverity ID 158379 identical branches

Coverity is obviously correct that the two branches are identical. I'm
no longer certain of how this works, but I did test it quite extensively
at the time so I'm going to assume that the code is correct and simply
remove the branch logic which seems to be pointless.

base/gxshade1.c


2017-07-28 11:37:14 +0100
Ken Sharp <ken.sharp@artifex.com>
f26ebc119717475bef5b6fd6068af5f0ab779dc9

Coverity ID 158388 - don't dereference a pointer before checking it is non-NULL

base/gdevdflt.c


2017-07-28 11:08:18 +0100
Ken Sharp <ken.sharp@artifex.com>
0947a042bab551b60f9004366bc06b098b8bdbf3

Coverity ID 158394 - uninitial;ised scalar variable subrs_count[j]

Unlike other instances of this, I can't be certain that its impossible
to read the data when its not been initialised, and in other places
we zero the memory when we change the current hint size, which suggets
that its at least potentially possible, so here we zero the array of
bits (flags).

No differences expected

devices/vector/gdevpsfx.c


2017-07-27 16:33:08 +0100
Ken Sharp <ken.sharp@artifex.com>
e5d24b703e5413732f2ef58d8fcd5b4803865d7c

pdfwrite - don't handle some kinds of x/yshow with TJ

Bug 698218 "Font matrix woes, also with PDF Reader/Writer"

In fact this is not a problem with the FontMatrix. The problem is
actually to do with the way the PDF interpreter executes certain kinds
of operation, basically Fonts where the /Widths array entries don't
match the actual glyph widths.

In this case we use an x/yshow operation with the modified width, and
this works perfectly well for rendering. However, for pdfwrite, we can
try to use the TJ operator, which works in a slightly different way...

xshow takes a displacement which is measured from the origin of the first
glyph to the origin of the following glyph, TJ by contrast adds a
displacement after the first glyph is rendered. Normally we essentially
subtract the width from the displacement to find the TJ value. However,
if the Widths array overrides the glyph width, and the actual glyph
width is significantly different (eg 0), then what happens is that
we apply the modified width after rendering the first glyph, and then
apply the TJ displacement. In effect applying it twice.

Detecting this condition turned out to be essentially impossible, there
are too many cases in PostScript files where similar trickery is pulled
to reliably determine that this occurs. It is, however, rare, especially
in PDF files, because very few fonts are neither horizontal nor vertical
in their FontMatrix (shearing is not uncommon but that's different)

So this commit adds a new boolean which we set false only when we have
a x/yshow operation, and the width and real width do not match (which
happens when we have a /Widths mismatch). This prevents the TJ being
applied and uses direct text positioning commands instead, which works.

devices/vector/gdevpdte.c
devices/vector/gdevpdts.c
devices/vector/gdevpdts.h


2017-07-25 13:55:19 -0600
Henry Stiles <henry.stiles@artifex.com>
44ccac6fb19ec0e3f42b2b51ec4b2b6a4438af71

Add an upper bound for pattern and bitmap source heights.

pcl/pxl/pxptable.c


2017-07-21 13:03:54 -0600
Henry Stiles <henry.stiles@artifex.com>
92e2f00d88d664e5249792458c276b6be89b37fa

Remove unnecessary padding.

pcl/pxl/pximage.c


2017-07-21 10:59:35 -0600
Henry Stiles <henry.stiles@artifex.com>
bcae781b1f4ef69a67c287f187cf871cd5db60f0

Fix 694654 - fuzzing seg fault.

The clip path accumulator device (gxacpath.c) does not support raster
operations so don't install the device if the raster operation is not
default.

To support raster ops the device would need to add procs for get_bits,
get_bits_rectangle, strip_copy_rop, and copy_color (used by get_bits
potentially), then it would need to render the accumulated path using
the current raster operation (it uses "lop_default" now). The
optimization is not useful in real world PCL files so we choose to
bypass it.

base/gsimage.c
base/gximask.c
base/gximask.h


2017-07-18 13:50:33 -0600
Henry Stiles <henry.stiles@artifex.com>
dbb4ea0147655b70ee51c18f9963566057b05dc6

Fix 694643 fuzzing segfault.

It was possible to write past the end of the gs_debug array.

pcl/pcl/pgconfig.c


2017-07-21 09:38:13 -0700
Ray Johnston <ray.johnston@artifex.com>
be281458bc48aa20acd7d276fb1e1713f1966750

Fix bug 694654: Stale cdev->clip_path with image

base/gxclimag.c


2017-07-20 13:23:14 -0700
Ray Johnston <ray.johnston@artifex.com>
0d751be73cfa40e45bee50560873bf01884b9d92

Add ROUNDSPOT function and fix limit on lpi search.

ROUNDSPOT added as growing white circle transitioning to shrinking black
circle.

Also there was an arbitrary limit of lpi <= res/10.0 (y<11) that I changed
to allow things like -l30 -r600 to give more than 100 levels.

toolbin/halftone/gen_ordered/gen_ordered.c


2017-07-25 12:58:02 +0100
Ken Sharp <ken.sharp@artifex.com>
f816b092c1f69c0fed977aa8804dadd04f0296a5

PDF interpreter - cope with corrupted Pattern

Bug #696410 "Seg faults found by fuzzing in pattern_paint_finish (zpcolor.c:321)"

The file no longer seg faults, but it did enter an endless loop, caused
by the pattern code consuming the saved dictionary for the 'q' (gsave)
operation, but leaving another different dictionary on the dictionary
stack.

The code here 'ends' teh current dictionary if it has neither a /n or
/self key, otherwise it calls 'Q' which will end it anyway. This
prevents the loop being endless because countdictstack is greater
than the saved dict count, but the current dictionary isn't the
result of a gsave.

No differences expected

Resource/Init/pdf_draw.ps


2017-07-25 11:30:20 +0100
Chris Liddell <chris.liddell@artifex.com>
f0b4fc4f870ada5264c74c17094c982a66bcb42c

Bug 698287: fix out of bounds access in c_pdf14trans_write

In pdf14_clist_create_compositor() we create a temporary compositor command to
change the compositor procs and avoid creating subsequent compositors (rather
than enable/disable/reconfigure the already existing compositor).

The problem arises because we create and only copy the data defined by
the generic gs_composite_t type, rather than the pdf14 compositor specific
type (gs_pdf14trans_t).

Change so we use, and copy, the full pdf14 compositor command type.

base/gdevp14.c


2017-07-25 11:02:07 +0100
Chris Liddell <chris.liddell@artifex.com>
f98e88cabfa7161ec098e0aaf9d94df52923a212

Move the PCL/PXL/XPS example files into pcl/examples

instead of pcl/tools

pcl/examples/bitfont.pcl
pcl/examples/bitfonts.pxl
pcl/examples/fills.pcl
pcl/examples/fontpage.pcl
pcl/examples/fonts.pcl
pcl/examples/fonts.pxl
pcl/examples/frs96.pxl
pcl/examples/gl-chars.pcl
pcl/examples/grashopp.pcl
pcl/examples/grid.pcl
pcl/examples/label.tst
pcl/examples/lineprinter.pcl
pcl/examples/null.pxl
pcl/examples/opaque.pcl
pcl/examples/origins.pcl
pcl/examples/owl.pcl
pcl/examples/owl2.pcl
pcl/examples/pattern.pcl
pcl/examples/pattern.pxl
pcl/examples/tiger.px3
pcl/examples/tiger.xps
pcl/examples/vasarely.px3


2017-07-21 15:03:16 +0100
Chris Liddell <chris.liddell@artifex.com>
910927d86239c80cc5bc365445c1df7a6e5fa8da

Bug 696387: iccprofile ref counting in gdevp14 compositor

The transparency compositor does extensive swapping and creating of ICC
profiles but was less than well disciplined with the reference counting. This
moves *most* of the profile swapping to a consistent use of the reference
counting.

The one remaining exception is the handling of colors for soft masks, which are
still handled "specially".

base/gdevp14.c


2017-07-13 13:57:30 +0100
Chris Liddell <chris.liddell@artifex.com>
f060b1bffacca60b45b9be1b94a8944ca2608930

Bug 698188: (clist) prevent reading off the end of a bitmap buffer

In clist_copy_mono, when the bitmap is clipped (in the x-direction) we apply
gross clipping to the bitmap data - the "clip" the left edge of the bitmap
to the nearest byte.

The problem is that we then calculate the aligned bitmap raster from that
byte offset. Thus, in the uncompressed case, if we copy the aligned raster
bytes for each scanline, we *can* end up reading off the end of the buffer.

Instead, use width/8 bytes as the amount to copy for each scanline. Then, if
necessary, zero the padding bytes.

base/gxclbits.c


2017-07-06 14:54:02 +0100
Chris Liddell <chris.liddell@artifex.com>
671fd59eb657743aa86fbc1895cb15872a317caa

Bug 698158: prevent trying to reloc a freed object

In the token reader, we pass the scanner state structure around as a
t_struct ref on the Postscript operand stack.

But we explicitly free the scanner state when we're done, which leaves a
dangling reference on the operand stack and, unless that reference gets
overwritten before the next garbager run, we can end up with the garbager
trying to deal with an already freed object - that can cause a crash, or
memory corruption.

psi/ztoken.c


2017-07-13 13:36:19 +0100
Chris Liddell <chris.liddell@artifex.com>
18a2365b69cc43ed4dbe2bfd44f739622623821c

Update fonts to latest URW++ release (2017/05/01)

Plus 2017/07/20 update

Fixes bugs 696582, 697232 and 697058

Resource/Font/C059-BdIta
Resource/Font/C059-Bold
Resource/Font/C059-Italic
Resource/Font/C059-Roman
Resource/Font/NimbusMonoPS-Bold
Resource/Font/NimbusMonoPS-BoldItalic
Resource/Font/NimbusMonoPS-Italic
Resource/Font/NimbusMonoPS-Regular
Resource/Font/NimbusRoman-Bold
Resource/Font/NimbusRoman-BoldItalic
Resource/Font/NimbusRoman-Italic
Resource/Font/NimbusRoman-Regular
Resource/Font/NimbusSans-Bold
Resource/Font/NimbusSans-BoldItalic
Resource/Font/NimbusSans-BoldOblique
Resource/Font/NimbusSans-Italic
Resource/Font/NimbusSans-Oblique
Resource/Font/NimbusSans-Regular
Resource/Font/NimbusSansNarrow-BdOblique
Resource/Font/NimbusSansNarrow-Bold
Resource/Font/NimbusSansNarrow-Oblique
Resource/Font/NimbusSansNarrow-Regular
Resource/Font/P052-Bold
Resource/Font/P052-BoldItalic
Resource/Font/P052-Italic
Resource/Font/P052-Roman
Resource/Font/URWBookman-Demi
Resource/Font/URWBookman-DemiItalic
Resource/Font/URWBookman-Light
Resource/Font/URWBookman-LightItalic
Resource/Font/URWGothic-Book
Resource/Font/URWGothic-BookOblique
Resource/Font/URWGothic-Demi
Resource/Font/URWGothic-DemiOblique
Resource/Font/Z003-MediumItalic
Resource/Init/Fontmap.GS
psi/psromfs.mak


2017-07-24 15:54:41 +0100
Ken Sharp <ken.sharp@artifex.com>
bfed2aa2b1d854d4b63bc75957438e38fca361fc

PDF interpreter - permit Widths arrays to contain indirect objects (!)

Bug 698275 "GPL Ghostscript 9.21: Failed to interpret TT Instructions"

The actual problem is that the PDF file contains a Widths array where
one or more of the entries is an indirect object. Since this has no
useful purpose beyond making the PDF file larger I can't think why this
has been done.

Nevertheless, as usual 'Acrobat accepts it' so now we do too.

The complain about the TT instructions is because in addition the file
contains two TrueType fonts which are broken.

Resource/Init/pdf_font.ps


2017-07-19 22:05:33 -0700
Ray Johnston <ray.johnston@artifex.com>
983e56cb679768fe5a048fbb33a43259efb9afbf

Fix Bug 696398: Segfault with fuzzing file.

Oveflow of integer caused later failure even if allocation of the
ht_buffer succeeded. Detect overflow, return error.

base/gxht_thresh.c


2017-07-19 12:13:30 -0700
Ray Johnston <ray.johnston@artifex.com>
877cbdf0b279bb4bf5f3b74182ab6d0101095f99

Fix bug 696402: Segfault with fuzzed data caused by dda overflow.

The ty of the matrix in the fuzzed data was a very large value that
resulted in the Y for an image being near the limit for the dda,
so the first step (dda_next) overflowed from positive to negative
resulting is a large destination height calculation (vdi). Prevent
this by not stepping if it would cause an overflow. This will be
outside the clip limits, so will not affect the output.

base/gxidata.c


2017-07-20 13:36:46 +0100
Ken Sharp <ken.sharp@artifex.com>
91fd78617440c18288b6d4cd226fa3f77db91705

Update the nulldevice for DeviceN

Bug #696383 "Seg faults found by fuzzing in get_num_pdf14_spot_colors (gstrans.c:720)"

The problem here is really an example of our poorly maintained device
API. As stated previously the comments in the code seem to indicate
that all devices should either implement their own versions of all
the device methods, or use the graphics library default method. No
device method should be NULL, so it should never be necessary to check
this.

Sadly, many of our devices have NULL entries for some methods, and in
this case the nulldevice did not implement a method for
'ret_devn_params'. Presumably this was missed when the mthod was added.

In this commit, just up date the device to use the default method.

base/gdevnfwd.c


2017-07-18 16:36:15 +0100
Ken Sharp <ken.sharp@artifex.com>
64cb7a492292eb40a01de760be832b7d5425d8e9

PDF interpreter - detect and ignore recursive Form XObjects

Bug #698226 "Error: /rangecheck in --run--"

The PDF file supplied in the bug is broken, it has a Form XObject:

285 0 obj
<<
/BBox [ 294.572 797.586 306.188 793.466 ]
/Group 287 0 R
/Matrix [ 1 0 0 1 0 0 ]
/Resources <<
/ExtGState <<
/GS0 32 0 R
>>
/XObject <<
/Fm0 285 0 R
>>
>>
/Subtype /Form
/Length 58
>>
stream
q
0 Tc 0 Tw 0 Ts 100 Tz 0 Tr []0 d
/GS0 gs
0 TL/Fm0 Do
Q
endstream
endobj

The file throws an error in Acrobat, Ghostscript recurses the Form until
it hits an execstackoverflow, and is then unable to proceed. Testing
Acrobat we see that it can detect recursion even when its not a simple
self-reference, a child referencing a parent is also detected and
ignored.

In the PDF interpreter we normally push a dictionary on the operand
stack and record objects as we encounter them, checking each new one
against all the ones executed so far, and exit if we find reuse. This
approach doesn't quite work for Form XObjects, because we cannot be
certain of the operand stack shape when a Form is executed, and so we
cannot locate our dictionary.

Instead we now store the dictionary in the top level 'pdfdict' which is
always available. The technique is otherwise the same.

I'm not totally happy with this, but its the best compromise between
performance hit, memory use and code frailty I could come up with.

No differences expected.

Resource/Init/pdf_draw.ps
Resource/Init/pdf_main.ps


2017-07-13 16:02:16 -0600
Henry Stiles <henry.stiles@artifex.com>
cea2da4aae1edbf6aef128f44962cfe8baa5c728

Fixes Bug 697900 - No support for disk resident fonts.

Support added for using PCL font resources from the PJL file system.
Macros have always been supported and using a font wrapped in a macro
as a workaround works, but this isn't quite correct or convenient.
Also refactoring and better error handling for alphanumeric key support.

pcl/pcl/pcsfont.c


2017-07-12 08:53:21 -0600
Henry Stiles <henry.stiles@artifex.com>
8d195215c057f4df0c609828b5da65c7f3462588

Fix bug #697650 - RemoveFont opearator error handling.

The RemoveFont operator produced an error and stopped processing when
the font was not found, now we produce a warning and continue like HP.
Other areas of the code needed tidying up as well. The
px_widen_font() function did not NULL the font output parameter
according to its spec and RemoveFont did not check there wasn't an
error before attempting to remove the font from the font dictionary

pcl/pxl/pxffont.c
pcl/pxl/pxfont.c


2017-07-17 09:19:14 +0100
Ken Sharp <ken.sharp@artifex.com>
798bc40317ba4b552560f4ceede1607c561ef54c

pdfwrite - remove the 'deferred free' code

Now that the memory cleanup is completed, we can remove the 'hack'
that defers really freeing freed memory in the memory manager.

devices/vector/gdevpdf.c


2017-07-13 13:43:45 +0100
Ken Sharp <ken.sharp@artifex.com>
091b860bcde7fc610cff89b7711c59597dc06674

pdfwrite - memory management cleanup

Bug #696608 "Use after free error in PDF write"

As per the instructions in the original bug report, filling free memory
with 0x00 causes seg faults because of 'use after free' conditions in
the pdfwrite resource management.

There were a number of problems solved in order:

1) Move freeing of colour spaces until after shadings are freed, because
shadings can refer to colour spaces.

2) Colour space and function resources can reference other resources of
the same type. clear such references before freeing the resources.

3) 'Other' resources can potentially reference other resource types
(seen with Colorant dictionaries referencing colour spaces). We need to
clear these references before freeing the resource types. Also, move the
freeing of 'other' resources until nearer the end.

4) The 'Metadata' resource was previously added to the Catalog
dictionary after the 'Other' resources were freed, so the fact that it
was double referenced (once from resourceOther, once from 'global named
object' wasn't a problem. Now that we free 'other' resources later,
this could lead to double freeing. Explicitly remove the Metadata
reference from the 'other' resource chains to prevent this.

Running this on the cluster fixes all the pdfwrite problems, it does
however leave one file which still causes problems, just not with pdfwrite.

Bug688308.ps seg faults on the cluster with differing configurations,
it isn't stable, so I suspect garbage collection may be involved. Its a
rather complicated page from a yellow pages directory, and involves
numerous EPS files from varied sources. Unfortunately I can't reproduce
a problem locally.

However, its not a pdfwrite problem.

devices/vector/gdevpdf.c
devices/vector/gdevpdfe.c
devices/vector/gdevpdfo.h
devices/vector/gdevpdfu.c
devices/vector/gdevpdfx.h


2017-07-10 15:06:36 -0600
Henry Stiles <henry.stiles@artifex.com>
7276327a2f78290a7d526df493d92325947a834d

Bug 698147 - PXL "passthrough" initialization problem.

Don't let PCL clear the current page if XL has marked the page.
Thanks to Norbert Janssen for the patch.

pcl/pxl/pxpthr.c


2017-07-10 11:09:57 -0600
Henry Stiles <henry.stiles@artifex.com>
ec906d206f6ed044b6b7e1b1cc7551150b8db6d4

Bug 698125 - JPEG RGB not grayscaled.

Using the XL JPEG compression scheme it is possible to have a mismatch
between color space in the graphics state and image. This cannot
happen in any other PXL raster format except JPEG and we expect it
will rarely happen in the normal workflows. We detect the the
mismatch and convert the rgb triples to gray triples in advance of
rendering the scanline.

pcl/pxl/pximage.c


2017-06-28 17:14:14 -0600
Henry Stiles <henry.stiles@artifex.com>
df8ac78c06cc6093409142aaee839cd4bf953588

Renaming and refactoring, no functional differences.

In particular, we get rid of the "universe" structure and move its
members into the main instance.

pcl/pl/plapi.c
pcl/pl/plmain.c
pcl/pl/plmain.h


2017-07-06 13:57:41 -0700
Ray Johnston <ray.johnston@artifex.com>
21e28148792158aba5cf2b93fad755455d0cc8ba

Fix viewpbm.ps FITPAGE SCALE option

lib/viewpbm.ps


2017-07-05 08:45:10 -0700
Ray Johnston <ray.johnston@artifex.com>
12cb9d16d69cd3430b86d0bdfea7f73fcbeeceb3

Fix regression from InterpolateControl change that affects pattern-clist

Seen with comparefiles/Bug689851.pdf as missing interpolation.

The clist_make_accum_device did not copy the interpolate_control value
from the target. Also copy the params for non-clist pattern accum
devices and forwarding devices along with graphics_type_tag.

base/gdevnfwd.c
base/gxclist.c
base/gxpcmap.c


2017-07-05 10:59:18 +0100
Robin Watts <robin.watts@artifex.com>
6b24e08b26bbd99082e36785fe742108ab705c23

Bug 698135: Import security fix for OpenJPEG

https://pdfium.googlesource.com/pdfium/+/463b77b4f1e4257cd89f3460b5a6fdb102f44265%5E%21/#F0

Patch doesn't apply cleanly, but requires some manual conflict
resolution.

openjpeg/src/lib/openjp2/dwt.c


2017-07-05 14:31:31 +0100
Ken Sharp <ken.sharp@artifex.com>
095a0c9e9c16b5c131709d2d831f97a77084f1bd

pdfwrite - prevent substitution of an SMask for an identical parent image

Bug #698128 "PDF created by gs generates "recursive /SMask" messages when run with gs"

When we have the (highly unusual) case where an image dictionary has an
SMask entry, and the SMask is an image which is identical to the parent
in every respect (dictionary contents, stream data) except for the
SMask key, it was possible for pdfwrite to decide to use the SMask
instead of the image.

This leads to a PDF which has an image which references an SMask in the
image dictionary, and the SMask is the same image XObject.

In this commit, when checking for an identical image, if the image we
find is the same as the 'current' softmask image, then do not treat it
as identical. This prevents us inadvertently detecting an image and its
SMask as being the same image.

devices/vector/gdevpdfj.c


2013-06-05 10:07:47 -0700
Ray Johnston <ray.johnston@artifex.com>
a936cf76a33389610b558ffaf5de7389265fd657

Bug 693684: Add InterpolateControl parameter to limit image interpolation.

Previously, we always interpolated to the full device resolution. This
parameter allows control of the resolution of the interploated image
which makes sense for devices that cannot render continuous tone at
the device resolution due to halftone cell size. This avoids the
overhead of interpolation beyond what the device can reproduce and
allows the user a quality/performance tradeoff.

The -dDOINTERPOLATE is equivalent to -dInterpolateControl=-1 and the
-dNOINTERPOLATE is equivalent to -dInterpolateControl=0. These options
still work for PS/PDF files, but are deprecated and may be removed in
the future.

Performance results vary, but using the -dInterpolateControl=4 is
4.5 times faster with files that have images that are scaled up and cover
a large portion of the page such as comparefiles/Bug695221.ps at 600dpi.

Resource/Init/gs_img.ps
Resource/Init/gs_init.ps
base/gsdparam.c
base/gxdevcli.h
base/gxdevice.h
base/gxht.c
base/gxiscale.c
base/lib.mak
base/siscale.c
base/sisparam.h
devices/devs.mak
devices/gdevbit.c
devices/vector/gdevpsdi.c
doc/Use.htm


2017-06-27 15:56:01 -0700
Ray Johnston <ray.johnston@artifex.com>
e56286167cad5a5fba3e0b8911d9a54b6a5a5400

Speed up image interpolation with UseFastColor

The check for dev_profile->usefastcolor was buried way down in the ICC
remap logic after getting a link, etc. then eventually returning the
is_identity that would skip transforming the color. Also check in the
image_class0_interpolate function to disable use_icc so that it uses
the faster image_render_interpolate rather than the interpolate_icc
versions.

base/gxiscale.c


2017-06-29 15:13:03 -0600
Henry Stiles <henry.stiles@artifex.com>
9ed740e848891de10af6f85bd234298ac2bbab7b

Fix fuzzing Bug 694668 - CCITT fuzzing.

Bounds check CCITT Columns.

pcl/pcl/pcl.mak
pcl/pcl/rtraster.c


2017-07-04 12:11:33 +0100
Ken Sharp <ken.sharp@artifex.com>
676ad40aed33815aea7bf65cb9f374b79b1d8518

pdfwrite - fix /Colorants when converting DeviceN colour spaces

Bug 698129 "Produced PDF that gives "Wrong operand type" in Acrobat for some pages"

The supplied example uses a Duotone witha CMYK alternate and a Colorants
array (for the Pantone colour only). When converting to a different
space we preserve the Spot colours (and therefore DeviceN) but we
convert the alternate space to the specified base space by sampling the
original space.

However, if the DeviceN space contained a Colorants array we were writing
the new colour space array with the Colorants inserted in the wrong
position, immediately after the ink array instead of at the end.

This commit moves the Colorants entry to the correct place, and also
adds the (previously missing) Subtype key to the Colorants dictionary.

devices/vector/gdevpdfg.c


2017-07-01 16:36:29 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f1cfdcd88da67bcab1efbed26191d27a0ce00a53

Bug 694626: Prevent SEGV due to division by zero.

Add bounds checking in ttfFont__Open to default nUnitsPerEm to 1024 as
precedented in ttfOutliner__Outline.

base/ttfmain.c


2017-06-29 11:20:09 +0100
Chris Liddell <chris.liddell@artifex.com>
0b7fa9293f43dce8aea028e4d2b32da1d8fc18c8

Add error checking for gs_colorspace_set_icc_equivalent()

base/gscdevn.c
base/gsciemap.c
base/gscolor2.c
base/gscsepr.c
base/gstrans.c
base/gxcmap.c
base/gxipixel.c
base/gxiscale.c
base/gxshade.c


2017-06-29 11:00:38 +0100
Chris Liddell <chris.liddell@artifex.com>
d592ee18a9168b1190bc7f7a1426b41fa6d508af

Bug 698151: XPS: bounds check selecting cmap table.

xps/xpsfont.c


2017-06-29 10:54:49 +0100
Chris Liddell <chris.liddell@artifex.com>
0c39ac5a0b8ca650101ac6322be34bd7504e7f63

Bug 698150: XPS: bounds check in format 6 and 10 cmap tables

xps/xpsfont.c


2017-06-29 12:07:29 +0100
Robin Watts <robin.watts@artifex.com>
ad0ac7883807331c1c9afb0b87585838bd3e63be

Bug 697981: Avoid integer overflow problems in scan converter.

Positions can be anywhere in the signed range 0x80000000..0x7fffffff,
therefore the difference between those positions can overflow a
signed 32bit representation.

base/gxscanc.c


2017-06-28 17:03:24 -0600
Henry Stiles <henry.stiles@artifex.com>
d4681a07410f96ee68479e0c39f1ca6f27168b8f

Fix Bug 694656, Seg faults found by fuzzing in hpgl_get_char_width

Along with checking that there is a valid font make sure there is a
current font selection, if not recompute the current font.

pcl/pcl/pglabel.c


2017-06-28 20:29:47 +0100
Robin Watts <robin.watts@artifex.com>
1d9dc902167802515d8ee86bf4e2205461486b50

Squash some warnings in gsmchunk.c

base/gsmchunk.c


2017-06-07 19:16:46 +0100
Robin Watts <robin.watts@artifex.com>
af4317bc527142dd0b8a6032799c4accf40bf835

MSVC: Squash double->float implicit cast warning.

devices/vector/gdevpdfv.c


2017-06-07 19:14:16 +0100
Robin Watts <robin.watts@artifex.com>
f204ddc13530f1bdb180eb38ebcf5a96caab8b74

MSVC: Fix some implicit casting warnings in ft_api.c

Simply make the castings explicit.

base/fapi_ft.c


2017-06-27 19:18:32 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
3a684e3dcc55c27506dc179723e8bcd85d121aa7

Bug 694670: Prevent buffer overrun.

Add bounds checking in pxSetHalftoneMethod to prevent a buffer
overrun.

pcl/pxl/pxink.c


2017-06-22 22:14:59 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
25d4e951e5290a34354f633f46d57cb6870fbd5d

Bug 694681: Prevent buffer overrun.

Move bounds checking earlier in pxReadRastPattern to prevent a buffer
overrun when StartLine attribute is set to non-zero.

pcl/pxl/pximage.c


2017-06-27 09:58:44 -0700
Michael Vrhel <michael.vrhel@artifex.com>
dc09d291658c1758fe2a0a02776e66355f56b09a

Bug 698134 Text knock with alphabits

The pdf14_copy_alpha operation was not updated
when fixes were made to properly handle non-isolated
knockout groups.

base/gdevp14.c


2017-06-27 15:33:22 +0100
Chris Liddell <chris.liddell@artifex.com>
6ce668c11ccbadde6d76430ba00205eca853879e

Bug 698130: check the icc profile data exists before accessing it

base/gscsepr.c


2017-06-26 10:04:02 +0100
Chris Liddell <chris.liddell@artifex.com>
74ce33d1fdb26af4e15a58e5df91dbb1403f66f9

Drop the now redundant check for zero length, staight contours

when degenerating the outline into moveto/lineto/curveto operations.

base/gxfapi.c


2017-06-26 09:58:11 +0100
Chris Liddell <chris.liddell@artifex.com>
6d17251a6c22673854bcd288d8562650361847e5

Bug 697983: (re-redux) Drop zero length contours from glyph outlines

Zero length contours cause issues (line-caps) when the outline is stroked.

Turns out the same problem can arise with arcs as with straight lines.

That complicates things where TTFs are concerned since we have to convert cubic
to conic splines, and the floating point errors make it dubious checking for
point equality after the conversion. As a result, the checking has to be done
in the scaler specific interface code, rather than in the scaler independant
FAPI code.

That just means if we ever integrate another scaler that can handle
downloadable fonts, we need to take care to include the same checks as are
now in the Freetype interface code.

base/fapi_ft.c


2017-06-20 06:50:49 -0600
Henry Stiles <henry.stiles@artifex.com>
793f93b08813e898aa0f1b316619e33568275fb0

Fix Bug 697926, processing jpeg embedded color parameters.

HP ignores the height, width and color components provided with the
raster commands and uses the values in the embedded JPEG.
Consequently, we have to defer beginning the image until the image
data arrives.

pcl/pxl/pximage.c


2017-06-21 01:07:17 +0800
Sebastian Rasmussen <sebras@gmail.com>
4942c650d9ab84671724e1f98541829ba8b6ff80

Adapt tools to use renamed gpcl6 binary.

pcl/tools/docov.pl
pcl/tools/pcl2pdfwr
pcl/tools/pcl2pdfwr.bat
pcl/tools/plot2pdf.sh
pcl/tools/smoke_check.sh
pcl/tools/smoke_update.sh


2017-06-21 16:01:39 +0100
Ken Sharp <ken.sharp@artifex.com>
3b6625b9f04daedf678a137475858ad35b991052

pdfwrite - don't arbitrarily alter the 'current' shape alpha

Bug 697472 "Transparent box appears lighter"

Whenever we opened a substream, if it was an XObject resource we would
set the blend mode and shape alpha to the default values.

This looks wrong to me, and it means that when using a complex ExtGState
which includes a SMask, if there was an alpha other than 1 in the
ExtGState then we would write the constant alpha out twice, once
in the page content, and once again in the resulting Group Form
XObject which we create. If the alpha was not 1, then this causes it
to be applied twice, resulting in rendered content which is too pale.

Both of these look incorrect, but removing the blend mode causes other
files to fail. Removing the shape alpha causes progressions in a number
of test suite files.

devices/vector/gdevpdti.c


2017-06-21 07:38:01 -0700
Ray Johnston <ray.johnston@artifex.com>
e178c1c3a45076fcffbe703c722b4f9bca0ac532

Fix typo in previous commit s/b PageUsesTransparency

examples/transparency_example.ps


2017-06-20 17:57:26 -0700
Ray Johnston <ray.johnston@artifex.com>
670840afcd100f4751b911cf4ac3bf0415ba55c2

Bug 698087: Heap buffer overflow with confused clist colorspace

The PDF14 transparency compositor changes the colorspace to Gray
(8-bit), but if a 1-bit deep device is the target device, and the
normal startup for transparent pages doesn't happen, the playback
would write 8-bit data to a 1-bit deep buffer

Also fix the transparency_example.ps so that it sets the device param
PageUsesTransparency which is expected.

examples/transparency_example.ps
psi/ztrans.c


2017-06-20 15:39:22 +0100
Chris Liddell <chris.liddell@artifex.com>
7258589eb5005d05c1499e717da8de804e1c35e1

Bug 698069: tighten up the out-of-data condition in spgetcc

base/stream.c


2017-06-20 10:06:51 +0100
Chris Liddell <chris.liddell@artifex.com>
8aaacf3f8d3837b471fc302de0a84c85ecb24307

Bug 698081: more bounds checking in xps_load_sfnt_name

xps/xpsfont.c


2017-06-19 13:26:02 +0100
Ken Sharp <ken.sharp@artifex.com>
605af24e8adcbc71bec1c5e1283dc20eabfbc515

Yet another check on raster memory for get_bits_rectangle

Bug #698073 "Potential null pointer dereference in mem_word_get_bits_rectangle"

Not the same reason, but still a potential use of dev->line_ptrs, which
can be NULL If you mangle makeimagedevice and copyscanlines.

base/gdevmem.c


2017-06-19 10:02:34 +0100
Ken Sharp <ken.sharp@artifex.com>
a5c6f7da872845b1d9bf2025c0cd5fc98b937d90

PS interpreter - remove 'STRICT' and remove from documentation

The 'STRICT' switch is documented as removing as many Ghostsctipt
extensions as possible. In reality it only removes some media size
definitions from statusdict.

This seems less than useful, so remove it to reduce clutter.

Resource/Init/gs_init.ps
Resource/Init/gs_statd.ps
doc/Use.htm


2017-06-19 09:46:21 +0100
Ken Sharp <ken.sharp@artifex.com>
2fa6beaa40144c592661a611bf35ff6f06d3354f

Tools - remove ps2ascii.ps, recode scripts to use txtwrite

ps2ascii.ps uses DELAYBIND, which we would like to get rid of, in
addition it doesn't do a terribly good job of actually extracting text.
The txtwrite device is more sophisticated, although it does not have the
added 'COMPLEX' feature of ps2ascii.ps which emits strokes and fills
as rectangles.

If the COMPLEX feature set should prove useful enough it would be easy
to add this functionality to a new device, but in reality I doubt
anyone is using this. The scripts specifically set -dSIMPLE.

This allows us to deprecate DELAYBIND and in future remove it.

lib/ps2ascii
lib/ps2ascii.bat
lib/ps2ascii.cmd
lib/ps2ascii.ps


2017-06-17 17:06:32 +0100
Ken Sharp <ken.sharp@artifex.com>
8f796773b5aae90362ec500d942dc38e6a1f0f6b

PS interpreter - deprecate DELAYBIND, remove from documentation

DELAYBIND seems like a bad idea, we suspect there is nothing it does
which cannot be achieved another way.

For now we will continue to allow it, but user will have to set
-dREALLYDELAYBIND instead, setting -dDELAYBIND will trigger a warning
message and an error.

Resource/Init/gs_init.ps
doc/Language.htm
doc/Use.htm


2017-06-17 16:13:57 +0100
Ken Sharp <ken.sharp@artifex.com>
0a41e707c2ca9a9243df640b32c5abe372be1f53

PS interpreter - remove NOBIND option and all references

This was only ever supposed to be a 'debugging aid' and its something
of a struggle to see why it would be useful.

Resource/Init/gs_dps1.ps
Resource/Init/gs_init.ps
Resource/Init/gs_ll3.ps
doc/Language.htm
doc/Use.htm


2017-06-17 14:27:06 +0100
Ken Sharp <ken.sharp@artifex.com>
c294b131ea270cea5d66c9b0a6ea61d3a69a20a0

PS interpreter - fix use of superexec with DELAYBIND

Commit 8556b698892e4706aa0b9d996bec82fed645eaa5 removed superexec from
systemdict, leaving it in internaldict, where it should be. However,
if we run with DELAYBIND then by the time we come to bind the procedures
which use superexec the definition in systemdict is gone.

Technically this shouldn't be a problem, as we should be using the version
in internaldict. But if we do that, without DELAYBIND the internaldict
definition isn't present, because we haven't copied it yet....

So now we look for the presence of superexec in systemdict and use that
one if its present, otherwise we assume its in internaldict and use
that instead.

Unfortunately the use of DELAYBIND interferes with the cluster testing
causing thousands of files to fail. I've run a random selection of them
locally in a normal setup and they work, I guess we'll just have to
hope for the best and fix any problems as they are reported.

Resource/Init/gs_dps1.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_ttf.ps
Resource/Init/gs_type1.ps


2017-06-17 11:17:52 +0100
Ken Sharp <ken.sharp@artifex.com>
971472c83a345a16dac9f90f91258bb22dd77f22

Make operator hiding work with DELAYBIND

Commit 1497d65039885a52b598b137dd8622bd4672f9be undefines as many operators
as possible once startup is completed, in order to prevent potantially
malicious PostScript or PDF files using them.

However, if DELAYBIND (itself a gaping security hole if used) is
specified, this leads to an endless loop. Instead we must undefine the
operators during .bindnow (after the deferred binding has occured).

Resource/Init/gs_init.ps
Resource/Init/pdf_main.ps


2017-06-13 00:45:54 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
4bf1f491517c4d1f30f594a77ea4adbef263bfc9

Bug 694639: Prevent buffer overrun.

Add bounds checking in pxReadRastPattern to prevent a buffer overrun when
StartLine attribute is set to non-zero.

pcl/pxl/pximage.c


2017-06-16 15:40:33 +0100
Chris Liddell <chris.liddell@artifex.com>
824aa630e2d4ce5b53e78cf8b2686ee6acb7a5fe

Bug 698066: Ensure device has raster memory before using it

Same solution as Bug #697676

This is only possible by abusing/mis-using Ghostscript-specific
language extensions, so cannot happen in a general PostScript program.

Nevertheless, Ghostscript should not crash. So this commit checks the
memory device to see if raster memory has been allocated, before trying
to read from it.

base/gdevmpla.c


2017-06-16 09:03:14 +0100
Chris Liddell <chris.liddell@artifex.com>
260fefe6504653742a623d416fcf73f6b2559579

Bug 698065: xps: fix reading of idRangeOffset in cmap table

In format 4 cmap tables the idRangeOffset was being read as a signed value,
but it is unsigned.

xps/xpsfont.c


2017-06-16 08:50:43 +0100
Chris Liddell <chris.liddell@artifex.com>
961b10cdd71403072fb99401a45f3bef6ce53626

Bug 698064: bounds check xps_encode/decode_font_char_imp

xps/xpsfont.c


2017-06-16 08:29:25 +0100
Chris Liddell <chris.liddell@artifex.com>
c501a58f8d5650c8ba21d447c0d6f07eafcb0f15

Bug 698063: Bounds check Ins_JMPR

base/ttinterp.c


2017-06-15 09:05:20 +0100
Chris Liddell <chris.liddell@artifex.com>
937ccd17ac65935633b2ebc06cb7089b91e17e6b

Bug 698056: make bounds check in gx_ttfReader__Read more robust

base/gxttfb.c


2017-06-15 08:58:31 +0100
Chris Liddell <chris.liddell@artifex.com>
7755e67116e8973ee0e3b22d653df026a84fa01b

Bug 698055: bounds check zone pointer in Ins_MDRP

base/ttinterp.c


2017-06-14 22:00:52 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f887813ad00d680e2ea5d81606fd21d1b68067af

Bug 694662: Bounds check formlines in pcl_vmi_default()

Added bounds checking to clamp value between a minimum of 5 and a
maximum of 128.

pcl/pcl/pcursor.c


2017-06-13 22:35:37 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
3749bc274be1ae5a2f9897447708e84418ccf7a4

Bug 694653: Prevent buffer overrun.

Add bounds checking to pcl_character_data to prevent a buffer overrun if
the continuation data total is greater than font_data_size.

pcl/pcl/pcsfont.c


2017-06-14 16:07:02 +0100
Chris Liddell <chris.liddell@artifex.com>
db85b2782543f6dc6397a2e87c6beefc00b25b54

Fix mistake introduced with the pcl glyph data bounds checking code

When I added the bounds checking for PCL glyph data, I changed slightly the
way offsets were calculated for the PXL 'error handler' bitmap font so
we could know the data length.

I messed up, and forgot to fully take account of the first byte being the
char code, and not part of the bitmap data.

pcl/pxl/pxerrors.c


2017-06-14 15:14:30 +0100
Chris Liddell <chris.liddell@artifex.com>
4992ef5bc283a6347737f1369ef3d7bd4efbdce1

Bug 697983: (redux) Drop zero length contours from glyph outlines

When a outline glyph has contours with only one point in it, we end up with
a moveto and a lineto the same point, thus resulting in a zero length line
segment. This causes problems when the outline is stroked (line caps).

We'll now drop these pointless lineto operations.

Resource/Init/pdf_ops.ps
base/gxfapi.c
base/lib.mak


2017-06-14 10:46:27 +0100
Chris Liddell <chris.liddell@artifex.com>
80f4cc558efdd73be26ede4057ac1750b0b34210

chunk allocator: on free, use original size for single object chunk

On allocation, we decide, based on the requested size (+ house keeping data)
if an object should be in a chunk on its own. But the size recorded can be
larger than that if the chunk was recovered from the free list (because the
free list can contain merged free chunks). In such a case, we also record the
padding bytes.

On freeing, we have to use the object size minus the object padding to
identify single object chunks - to mirror the decision making in the allocation
code.

Fixes the cluster segfault with C410.bin and bitrgbtags

base/gsmchunk.c


2017-06-14 10:14:51 +0100
Chris Liddell <chris.liddell@artifex.com>
3ee55637480d5e319a5de0481b01c3346855cbc9

Bug 698050: xps: bounds check offset for requested cmap table

xps/ghostxps.h
xps/xpsfont.c
xps/xpsglyphs.c


2017-06-14 09:30:45 +0100
Chris Liddell <chris.liddell@artifex.com>
3c2aebbedd37fab054e80f2e315de07d7e9b5bdb

Bug 698044: restrict font name length to the buffer size.

xps/ghostxps.h
xps/xpsfont.c
xps/xpsttf.c


2017-06-14 09:16:02 +0100
Chris Liddell <chris.liddell@artifex.com>
c53183d4e7103e87368b7cfa15367a47d559e323

Bug 698042: xps: fix glyph index and index bounds check.

If a gs_glyph has the GS_MIN_GLYPH_INDEX offset, we need to remove the offset
before we try to use it.

Secondly, using a unsigned variable for a value from which we subtract 1, and
which can be zero doesn't work well. Switch to a signed value.

xps/xpsttf.c


2017-06-14 09:28:34 +0100
Ken Sharp <ken.sharp@artifex.com>
6cf7a8c45517d5857aa81cf59a82a2cc5c7d021c

PDF interpreter - fix a problem with AcroForm interpretation

No bug for this, noticed in passing while working on a customer bug.

If we turn on AcroForm processing, and we have an AcroFOrm where a /Tx
field has a /V entry, then we would not write the value to the string we
are accumulating. We would only write the value if we had no /V but a
/DV.

Instead the string was left on the stack, leading to an error. This
appears to be due to a logical error when writing the V/DV handling
where the write== was placed inside the if clause, when it should be
outside the clause.

Resource/Init/pdf_draw.ps


2017-06-13 06:58:32 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
fe61712d5157066212d0fcee79b129d6ddcbd251

Bug 694657: Prevent SEGV due to missing font.

Updated pcl_reselect_font to check for missing font.

Updated hpgl_select_stick_font to initialise font->storage before it is
used in pcl_downloaded_and_bound.

pcl/pcl/pcfsel.c
pcl/pcl/pglabel.c


2017-06-12 18:05:14 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
8e1acddeb57e9cbb105ec9ff9e65d35005cac44f

Bug 694648: Prevent buffer overrun.

Add bounds checking to pl_tt_string_proc to prevent a buffer overrun if
the incoming offset value is greater than the header size.

pcl/pl/plchar.c


2017-06-12 17:50:58 +0100
Chris Liddell <chris.liddell@artifex.com>
284f5fe121d8eb0a0f50a6f2465ee2f99a061018

mkromfs needs linked to zlib when using shared zlib

Ensure the compiler/linker command line parameter gets propagated from configure
to the mkromfs build.

Makefile.in


2017-06-12 13:15:17 +0100
Chris Liddell <chris.liddell@artifex.com>
98f6da60b9d463c617e631fc254cf6d66f2e8e3c

Bug 698026: bounds check zone pointers in Ins_IP()

base/ttinterp.c


2017-06-12 13:08:40 +0100
Chris Liddell <chris.liddell@artifex.com>
c7c55972758a93350882c32147801a3485b010fe

Bug 698024: bounds check zone pointer in Ins_MIRP()

base/ttinterp.c


2017-06-12 12:59:38 +0100
Chris Liddell <chris.liddell@artifex.com>
d2ab84732936b6e7e5a461dc94344902965e9a06

Bug 698025: validate offsets reading TTF name table in xps

xps/xpsfont.c


2017-06-10 14:06:49 +0100
Ken Sharp <ken.sharp@artifex.com>
f6507e828ddfe1f60645bc925bff9bedfdb306ce

graphics library - fix memory leak regression

Bug # 698005 "regression: commit 70cfc6afc42b9c299e9c05359f12455055105fac with Bug692720.pdf"

Commit 70cfc6 created a path from a list of rectangles early in a clip,
in order to minimise the number of times the path was created (creating
it later caused it to be discarded and re-created multiple times)

Unfortunately, as I feared at the time, this introduced a memory leak
under certain conditions. When the clip_path is discarded we weren't
counting down the reference to the path_list.

With this commit Bug697270.pdf uses approximately the same amount of
memory as it did before commit 70cfc6, but runs approximately 20%
faster.

The regular cluster run also seems to exhibit a further ~20% improvement
in performance, presumably in addition to the existing 10% from the initial
commit. Note, this *only* affects configurations where the clist is
used.

base/gxcpath.c


2017-06-08 16:57:25 +0100
Ken Sharp <ken.sharp@artifex.com>
a4f2cd23893cabe466d977668975987f925278d2

pdfwrite - keep using /Subsample for /Indexed images when downsampling

Bug #698000 "Inappropriate choice of downsampling filter for Indexed images"

For Bug #693917 we checked the downsampling factor for the Subsample and
Average downsampling filters and, if it was not an integer or nearly so,
we forced the Bicubic filter instead.

Unfortunately, this doesn't work well for image data in a /Indexed colour
space.

Instead this commit checks the colour space and, if its a /Indexed space,
forces the downsampling factor to the nearest integer, and preserves the
Subsample or Average filter.

devices/vector/gdevpsdi.c


2017-06-08 15:43:42 +0100
Chris Liddell <chris.liddell@artifex.com>
2a9d6adb5239e797eec3358518950e49565730b0

Bug 697983: avoid marking zero length glyph contours

The file contains many glyphs with stray zero length contours dotted around the
'main body' of the glyph outline. When a text rendering mode involving stroke
was used, these were resulting in the linecaps being drawn, and showing as
extra dots around the gylphs.

Force linecap to 'butt' when using a stroking text rendering mode to avoid this.

Resource/Init/pdf_ops.ps


2017-06-07 14:55:12 +0100
Chris Liddell <chris.liddell@artifex.com>
cfde94be1d4286bc47633c6e6eaf4e659bd78066

Bug 697985: bounds check the array allocations methods

The clump allocator has four allocation functions that use 'number of elements'
and 'size of elements' parameters (rather than a simple 'number of bytes').

Those need specific bounds checking.

base/gsalloc.c


2017-06-07 14:27:51 +0100
Robin Watts <robin.watts@artifex.com>
70cfc6afc42b9c299e9c05359f12455055105fac

Bug 697679: Ensure clist playback correctly creates clip paths.

Ghostscript clip paths consist of 3 parts:

1) A list of scan converted rectangles that union together to give
the clipping region.
2) (Optionally) a path that represents the clipping region.
3) A path_list structure (a list of paths that when intersected
together give the required clipping region).

3 is required for high level devices like pdfwrite (and the opvp
device).

Most of the code is at pains to preserve path_list as gx_cpaths are
manipulated. The exception to this appears to be the clist code.
The rectangle list is sent through the clist, but the path is not.

Accordingly, the code to intersect a gx_cpath with another path
checks to see if the path_list is valid on entry. If not, it
synthesizes one from the rectangle list.

This bug is caused by the fact that we end up intersecting a
clip path 120000 times in a pattern clist playback. Each of those
synthesizes a path from the rectangle list.

The fix here is to make the pattern clist playback create the
path_list each time it is replayed, meaning we have < 100 such
operations.

Thanks to Ken for his work on this, and for coming up with the
initial version of this patch.

base/gxclrast.c
base/gxcpath.c
base/gxpath.h


2017-06-03 18:50:05 +0100
Ken Sharp <ken.sharp@artifex.com>
0af88bdacdd8962244ac0a538c78b56bd5cc9376

pdfwrite - fix customised doumentUUID

Bug #697977 "document UUID gets truncated"

The code writing out a user-specified documentUUID had an error, failing
to account for the 'uuid:' prefix.

Credit to Axel Holewa for finding the preoblem and suggesting the fix.

devices/vector/gdevpdfe.c


2017-05-19 18:12:00 +0100
Robin Watts <robin.watts@artifex.com>
9c94340cd251ead99b4ae9121d1138c83be9a5df

PXL: Optimise 1 pixel wide image handling.

If we are given a 1xH image, we'd rather reflect it to be
an Hx1 image so that it gets passed through the image code
as a single scanline. This allows things like collation of
runs of matching pixels to work far better.

In particular this improves page mode performance for j11.prn.

pcl/pxl/pximage.c


2017-05-29 16:19:39 +0100
Chris Liddell <chris.liddell@artifex.com>
5f53dbc3e917d44e92619f831ba06be7944b5471

Bounds check buffers for downloaded glyphs in PCL.

For downloaded fonts, there were several buffer overreads reported by valgrind
when interpreting Intellifont glyph descriptions.

This adds using the (already existing) length field to bounds check when we
interpret the glyph.

pcl/pcl/pcsfont.c
pcl/pl/plchar.c
pcl/pl/plfont.c
pcl/pl/plfont.h
pcl/pl/pllfont.c
pcl/pl/plulfont.c
pcl/pxl/pxerrors.c
pcl/pxl/pxfont.c


2017-05-29 16:22:19 +0100
Chris Liddell <chris.liddell@artifex.com>
fe6ed9f54a02357e01c1f8c517b6af831e5f59ae

Ensure a FAPI instance is attached to a cloned font

It was possible for a cloned font to be missing the FAPI server attached to the
'parent' font. Add in a pl_fapi_passfont() call so it's guaranteed to be
available.

pcl/pcl/pcsfont.c


2017-05-31 20:51:00 +0100
Robin Watts <robin.watts@artifex.com>
bc12dc36623f3eb3c553ea1455cf1fd84d10b114

Avoid needless clip path recalculations.

While investigating Bug 697679, I spotted that clip_call_fill_path
was being called with a non NULL pcpath, thus triggering a 'slow'
rebuild of the clipping path.

In at least some of these cases, pcpath pointed to an invalid
clipping path. I believe this means we might as well have used
the fast route!

base/gxclip.c


2017-05-31 20:14:55 +0100
Robin Watts <robin.watts@artifex.com>
9ee2adefdfc9a12bf71acd1e08e88b8cc8af0502

Avoid calling the same function twice.

Not really expecting any huge speed benefit from this, but
it's silly to call it twice with the same args.

base/gxcpath.c


2017-05-31 21:44:41 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
2cebfeb7c91d5bcf916bc2c51d32a213f0ca776d

Bug 694646: Fix SEGV due to missing FontName attribute.

pxSetFont allowed for an optional FontName attribute which meant it tried
to set a font using NULL. This function has been updated to check that
FontName, CharSize and SymbolSet are not NULL before trying to use them.

pcl/pxl/pxfont.c


2017-05-31 12:28:43 +0100
Robin Watts <robin.watts@artifex.com>
e57b2aafe5bf09bb7e7df5f4608a4910145553b2

Bug 697970: Solve underflow/overflow problems in new scan converter.

The test file asks us to fill a line with one end at 0x7fffffff,
using 'any part of a pixel'. In order to calculate the index table
the existing code 'expands' this vertical area by 0x7f to allow
for rounding within a pixel. This leads to 0x8000007e, which
is of a different sign.

Correspondingly the vertical ranges touched by the lines appear
different in the indexing and marking phases.

To fix this we rejig the line calculations to avoid this
difference by more carefully doing the expansion.

Thanks to Kamil Frankowicz for doing the fuzz testing that lead
to this bug/fix.

base/gxscanc.c


2017-05-31 13:50:32 +0100
Ken Sharp <ken.sharp@artifex.com>
9e621d6ffb0e29c5de8331bf2c95003c8cf85941

PDF interpreter - apply Optional Content /Usage dictionaries

Bug #696076 "Ghost script 9.16/9.15 print PDF layer even if print state is "Never Print""

We currently only apply the /OFF (or /ON) entries from the Optional
Content Properties (/OCProperties) which is quite a high level and hence
low granularity control.

This commit adds processing of the /Usage dictionary; any ordinary
Optional Content (not OCMD) which is not set to /OFF in the OCProperties
is checked for the existence of a /Usage dictionary. We then check for
either a /Print or /View key in the dictionary depending on the setting
of the -dPrinted command line switch. If the relevant key is present
then we check for a ViewState key and use that to determine whether the
Optional Content should be rendered or not.

Note that if -dPrinted is not set on the command line then the interpreter
will attempt to guess. If the current device has OutputFile set then
the interpreter will assume that it should consider 'Print' keys. If it
is not present in the device, then the interpreter will assume that it
should consider 'View' keys.

This causes the PDF file Bug690364.pdf to render radically differently.
This is because much of the content is set to not print, and a small
amount of extra data is set to render only when printed. Because the
cluster uses an OutputFile, we assume that we should behave as if
printing.

Resource/Init/pdf_draw.ps


2017-05-31 11:24:40 +0100
Robin Watts <robin.watts@artifex.com>
33cf871a82e0fd9a0ebfed14317a2fa0f40e1e9d

Bug 697748: Fix misspelled alignment attribute in SSE code.

The SSE thresholding code relies on a buffer being 16 byte aligned.
To achieve this we use a compiler attribute to force alignment
to 16 bytes.

MSVC uses "align(16)", but gcc etc uses "aligned(16)".

We were using "align(16)" for both. Fix this in the macro here.

Thanks to Timo Teras for spotting the problem and suggesting the
fix.

base/gxht_thresh.c


2017-05-30 10:30:05 +0100
Ken Sharp <ken.sharp@artifex.com>
b883b8fc62ec6bc630d5f88abef0d7799efa6687

pdfwrite - Don't assume param list strings are NULL-terminated

Bug #697948 "(Add an ID to memory allocations.) breaks PDF/A output"

The bug description is misleading; in fact the problem is that the code
for reading a flag numeric value from a string parameter was assuming
the parameter was NULL_terminated, when in fact it is not.

Depending on exactly how the memory layout happened to be, the bytes
following the parameter may or may not be NULLs, or ASCII digits. If it
so happened that the trailing bytes were ASCII digits, it was possible
for an incorrect Flag value to be parsed, which could lead to an error
being flagged.

This commit just copies the actual number of bytes in the parameter
string to a temporary stack-based character buffer, NULL terminates the
buffer and reads the Flag value from there.

devices/vector/gdevpdfm.c


2017-05-28 21:46:26 -0600
Henry Stiles <henry.stiles@artifex.com>
4226202adec2a3f3a416e1986e8630bf7ca3bdc7

Fix Bug 694633 fuzzing segmentation fault.

Return an error if the GL/2 parser runs out of data while processing
a macro. If within a macro, unlike the normal data stream, the GL/2
commands already have access to all of the data.

pcl/pcl/pgparse.c


2016-07-04 09:28:06 +0100
Ken Sharp <ken.sharp@artifex.com>
7918a01dd37bc383e61ae0b237341e69286dc83c

PDF interpreter - Move ExtGState parameters into the regular graphics state

Bug #696511 - "Move ExtGState parameters into the regular graphics state"

A long time ago a decision was made not to replicate the PDF ExtGstate
parameters in the graphics state. This has had long term painful consequences
because we were unable to do a gsave/grestore to simply preserve
parameters but had to jump throuhg a lot of hoops. Amongst other problems
has been confusion over when exactly a change in colour has taken place.
With this commit the ExtGState parameters are moved into the graphics state
and obey gsave and grestore.

This extensive commit was worked on in the PDF_gstate branch and the history
is preserved in that branch.

This does introduce a few differences in the test suite;

There are a few cases where broken files (recursive SMasks) now render
slightly differently.

Some files now exhibit progressions, especially with CMYK or DeviceN output
devices, this is because the 'default' colour space was incorrect, the code
was using DeviceGray instead of the device's colour space, and this makes
a difference for some types of transparency blending when the Group does
not specify a Blending space.

A few other files demonstrate progressions because a change in colour now
takes place before an error occurs.

Resource/Init/pdf_draw.ps
Resource/Init/pdf_font.ps
Resource/Init/pdf_main.ps
Resource/Init/pdf_ops.ps
base/gsstate.c
base/gsstate.h
base/gstrans.c
base/gstrans.h
base/gxgstate.h
psi/igstate.h
psi/int.mak
psi/zcolor.c
psi/zcssepr.c
psi/zgstate.c
psi/zmatrix.c
psi/ztrans.c
psi/ztype.c


2017-05-29 11:22:34 +0100
Ken Sharp <ken.sharp@artifex.com>
2e2a9d851c73192739c9227ef0030f3ba3e7b6fd

PDF interpreter - Don't render closed Popup annotations, synthesise missing Popup Appearances

Bug #697951 "MuPDF - Arguably incorrect annotation"

Although this is a MuPDF bug, it showed a couple of problems in Ghostscript

Firstly; Popup annotations which have /Open false should not be rendered

Secondly; Popup annotations with no /Open should be treated as ?open False

Finally, Popup annotations with no /Appearance were not rendered, unlike
other annotation types we were not synthesising an Appearance.

This commit addresses all 3 of these, and shows progressions with:

tests_private/pdf/PDF_1.7_FTS/fts_32_3232.pdf
tests_private/pdf/sumatra/1312_-_comments_not_displayed.pdf
tests_private/pdf/sumatra/1571_-_popup_annotations.pdf
tests_private/pdf/sumatra/embedded_go-to_actions.pdf

Resource/Init/pdf_draw.ps


2017-05-28 21:27:41 -0600
Henry Stiles <henry.stiles@artifex.com>
3ded6c3b28a1b183a492ada2f2a3970953f3d060

Increment the PJL stream pointer for illegal characters.

When an illegal character is encountered within a PJL command we exit
with end of job. With recent changes it is necessary to increment the
stream pointer as well because the PJL interpreter is reinvoked upon
UEL resulting in an infinite loop.

pcl/pl/pjparse.c


2017-05-24 19:29:57 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
3ebffb1d96ba0cacec23016eccb4047dab365853

Bug 697934: Fix SEGV due to error code