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.53.0 (2020-09-10)

Highlights in this release include:

  • The 9.53.0 release is primarily maintenance.

  • The most obvious change is the (re-)introduction of the patch level to the version number, this helps facilitate a revised policy on handling security related issues.

  • Our efforts in code hygiene and maintainability continue.

  • We have added the capability to build with the Tesseract OCR engine. In such a build, new devices are available (pdfocr8/pdfocr24/pdfocr32) which render the output file to an image, OCR that image, and output the image "wrapped" up as a PDF file, with the OCR generated text information included as "invisible" text (in PDF terms, text rendering mode 3).

    Due to some patches to the Tesseract sources that are required (integrated upstream, but awaiting release), time constraints, and the experimental nature of the feature, we only support including Tesseract from source, not linking to Tesseract shared libraries. Whether we add this capability will be largely dependant on community demand for the feature.

  • We have added Python bindings for the gsapi interface, can be found in demos/python. These are experimental, and we welcome feedback from interested developers.

  • For those integrating Ghostscript/GhostPDL via the gsapi interface, we have added new capabilities to that, specifically in terms of setting and interrogating device parameters. These, along with the existing interface calls, are documented in: Ghostscript Interpreter API

  • IMPORTANT: In consultation with a representative of (OpenPrinting) it is our intention to deprecate and, in the not distant future, remove the OpenPrinting Vector/Raster Printer Drivers (that is, the opvp and oprp devices).

    If you rely on either of these devices, please get in touch with us, so we can discuss your use case, and revise our plans accordingly.

  • IMPORTANT: We have forked LittleCMS2 into LittleCMS2mt (the "mt" indicating "multi-thread"). 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. If there is sufficient interest, 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

Included below are incompatible changes from recent releases (the specific release in question listed in parentheses). We include these, for now, as we are aware that not everyone upgrades with every release.

  • (9.53.0) As of 9.53.0, we have (re-)introduced the patch level to the version number, this helps facilitate a revised policy on handling security related issues.

    Note for GSView Users:The patch level addition breaks GSView 5 (it is hardcoded to check for versions 704-999. It is possible, but not guaranteed that a GSView update might be forthcoming to resolve this.

  • (9.52) As of 9.52, the Windows binaries released by the Ghostscript development team are built with Microsoft Visual Studio 2019. As a result, Microsoft Windows XP and earlier are no longer supported by these binaries. This does not imply we are, or will start relying upon features only available in VS2019, so the nmake Makefiles will continue to allow older Visual Studio versions (back to VS2005) to build Ghostscript.

  • (9.52) -dALLOWPSTRANSPARENCY: The transparency compositor (and related features), whilst we are improving it, remains sensitive to being driven correctly, and incorrect use can have unexpected/undefined results. Hence, as part of improving security we limited access to these operators, originally using the -dSAFER feature. As we made "SAFER" the default mode, that became unacceptable, hence the new option -dALLOWPSTRANSPARENCY which enables access to the operators.

  • (9.50) There are a couple of subtle incompatibilities between the old and new SAFER implementations. Firstly, as mentioned in the 9.50 release notes, SAFER now leaves standard Postcript functionality unchanged (except for the file access limitations). Secondly, the interaction with save/restore operations, see SAFER.

    Important Note for Windows Users:
    The file/path pattern matching is case sensitive, even on Windows. This is a change in behaviour compared to the old code which, on Windows, was case insensitive. This is in recognition of changes in Windows behaviour, in that it now supports (although does not enforce) case sensitivity.

  • (9.27) The process of "tidying" the PostScript name space should have removed only non-standard and undocumented operators. Nevertheless, it is possible that any integrations or utilities that rely on those non-standard and undocumented operators may stop working or may change behaviour.

    If you encounter such a case, please contact us (either the #ghostscript IRC channel, or the gs-devel mailing list would be best), and we'll work with you to either find an alternative solution or return the previous functionality, if there is genuinely no other option.

    One case we know this has occurred is GSView 5 (and earlier). GSView 5 support for PDF files relied upon internal use only features which are no longer available. GSView 5 will still work as previously for PostScript files. For PDF files, users are encouraged to look at MuPDF.

Changelog

2020-09-10 22:47:09 +0800
Sebastian Rasmussen <sebras@gmail.com>
9a5ace846c8af91d047e59c87722d0c36e79e5d3

Bug 702884: Require jbig2dec 0.19 when building ghostscript.

In practice this has been required since commit
9b5008aa2bc1c6a6acb2c6f90d1ef8d6bad9e66a.

configure.ac


2020-09-10 22:41:20 +0800
Sebastian Rasmussen <sebras@gmail.com>
53db58bd227c80375f00135045d36b66868732f4

Update jbig2dec stuff for 0.19 release.

jbig2dec/CHANGES
jbig2dec/jbig2.h
jbig2dec/jbig2dec.1


2020-09-09 11:50:12 +0100
Robin Watts <Robin.Watts@artifex.com>
45884ca68488ac470b894702bdd8da232743d8e4

Bug 702871: Fix GraphicsAlphaBits + Fill/Stroke issue.

When we flush the alphabuffer, mapped_start and mapped_height are
both set to zero. When we refill it, mapped_height is set to
non-zero. USUALLY mapped_start is set to non-zero too, but it can
be set to zero when we are close to the bottom of the page.

Hence we should test for mapped_height != 0, rather than both
mapped_height and mapped_start being non-zero.

So the 'quick hack' that Chris used is actually correct.

base/gdevabuf.c


2020-08-28 09:31:58 +0100
Ken Sharp <ken.sharp@artifex.com>
4ba6aa1d7253e8ecd7cd796c95306f1203f70879

Bug 702837 typo in warning message

Thanks to Herbert Voss for spotting this. Fixed the typo and updated the
version number in the warning from 9.53 to 9.53.0 to match the actual
version and patch number of the release (the decision to add the patch
level was taken after the original commit)

Resource/Init/pdf_main.ps


2020-08-24 18:55:30 +0100
Robin Watts <Robin.Watts@artifex.com>
197eb511b5d81a662f801333709199495abe61cf

Fix Tesseract traineddata file loading.

If it was finding any Tesseract data in ROM it was then not looking
for files.

base/tessocr.cpp


2020-08-24 09:24:31 +0100
Chris Liddell <chris.liddell@artifex.com>
cb279d8a0e356542f6829ed429269ce07ec838a9

Coverity 361429: move "break" to correct place.

We had to add the outputfile to the "control" file permission list (as well
as write), but for the "pipe" case, I accidentally added the call after the
break out of loop that checks for a pipe.

base/gslibctx.c


2020-08-21 18:50:55 +0100
Chris Liddell <chris.liddell@artifex.com>
bad72741aad21b17a3965673f3e7949a2fc7c256

PDF interp: Consolidate disabling of page handler device

Resource/Init/pdf_main.ps


2020-08-21 11:13:33 +0100
Ken Sharp <ken.sharp@artifex.com>
60bbe61efc97c208f31c2d2d617753232ed1881d

More version number fixes

The code to retrieve the Ghostscript paths from the Windows Registry
was generating a key based on the version number, but since we added the
patch the generation was incorrect.

Since this is the third (!) case of this, scan the code for any usage of
gs_version, gs_version_number, GS_VERSION, GS_VERSION_NUMBER,
gs_revision, gs_revision_number, GS_REVISION and GS_REVISION_NUMBER.

This reveals two more places, neither serious but we might as well fix
them while we're here.

Thanks to Akira Kakuto for finding this problem and suggesting a patch.
I chose to use the code we were already using in two other places, just
for consistency, but the supplied patch was equally good.

base/gp_wgetv.c
devices/gdevpdfimg.c
devices/gdevpng.c


2020-08-21 08:14:49 +0100
Chris Liddell <chris.liddell@artifex.com>
45baf1a5b71c2ddad8e16ae2f895c4244e6af9e6

Fox typos and stuff in the release highlights

doc/History9.htm
doc/News.htm


2020-08-20 18:33:00 +0100
Chris Liddell <chris.liddell@artifex.com>
58ea17fd3032584e04f4e844e2d9991af87f114e

Delete binary files from lcms2mt tree

There were left over binary libraries, remove them.

lcms2mt/Lib/MS/lcms2_fast_float_plugin.lib
lcms2mt/Lib/MS/lcms2_static.lib
lcms2mt/Lib/MS/lcms2mt_fast_float_plugin.lib
lcms2mt/Lib/MS/lcms2mt_static.lib


2020-08-20 17:19:09 +0100
Chris Liddell <chris.liddell@artifex.com>
2ddd9d68bb0831ec8c9dd5e4e2e94bb44f8e5028

Fix pdfwrite "%d" mode with file permissions

Firstly, in gx_device_delete_output_file the iodev pointer was being passed
to the delete_method incorrectly (passing a pointer to that pointer). Thus
when we attempted to use that to confirm permission to delete the file, it
crashed. Credit to Ken for finding that.

Secondly, due to the way pdfwrite works, when running with an output file per
page, it creates the current output file immediately it has completed writing
the previous one. Thus, it has to delete that partial file on exit.

Previously, the output file was not added to the "control" permission list,
so an attempt to delete it would result in an error. So add the output file
to the "control" as well as "write" list.

base/gsdevice.c
base/gslibctx.c


2020-08-18 10:23:13 +0100
Chris Liddell <chris.liddell@artifex.com>
dee56822c0c9989fdf0115dab79842ad116c14f3

Update version, dates, product family

for 9.53.0 RC1

base/gscdefs.h
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/Internal.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


2020-08-20 09:12:12 +0100
Ken Sharp <ken.sharp@artifex.com>
f797ac99d0b0a337b5a57c37cdd026f4a9dbf897

Fix PDF /Producer for new patch level

Bug #702772 "Strange /Producer attribute"

The change to include a patch level for Ghostscript in the gs_revision
value wasn't being reflected in the code to generate the version
number used in the PDF /Producer string.

Copied the code from printf_program_ident() in base/gsmisc.c to the
code in pdf_store_default_Producer() and commented both pieces of code
to note the existence of each other so that in future hopefully we won't
forget to keep them in sync.

Thanks to Peter Cherepanov for spotting the flaw.

base/gsmisc.c
devices/vector/gdevpdfu.c


2020-08-18 23:23:40 -0700
Ray Johnston <ray.johnston@artifex.com>
ec82d2aa95dc8eb764483ff9011585bfc47a0f1b

Fix Bug 702381: Hang due to cyclic PDF resources.

The loop is caused by a circular /ParentResources attribute.
This branch of code is triggered by an error in the sample file:
misplaced /Form resources in a Type 3 font. This font has /Resource
dictionaries added to /CharProcs entries rather than the font dictionary.

Note that this patch fixes the hang issue, but does not correct the
issue of not being able to find the correct resource (in the CharProc)
so that the file still output does not match Adobe (mupdf has that
same issue).

Thanks to Peter Cherepanov for this patch.

Resource/Init/pdf_base.ps
Resource/Init/pdf_main.ps


2020-08-17 15:44:01 +0100
Robin Watts <Robin.Watts@artifex.com>
a01320e4d57d984f5bf65126534dbb3c33b416a4

Bug 702744: Add windows utf-8 handling for unlink and rename.

To do this, we introduce gp_unlink and gp_rename, and call those
as appropriate.

Also, make gp_open_scratch_file add the file to the permit list.
When such a file is closed, it will be deleted from the permit list.

It will also be removed from the permit list if the file is deleted
using the PS deletefile operator.

On closedown, if scratch files haven't been deleted, then we'll
delete them as part of the closedown of gs_lib_ctx.

This means that 'purging' the control lists must not remove scratch
file paths from the list.

Also, ensure that gsapi callers can't maliciously (or accidentally)
remove scratch path paths from the list so as to leave them around
after closedown.

base/gp.h
base/gp_mswin.c
base/gp_os2.c
base/gp_os2fs.c
base/gp_os2pr.c
base/gp_unifs.c
base/gp_vms.c
base/gp_winfs.c
base/gpmisc.c
base/gsiodev.c
base/gslibctx.c
base/gslibctx.h
base/mkromfs.c
base/winlib.mak
pcl/pl/pjparse.c
psi/imain.c
psi/zfile.c
xps/xpsjxr.c
xps/xpstop.c


2020-08-11 14:41:28 +0100
Chris Liddell <chris.liddell@artifex.com>
0e98e2a27ed19fcc138215afe17ab1a173aeed7b

Add patch version to version number

This makes it easier to issue patch releases for security problems.

Resource/Init/gs_init.ps
base/gsmisc.c
base/version.mak
devices/gdevtifs.c


2020-08-17 13:14:18 +0100
Chris Liddell <chris.liddell@artifex.com>
7cfa8d364797aed267285124a32b5cc5e1cd4794

Bug 702360: Allow @loader_path on darwin so build

As this is change in behaviour, it's optional. The configure script now
uses (if set) a environment variable called "DARWIN_LDFLAGS_SO_PREFIX" -
included "DARWIN" because it only applies to DARWIN derived systems.

This allows the caller to use:
./configure DARWIN_LDFLAGS_SO_PREFIX="@loader_path/"

Thus meaning the build will use loader_path rather than "@executable_path".

Configuring/building without that environment variable will retain the current
behaviour.

configure.ac


2020-08-15 11:10:02 +0100
Ken Sharp <ken.sharp@artifex.com>
ffbd883cd13883ace8fb424a8a7c447084ea5fac

Enhance First/LastPage processing

Previously the FirstPage and LastPage processing device did not allow
any means to reset the PageCount. This was because Ghostscript's
command line processing does not permit changing non-PostScript
controls (interpreter and some device parameters) after the first file
has been run.

GPDL however, has a new mechanism 'set_param' which can be used
programmatically, and that does permit for device and interpreter
parameters to be altered after the initial file has been processed.

To allow for this the gdevflp device now processes parameters itself
instead of relying on the underlying device to do so. The parameters
FirstPage, LastPage, PageList and DisablePageHandler now all reset the
page count to 0 when they are encountered. This means that, using gpdl,
it is possible to select a set of pages from one file, then select a
different set of pages from a second file. Sending any of these
parameters (except, obviously DisablePageHandler) also now automatically
enables the device again ie it sets DisablePageHandler to false.

It is not, unfortunately, possible to load the gdevflp device at any
time except when the underlying device is initially opened. This means
that if any file is to be processed using gdevflp the first file must
use one of the parameters, in order to load gdevflp. The simplest
solution is simply to set -dFirstPage=1 which will load the device and
run all the pages from the file.

This commit also includes a minor change to the PDF interpreter. Because
the PDF interpreter (currently) handles subsets of pages itself, it
does not want the first/last page device to be active, so it
disables the device by sending a 'DisablePageHandler' to it. However
(because of the GS command line, as described in the first paragraph) it
did not bother to re-enable the device. So here we add a line to
re-enable the device after processing is complete.

This is probably superfluous now that sending the params will re-enable
the gdevflp device anyway, but it should make the intention plain.

Resource/Init/pdf_main.ps
base/gdevflp.c


2020-08-14 10:47:04 -0700
Michael Vrhel <michael.vrhel@artifex.com>
604646154201c1ecd7000a04fd33778d95b6aeac

Bug 702725 Maintain spot colors when overprint mismatch in process CS

If the process color space does not match the source color space (for example
drawing an RGB image to a CMYK device) and overprint is true, then we should
still retain the spot colorants assuming the device supports them.

base/gscspace.c
base/gscspace.h
base/gsicc.c
base/lib.mak


2020-08-14 12:40:37 +0100
Julian Smith <jules@op59.net>
a02c4496e0c41f5db492e3e549ad06254676dd0e

demos/python/gsapi.py: match new handling of bool by gsapi_set_param().

demos/python/gsapi.py


2020-08-14 16:32:52 +0100
Robin Watts <Robin.Watts@artifex.com>
99c90d8d20d4be6113016154119dc102c18c986b

Update api_test.

Fix proper expectation of return codes when setting params.

Fix alignment of memory buffers for display buffer test. md5sums
of generated files now match properly.

demos/c/api_test.c


2020-08-14 16:30:37 +0100
Robin Watts <Robin.Watts@artifex.com>
067b1ee4b45ee31d251bb796b30079866465ce42

Fix stray error during param to string conversions.

base/gsparaml.c


2020-08-14 13:14:26 +0100
Robin Watts <Robin.Watts@artifex.com>
8eaac9486822db53d3a903ec8638dd83f6677782

Add a couple of files missing from VS Solution.

windows/ghostscript.vcxproj
windows/ghostscript.vcxproj.filters


2020-08-14 13:05:14 +0100
Robin Watts <Robin.Watts@artifex.com>
043a9629cfc27d743b5125584753fd15e462d772

Update gsapi_set_params to use an "int *" for booleans.

doc/API.htm
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/plmain.h
psi/iapi.c
psi/iapi.h


2020-08-14 11:10:27 +0100
Chris Liddell <chris.liddell@artifex.com>
d7e8ea24060997ea5f4be1808b45117fe59b9ead

Bug 702611: Fix tiff_from_filep to handle subclassing

tiff_from_filep() creates a tiffio structure, which contains a pointer to the
tiff device. If the device has been subclassed, however, that is the transient
copy of the tiff device, and not the memory used by the "real" device, as
pointed to by the graphics state.

Since we only use the device to get to the gs_memory_t pointer, just store that
instead.

base/gstiffio.c


2020-08-13 11:15:01 -0700
Nancy Durgin <nancy.durgin@artifex.com>
ae3d32942f4f976e89faff65c4e2fbcf4c6d5068

Fix memory leak associated with pdfwrite, type3x images

This leak is only an issue for non-GC interpreters such as pdfi

devices/vector/gdevpdfi.c


2020-08-13 10:38:45 +0100
Ken Sharp <ken.sharp@artifex.com>
3f2408d5ac786ac1c0a837b600f4ef3be9be0332

graphics library- clean up streams used as DataSource for functions

The graphics library doesn't close streams which are supplied as
the DataSource for type 0 functions, leading to a memory leak in pdfi
because we create memory streams (and hence allocate buffers) for this
kind of input.

Add code to close the stream (if present) when the type 0 function is
freed. There may be future work required here and in other function
types.

base/gsfunc0.c


2020-08-12 15:15:25 -0700
Michael Vrhel <michael.vrhel@artifex.com>
0694e6e708ccab305524b64692403308f62f2652

More API.htm fixes

Found by Ethan Vrhel.

doc/API.htm


2020-08-11 13:53:07 +0100
Ken Sharp <ken.sharp@artifex.com>
5066e260483660b8c13caab141fd34f5844298c7

Improve client memory handling for colour spaces and patterns

Colour spaces have had a client_data member for some time (only used
with Pantone colour replacement) but no means to signal to the client
that a colour space was going to be freed.

In addition, its terribly hard for an interpreter which uses complex
colour spaces (such as Separation and DeviceN, for Patterns see below)
to reliably track when a colour space is freed.

This commit adds a new 'interpreter_data' pointer to hold data allocated
by the interpreter which is associated with a colour space. We also add
an 'interpreter_free_cspace_proc' to be called when a colour space is
about to be freed. This gives the interpreter an opportunity to clean
up the memory it has associated with the colour space.

Similarly pattern instances (as opposed to Pattern colour spaces) have
long had a client_data member, which was previously stored in the
'template' (which is a terrible misnomer) for both type 1 and type 2
patterns. However there was no procedure to notify the client when the
pattern was freed! The PCL interpreter (which was the only one using
this type of pattern) dealt with this by replacing the 'free' routine
in the structure with its own routine which first freed the client data
and then called the original free routine. This seems like a hack.

This commit moves the client_data out of the pattern instance and into
the pattern structure proper. It also adds a 'notfy_free' member which
holds a pointer to a function to be called when a pattern is freed. This
gives the client a reliable opportunity to clean up the client_data.

These changes involve updating the PostScript, PCL and XPS interpreters
to point to the new location of the client_data, as well as similar
changes in the graphics library. pixmap patterns now use the notify_free
functio0n instead of patching over the structure's free routine.

base/gscspace.c
base/gscspace.h
base/gspcolor.c
base/gspcolor.h
base/gsptype1.c
base/gsptype1.h
pcl/pxl/pxink.c
psi/zpcolor.c
psi/zshade.c
xps/xpstile.c


2020-08-12 10:46:32 +0100
Robin Watts <Robin.Watts@artifex.com>
e0529567af14fbbbd397b79ad9579d97799abfa5

Update Makefiles for new MSVC version.

base/msvclib.mak
psi/msvc.mak


2020-08-11 16:09:48 -0700
Michael Vrhel <michael.vrhel@artifex.com>
2228dad8c8649a120fd68d707824be1a06c87ee8

Fix missing bits and errors in API.htm

doc/API.htm


2020-08-08 10:02:18 -0700
Ray Johnston <ray.johnston@artifex.com>
e52f3fccbbb81a4cc0e26837dea4359bda774d3c

Fix Bug 702472: Array contents scrambled with writeobject/printobject

Thanks to Peter Cherepanov for this patch.

The mix-up of the nested arrays was caused by depth-first traversal of
the array tree and assignment of offsets to subsidiary arrays that assumed
width-first traversal. Switching to width-first traversal in all cases is
the easiest way to fix the problem.

Additionally, access to the list of arrays is now implemented with the
-index- operator that has constant complexity, rather than with -roll-
that has linear complexity. So the whole process now has linear complexity
rather than quadratic.

The total number of arrays in the exported object is arbitrarily limited to
64K. This prevents memory exhaustion when exported object has circular
references, but should not hinder real world usage, if any.

Following the original implementation, equal names are not merged and
exported separately.

NOTE:
A Ghostscript extension, support of dictionaries in binary object sequence
has been removed. Following the recent trend of cleaning up non-standard
features.

Dictionary support is not yet removed from the C part. Contrary to PLRM,
Adobe can parse binary object sequences with a non-zero tag in the top
object. This feature is not yet added. Sequences that contain zero
length names can be exported but cannot be imported due a conflict with
accessing the user name index. This is a design flaw in PostScript.

Resource/Init/gs_btokn.ps


2020-08-10 13:51:43 +0100
Julian Smith <jules@op59.net>
9ff6690610a44be40b938ac948d2d0e96852fac2

demos/python/gsapi.py: added support for gsapi_get_param() and gsapi_enumerate_params().

Also:
Wrote some very crude tests of new fns.
Extended gsapi_set_param() to take optional <type_> arg.
Fixed error in handling of word size on 64-bit Windows.

demos/python/gsapi.py


2020-08-11 16:13:55 +0100
Robin Watts <Robin.Watts@artifex.com>
fbe65ad97b583611ad854941927aa4b5a6642c55

Swap order of arguments in gsapi_set_param/gsapi_get_param.

This should play nicer with python.

demos/c/api_test.c
doc/API.htm
doc/GPDL.htm
pcl/pl/plapi.c
pcl/pl/plapi.h
psi/iapi.c
psi/iapi.h
psi/imainarg.c


2020-08-10 18:29:17 +0100
Robin Watts <Robin.Watts@artifex.com>
4a98669de4caf9ac9598ba28633979c78f31d884

Fix gsapi_get_param behaviour on 'not found'.

Now we return gs_error_undefined if a value is not found.

doc/API.htm
pcl/pl/plapi.h
pcl/pl/plmain.c
psi/iapi.c
psi/iapi.h


2020-08-07 18:07:08 -0700
Ray Johnston <ray.johnston@artifex.com>
826f4411a7e879f0891728c0d38c82c516ae34d7

Bug 702607: Fix (and IMPROVE the maintainability of) EPSFitPage

Thanks to Peter Cherepanov for this excellent PostScript code to perform
the scale and rotate FitPage. It is well designed and well documented and
much more understandable than the previous.

Resource/Init/gs_epsf.ps


2020-08-07 18:29:16 +0100
Robin Watts <Robin.Watts@artifex.com>
18caff3cdf2158e7642ded330bbaf14469863c7e

Update .def files with new gsapi functions.

psi/gsdll2.def
psi/gsdll32.def
psi/gsdll32metro.def
psi/gsdll64.def
psi/gsdll64metro.def
psi/gsdllARM32metro.def


2020-08-04 19:45:27 +0100
Robin Watts <Robin.Watts@artifex.com>
4f5692b9c78f0a9fb92c2019d509b80e08a19636

Update api_test: test enumeration of parameters.

demos/c/api_test.c


2020-08-07 18:01:37 +0100
Robin Watts <Robin.Watts@artifex.com>
e66ab52ed2d65ad6989e73b8c6c797faced8343a

Improve gs_param to string functions.

size_t's and int64_t's were being displayed wrong due to a typo
in my use of the PRI macros.

Allow strings to be returned as human readable strings rather than
hexstrings.

base/gsparaml.c


2020-08-07 15:18:07 +0100
Robin Watts <Robin.Watts@artifex.com>
c5b0d528b9e3cbbeadeaba4e7f2e6958cc2a99a6

Add gsapi_enumerate_params functions.

doc/API.htm
pcl/pl/pl.mak
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/plmain.h
psi/iapi.c
psi/iapi.h
psi/iminst.h
psi/psapi.c


2020-08-08 09:32:59 +0100
Robin Watts <Robin.Watts@artifex.com>
0c2e9b65fbc6a7b813fbf96e59d01bd8ffc776e4

Coverity 361226: Add missing break.

psi/imainarg.c


2020-08-07 18:00:58 +0100
Robin Watts <Robin.Watts@artifex.com>
d65d008f20c1cefb27f9ee2f40bcde268050cd6e

Fix typo in default param handling.

PageList should be a string, not a name.

base/gsdparam.c


2020-08-06 07:44:07 -0700
Nancy Durgin <nancy.durgin@artifex.com>
249da10b83dd8ed287877e6d21fa3ca3658aadea

Add gstate param to client callback

This is needed for the pdfi interpreter.

base/gsstate.c
base/gxstate.h
pcl/pcl/pctop.c
pcl/pxl/pxgstate.c
psi/zgstate.c


2020-08-04 19:45:27 +0100
Robin Watts <Robin.Watts@artifex.com>
419fe20af3bdf203f980f41bd92189c7a76b32ba

Update api_test.

Test param getting, and resolution changing.

demos/c/api_test.c


2020-08-06 15:23:50 +0100
Robin Watts <Robin.Watts@artifex.com>
d01489255d8b5e1733ac1d664cbc1fbf206319e9

Fix bug in param array coercion.

If we're going to autoconvert an int array to a float array,
make sure we label the final array as being floats, otherwise
we run the risk of converting it again!

base/gscparam.c


2020-08-06 13:30:45 +0100
Robin Watts <Robin.Watts@artifex.com>
afac1313514a34b47bd7f3f441c6ec0ef169fccc

Tidy printing of floating point numbers in get_params.

base/gsparaml.c


2020-08-06 13:30:22 +0100
Robin Watts <Robin.Watts@artifex.com>
afbecca968cf0701da25cc7ec8ceba9075aad0f8

Parse #xx in param names correctly (for gsapi_set_param).

base/gsparaml.c


2020-08-06 12:02:59 +0100
Robin Watts <Robin.Watts@artifex.com>
783049405b39fb48f84d4ddee478e4ea10631c3d

Support arrays of names in the param passing code.

base/gsparaml.c


2020-08-05 18:48:59 +0100
Robin Watts <Robin.Watts@artifex.com>
d1d44a90cf94338fec8ccf73338767ddb07a2254

Update docs for set_param/get_param and -p.

doc/API.htm
doc/Use.htm


2020-08-05 16:16:39 +0100
Robin Watts <Robin.Watts@artifex.com>
34703d722359c7547c532a3e24d2cd81c3f332f5

Trigger an initgraphics on every usage of -p within gs.

This enables us to set the resolution and have it reflected.

psi/iapi.c
psi/imainarg.c
psi/int.mak


2020-08-05 13:44:51 +0100
Robin Watts <Robin.Watts@artifex.com>
932dc770a270ff7c70e899f953df9e9c72620d47

Update gpdl to accept -d/-s/-p after filenames.

pcl/pl/plmain.c


2020-08-05 13:18:00 +0100
Robin Watts <Robin.Watts@artifex.com>
4d94506a1a9442bd3cc51b94eb5f6a16a12588f2

Add -pNAME=STRING options to gs and gpdl to accept parsed params.

This means we no longer need to rely on using -c and passing
postscript fragments to configure (for example) pdfwrite.

pcl/pl/plmain.c
pcl/pl/plmain.h
psi/imainarg.c


2020-08-04 19:44:23 +0100
Robin Watts <Robin.Watts@artifex.com>
fe0c022fbc1906a48b5a03704d9337751b26be8a

Add gsapi_get_param

base/gsparam.h
base/gsparam2.c
base/gsparaml.c
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/plmain.h
psi/iapi.c
psi/iapi.h
psi/psapi.c
psi/psapi.h


2020-08-05 16:52:06 +0100
Robin Watts <Robin.Watts@artifex.com>
3a8f4eca0284294c05a471a99263d22032db84b6

Bug 702606: Fix downsampler failing to initialise with pdfwrite.

Some of the params were being left unset. My mistake when I added
them.

devices/vector/gdevpsdi.c


2020-08-03 12:53:26 -0700
Ray Johnston <ray.johnston@artifex.com>
c935b86d261d91ee04b5bf5f95028473d4af3735

Fix infinite loop in ialloc_validate_memory tracing the freelist.

Found in a DEBUG build running the file from Bug 702586 using:
-sDEVICE=ppmraw -o x.ppm Bug702586.pdf
Hangs after printing the error message:
GPL Ghostscript GIT PRERELEASE 9.53: Unrecoverable error, exit code 1

Fixed by adding a check for self-reference and break out of the loop.

At some point, someone may want to look at how we get this freelist
problem.

psi/ilocate.c


2020-08-04 12:32:20 +0100
Robin Watts <Robin.Watts@artifex.com>
ae588a57abccc598d74cb664c117ef339a42c1ba

Coverity 361222: Add missing break.

psi/imain.c


2020-08-03 13:57:39 +0100
Robin Watts <Robin.Watts@artifex.com>
341da1a6c41d71344f7ea32505f9ce82c1177e99

Avoid gsapi_set_param within a gsapi_runstring.

Also, avoid gsapi_run_file within a gsapi_runstring.

pcl/pl/plmain.c
psi/iminst.h
psi/psapi.c


2020-08-03 13:17:30 +0100
Robin Watts <Robin.Watts@artifex.com>
d1337dc425e1d032c0eeef26d530b096930432f4

Update header dependencies

base/lib.mak
base/tiff.mak
devices/dcontrib.mak
devices/devs.mak
devices/gdevpdfimg.h
psi/int.mak


2020-07-30 19:16:13 +0100
Robin Watts <Robin.Watts@artifex.com>
bf6884134c244c4766d13c76264fa4372eab4056

gsapi_set_param improvements.

Allow for a 'parsed' param type; this leverages the functions in
gsparaml.c to parse an input string into a param list, coping
with dictionaries and arrays.

We update those functions to improve behaviour on more exotically
formed numbers ("- 0.3e-10" etc), on 'tricksy' inputs (e.g.
"<< /Foo (>>) >>" etc) and to cope without relying on whitespace
(e.g. "<</Foo/Bar/Baz[1 0]/Fizz<1234>/Bang(A)>>" etc).

Update pl_implementation set_param entrypoint so that the language
interface itself is based upon param lists, rather than typed
params.

Update both implementations of gsapi_set_params so that if
we are too early in the setup process stuff goes into the list
and is held until we have devices/languages to pass it to. Also
add a flag to allow for 'more to come' so that we can effectively
set multiple params at once.

base/gsparam.h
base/gsparaml.c
demos/c/api_test.c
demos/c/api_test.vcxproj
gpdl/psitop.c
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/plmain.h
pcl/pl/pltop.c
pcl/pl/pltop.h
psi/iapi.c
psi/iapi.h
psi/imain.c
psi/imain.h
psi/iminst.h
psi/psapi.c
psi/psapi.h


2020-07-31 10:13:27 -0700
Ray Johnston <ray.johnston@artifex.com>
49a4fede913a12a61fd6649898cf5999030f4b69

Fix Bug 702598: Ghostscript will not open SECURED PDF that Adobe opens.

It's not really clear that this is a valid PDF since it does not conform to
one comment in the spec related to AuthEvent with StmF and StrF /Identity,
but since Adobe opens this we now open PDF's with AuthEvent specified as
something other than /DocOpen and BOTH StrF and StmF /Identity. We look
in the /CF "StdCF" dictionary for the AuthEvent. As per the spec., if
AuthEvent is not present, assume DocOpen, and if StmF or StrF are not
present, we default to /Identity.

Thanks to Ken Sharp for the initial work on this.

Resource/Init/pdf_sec.ps


2020-07-30 14:23:23 -0700
Nancy Durgin <nancy.durgin@artifex.com>
e3c4d64fe28ffc1361995de034beaeb2a9a7b206

Fix warning message re: gs_smoothness

base/gsstate.c
base/lib.mak


2020-07-30 14:22:09 -0700
Nancy Durgin <nancy.durgin@artifex.com>
28452533cab466bef9437ee393140695dabc5f9c

Fix memory leak with non-GC overprint device

This memory leak only matters in non-GC (reference-counted) interpreters
such as pdfi.

There was an extra reference count after creating and then setting the
overprint device. This change decrements the rc so that it will be 1
when exiting this function, allowing it to be properly freed later.

base/gsstate.c


2020-07-30 16:18:44 +0100
Julian Smith <jules@op59.net>
a1441168f346cefd28e6336f6fbb3b310540dbff

Changed gsapi.py to raise exceptions instead of returning error number

gsapi.py:
Generate exceptions instead of returning error codes.
Added python versions of gs_error_* codes.

examples.py:
Updated to match new API.
Re-raise import error if 'import gsapi' fails.
Patched up calls of run_gpdl() to pass in_filename because passing None
caused underlying C to return an error.
Marked as executable.
Look for input files relative to top of ghospdl checkout (found using
__file__).

demos/python/examples.py
demos/python/gsapi.py


2020-07-29 17:27:31 +0100
Julian Smith <jules@op59.net>
868200752e41adacc9d027092eba7be2db572b00

demos/python/gsapi.py: added detection of OS to import correct libgs.so/gpdldll*.dll.

demos/python/gsapi.py


2020-07-29 07:25:58 +0100
Julian Smith <jules@op59.net>
54842402fafb0bfc9e4ab2031dbe82e7593f5d08

devices/vector/gdevtxtw.c: Added TextFormat=4 for extract system.

We now retain glyph advance values, and fixed handling of extra widths.

Added .Advs arrays to text_list_entry_s and textw_text_enum_s so that
we can store the original width of glyph before any additions due to
TEXT_ADD_TO_ALL_WIDTHS. E.g. this allows one to determine whether glyphs are
actually not adjacent.

Added TextFormat=4 for generating data suitable for extract system.

txtwrite_process_plain_text:
Don't preserve gs_point dpt across iterations - this was cumlatively
adding additions from TEXT_ADD_TO_SPACE_WIDTH, giving incorrect
positioning. Instead we reset dpt back to {0,0} at the start of each
iteration.

extract_text_output():
New, implements TextFormat=4. Writes similar information to
decorated_text_output() with TextFormat=0, but also specifies advance value
for each char.

devices/vector/gdevtxtw.c


2020-07-29 13:19:02 -0700
Michael Vrhel <michael.vrhel@artifex.com>
7e28caf03348229390e8aa3cf6395e3a13fab0b3

Fix minor items in python demo

Remove ;'s at some line endings (a hard habit to break).
Add try catch around import process. Update README

demos/python/README.txt
demos/python/examples.py


2020-07-29 14:39:46 +0100
Robin Watts <Robin.Watts@artifex.com>
d802303d48d2cb7ac7be157865588b2416e8e633

Add gs_param list parsing functions.

Actually, steal the existing functions from the PJL code,
move them into the graphics library, and refactor slightly.

2 functions; the first one, gs_param_list_add_tokens reads
a string of key/value pairs and adds them to the list.

The second one, gs_param_list_add_parsed_value takes a key
and a string for the value, and just adds that pair to the
list.

base/gsparam.h
base/gsparaml.c
base/lib.mak
pcl/pl/plparams.c
windows/ghostscript.vcxproj
windows/ghostscript.vcxproj.filters


2020-07-29 11:29:31 +0100
Robin Watts <Robin.Watts@artifex.com>
423a04cd8bb7f12ffc127bfb30630348d98694b4

Coverity 361150: Check return values for abuf_flush().

I foolishly checked the return value from abuf_flush() in new
code, which has made Coverity wake up and start complaining
about these older ones.

base/gdevabuf.c


2020-07-25 08:29:31 +0100
Chris Liddell <chris.liddell@artifex.com>
89bba350f5724b034753c4febfc559afad835d5c

Defeat ICC component validation for nullpage device

Further to commit 4a3441bdde7060ecc9048bf391977412a82063a8, it turns out that,
in practice, we can't completely ignore the ICC profile device parameters,
parameters that have an immediate effect on the device are also validated during
put_params and thus, for those, validation can still fail.

Using gxdso_supports_devn allows us to defeat the profile component validation,
but nullpage is not a DeviceN device, hence that could cause confusion.

Using a dedicated gxdso_skip_icc_component_validation allows us to be more
selective about when to short circuit those tests, and avoid confusion.

This is required for gpdl as Postscript initialisation is slightly different
compared to regular Ghostscript - the nulldevice remains in play all through
Postscript initialisation (rather than being replaced with the device
specified by the command arguments part way through initialisation).

base/gdevmpla.c
base/gdevnfwd.c
base/gdevp14.c
base/gsicc_manage.c
base/gxclrect.c
base/gxdevsop.h
devices/gdevcmykog.c
devices/gdevdsp.c
devices/gdevpsd.c
devices/gdevtsep.c


2020-07-27 12:46:02 +0100
Chris Liddell <chris.liddell@artifex.com>
9beae99074655cf78729d5e26862f00cea11b109

Ensure we can call dev_spec_op as soon as device is created

Since we can legitimately want to interrogate a device for its capabilities and
preferences right from its creation, ensure the dev_spec_op is valid as soon
as the device is created.

base/gsdevice.c


2020-07-28 21:36:11 -0700
Michael Vrhel <michael.vrhel@artifex.com>
6179b719348c1622352b55d66599ba26cfba9d3d

Add Python examples and README

Also fix typos in C# README

demos/csharp/README.txt
demos/python/README.txt
demos/python/examples.py
demos/python/gsapi.py


2020-07-28 17:52:11 +0100
Robin Watts <Robin.Watts@artifex.com>
c001ce438ef9fd0171104ac49afa110e39edb03e

Bug 702587: Fix alpha buffer issue with fill/stroke operations.

The "alphabits" devices work by an alpha buffer being inserted
into the device chain before graphical operations. This intercepts
drawing device calls, 'saves' the color, and then converts the
call into a fill of a monochrome mask.

Only a small 'window' of mask is ever held in memory at once. When
the drawing moves out of the range of that window, the window is
flushed (conceptually the mask is scaled down, and then that scaled
representation is filled with the saved color).

Any "stragglers" (i.e. unwritten back bits of mask) are flushed at
the end of the graphical operation.

When using fill/stroke, the existing code fails to notice the
color in use being changed. This means the last 'window' of
fill can end up being written in the color intended for 'stroke'.

We therefore update the fill/stroke logic to check for the color
changing. (We check for 'unflushed data' and 'color has changed').

base/gdevabuf.c


2020-07-27 12:43:38 +0100
Ken Sharp <ken.sharp@artifex.com>
45b122117e937bb36da2ef03ea590c90ebcd2de9

pdfwrite - free ICCBased profile streams to prevent memory leak

An oversight in memory cleanup in pdfwrite.

ICCBased colour space arrays contain a reference (must be a reference)
to a stream dictionary where the stream data is the profile. Because the
stream dictionary is a reference, it must have an ID (a pdf index). This
means that when we free the colour space array we do not free the stream
dictionary element contained within it.

We don't free objects with a non-zero ID because these are assumed to be
a type of resource, and tracked via the resource chains, but in the
case of ICC profiles we were not adding them to a resource chain.

Fixed here by adding ICC profile streams to the 'resourceOther' chain
so that they are freed on exit.

devices/vector/gdevpdfk.c


2020-07-25 10:52:24 +0100
Ken Sharp <ken.sharp@artifex.com>
55088a6e12775eeae1d19bf9a6db641566ea0c8f

pdfwrite - review use of sclose().

The stream interface essentially leaves the buffer management in the
hands of the creator; sclose() does not free the stream buffer, but it
does set the pointer in the stream state to NULL.

This can be problematic; if the only reference we have to the original
buffer is the pointer in the stream state, then we must copy the pointer
before calling sclose() and then free the buffer afterwards.

s_close_filters() does this BUT it can't know whether a given buffer
was allocated in memory, from the C heap or some other fixed allocation.
It simply frees all the buffers. Obviously this can cause problems if
we use it indiscriminately.

I've reviewed all the places pdfwrite uses sclose() and where we can
use s_close_filters() I've modified the code to do so (to avoid memory
leaks in non-GC memory allocators). Where we must not attempt to free
the buffer I've left the sclose() but commented on the reason.

devices/vector/gdevpdf.c
devices/vector/gdevpdfc.c
devices/vector/gdevpdfo.c
devices/vector/gdevpdfu.c


2020-07-22 09:57:54 -0700
Ray Johnston <ray.johnston@artifex.com>
5d499272b95a6b890a1397e11d20937de000d31b

Bug 702582, CVE 2020-15900 Memory Corruption in Ghostscript 9.52

Fix the 'rsearch' calculation for the 'post' size to give the correct
size. Previous calculation would result in a size that was too large,
and could underflow to max uint32_t. Also fix 'rsearch' to return the
correct 'pre' string with empty string match.

A future change may 'undefine' this undocumented, non-standard operator
during initialization as we do with the many other non-standard internal
PostScript operators and procedures.

psi/zstring.c


2020-07-24 14:03:51 +0100
Julian Smith <jules@op59.net>
f77f99702c9c8418b9516056d5f4280105beafc4

demos/python/gsapi.py: improved encoding/decoding of strings.

Set global _encoding to the encoding passed to gsapi_set_arg_encoding(), and
use it where expected by the underlying C code.

gsapi_set_stdio():
Pass bytes object to stdout and stderr callbacks for convenience, and
document what expectations are.

gsapi_run_string*():
Accept str or bytes; encode the former into bytes using utf-8 encoding.

demos/python/gsapi.py


2020-07-22 18:41:05 +0100
Julian Smith <jules@op59.net>
269f880585dd2c6b3f716668b05f4c911214356b

configure.ac: avoid pathological shell glob expansion in CFLAGS_SANITIZE.

Specifying a command-line arg with lots of '*' characters that aren't intended
to match any filenames, can stress the shell's glob code.

OpenBSD's ksh gets very slow, for example (e.g. 20m vs 45s in bash).

configure.ac


2020-07-24 17:52:05 +0100
Ken Sharp <ken.sharp@artifex.com>
dd1114e8ac0508ada6959c7ffcf6433b5bebe0cf

make pdf_end_encrypt static

devices/vector/gdevpdfx.h


2020-07-24 15:26:27 +0100
Ken Sharp <ken.sharp@artifex.com>
0752757bca7979ed23e6e4fc3cf0772a49fb86c2

pdfwrite - fix memory leak with sclose

The stream code is hideous and full of surprised to trap the unwary. In
this case sclose() has the unexpected side-effect of setting the stream
buffer to NULL before returning, so we cannot free it afterwards.

s_close_filters deals with this for us by taking a pointer to the
buffer and calling gs_free_object on it after the stream is closed, so
we really need to do that (or mimic the same thing ourselves).

We could do s_close_filters(s, s->strm) to just close each filter in
turn, but I've chosen to just walk down the filter chain for each
filter we added, and then close them all up to that point.

This means changing pdf_end_encrypt() so that instead of closing the
stream (with the potential memory leak) we just signal whether the
calling code should close the encryption filter.

devices/vector/gdevpdfu.c
devices/vector/gdevpdfx.h
devices/vector/gdevpdti.c


2020-07-24 09:42:10 +0100
Chris Liddell <chris.liddell@artifex.com>
4837ddb473d3109fe2108b2ac2aa12a8bf5a0b4e

Have gsapi_run_file() handle access controls

Previously, gsapi_run_file() required the caller to add the file to be
processed to the permit read file list. We'll now add the file to the permit
read list, execute the file, and remove it from the list without the caller
having to do so.

pcl/pl/plapi.c
psi/imainarg.c


2020-07-22 14:01:14 -0700
Nancy Durgin <nancy.durgin@artifex.com>
3244573621b1daa2997fbea0c13ce7f891b42203

Fix pdfwrite memory leak when doing multi-page output

When doing multiple page output (i.e. page-%0d.pdf or whatever) there
was a memory leak because it was attempting to short-circuit things and
just delete the last (blank) page, but there was a ton of stuff that
never got freed in that case.

This change sets a flag for the condition and then processes the whole
page (which hopefully doesn't do much because it is empty), including
freeing everything. Then it just deletes the file at the end instead
of at the beginning of the function.

This function (pdf_close()) is over 1000 lines and really needs to be
refactored for maintainability.

devices/vector/gdevpdf.c


2020-07-22 12:24:05 -0700
Nancy Durgin <nancy.durgin@artifex.com>
90f0f92bf6bf9c346cd3f74adaa42a7c8a3702cb

Fix memory leak in pdfwrite device

This appears to only be a memory leak for non-garbage-collected interpreters
such as pdfi.

sclose() calls s_disable() which sets s->cbuf to 0.
But it also calls client callbacks that might do things with cbuf first, so
it will crash if we free it before calling sclose().
Side-effects galore! :(

Anyway, we save the pointer before doing the sclose() so we can
properly free it afterwards.

devices/vector/gdevpdfu.c


2020-07-23 12:51:20 +0100
Chris Liddell <chris.liddell@artifex.com>
4a3441bdde7060ecc9048bf391977412a82063a8

Have nullpage ignore ICC parameters

We want nullpage to be (largely) a bitbucket device, but ICC profile
parameters that require a specific color model could cause it to error.

Force nullpage to ignore changes to the device ICC profiles. Since it cannot
ever produce output, it has no effect in normal operation.

base/gdevnfwd.c


2020-07-23 13:15:20 +0100
Robin Watts <Robin.Watts@artifex.com>
a0288377aa1952f8bb3c3739e0d119635280f31c

gpdl: Don't report -h or --help as failures.

pcl/pl/plmain.c


2020-07-21 14:50:13 +0100
Julian Smith <jules@op59.net>
36bec547acf7b799d09f0433b25b059153712839

demos/python/gsapi.py: removed requirement for python-3.7.

Removed use of collections module, and instead use hand-written classes, which
are clearer and don't require python-3.7.

demos/python/gsapi.py


2020-07-21 08:19:04 +0100
Ken Sharp <ken.sharp@artifex.com>
1d2b10ba71b40f261350e4ffc1f808381e81544d

Fix Coverity ID 360929

Remove some pointless code, over-enthusiastic copy/paste error.

base/gsstate.c


2020-07-20 16:41:37 -0700
Michael Vrhel <michael.vrhel@artifex.com>
e2efdde6b718098f0d35763bb094833a766af479

Fix two minor issues in python API demo

demos/python/gsapi.py
demos/python/jlib.py


2020-07-20 16:32:42 -0700
Michael Vrhel <michael.vrhel@artifex.com>
217b8d292a1098ee56ab52b57bce3e32920b55d4

Demo Viewers: Add readme for csharp example.

Also minor fixes in Windows application.

demos/csharp/README.txt
demos/csharp/api/ghostnet.cs
demos/csharp/windows/ghostnet_wpf_example/MainWindow.xaml.cs


2020-07-20 16:02:31 -0700
Michael Vrhel <michael.vrhel@artifex.com>
4aa0fb2f264f196bb9a07f9d03f7b2da3e89abec

Linux Demo Viewer : Fix few issues found with testing

Race condition between gs thread and ui thread. Also
issues with zoom factors.

demos/csharp/api/ghostmono.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs
demos/csharp/linux/gtk_viewer/src/MainZoom.cs


2020-07-20 14:42:17 -0700
Michael Vrhel <michael.vrhel@artifex.com>
b6622b9b2e95e20febe283035328569211413ac4

Demo Viewer: Delete unused file. Minor code fix in wpf viewer.

demos/csharp/linux/gtk_viewer/src/gsIO.cs
demos/csharp/linux/gtk_viewer/src/gsOutput.xaml.cs
demos/csharp/windows/ghostnet_wpf_example/MainWindow.xaml.cs


2020-07-20 14:32:59 -0700
Michael Vrhel <michael.vrhel@artifex.com>
4c6a3e9b8c87aadc6a50c457d8cf7190fafef59c

Linux Demo Viewer: Complete various lingering tasks

Add proper closure of current file. Add launching of new
process when another file is opened. Fix issue in
distilling process.

demos/csharp/api/ghostapi.cs
demos/csharp/api/ghostmono.cs
demos/csharp/linux/gtk_viewer/src/MainRender.cs
demos/csharp/linux/gtk_viewer/src/MainThumbRendering.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs


2020-07-20 11:14:42 +0100
Ken Sharp <ken.sharp@artifex.com>
ed82512ecb34f9b51461383755e061e881c269c9

graphics library - initialise more members of the graphics state

When creating a graphics state and when calling gs_initgraphics() the
code was not initialising several members of the graphics state. Mainly
these were the new members introduced some time back to allow the PDF
interpreter to track the PDF graphics state.

For consistency, and simpler implementation in pdfi, its better to
specifically initialise the state, especially those members which
should not default to 0.

This causes a few tiny diffs with XPS (because the XPS interpeter,
unlike the PS and PDF interpreters) did not set a couple of members
which are, nevertheless, used when rendering (smoothness and
accuratecurves). Smoothness (which affects gradient fills) is now
initialised to 0.02 instead of 1 (so much smoother) and accuratecurves
is now true instead of false.

base/gsstate.c
base/gxgstate.h


2020-07-19 23:21:25 -0700
Michael Vrhel <michael.vrhel@artifex.com>
45d1994b40289b4ca7bf2d6504081ddcc4d68f14

Linux Demo Viewer: Distiller work.

Everything is hooked in and running. For some odd reason the tmp
file generated in the distilling process is 0 bytes. Will
dig further to see why the file is not getting written. API
seems happy as can be... very odd.

demos/csharp/api/ghostapi.cs
demos/csharp/api/ghostmono.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs


2020-07-18 17:02:46 -0700
Michael Vrhel <michael.vrhel@artifex.com>
6466211fec0c44ce29e7cd094465d2ed4f351ef1

Linux Demo Viewer: Progress at last.

Many thing that should have been simple were complicated
in the poorly documented world of C# mono development.
Just need to do a bit more clean up and hook in the
distilling option for PS.

demos/csharp/api/ghostmono.cs
demos/csharp/linux/gtk_viewer/gtk_viewer.csproj
demos/csharp/linux/gtk_viewer/gtk_viewer.sln
demos/csharp/linux/gtk_viewer/src/MainRender.cs
demos/csharp/linux/gtk_viewer/src/MainThumbRendering.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs
demos/csharp/linux/gtk_viewer/src/MainZoom.cs
demos/csharp/linux/gtk_viewer/src/Program.cs
demos/csharp/linux/gtk_viewer/src/gsOutput.cs


2020-07-15 16:48:25 -0700
Michael Vrhel <michael.vrhel@artifex.com>
0f59de6b3daab30d405ee5c5c4ac943c26721622

Linux Demo Viewer: Various updates to try to get threading working

demos/csharp/linux/gtk_viewer/src/DocPage.cs
demos/csharp/linux/gtk_viewer/src/MainRender.cs
demos/csharp/linux/gtk_viewer/src/MainThumbRendering.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs
demos/csharp/linux/gtk_viewer/src/MainZoom.cs
demos/csharp/linux/gtk_viewer/src/Program.cs


2020-07-15 16:42:57 -0700
Michael Vrhel <michael.vrhel@artifex.com>
42b49069c0f87406dcd796183ba719d45dd8ce69

Mono GTK requires a different type of threading call

In Windows .NET one can use the BackgroundWorker event handler.
Unfortunately the completed event does not call back on the
correct thread. This one uses methods suggested by the mono
GTK documentation. Keeping both versions for examples.

demos/csharp/api/ghostmono.cs


2020-07-17 13:44:59 +0100
Ken Sharp <ken.sharp@artifex.com>
69593c399cbd445b51b4a7bf7d1ccc36604f2c37

graphics library - initialise some gstate members appropriately

The members are (I think) all part of the PDF graphics state rather than
the PostScript graphics state. These members are normally initialised
by the (PostScript) PDF interpreter but when we are running the new
pdfi interpreter inside Ghostscript we want to inherit the contents of
the graphics state, not overwrite them, so we do not initialise these.

This leads to problems; because the values are never initialised in this
case, and (for example) the text horizontal scaling remains at 0 when
it should be 100. Since we set the Text Rendering Matrix partially by
multiplying by that value, this can lead to a degenerate matrix and
cause text not to appear. In addition it causes ps2write output to be
incorrect and throw an error.

This commit does nothing with regular Ghostscript, but with GS+pdfi it
fixes hundreds of errors in ps2write tests and results in at least some
files drawing some content. At least one of these files is still not
correct (it is with pdfi alone) so there is clearly more to do here.

This reduces the number of errors testing GS+pdfi to 475 which is
447 errors less than Ghostscript alone.

base/gxgstate.h


2020-07-08 10:51:21 -0700
Nancy Durgin <nancy.durgin@artifex.com>
c735180bed16fa7e0525640670a4ee082700b770

Change default pdfwrite.params.OPM to be 0

It is already set this way by gs distillerparams, but this makes it
match to make it easier for pdfi.

(This is just a hack at this point, need a general solution for pdfi)

devices/vector/gdevpsdf.h


2020-07-16 09:15:34 +0100
Chris Liddell <chris.liddell@artifex.com>
630d427ab701c582c576a54f2b02f44ddae4a3f6

Bug 702560: Honour PDFSTOPONERROR with broken form dict

Commit 409db64c5519 added support for form XObject dictionaries with a /Contents
key for the content stream, rather than the form dict being the stream dict.

As that is contrary to the spec, this commit makes that case trigger an error
when -dPDFSTOPONERROR is used.

Resource/Init/pdf_draw.ps


2020-07-16 08:14:38 +0100
Chris Liddell <chris.liddell@artifex.com>
409db64c55198b0126c4afebd74eb26d8d7d57ed

Bug 702560: Cope with (broken) form with "Contents"

The file for this bug has a form which contains a /Contents key for the content
stream, rather than the /Form dictionary being a stream dictionary itself.

This is contrary to the spec, but Acrobat displays it without complaint.

Note: Acrobat pre-flight lists the resource to reference the form object
as "missing", and yet renders the form contents anyway.

Also note: we have a test file in the test suite that also includes "/Contents"
key, which is a metadata string, so we have to explicitly check that the value
for the "/Contents" key is a stream dictionary.

Resource/Init/pdf_draw.ps


2020-07-14 14:03:41 -0700
Ray Johnston <ray.johnston@artifex.com>
c184fcbcc23a196a6d6a26648e52d9f3372ac46b

Fix problem introduced by commit 6a3c36f8 with multi-threaded rendering.

That commit changed the allocation requirement in clist_init_states, but didn't
change the corresponding calculation that is supposed to match. Make this a
function so that both will agree going forward.

base/gxclist.c
base/gxclist.h
base/gxclthrd.c


2020-07-15 15:25:10 +0100
Ken Sharp <ken.sharp@artifex.com>
3786f7cb0c4ccf3442beafdf186dbc6835da8ae3

pdfwrite - write FontMatrix for FDArray of a CFF CIDFont

Bug #702556 "pdfwrite produces an invalid pdf file"

The description is incorrect here, the PDF file is not invalid. The
input PostScript file has been created by converting a PDF file using
Poppler.

The original PDF file contains a number of CIDFonts, all with CFF
outlines, and the conversion, for reasons best known to itself, moves
the FontMatrix out of the CFF font and into the CIDFont. This isn't
possible with PDF, so pdfwrite is forced to move the FontMatrix from
the CIDFont back into the CFF font.

Unfortunately we were not writing the FontMatrix out at the FDArray
level of the CFF CIDFont, leading to text 1000 times too large.

Fixed here by writing the FontMatrix for each font in the FDArray.

devices/vector/gdevpsf2.c


2020-07-14 13:56:24 -0700
Ray Johnston <ray.johnston@artifex.com>
5ec2c321c890114af532cb69e913462d56fd4f4f

Fix bug 702559: Patterns + overprint on 16 bit-per-component devicen devices.

The 'blank_unmasked_bits' needed to handle 16 bit per component (deep) planes.

base/gxpcmap.c


2020-07-14 13:52:45 -0700
Ray Johnston <ray.johnston@artifex.com>
d23a584e66c103f43a1de2b1d327bcf196c5972a

Fix bug 702557: oknown missing in paint_form check for Group.

Yet another case where indirect objects were not being handled.

Resource/Init/pdf_draw.ps


2020-07-14 10:42:54 +0100
Ken Sharp <ken.sharp@artifex.com>
868b71c7df45571088e2ff7fcde666b2534d03f0

pdfwrite - move TwoByteToUnicode variable out of union

Discovered while working on the new PDF interpreter and the test file
BCL_Easy.pdf with pdfwrite.

The TwoByteToUnicode flag was stored in the 'simple' structure in the
encoding union. However, that flag is altered by the addition of
ToUnicode code points, and that is *not* limited to simple encodings,
we also alter it for CIDFonts. If we alter the flag we are, in effect,
corrupting members of the union in the case where we are using a
different structure in the union.

This showed up as corrupting the CMapName member of the type0 structure
when built for 64-bit. It didn't exhibit with regular Ghostscript
because that uses the ToUnicode CMap from the input, and only has a
2-byte Unicode value, the pdfi version currently returns a 4-byte
code point.

Nevertheless, this clearly shows that the potential for problems is
there, so to avoid this in future move the flag out of the union and
into the main pdf_font_resource_s structure.

devices/vector/gdevpdte.c
devices/vector/gdevpdtf.c
devices/vector/gdevpdtf.h
devices/vector/gdevpdtw.c


2020-07-14 10:35:53 +0100
Ken Sharp <ken.sharp@artifex.com>
bb1fcf280916311b4e38dfc438399aaebf9c8698

Move declaration of a variable to function prolog.

base/simscale.c


2020-06-03 06:38:12 -0400
Ken Brown <kbrown@cornell.edu>
8690eed13e3f343fde0d78a5c9bb0108b7f88d41

Bug 702464: Fix Cygwin build

Commit 327dc89 made many changes to the Cygwin build of ghostscript,
most of which were wrong. (They treated Cygwin as though it were
Windows.) One of those changes caused the problem on x86_64 Cygwin
reported here:

https://sourceware.org/pipermail/cygwin/2020-June/245070.html

This patch restores the Cygwin build to its former state and also
makes a couple of small tweaks.

configure.ac


2020-07-10 09:44:19 +0100
Chris Liddell <chris.liddell@artifex.com>
857b4a2c5cb7d8ce8798caf623134b77e9f5c447

Bug 702553: Broken handling of 1.0 TTF cmap case

A (clearly!) fairly little used path through the TTF cmap table handling code
for PDF files had bitrotted to the point where we ended up trying to create
a Type 42 font (from a TTF) which didn't have a CharStrings dictionary.

Specifically, this is the case where we're using a 1.0 cmap table, and the
source PDF font's Encoding object does not contain a Differences key.

Resource/Init/gs_ttf.ps


2020-07-09 22:20:32 -0700
Michael Vrhel <michael.vrhel@artifex.com>
13c04693416d0fbf0d614509cabce71e7399207e

WPF demo: Make changes introduced due to needs of mono project

demos/csharp/windows/ghostnet_wpf_example/MainRender.cs
demos/csharp/windows/ghostnet_wpf_example/MainThumbRendering.cs
demos/csharp/windows/ghostnet_wpf_example/MainWindow.xaml.cs
demos/csharp/windows/ghostnet_wpf_example/ghostnet_simple_viewer.csproj


2020-07-09 22:08:08 -0700
Michael Vrhel <michael.vrhel@artifex.com>
279f4835e1ab58653665e9024aaf58032c0591d7

Linux Demo Viewer: Pages now rendering.

AA working. Need to add zoom, page navigation, track down a few
crashing issues.

demos/csharp/api/ghostnet.cs
demos/csharp/linux/gtk_viewer/gtk-gui/gtk_viewer.src.gsOutput.cs
demos/csharp/linux/gtk_viewer/gtk_viewer.csproj
demos/csharp/linux/gtk_viewer/src/DocPage.cs
demos/csharp/linux/gtk_viewer/src/MainRender.cs
demos/csharp/linux/gtk_viewer/src/MainThumbRendering.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs
demos/csharp/linux/gtk_viewer/src/gsOutput.cs


2020-07-08 22:36:25 -0700
Michael Vrhel <michael.vrhel@artifex.com>
2260ba90c0e70f38f2fef96baf8b1b972eef2940

Linux Demo Viewer: StdIO output working

Thumbnail images created. Need to populate into UI next.

demos/csharp/linux/gtk_viewer/src/MainThumbRendering.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs
demos/csharp/linux/gtk_viewer/src/gsOutput.cs


2020-07-08 17:42:56 -0700
Michael Vrhel <michael.vrhel@artifex.com>
fcef740cdba16732a16f83a180404c458a075abc

Progress on the UI design.

Made design similar to what was done for the WPF application.
stdio callbacks from GS are working so hopefully will have pages
rendered shortly.

demos/csharp/linux/gtk_viewer/gtk-gui/gtk_viewer.src.gsOutput.cs
demos/csharp/linux/gtk_viewer/gtk_viewer.csproj
demos/csharp/linux/gtk_viewer/src/MainThumbRendering.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs
demos/csharp/linux/gtk_viewer/src/gsOutput.cs


2020-07-07 21:54:08 -0700
Michael Vrhel <michael.vrhel@artifex.com>
057a39eb4e3f859d293c1e98e1005c82da31024c

csharp/linux: Initial commit of mono gtk csharp project

Many of the files are variants of the wpf project from windows.
These projects share the same API files to ghostscript, but the
mono UI related objects have to change since mono does not support
WPF. This is just an initial commit to get something in place.

demos/csharp/linux/gs_mono.sln
demos/csharp/linux/gtk_viewer/Properties/AssemblyInfo.cs
demos/csharp/linux/gtk_viewer/gtk-gui/generated.cs
demos/csharp/linux/gtk_viewer/gtk-gui/gtk_viewer.src.gsOutput.cs
demos/csharp/linux/gtk_viewer/gtk-gui/gui.stetic
demos/csharp/linux/gtk_viewer/gtk_viewer.csproj
demos/csharp/linux/gtk_viewer/src/DocPage.cs
demos/csharp/linux/gtk_viewer/src/MainRender.cs
demos/csharp/linux/gtk_viewer/src/MainThumbRendering.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs
demos/csharp/linux/gtk_viewer/src/MainZoom.cs
demos/csharp/linux/gtk_viewer/src/Program.cs
demos/csharp/linux/gtk_viewer/src/TempFile.cs
demos/csharp/linux/gtk_viewer/src/gsIO.cs
demos/csharp/linux/gtk_viewer/src/gsOutput.cs
demos/csharp/linux/gtk_viewer/src/gsOutput.xaml.cs


2020-07-09 11:14:46 +0100
Robin Watts <Robin.Watts@artifex.com>
e88ba0a1ee23911172222ee6ad7c2e3c9ea205a4

Fix Coverity issue: sizeof(byte **) vs sizeof(byte *)

*Apparently* sizeof(byte *) and sizeof(byte **) might be different.
I can't think of a case where that's true, but I am indeed using
the wrong one.

Fix it here.

pcl/pl/plmain.c


2020-07-08 16:41:11 +0100
Robin Watts <Robin.Watts@artifex.com>
da755f7ee3da900a504a3265c64fb08c93a41eac

Bug 688990: Reimplementation of image mask scaling.

Aiming for a better match to Adobe's reference implementation.

Patch supplied by Peter Cherepanov. Many Thanks!

base/lib.mak
base/simscale.c
base/simscale.h
base/simscale_foo.c
base/simscale_foo.h


2020-07-08 18:52:44 +0100
Robin Watts <Robin.Watts@artifex.com>
cc596ad6dd030f192416086370bd54e8059589d4

lgtm.com issue: Fix potential overflow in mkromfs.

We know that we only ever call this splitting the ROMFS into 4,
so it's never going to overflow, but lgtm.com can't know that.
Add a check to keep the number down to a sane size to keep it
happy.

base/mkromfs.c


2020-07-08 15:50:11 +0100
Robin Watts <Robin.Watts@artifex.com>
b0c208a555ed89139395a6ed0d8dce70d81cde09

Bug 691452: Add missing dependencies.

Patch from Peter Cherepanov. Many thanks!

base/lib.mak


2020-07-08 07:22:06 -0700
Robin Watts <Robin.Watts@artifex.com>
000de1419225213fce7d06de0f1982cd79e4e141

Update CAL makefile to pass correct compiler flags.

base/cal.mak


2020-07-08 00:03:56 +0100
Robin Watts <Robin.Watts@artifex.com>
79d9c45db7ce0ee075254bbfa8235d2996869fb1

Bug 702517: Fix overenthusiastic checking for NULL.

Patch from Peter Cherepanov. Many thanks.

devices/gdevmgr.c


2020-07-03 17:16:10 +0100
Robin Watts <Robin.Watts@artifex.com>
6c5a246ebe922e94df2e5f5cdd7d01ca86762cb3

Rename displaydev_test to api_test.

Move it into the new "demos" directory, and expand it to cope
with testing run_string too.

demos/c/ReadMe.txt
demos/c/api_test.c
demos/c/api_test.vcxproj
demos/c/api_test.vcxproj.filters
toolbin/displaydev_test.vcxproj.filters


2020-07-07 12:55:42 +0100
Robin Watts <Robin.Watts@artifex.com>
db8f3a277d0ae43cf5cffea16ee1c9149d4eb3de

Extend gpdl to cope with being fed PDFs via run_string.

More generally, we can now cope with any language implementation
requesting that data being fed in via run_string should be
buffered up and then fed in via run_file instead, so formats that
require seeking can cope.

We add a new gs_error_NeedFile error code. If a run_string
implementation returns this, the calling gpdl layers captures
the unused incoming data into an internal "buffered_file" object.

When we reach run_string_end, we then register a new filing
system with gs_add_fs() to allow this buffered file to be found.
We then run that file using the standard run_file mechanism.
Then we remove that filing system, and free the buffered file.

The only implementation that currently uses this is the
postscript one, which is amended to skip over leading whitespace
and comments, looking for a PDF header.

XPS already has a mechanism in it for collating data
into a file using run_string, but this was broken (due to
process_eof not being called). Fixed here, but still using its
own mechanism rather than gs_error_NeedFile for now.

base/gserrors.h
doc/GPDL.htm
gpdl/psitop.c
pcl/pl/plmain.c


2020-07-07 16:09:18 +0100
Robin Watts <Robin.Watts@artifex.com>
6eb675b18b8234256bb37190fd35243eab369e36

Tweak gsapi for gpdl to match gs.

The gpdl implementation of gsapi differed in the "run_string"
arguments from the original gs implementation. Add the extra
parameters here to make the two look identical.

doc/GPDL.htm
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/realmain.c


2020-07-07 14:56:23 +0100
Robin Watts <Robin.Watts@artifex.com>
24c9b3834b29e8a0eaa6dd78712ef1306049b479

Tweak gp_file veneers.

This allows for implementations to have more NULL function pointers,
and hence to be simpler.

base/gp.h


2020-07-06 11:04:52 -0700
Ray Johnston <ray.johnston@artifex.com>
0a9ec5e7fa81cf3f67f001bfcac2575611e49d85

Fix bug 702530: Spurious circular reference error message from PDF interpreter

The safe_recursive function comments described popping the copy of the dict
made for recursion (to allow multiple references at the same level), but the
code did not implement that.

Resource/Init/pdf_base.ps


2020-07-06 15:44:41 +0100
Chris Liddell <chris.liddell@artifex.com>
f2e2e3c1bb24887bce699821a3da1f8b3bbd12be

Remove the dmprt device

It has code which triggers security warnings, it has not built as it stands
since before 8.71 (so >10 years) and has significant (segfaulting) problems
when modified to successfully build.

Since it cannot have been used (and no one has complained) in over ten years,
we're removing it.

contrib/contrib.mak
contrib/japanese/dmp_init.ps
contrib/japanese/dmp_site.ps
contrib/japanese/doc/gdevdmpr.txt
contrib/japanese/dviprlib.c
contrib/japanese/escp_24.src
contrib/japanese/gdevdmpr.c


2020-07-03 13:52:02 +0100
Chris Liddell <chris.liddell@artifex.com>
61cbcfe94512ebd9316ff3c0d7ffaee06e226bc2

Add/fix documentation for .begintransparencymaskgroup/.endtransparencymask

doc/Language.htm


2020-07-06 12:13:09 +0100
Robin Watts <Robin.Watts@artifex.com>
0296da79f0f215322a1445c35f7343344806c08b

Fix spot color handling of display device.

The device icc_struct needs to be initialised before we try to
use it.

devices/devs.mak
devices/gdevdsp.c


2020-07-07 12:51:45 +0100
Robin Watts <Robin.Watts@artifex.com>
2398bdb09fa80498a57ab54815e85d326506b509

Fix silly typo in gs_remove_fs.

base/gslibctx.c


2020-07-07 12:51:01 +0100
Robin Watts <Robin.Watts@artifex.com>
dbe3a897df38c94c0c2af5b6ad5c4ee9a1c0ffe5

Add a 'const' to gp_file_alloc.

This enables it to be called in some circumstances where we only
have a const gs_memory_t.

base/gp.h
base/gpmisc.c


2020-07-06 12:35:01 +0100
Robin Watts <Robin.Watts@artifex.com>
87be031c6039d5f6d9bc960a9aefd442dded3e92

Fix Coverity 360266: Unchecked return value.

By the time we get here, we are guaranteed to be fatally failing.
Checking the return value can't alter what we are returning.

pcl/pl/plmain.c


2020-07-03 18:37:13 +0100
Robin Watts <Robin.Watts@artifex.com>
8549a5c5af77ee512dea0a43a82bf7612a861237

Fix stray change in doc/API.htm

doc/API.htm


2020-07-03 18:29:48 +0100
Robin Watts <Robin.Watts@artifex.com>
aafbb943f1298a75058485fc0c277edfd7ef4048

Fixes for displaydev_test.

In 64bit builds, we expect the display device to fail when asked
to align to a multiple of 4.

Also, correct detection of failures.

toolbin/displaydev_test.c


2020-07-03 17:14:52 +0100
Robin Watts <Robin.Watts@artifex.com>
5410cc1d64a2082dcd0e037d1ccefdbf68894198

Fix infinite recursion in display device.

If the device was a clist device, and was opened/closed repeatedly,
the wrong 'base' dev_spec_op could be stored.

devices/gdevdsp.c


2020-07-03 15:45:49 +0100
Robin Watts <Robin.Watts@artifex.com>
c2b0b6d61e62b9d490e9e3fcc24efb64c06f2a14

Fix gpdl run_string API to properly detect language.

pcl/pl/plmain.c


2020-07-03 12:06:17 +0100
Ken Sharp <ken.sharp@artifex.com>
a3cf573c2e72daf75c64d7b3a09e544f6e027244

pdfwrite - when copying clip path, cater for differing allocators

This is for pdfi when run under Ghostscript; the pdfwrite device keeps
a copy of the current clip path when it writes it to the output. But
the code (gx_cpath_to_path) relies on gx_path_asign_preserve and that
function specifically states that the allocators for the two paths
must be the same.

In the case of pdfi under GS, the path is created using the pdfi memory
allocator (its created by the pdfi interpreter), but the copied path
is allocated using the device allocator, which is derived from the
PostScript interpreter. The result of this is that pdfwrite can still
be pointing to a path which was allocated by pdfi and can disappear
when the pdfi interpreter exits, leaving a dangling pointer. Since the
path is subject to garbage collection (allocated with the PostScript
interpreter allocator) this causes a crash as soon as any kind of
grbage collection takes place.

Fortunately there's a simple function call 'gx_path_unshare' which will
copy the segments after assignment and we can check the allocators to
see if they are the same and us this function if they are not.

Fixes the remaining (currently) seg faults with pdf when running inside
Ghostscript.

devices/vector/gdevpdfd.c


2020-07-02 15:38:27 -0700
Michael Vrhel <michael.vrhel@artifex.com>
20757da77706d4227cd7268113bbffbe7716a6fc

Introduce demos folder with csharp and python API examples

Current csharp demo shows creation of wpf viewer. Goal will
be to next show a Linux viewer using mono and the same API file.
Python demo/API brought over from toolbin.

demos/csharp/api/ghostapi.cs
demos/csharp/api/ghostnet.cs
demos/csharp/windows/ghostnet.sln
demos/csharp/windows/ghostnet_wpf_example/About.xaml
demos/csharp/windows/ghostnet_wpf_example/About.xaml.cs
demos/csharp/windows/ghostnet_wpf_example/App.config
demos/csharp/windows/ghostnet_wpf_example/App.xaml
demos/csharp/windows/ghostnet_wpf_example/App.xaml.cs
demos/csharp/windows/ghostnet_wpf_example/DocPage.cs
demos/csharp/windows/ghostnet_wpf_example/MainPrint.cs
demos/csharp/windows/ghostnet_wpf_example/MainRender.cs
demos/csharp/windows/ghostnet_wpf_example/MainThumbRendering.cs
demos/csharp/windows/ghostnet_wpf_example/MainWindow.xaml
demos/csharp/windows/ghostnet_wpf_example/MainWindow.xaml.cs
demos/csharp/windows/ghostnet_wpf_example/MainZoom.cs
demos/csharp/windows/ghostnet_wpf_example/PrintControl.xaml
demos/csharp/windows/ghostnet_wpf_example/PrintControl.xaml.cs
demos/csharp/windows/ghostnet_wpf_example/Properties/AssemblyInfo.cs
demos/csharp/windows/ghostnet_wpf_example/Properties/Resources.Designer.cs
demos/csharp/windows/ghostnet_wpf_example/Properties/Resources.resx
demos/csharp/windows/ghostnet_wpf_example/Properties/Settings.Designer.cs
demos/csharp/windows/ghostnet_wpf_example/Properties/Settings.settings
demos/csharp/windows/ghostnet_wpf_example/TempFile.cs
demos/csharp/windows/ghostnet_wpf_example/XPSprint.cs
demos/csharp/windows/ghostnet_wpf_example/ghostnet_simple_viewer.csproj
demos/csharp/windows/ghostnet_wpf_example/gsIO.cs
demos/csharp/windows/ghostnet_wpf_example/gsOutput.xaml
demos/csharp/windows/ghostnet_wpf_example/gsOutput.xaml.cs
demos/python/gsapi.py
demos/python/gsapiwrap.py
demos/python/jlib.py


2020-07-02 15:02:48 -0700
Michael Vrhel <michael.vrhel@artifex.com>
ade938cc74549ffc8d58b0c1fd5e9be7f5429855

Add missing methods to API.htm

doc/API.htm


2020-07-02 12:21:33 -0700
Michael Vrhel <michael.vrhel@artifex.com>
62d83a31f7f20910eeb5938873c62e890c9d2b3a

Make -dSimulateOverprint=false work with transparency

When the source file has transparency and overprint, avoid doing
the compatible overprint mode if overprint is specified to
be disabled. Thanks to Ray Johnston for helping with the PS
in pdf_main.ps

Resource/Init/pdf_main.ps
base/gdevp14.c


2020-06-25 10:52:19 -0700
Nancy Durgin <nancy.durgin@artifex.com>
00e7143ce97a3d983a223c7d69f74f995d8e267d

Pass memory to clist_make_accum_device()

Change function args to propagate the memory type of the graphics
state to clist_make_accum_device to create device with it.

Also, make sure the dev->bandlist_memory (used for freeing 'data') is
allocated in the mem->non_gc_memory instead of the parent device's
(fixes crash in gpdl/pcl that was introduced).

That will mean pdfi and gs/pdfi get non-gc, and gs gets gc.

There was a bug in gs/pdfi where the clist-pattern device was in gc
memory and it was getting freed when pdfi was still using it.

This should fix a segfault in: tests_private/comparefiles/Bug688396.pdf

base/gxclist.c
base/gxclist.h
base/gxpcmap.c


2020-07-01 17:16:41 +0100
Julian Smith <jules@op59.net>
60d740278fc7f7b719482ae0dd4a59743025444d

toolbin/gsapi.py: fixed stray ';' character.

toolbin/gsapi.py


2020-07-01 14:00:17 +0100
Julian Smith <jules@op59.net>
07047636c74555d22c87fd7f05535b57e681a35d

toolbin/gsapi.py: added example of how to build .so and run.

toolbin/gsapi.py


2020-07-01 13:59:56 +0100
Julian Smith <jules@op59.net>
9900ecb043f3c138160f7d78d32af9967ea09b64

devices/vector/gdevtxtw.c: fixed build if TRACE_TXTWRITE defined.

devices/vector/gdevtxtw.c


2020-06-30 15:38:24 +0100
Chris Liddell <chris.liddell@artifex.com>
f3c50e50d6ffd9b4fd98f0215e78d7659bf0bdc3

Whitespace fixes

doc/API.htm
psi/dw32c.def
psi/dw64c.def
psi/dwmain32.def
psi/dwmain64.def
psi/dwsetup.def
psi/dwuninst.def
psi/gsdll32.def
psi/gsdll32metro.def
psi/gsdll64.def
psi/gsdll64metro.def
psi/gsdllARM32metro.def
psi/gsos2.def
toolbin/gsapi.py


2020-06-30 13:58:11 +0100
Chris Liddell <chris.liddell@artifex.com>
a1cf59357b6945fdac87afa76e2afd56bb3c1206

Slight tweak to the FAPI API

The previous Font API update had a slight mistake: for non-CID fonts, we'd pass
GS_NO_GLYPH in place of the actually CID/GID into the "fapi_set_cache" call
back.

That worked fine because, for Postscript (and currrent PDF) non-CID fonts use
the glyph name, not a character code, and the other interpreters do not
need a character for that callback.

We'll now pass the glyph index for non-CID fonts, and the
glyph index + GS_MIN_CID_GLYPH (as is conventional for gs) - and that allows
the fapi_set_cache call back to differentiate between CID and non-CID fonts.

For the new PDF interpreter (pdfi) we actually do need the character code, to
correctly handle Truetype fonts. So fixing the graphics lib and associated code
on master, so the pdfi branch can also work.

base/gxfapi.c
psi/zfapi.c


2020-06-30 09:27:41 +0100
Ken Sharp <ken.sharp@artifex.com>
71d0b343a3f20d298b9abbe6261bcb01ecb48dcb

Improve eps2write

Bug #702521 "eps2write hygiene enhancements"

If processing a multi-page input file, throw an error on the second
page and write a message explaining the problem.

Encapsulate the 'global configuration' switches which affect the prolog
processing, and are written from the ps2write device, in a dictionary
because EPS files should not affect the current dictionary. Read those
parameters back from the dictionary when establishing the EPS file's
own dictionary, ensuring that a dictionary is actually present.

Use the global configuration to determine whether to install a custom
error handler. If its an EPS file, then don't.

devices/vector/gdevpdf.c
devices/vector/gdevpdfu.c
devices/vector/opdfread.ps


2020-06-29 12:04:05 -0700
Michael Vrhel <michael.vrhel@artifex.com>
d286e365c298b30fc8f0d74979779c18cf4d28f5

A few more changes to the API.htm docs.

doc/API.htm


2020-06-29 10:51:57 -0700
Michael Vrhel <michael.vrhel@artifex.com>
50a60d8421f3e64828790ec4588727fdc41c4d58

Fix minor issues in API.htm

doc/API.htm


2020-06-29 13:15:35 +0100
Chris Liddell <chris.liddell@artifex.com>
95e5e879c3a3fea42a97e942b53a6914ed7ccfc2

int_gstate_alloc() error handling

If we fail to allocate even the graphics libaray graphics state, bail out
immediately.

psi/zgstate.c


2020-06-23 09:22:03 +0100
Chris Liddell <chris.liddell@artifex.com>
ea7818b8bb62b1df4f81e4dc752ccda54cc3d59c

UMR fix: parameters for overprint compositor

Discovered while investigating (red herring) indeterminacy problems with
eci_altona-test-suite-v2_technical2_x4.pdf

Reported by both valgrind and MSAN.

base/gsptype1.c


2020-06-26 20:05:36 +0100
Robin Watts <Robin.Watts@artifex.com>
71962c6ed1e0bdf41e604a8014b93889f9d07ee5

Squash warnings seen in Windows 64 bit build.

base/gp_msprn.c
base/gp_mswin.c
base/gp_winfs.c
base/gsalloc.c
base/gsmemory.c
base/gxclist.c
base/gxi12bit.c
base/gxicolor.c
devices/gdevcdj.c
devices/gdevupd.c
devices/vector/gdevpdtb.c
ijs/ijs_exec_win.c
psi/idict.c
psi/inamedef.h


2020-06-26 19:11:06 +0100
Robin Watts <Robin.Watts@artifex.com>
b68604731130f5493d2ecd5ae627b1bae9624c64

Update Makefile for new version of tesseract.

base/tesseract.mak


2020-06-26 19:08:39 +0100
Robin Watts <Robin.Watts@artifex.com>
ad2418e6dc8afa7c7278d6687c77791026f98228

Fix callouts being allocated/deallocated with the wrong gs_memory_t.

This didn't matter for gs, but for gpdl, it could cause problems
on shutdown.

base/gslibctx.c


2020-06-02 16:29:32 -0700
Michael Vrhel <michael.vrhel@artifex.com>
135f2ceaa84fb0a058ba781a451c65b95230e49a

Have bmpcmp return EXIT_FAILURE if it can not compare

toolbin/bmpcmp.c


2020-06-26 16:15:43 +0100
Robin Watts <Robin.Watts@artifex.com>
c022554c30f680c464f1026dc96c2450867da73c

Remove displaydev_test project from GhostPDL.sln.

It should never have been added in git. I added it locally and
then it slipped through and got committed by accidently.

windows/GhostPDL.sln


2020-06-26 16:12:33 +0100
Robin Watts <Robin.Watts@artifex.com>
622f4ea8ecc9b677165121d0c093632b9ea00c67

Don't let psapi_new_instance trample libctx->stdio functions.

For GS builds this doesn't matter, as psapi_new_instance is called
before users of the API get to set their own versions. With GPDL
builds, the call to psapi_new_instance is deferred to the point
where the API user may have already set their own functions.

psi/psapi.c


2020-06-26 16:10:42 +0100
Robin Watts <Robin.Watts@artifex.com>
4f886898e23483e82866148d6b564faf281490ba

Avoid using bool in gslibctx.h.

Ghostscript relies on bool being 'int'. Unfortunately, this header
is included from various C++ files that use bool as char. Accordingly
the easiest fix is to avoid using bool in these structure definitions.

base/gslibctx.h


2020-06-25 12:29:01 -0700
Nancy Durgin <nancy.durgin@artifex.com>
969370ba1dbcf767bae97fda6a3c066b04439c76

Fix refcnt's on the colorspace in clist

In the case where the colorspace was modified (read_set_color_space)
there was a memory leak.

This was because the old code just freed pcs, but if the color had
changed, then gs_state.color[0].color_space and [1].color_space are no
longer the same. This way we track the references to them separately
and free them separately.

pcs doesn't get its own ref, because it is always the same as
gs_gstate.color[0].color_space.

This fixes memory leaks that only show up in the case that the memory
is not garbage-collected, such as in pdfi.

base/gxclrast.c


2020-06-25 19:15:28 +0100
Robin Watts <Robin.Watts@artifex.com>
305b9fa7334fc0cd1f45585b8449b0c2c7517559

Fix leak of non-deregistered callback handlers on shutdown.

base/gslibctx.c


2020-06-25 17:08:23 +0100
Robin Watts <Robin.Watts@artifex.com>
59bd5d853cec55497486ad4fb2f253a92e4da3cc

Fix typos in GPDL.htm.

doc/GPDL.htm


2020-06-25 16:39:01 +0100
Robin Watts <Robin.Watts@artifex.com>
1615ace33ebb93d8c5faae8a440ab96f06f5f0fe

Add documentation for GPDL.

doc/GPDL.htm


2020-06-25 15:13:47 +0100
Robin Watts <Robin.Watts@artifex.com>
35f6a9d9e2838069b5ba250cf26d016bc5ad3635

GPDL whitespace fixes.

pcl/pl/pjparsei.c
pcl/pxl/pxtop.c
xps/xpstop.c


2020-06-25 15:12:40 +0100
Robin Watts <Robin.Watts@artifex.com>
a9bd94535682bd75bbaa18da42129e49046f3838

Remove unused remnants from gpdl/pngtop.c

gpdl/pngtop.c


2020-06-25 15:12:26 +0100
Robin Watts <Robin.Watts@artifex.com>
f5b28fa033b4837f3cc28943f5c022bf48ca39d4

GPDL: Remove "min_input_size" from pl_interp_characteristics_t

Never used.

gpdl/jbig2top.c
gpdl/jp2ktop.c
gpdl/jpgtop.c
gpdl/pngtop.c
gpdl/psitop.c
gpdl/pwgtop.c
gpdl/tifftop.c
pcl/pcl/pctop.c
pcl/pl/pjparsei.c
pcl/pl/pltop.h
pcl/pxl/pxtop.c
xps/xpstop.c


2020-06-23 10:56:22 +0100
Robin Watts <Robin.Watts@artifex.com>
ae5bcb6df4b9aa4337a93d5ce8c8152ea4494941

Simple test app for driving the display device.

toolbin/displaydev_test.c
toolbin/displaydev_test.vcxproj
toolbin/displaydev_test.vcxproj.filters
windows/GhostPDL.sln


2020-06-16 14:31:40 +0100
Robin Watts <Robin.Watts@artifex.com>
eed3bad23510e59278bdaa5f7d0ab01fc1a1c21b

Display device revamp.

Move display device over to being based upon a "clist_mutatable"
device. Existing claimants won't see any difference.

New claimants can provide additional callbacks so they can drive
it in 'rectangle request' mode.

devices/gdevdsp.c
devices/gdevdsp.h
devices/gdevdsp2.h
doc/API.htm


2020-06-12 13:00:01 +0100
Robin Watts <Robin.Watts@artifex.com>
04e937862eaa7e66bb9a87109874112cd354bf6f

Remove clist "is_printer" field.

Currently, the clist has an "is_printer" field, which is used to
tell it how to forward dev_spec_op calls. This seems evil to me;
a base class should not really need to know what class is being
derived from it to know how to behave.

Instead, introduce a function pointer that says where
dev_spec_ops should be forwarded to.

base/gdevprn.c
base/gxclist.c
base/gxclist.h
base/gxclrect.c


2020-06-11 12:47:58 +0100
Robin Watts <Robin.Watts@artifex.com>
f697ed393a3f0cfffbf82b1f679cf6667b06611c

Refactor 'clist mutatable devices' from prn ones.

Devices that have to mutate to be clist ones need to be setup
in a particular way. After the standard gx_device header, they
are padded out to a large enough size that the clist header
fields can fit in. Then the device specific fields follow.

gdev_prn devices are the standard example of this. In order
to more easily allow other devices to work in the same way,
we refactor the padding/clist specific fields out into new
macros.

base/gdevprn.c
base/gdevprn.h
base/gxclist.c
base/gxclist.h
devices/gdevbit.c


2020-06-11 12:04:03 +0100
Robin Watts <Robin.Watts@artifex.com>
aae141b7849700a3b99a9222e09ed6ebaff5c61b

Refactor gdev_space_params slightly.

The gdev_space_params structure is also known as gdev_prn_space_params,
which is slightly misleading as there is nothing prn specific about
it.

Rename all uses of gdev_prn_space_params within the code to be
gdev_space_params. Leave gdev_prn_space_params defined as a typedef
so that any customer code will not be affected.

Rename compare_gdev_prn_space_params to be gdev_space_params_cmp
to better reflect its non-prn-specific nature. Make it non-static
and move it to gsdevice.c.

base/gdevprn.c
base/gdevprn.h
base/gsdevice.c
base/gxdevcli.h
cups/gdevcups.c
devices/gdevcdj.c
devices/gdevijs.c


2020-06-22 10:06:58 +0100
Robin Watts <Robin.Watts@artifex.com>
8f40f4b1aca7a7f75ecf83469892478311ca21e1

Update Planar device to allow for easy "interleaved" operation.

base/gdevmem.c
base/gdevmpla.c
base/gdevmpla.h
base/gxdevmem.h


2020-06-19 19:04:53 +0100
Robin Watts <Robin.Watts@artifex.com>
22f5f898d49443df82c13bd683fbff61005485c2

Improve get_bits_rectangle for planar case.

The implementation of get_bits_rectangle to read planar data from
a planar device, only implements GB_RETURN_POINTER. If this isn't
in the request (i.e. the caller uses GB_RETURN_COPY to get a copy
of the data in its own buffers), then it cannot cope.

Here we extend the routine to try to use a GB_RETURN_POINTER
request internally, and to copy the returned data into the
callers buffers.

Callers are of course already free to do this operation themselves,
but this avoids the needless repetition of the code in every
caller.

base/gdevmpla.c


2020-06-04 19:27:15 +0100
Robin Watts <Robin.Watts@artifex.com>
4438e3e5bc4dfc9e46fc86d86d912171ec582a4e

Rework display device "DisplayHandle" passing.

Add gsapi_{,de}register_callout API. This allows integrators
to register handlers for "callouts" from gs devices.

The first example of such a callout is the display device.
Previously, this has relied on the gsapi_set_display_callback
API to pass a pointer to a structure into the core, from where
it was hackily poked into the display device structure.

Instead, we now have the display device "callout" to registered
handlers to get the structure and the handle to use.

The legacy API is maintained by the API level implementing
a handler to return the display callback in response to the
devices callout.

The code to do the 'poking' of the display device has therefore
been removed, and replaced by code that checks to see if an
opened device needs reopening after init, if so, opens/closes it.

base/gsdevice.c
base/gslibctx.c
base/gslibctx.h
base/gxdevcli.h
base/gxdevsop.h
devices/gdevdsp.c
devices/gdevdsp.h
devices/gdevdsp2.h
doc/API.htm
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plmain.c
psi/gsdll2.def
psi/gsdll32.def
psi/gsdll32metro.def
psi/gsdll64.def
psi/gsdll64metro.def
psi/gsdllARM32metro.def
psi/iapi.c
psi/iapi.h
psi/idisp.c
psi/idisp.h
psi/imain.c
psi/int.mak


2020-06-22 17:04:02 +0100
Robin Watts <Robin.Watts@artifex.com>
7e427246abb151cde9154783775acfaa776b502e

Simple Spot color test file.

examples/spots.ps


2020-06-19 15:05:34 +0100
Robin Watts <Robin.Watts@artifex.com>
63d4ce589086609178160857452dbe3ca6ec0361

Tweak mem device; use NULL rather than 0.

base/gdevmem.c


2020-06-20 19:08:20 -0700
Ray Johnston <ray.johnston@artifex.com>
5123260e329a44db83edf4b1378cb7101632f7eb

Fix Bug 701852. Problems with the plane_extract device.

First, the plane_begin_typed_image function used the gs_gstate_copy_temp,
but since this was allocated as a st_gs_gstate, and the reference counts
were not handled (as the comment describes), freeing that object would
decrement the ref_counts, causing premature free of objects.

Remove this dangerous function.

Change to use gs_gstate_copy so we have a proper gs_gstate structure.

Using gs_gstate_copy from a clist playback gstate requires that we have
client colors and device colors in the color[0] and color[1] elements.
Allocate, and initialize these, then free upon exit from clist_playback.

Also, the mem device underlying the plane_extract device needs to be
retained so that it is not prematurely freed.

base/gdevplnx.c
base/gsgstate.c
base/gxclrast.c
base/gxgstate.h
base/lib.mak


2020-06-24 15:57:18 +0100
Robin Watts <Robin.Watts@artifex.com>
2d69b876807bb66889e7d89ad39649aded72901e

Tweak gpdl parameter handling.

Reorder some bits (to make checking against gs easier).

Add handling for --help (same as -h).

Add handling for -v. List languages supported in version
and usage output.

Add handling for -q. Rely on the fact that -q is the same as -dQUIET.

pcl/pl/plmain.c


2020-06-24 13:45:30 +0100
Robin Watts <Robin.Watts@artifex.com>
8433ecd5c9bee10a767293c886644fc91f6d7d4d

Fix gs command line parsing to handle --unknown

Previously "--unknown" would have been treated like "--".

psi/imainarg.c


2020-06-23 16:34:14 +0100
Chris Liddell <chris.liddell@artifex.com>
a50c9e8d1819c5273a5f6d46137dc527382fabb1

Typo: ps2weite -> ps2write

doc/VectorDevices.htm


2020-06-23 01:36:02 +0800
Sebastian Rasmussen <sebras@gmail.com>
ea495beece2c461d6561e3d5780d40e77603abc9

jbig2dec: Free result object upon error allocating referred to segments.

jbig2dec/jbig2_segment.c


2020-06-23 01:27:25 +0800
Sebastian Rasmussen <sebras@gmail.com>
e0c1b3c8162898eaa46640cae98be34642704e3c

jbig2dec: Fix memory leak caused by failing to allocate arithmetic coding context.

jbig2dec/jbig2_text.c


2020-06-18 22:02:27 -0700
Ray Johnston <ray.johnston@artifex.com>
554b67a6f3ba5e6c78b35f94ab3f57e96b1a3dee

Bug 702505. Annotations with BlendMode (/BM) failed as PDF is opened.

The check for transparency in the page would fail with 'typecheck' because
the operand stack was not properly cleaned once the /BM was detected.

Resource/Init/pdf_main.ps


2020-06-19 07:55:05 +0100
Chris Liddell <chris.liddell@artifex.com>
c287d823671769a45c3b0c4a7f16a10fc5e7cb5a

Coverity 359871, 359872: un-init variable and conditional always true

A return code could remain unset in an otherwise successful completion of the
function.

The new FAPI interface switch from using a signed value of -1 to the "standard"
special value of GS_NO_CHAR, and I missed a case of that - since GS_NO_CHAR is
positive, the existing test of >= 0 was flagged as always true.

psi/zfapi.c


2020-06-18 19:34:33 +0100
Chris Liddell <chris.liddell@artifex.com>
57885b1ab496d12d4b6e7ee6a98144e5b040afa1

Allow the First/LastPage device page count to be reset

If we get a DisablePageHandler parameter setting to "false" (i.e. enabling the
filtering) then start counting pages from there.

This allows more intuitive control over extracting specific pages from multiple
input files.

base/gdevflp.c


2020-06-18 19:26:57 +0100
Chris Liddell <chris.liddell@artifex.com>
99d5046ebd2998eb550a66677142186b00071b73

Improve PageList device param handling

The error handing when reading the PageList parameter did not match the rest of
the code in gx_default_put_params() - record the error, but carry on.

Secondly, the original implementation never accounted for the possibility of
"unsetting" the PageList. This is possible by sending an empty string.

base/gsdparam.c


2020-06-16 19:01:25 +0100
Julian Smith <jules@op59.net>
e21dc926e2a2214ab8ae830b984057994d139a1c

toolbin/gsapi.py: python version of psi/iapi.h, using ctypes.

toolbin/gsapi.py


2020-05-25 12:50:32 +0100
Julian Smith <jules@op59.net>
74d47eada1e07862c3af7bbb214edd6cf94e0164

In clusterpush, exclude sodebugobj and /build.

toolbin/localcluster/clusterpush.pl


2020-05-15 11:41:30 +0100
Julian Smith <jules@op59.net>
e29a4c0affe3e7b66ff19d70e0d2abbc1e7fdf21

Added experimental swig wrapper for gsapi.

toolbin/gsapiwrap.py
toolbin/jlib.py


2020-05-21 18:16:28 +0100
Julian Smith <jules@op59.net>
31157290172feea1817d6e69c5064d025a9ab45c

Changed gsapi_set_default_device_list() to take const char* arg, not char*.

This allows SWIG to work, and also tightens up the API.

pcl/pl/plapi.c
pcl/pl/plapi.h
psi/iapi.c
psi/iapi.h


2020-05-21 14:48:12 +0100
Julian Smith <jules@op59.net>
9b953e588fb74a73b997d11412a2878f4cdfcdfb

Improve test for error in s_stdout_write_process().

Detect error case where outwrite() incorrectly returns > count, so we can avoid
incrementing pr->ptr beyond bounds of array.

psi/ziodevsc.c


2020-06-09 19:17:55 +0100
Julian Smith <jules@op59.net>
fcd9967f93151c49cefe437f6f0bdb1f047d68cc

Avoid leak in pcl_process() by calling pcl_complete_raster() if returning error.

Fixes:

MEMENTO_FAILAT=18536 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ../tests_private/pcl/pcl5cfts/fts.2180

pcl/pcl/pcparse.c

pcl/pcl/pcparse.c


2020-06-04 16:14:20 +0100
Chris Liddell <chris.liddell@artifex.com>
0a4f6d6cb3efda8f0b334c0b04457362b00dac1b

Revisions to FAPI (error handling etc).

A lot of the FAPI methods made no account for errors (i.e. a call to return an
unsigned 16 bit value would return an unsigned short int). In various places
that meant we ended up using unlikely (in practice, impossible, yet still
"valid") values to indicate an error condition.

This commit changes those calls to have a conventional Ghostscript "int"
return value and (mostly) take pointer to the storage into which they should
write their value. We can now return meaninful error codes.

Secondly, in several places, the FAPI methods and code used integers to store
character codes, cids, gids etc. This is less than ideal because we potentially
have to handle 4 byte codes (especially for gids), and we also use some
special 64 bit values (when available) for specific meanings. There were
several workarounds for that, in various places.

This commit also changes the FAPI API and code to the gs_glyph type for all
such values, removing the need for those workarounds

base/fapi_ft.c
base/fapibstm.c
base/fapiufst.c
base/gxfapi.c
base/gxfapi.h
base/write_t1.c
base/write_t2.c
pcl/pl/plfapi.c
psi/zfapi.c
xps/xpsfapi.c


2020-05-28 11:04:24 +0100
Chris Liddell <chris.liddell@artifex.com>
8384e88e02cefa3de112546838a752d7f0a7a5c1

Make gs_char and gs_glyph explicitly 64 bit types

base/gsccode.h
base/lib.mak


2020-06-16 16:50:38 +0100
Chris Liddell <chris.liddell@artifex.com>
0339cbecea80d8a835b316b56d1c75a6fb850e52

oss-fuzz 23440: check string lengths for PDF decryption

to avoid Use-of-uninitialized-value problems.

psi/zpdf_r6.c


2020-06-11 11:54:32 +0100
Chris Liddell <chris.liddell@artifex.com>
889df15d7c69e1fc90c6491f574352cacf9bc065

oss-fuzz 22182: validate glyph offset/length values

Check if the glyph offset and offset + length are larger than the size of the
font stream before we can use it.

psi/zfapi.c


2020-06-11 11:53:13 +0100
Chris Liddell <chris.liddell@artifex.com>
e61000344e40930aa229be5aa5cb9d31958bcb6d

Truetype: Tweak a conditional for signed/unsigned compare

base/gstype42.c


2020-06-16 14:14:33 +0100
Chris Liddell <chris.liddell@artifex.com>
0e50ac9dfcff795ec69cb646eea151bd57f0dd1c

Fix letter `te` in in Nimbus Sans Bold(Italic)

Update from URW++ (2020/05/26).

See:
https://github.com/ArtifexSoftware/urw-base35-fonts/issues/28
https://bugs.launchpad.net/ubuntu/+source/fonts-urw-base35/+bug/1871377

The glyph outline was much too wide, as well as the advance width being too
large.

Note: a number of test files show tiny rounding differences - this is normal
when these fonts get regenerated.

Resource/Font/NimbusSans-BoldItalic
Resource/Font/NimbusSans-Italic


2020-06-15 18:37:57 +0200
Till Kamppeter <till.kamppeter@gmail.com>
a189c020b1eb34a043c086b89bbb1caa86cc01f5

When building on arm64 with gcc, disable libpng's neon optimizations.

Bug 702486 - Ghostscript 9.52 does not build on arm64

Ghostscript 9.52 with the libraries which it is including builds
perfectly on i386, amd64, s390x, and armhf, but not on ppc64el
and arm64. Problem are internal optimizations in the libpng
shipped with Ghostscript.

For ppc64el the problem was already solved after the 9.52
release:

http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=1c9bd8e0aa4
https://bugs.ghostscript.com/show_bug.cgi?id=702236

This fix is for arm64 is Based on this and on a similar fix for
arm64 on another free software project

https://github.com/imagemin/optipng-bin/issues/97

This makes it also build on arm64, but it is not tested whether
it still correctly works on arm64 after the fix.

configure.ac


2020-06-13 12:11:23 +0100
Ken Sharp <ken.sharp@artifex.com>
9984b482e5c41427f69be32752b649d44eccd3cd

More work on gs_get_colorname_string

Commit 14c70d4e9 was, unfortunately, insufficient for the new PDF
interpreter. The gs_lib_ctx pointer does not give us access back to the
interpreter context, only to the *PostScript* interpreter name table.

So instead we now pass a graphics state pointer to
gs_get_colorname_string(). This is only used for halftones currently,
and even future use seems likely to be limited to objects like colour
spaces, which are of course contained in a graphics state, so this
seems relatviely future proof.

For PostScript the graphics state contains a memory_t pointer which we
can use to get to the PostScript name table. For the PDF interpreter
we already store some state in the 'client_data' of the graphics state
and we will extend that to include a pointer to the interpreter context
which will allow us to get the string from its name table.

base/gscspace.h
base/gsncdummy.c
base/gxht.h
devices/vector/gdevpdfg.c
psi/zht2.c
psi/zht2.h


2020-06-12 10:37:00 +0100
Ken Sharp <ken.sharp@artifex.com>
14c70d4e91db4b13273a48004fada094e8f8090d

Improve usage of 'get_colorname_string'

This function is supplied to a couple of places, and stored. Its
purpose is to retrieve a string for a colour plane, given an 'index'.
The index is an entry in the interpreter's name table.

The implementations of get_colorname_string take a memory_t pointer
and then use that to get a pointer to the interpreter, which they need
because the interpreter context is where the name table is stored.

The problem with the existing usage is that we were supplying the
device's memory_t pointer. However, if the halftone or colour space had
been created by a different interpreter to the device (which can happen
if we are running the PDF interpreter inside the PostScript interpreter)
then the interpreter context would be incorrect.

We can solve this easily enough by using the colour space or halftone
memory pointer. This is much safer since we can reasonably assume that
the interpreter which created the object is the same one which stored
the colour name in its name table.

base/gsncdummy.c
devices/vector/gdevpdfg.c


2020-06-10 10:38:18 +0100
Chris Liddell <chris.liddell@artifex.com>
825d6807a72b68a2faf11fc37f89b1b75967d727

Bug 702476: Don't rely on null terminated strings

gs strings are not necessarily null terminted (especially so when created by the
Postscript interpreter). So, when parsing a file name and deciding whether it's
a "device" (e.g. "%ram%") or a device + file name/path, don't rely on the string
being null terminate.

base/gsfname.c


2020-06-08 09:25:57 +0100
Chris Liddell <chris.liddell@artifex.com>
0ae681ab1fd3475995418d00da1ccfe374f069cc

oss-fuzz 22752: handle broken loca table.

Previously, the code did not differentiate between an empty loca table, a
missing loca table and a broken loca table.

We'll now do so and, in particular, with a broken loca table (in this case,
one with only 1 entry) we'll initialize the single entry to avoid later code
accessing unitialized memory.

base/gstype42.c
base/gxfont42.h
psi/zfapi.c


2020-06-08 14:49:04 +0100
Chris Liddell <chris.liddell@artifex.com>
9e85e7a9518aa19964f1f8d30d3175ef8c3b950f

oss-fuzz 21643: Bounds check a pointer before accessing it.

In this case, immediately after a buffer refill, (as is "normal" for gs stream
buffers) the pointers starts one byte *before* the actual buffer, the state on
reentry meant we'd drop straight to trying dereference the pointer.

This just ensures the pointer gets moved on before we try to use it.

base/seexec.c


2020-06-10 10:16:10 +0100
Ken Sharp <ken.sharp@artifex.com>
a4edd8320a5076bb52d1be7c061910b3b78718e0

pdfwrite - don't error out on skipped images

Bug #702471 "eps to pdf OK in 9.50, but failed in 9.51 and 9.52"

Some encode filters, in this case DCTEncode, can throw an error on exit
(premature EOD) if we never write any data to them. This can happen
when pdfwrite sets up to write an image to the output file, but we
never actually write the image, because it is being 'skipped'.

Images can be skipped because they are fully clipped out, unfortunately
we can't detect this before we execute begin_typed_image or we could
avoid a lot of setup.

Anyway, when we get to end_image, if we skipped the image then don't
take any notice of errors when closing the filters used to write the
image data to the PDF file.

devices/vector/gdevpdfi.c


2020-06-09 15:14:02 +0100
Robin Watts <Robin.Watts@artifex.com>
d68f56e25110ba3baf03553c2d1839febc02dbdb

Add docs for missing parts of gsapi.

Add docs for gsapi_set_param (and update the code to cope with
long/int64_t/size_t's in line with the core code).

Add docs for path control functions.

doc/API.htm
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/pltop.h
psi/iapi.h
psi/psapi.c
psi/psapi.h


2020-06-08 20:36:34 +0100
Robin Watts <Robin.Watts@artifex.com>
b9a4616cdf710c79f575adb33b331cb495461d93

Add documentation for gsapi_set_{stdio,poll}_with_handle.

Missed from earlier commit.

doc/API.htm


2020-06-07 09:45:57 -0700
ray <Ray.Johnston@artifex.com>
748edd2fd75c684d63486eded71ad20254de6f4c

Fix Bug 702383 - Segfault due to mis-use of PostScript transparency.

The fix for Bug 698306 fixed that case, but this case showed that the double
calls to .pushpdf14devicefilter still could cause problems. Another patch
already resolved calling transparency operations WITHOUT pushing the pdf14
device (for Bug 702327).

Also undefine the PostScript transparency operators to (maybe) prevent
misuse if -dALLOWPSTRANSPARENCY is not specified.

Resource/Init/pdf_main.ps
psi/ztrans.c


2020-06-05 14:51:00 +0100
Chris Liddell <chris.liddell@artifex.com>
560ff82b0bc782465aa4591b2953954d7cf5608c

Fix a bounds check in FAPI

Using less than or equal to should have been less than.

Found while investigating an oss-fuzz issue.

psi/zfapi.c


2020-06-04 16:57:01 +0100
Robin Watts <Robin.Watts@artifex.com>
7502a26f082e71e05df33dcd1dff66655f088673

Add documentation for OCR devices.

doc/Devices.htm


2020-05-25 13:32:26 +0100
Robin Watts <Robin.Watts@artifex.com>
eb492c353084600d94877f7157840d24dd7f9301

Update lcms2mt to lcms2-2.10rc2.

lcms2mt/AUTHORS
lcms2mt/COPYING
lcms2mt/ChangeLog
lcms2mt/Lib/MS/lcms2_fast_float_plugin.lib
lcms2mt/Lib/MS/lcms2_static.lib
lcms2mt/Lib/MS/lcms2mt_fast_float_plugin.lib
lcms2mt/Lib/MS/lcms2mt_static.lib
lcms2mt/Makefile.am
lcms2mt/Makefile.in
lcms2mt/Projects/BorlandC_5.5/lcms2mt.rc
lcms2mt/Projects/BorlandC_5.5/lcmsdll.lk
lcms2mt/Projects/VC2013/lcms2mt.rc
lcms2mt/Projects/VC2013/lcms2mt.sln
lcms2mt/Projects/VC2013/lcms2mt_DLL/lcms2mt_DLL.vcxproj
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/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/VC2019/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2019/jpegicc/jpegicc.vcxproj.filters
lcms2mt/Projects/VC2019/lcms2mt.rc
lcms2mt/Projects/VC2019/lcms2mt.sln
lcms2mt/Projects/VC2019/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2019/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters
lcms2mt/Projects/VC2019/lcms2mt_static/lcms2mt_static.vcxproj
lcms2mt/Projects/VC2019/lcms2mt_static/lcms2mt_static.vcxproj.filters
lcms2mt/Projects/VC2019/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2019/linkicc/linkicc.vcxproj.filters
lcms2mt/Projects/VC2019/psicc/psicc.vcxproj
lcms2mt/Projects/VC2019/psicc/psicc.vcxproj.filters
lcms2mt/Projects/VC2019/resource.h
lcms2mt/Projects/VC2019/testbed/testbed.vcxproj
lcms2mt/Projects/VC2019/testbed/testbed.vcxproj.filters
lcms2mt/Projects/VC2019/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2019/tiffdiff/tiffdiff.vcxproj.filters
lcms2mt/Projects/VC2019/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2019/tifficc/tifficc.vcxproj.filters
lcms2mt/Projects/VC2019/transicc/transicc.vcxproj
lcms2mt/Projects/VC2019/transicc/transicc.vcxproj.filters
lcms2mt/Projects/cppcheck/lcms2mt.cppcheck
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.pbxproj
lcms2mt/README.1ST
lcms2mt/aclocal.m4
lcms2mt/config.guess
lcms2mt/configure
lcms2mt/configure.ac
lcms2mt/doc/LittleCMS2.10 API.pdf
lcms2mt/doc/LittleCMS2.10 Plugin API.pdf
lcms2mt/doc/LittleCMS2.10 tutorial.pdf
lcms2mt/doc/LittleCMS2.9 API.pdf
lcms2mt/doc/LittleCMS2.9 Plugin API.pdf
lcms2mt/doc/LittleCMS2.9 tutorial.pdf
lcms2mt/doc/WhyThisFork.txt
lcms2mt/include/Makefile.in
lcms2mt/include/lcms2mt.h
lcms2mt/include/lcms2mt_plugin.h
lcms2mt/plugins/README.1ST
lcms2mt/plugins/fast_float/COPYING.GPL3
lcms2mt/plugins/fast_float/Makefile
lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin.vcxproj
lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin.vcxproj.filters
lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin.vcxproj.user
lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin_testbed.vcxproj
lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin_testbed.vcxproj.filters
lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin_testbed.vcxproj.user
lcms2mt/plugins/fast_float/doc/LittleCMS fast float extensions 1.0.pdf
lcms2mt/plugins/fast_float/include/Makefile.am
lcms2mt/plugins/fast_float/include/lcms2mt_fast_float.h
lcms2mt/plugins/fast_float/src/Makefile.am
lcms2mt/plugins/fast_float/src/fast_16_tethra.c
lcms2mt/plugins/fast_float/src/fast_8_curves.c
lcms2mt/plugins/fast_float/src/fast_8_matsh.c
lcms2mt/plugins/fast_float/src/fast_8_tethra.c
lcms2mt/plugins/fast_float/src/fast_float_15bits.c
lcms2mt/plugins/fast_float/src/fast_float_15mats.c
lcms2mt/plugins/fast_float/src/fast_float_cmyk.c
lcms2mt/plugins/fast_float/src/fast_float_curves.c
lcms2mt/plugins/fast_float/src/fast_float_internal.h
lcms2mt/plugins/fast_float/src/fast_float_matsh.c
lcms2mt/plugins/fast_float/src/fast_float_separate.c
lcms2mt/plugins/fast_float/src/fast_float_sup.c
lcms2mt/plugins/fast_float/src/fast_float_tethra.c
lcms2mt/plugins/fast_float/testbed/Makefile.am
lcms2mt/plugins/fast_float/testbed/fast_float_testbed.c
lcms2mt/plugins/fast_float/testbed/test0.icc
lcms2mt/plugins/fast_float/testbed/test1.icc
lcms2mt/plugins/fast_float/testbed/test2.icc
lcms2mt/plugins/fast_float/testbed/test3.icc
lcms2mt/plugins/fast_float/testbed/test5.icc
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/lcms2_internal.h
lcms2mt/src/lcms2mt.def
lcms2mt/testbed/Makefile.am
lcms2mt/testbed/Makefile.in
lcms2mt/testbed/new.icc
lcms2mt/testbed/testcms2.c
lcms2mt/testbed/testcms2.h
lcms2mt/testbed/testplugin.c
lcms2mt/testbed/zoo_icc.c
lcms2mt/utils/common/utils.h
lcms2mt/utils/common/vprf.c
lcms2mt/utils/jpgicc/Makefile.am
lcms2mt/utils/jpgicc/Makefile.in
lcms2mt/utils/jpgicc/jpgicc.c
lcms2mt/utils/linkicc/Makefile.am
lcms2mt/utils/linkicc/Makefile.in
lcms2mt/utils/linkicc/linkicc.c
lcms2mt/utils/psicc/Makefile.am
lcms2mt/utils/psicc/Makefile.in
lcms2mt/utils/psicc/psicc.c
lcms2mt/utils/samples/Makefile.am
lcms2mt/utils/tificc/Makefile.am
lcms2mt/utils/tificc/Makefile.in
lcms2mt/utils/tificc/tifdiff.c
lcms2mt/utils/tificc/tificc.c
lcms2mt/utils/transicc/Makefile.am
lcms2mt/utils/transicc/Makefile.in
lcms2mt/utils/transicc/transicc.c


2020-06-03 19:41:31 +0100
Robin Watts <Robin.Watts@artifex.com>
a83716a1657df0a63aafa6582f47a93315aa61a6

Add skew detection/correction to downscaler.

base/cal.mak
base/gxdownscale.c
base/gxdownscale.h


2020-06-04 14:21:24 +0100
Robin Watts <Robin.Watts@artifex.com>
7867660a69bcc8624f0524ab56d86001d79e5b8d

Update doc/gdevds32.c to track updated downscaler API.

doc/gdevds32.c


2020-06-04 13:20:40 +0100
Ken Sharp <ken.sharp@artifex.com>
1db215120db50db418b199ff364e17feba681f14

Fix a couple of benign compiler warnings

Firstly a missing include file.

Secondly we were using a utility function from pdfwrite, and obviously
not including the .h file. We really shouldn't be hauling in bits of
pdfwrite, so instead duplicate the (miniscule) bit of functionality we
want.

devices/vector/gdevtxtw.c


2020-05-25 17:36:24 +0100
Ken Sharp <ken.sharp@artifex.com>
278f9a53ed507f9109380ee4210fb860b35b1811

txtwrite - better processing of text in type 3 fonts

Previously we were not able to accumulate the widths of text in a type
3 font. This code leverages (again) off the code in pdfwrite to exit
to the interpreter, run the type 3 CharProc, and pick up the glyph
advance width in setcachedevice.

This gives us better output for type 3 fonts, as we no longer
think that consecutive text is in the same position.

devices/vector/gdevtxtw.c


2020-06-03 16:54:41 +0100
Robin Watts <Robin.Watts@artifex.com>
feee7e6afd34ff3c1fa0c30ec024be25f1a61c1e

Rework downscaler initialisation.

Pass the downscaler parameters into the downscaler init routines,
rather than explicit values.

This reduces the size of the API, and means that future additions
to the structure will automatically be passed through.

base/gxdownscale.c
base/gxdownscale.h
devices/gdevchameleon.c
devices/gdevjpeg.c
devices/gdevocr.c
devices/gdevpdfimg.c
devices/gdevpng.c
devices/gdevpsd.c
devices/gdevtifs.c
devices/gdevtifs.h
devices/gdevtsep.c


2020-04-24 14:13:39 +0100
Robin Watts <Robin.Watts@artifex.com>
7322ef87546c55b29056c1d96d8bdbb7f3ba53ef

Tesseract based OCR devices.

pdfocr8/24/32, ocr and hocr devices.

Use OCRLanguage to set languages to use ("eng" by default).

Makefile.in
base/endianness.h
base/gsiorom.c
base/gxiodev.h
base/leptonica.mak
base/lib.mak
base/msvccmd.mak
base/ocr.mak
base/tess_version.h
base/tesseract.mak
base/tessocr.cpp
base/tessocr.h
base/unix-gcc.mak
base/winlib.mak
configure.ac
devices/devs.mak
devices/gdevocr.c
devices/gdevpdfimg.c
devices/gdevpdfimg.h
devices/gdevpdfocr.c
psi/msvc.mak
windows/ghostscript.vcxproj
windows/ghostscript.vcxproj.filters


2020-06-03 18:32:56 +0100
Robin Watts <Robin.Watts@artifex.com>
ff02973645a9aff2caf1bcd3032f119995e0d63f

Fix coverity 359151.

Check ds->dev is non NULL before dereferencing it.

base/gxdownscale.c


2020-06-02 19:24:50 +0100
Robin Watts <Robin.Watts@artifex.com>
89f3dba59d801dd7c586d81d996ea8d641e1018a

Add yet another version of nmake to makefile.

psi/msvc.mak


2020-06-02 19:23:30 +0100
Robin Watts <Robin.Watts@artifex.com>
df31667a82d8320d25c15f9eaf14fbb33a4ba0a1

Bug 702446: Fix CAL halftoning.

Looks like cal was interpretting halftone X phase in the wrong
direction.

base/gximono.c


2020-06-02 12:09:53 -0700
Michael Vrhel <michael.vrhel@artifex.com>
0006f8715f5f5d83a7823dc9f41c76a1bdf9b0f7

Add lcms2mt files into build_bmpcmp.sh

toolbin/build_bmpcmp.sh


2020-06-02 11:59:44 -0700
Michael Vrhel <michael.vrhel@artifex.com>
b9916ac2feec23b6c91e4c5d425dde0a73b1462d

Add missing line feeds on error messages in bmpcmp

toolbin/bmpcmp.c


2020-06-01 22:47:36 -0700
Michael Vrhel <michael.vrhel@artifex.com>
e3bbb3b93bcdade889b36641508f25929968089e

Add CIELAB comparison to bmpcmp

Adding the option -l will perform the difference in CIELAB
color space, provided the application was built with a CMM and
the source files were tiff files that had embedded ICC profiles.

It is necessary to use a threshold > 0 and a window > 1.

The threshold should be interpreted as dE^2 (a Euclidean norm squared
term is used as opposed to the L infinity norm used for the other
color spaces)

As a rule of thumb, dE^2 = 9 is barely noticeable in a side by side
solid color. Colors in complex images are going to require a larger
threshold.

This adds lcms2mt to the visual studio project. COLOR_MANAGED

toolbin/bmpcmp.c
toolbin/bmpcmp.vcxproj


2020-05-29 17:30:45 +0100
Robin Watts <Robin.Watts@artifex.com>
bb9959b60a9b3947c091ab867616385ac3fc7794

Refactor downscaler.

Originally the downscaler would just get the bits it wanted from
either get_bits or get_bits_rectangle.

Then we extended the downscaler to integrate ClapTrap, which means
it may have to get its scanlines from that. This was done hackily.

Now, we are pondering integrating scan/skew, which means there will
be a third possible source, and they might be used in different
combinations.

To simplify everything we introduce a "gx_downscaler_liner" mechanism
which wraps up getting a single line of data, and move to using
that everywhere. Adding scan/skew should then plug in using this
much more neatly.

base/gxdownscale.c
base/gxdownscale.h


2020-05-29 17:22:40 +0100
Robin Watts <Robin.Watts@artifex.com>
ba2fdf5517af3bcd8a613fda84c532307d1e7024

Fix memory leaks in tiffsep.

Calling TIFFCleanup doesn't close the underlying tiffio. Call
TIFFClose instead.

Now the tiff io close handler is actually called, be careful
not to close the underlying file twice.

Finally, actually remember to close the comp file.

base/gstiffio.c
devices/gdevtifs.c
devices/gdevtsep.c


2020-05-29 17:16:00 +0100
Robin Watts <Robin.Watts@artifex.com>
052a91b91d3d339dca3ce69bcb81faee9b8ff647

Claptrap: Fix us overrunning components in the planar case.

base/claptrap-planar.c


2020-05-30 19:38:38 +0100
Ken Sharp <ken.sharp@artifex.com>
2e4f5bdc708eaceecbce264184bc31f9b5fec107

Coverity ID 359131 and 359130

Remove some dead code after the commit which removed the ancient
Acrobat 4 & 5 compatibility hacks.

devices/vector/gdevpdfd.c


2020-05-27 11:50:08 +0100
Julian Smith <jules@op59.net>
a608d40b2d6d4a062857e23060c243a4b10aac69

Hacky fix for Memento leak in pcl_execute_macro().

Fixes the six remaining leaks after prev commit in:
MEMENTO_FAILAT=15796 ./ghostpdl/membin/gpcl6 -sDEVICE=pbmraw -o /dev/null tests_private/pcl/pcl5cfts/fts.2180

pcl/pcl/pcmacros.c


2020-05-29 16:19:46 +0100
Julian Smith <jules@op59.net>
be333874ffd55024ce640bf8d4347dabff162be1

Improvements to pcl_do_resets().

From Henry; we now do pcl_reset_permanent on all items if we get an error.

This fixes all but 6 of the memento leaks in:
MEMENTO_FAILAT=15796 ./ghostpdl/membin/gpcl6 -sDEVICE=pbmraw -o /dev/null tests_private/pcl/pcl5cfts/fts.2180

pcl/pcl/pcommand.c


2020-05-28 13:07:55 +0100
Ken Sharp <ken.sharp@artifex.com>
3156b0aa8ac4e9ef440c169799658da249eb41c9

pdfwrite - remove Acrobat 4 & 5 work arounds

Acrobat 4 had a limit of around =/- 16,320 on real numbers (despite the
reference stating it was +/- 32,7670, Acrobat 5 had a limit of 32,767.
These are implementation limits, not architectural limits, and since
co-ordinates are expressed as real numbers they place limits on the
position of objects on the page.

Its clear from Bug #702436 that the clamping used by pdfwrite is not
comprehensive; several paths are emitted that use co-ordinates outside
the permitted range.

Since the implementation is flawed, and the newest of the 2 versions
(Acrobat 5) has been obselete for 15 years, it seems pointless to try
and improve this clamping. Instead this commit removes it entirely.

This removes a number of places where we test values and do some
multiplication, so there should be a (probably immeasurable) performance
gain from this. In addition the accuracy should be (very slightly)
improved because there should be less problems with rounding errors.

This causes a large number of files to demonstrate single pixel shifts
of a few glyphs, due to changes in rounding. In general these are very
minor progressions, though a few could be seen to be equally minor
regressions. Since these mostly (and in the case of regressions,
entirely) occur at low resolution I believe this is acceptable.

One file, Bug694385, when sent to ps2write, exhibits a marked
progression. This is because the clamping wasn't limited to the pdfwrite
device, even though it was inappropriate to limit the ps2write output
this way. A good deal of content is now included, where it was previously
elided.

devices/vector/gdevpdfd.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfi.c
devices/vector/gdevpdfx.h
devices/vector/gdevpdts.c


2020-05-27 16:53:33 +0100
Ken Sharp <ken.sharp@artifex.com>
f8a0afa4029b33d3174a31fd562a0102644c9c9e

pdfwrite - fix clamping for Acrobat 4 and 5 limits

Bug #702436 "With -dCompatibilityLevel=1.4, gs -sDEVICE=pdfwrite corrupts the contents"

This isn't 'corruption'. Acrobat 4 and 5 have some serious limitations
on the maximum value a real number can take. Since co-ordinates are real
numbers this limits the area which can be addressed on the media.

The example file is very large and, using the default resolution of 720
dpi, some of the content has co-ordinates outside the region which can
be addressed by old versions of Acrobat.

In practice we can see that many parts of our output no longer limit
themselves to these values anyway, so we shjould remove this archaic
limitation.

In the meantime we can work around this specific case by noting that the
clip is rectangular, and will be emitted as a 're' operation, so
clamping all 4 co-ordinates is inappropriate. We need to clamp the llx
and lly co-ordinates, but then its the width and height we need to limit
rather than the urx and ury co-ordinates.

devices/vector/gdevpdfd.c


2020-05-26 18:57:30 +0100
Ken Sharp <ken.sharp@artifex.com>
b53ad834b8cddfc55e2297e3d34ff834926a25ff

documentation - update man/ps2pdf.1

Replace reference to ps2pdf.htm with VectorDevices.htm

man/ps2pdf.1


2020-05-26 13:04:09 +0100
Julian Smith <jules@op59.net>
6667495f56bc670322f607de419fe7e48434d3c6

Fix memento leak in hpgl_process_buffer().

The fix is to make hpgl_free_stick_fonts() call
pl_font_glyph_width_cache_remove_nodes().

Fixes:
MEMENTO_FAILAT=22007 ./ghostpdl/membin/gpcl6 -sDEVICE=pbmraw -o /dev/null tests_private/pcl/pcl5cfts/fts.1640

Also fixes many later leaks.

pcl/pcl/pglabel.c


2020-05-25 18:41:24 +0100
Julian Smith <jules@op59.net>
1e8dd08e6c9e721c993d28bb36e107f81d16ce0a

Fix leak after error in accum_fill_rectangle()

Fixes:
./ghostpdl/membin/gpcl6 -sDEVICE=pbmraw -o /dev/null tests_private/pcl/pcl5cfts/fts.1552

base/gxacpath.c


2020-05-25 11:59:52 +0100
Julian Smith <jules@op59.net>
776cf430dd1a96a7da33c0d33af9a6dd42bffec0

Fix memory leak on error in bitmap_paint() and its callers.

Previously, bitmap_paint() would free its 'gs_image_enum * pen' arg, but caller
image_PaintProc() could also attempt to free this in one error path.

So have changed bitmap_paint() to only free what it allocates - call
gs_image_cleanup() instead of gs_image_cleanup_and_free_enum(); and patched
its two callers, mask_PaintProc() and image_PaintProc(), to add calls to
gs_free_object(pen).

Fixes leak in:
MEMENTO_FAILAT=15601 ./ghostpdl/membin/gpcl6 -sDEVICE=pbmraw -o /dev/null tests_private/pcl/pcl5cfts/fts.0954

base/gsptype1.c


2020-05-25 11:59:19 +0100
Julian Smith <jules@op59.net>
815cbc244257f224eca799413ee64b17b62ffb4a

Fix error handling in image_render_interpolate_icc().

Need to return gs_error_VMerror if gs_alloc_bytes() returns NULL.

Fixes segv in:
MEMENTO_FAILAT=15601 ./ghostpdl/membin/gpcl6 -sDEVICE=pbmraw -o /dev/null tests_private/pcl/pcl5cfts/fts.0954

base/gxiscale.c


2020-05-22 08:26:34 -0700
Ray Johnston <ray.johnston@artifex.com>
3227677f842a1060d29acc53465c6a9c76f7d48b

Fix Bug702327: PS transparency operations before PUSH_DEVICE causes problems.

Add check to make sure PUSH_DEVICE is the first pdf14 compositor action
before allowing any other operation for page mode and clist mode.

base/gdevp14.c
base/gxclist.c
base/gxclist.h


2020-05-23 14:16:51 +0100
Ken Sharp <ken.sharp@artifex.com>
b4310ff9719fdafb840972649a4eb94a88165e66

ps2write - ignore (most) text rendering modes with type 3 fonts

Bug #702233 "ps2 stroked text mitre problem"

The PDF specification says that Tr (text rendering modes) are not
applied to type 3 fonts.

The PDF interpreter normally caters for this by not converting the
glyphs to paths and applying the operation(s) but simply rendering the
text.

However, when the destination is pdfwrite or ps2write, we don't apply
the text rendering mode operations, we simply leave it up to the device
to deal with. Ordinarily this works well, but ps2write had no provision
for the special handling of type 3 fonts, and so was applying the text
rendering mode to those fonts too, resulting in incorrect output.

This commit adds code to the PostScript output of ps2write; this checks
the font type and does not apply the text rendering mode if the font
type is 3. With one exception; if the text rendering mode is 3 (neither
stroke nor fill) then we *do* apply it, because Acrobat does and if we
don't apply it then we draw text that Acrobat does not.

devices/vector/opdfread.ps


2020-05-22 11:25:43 -0700
Michael Vrhel <michael.vrhel@artifex.com>
4d3ca982177aff19331b72a226664e281feede2c

Fix tiff bmpcmp to organize image data upside right for windows

toolbin/bmpcmp.c


2020-05-22 13:38:23 +0100
Chris Liddell <chris.liddell@artifex.com>
e1354dbd1cfc7692b7559a3f4c7f86900e513edc

Bug 702431: Don't cast a unsigned long to an unsigned int

When allocating the pixmap for a display device, we were casting the unsigned
long bitmap size to an unsigned int, meaning on LP64 (where a long is 64 bits)
we could end up truncating the value.

Change it to cast to a size_t.

Ultimately, we'll want to change the display device structure to store a size_t
rather than unsigned long, but that will mean changing the display device's
public API.

devices/gdevdsp.c


2020-05-21 11:12:14 +0100
Chris Liddell <chris.liddell@artifex.com>
b4cda2ee4cbdf045e05b9832fd93f6a1a5cc3bb6

Remove the last of TURBO C support.

Most of the TURBO C support went away years ago, and we've had no complaints,
so remove the rest.

base/malloc_.h
base/memory_.h
base/stdpre.h
psi/store.h


2020-05-22 14:24:39 +0100
Ken Sharp <ken.sharp@artifex.com>
7d6d69ff17c43664482fe0dc34676a46ba551d93

pdfwrite - rewrite the PSPageOptions code to use non-GC memory

Bug #702370 "PSPageOption injecting unwanted characters"

As Peter rightly comments in the bug this is due to the contents of the
param_string_array not being enumerated when the array pointer is
enumerated.

This seems to be a general problem, but we seem to get away with it for
NeverEmbed and AlwaysEmbed (which are handled in a much more complex
fashion) so I've chosen to leave those alone for now.

For PSPageOptions this commit creates a new gs_param_string_array and
new strings for each of the strings in the param_list. These are
allocated in non-GC memory and the pdfwrite device has complete control
over their lifetime now.

We no longer numerate the member for GC (because it should not be GC'ed)
and we free the array and its contents when we close the device.

This resolves the problem for me.

devices/vector/gdevpdf.c
devices/vector/gdevpsdf.h
devices/vector/gdevpsdp.c


2020-05-21 16:24:41 -0700
Michael Vrhel <michael.vrhel@artifex.com>
548fa474def31ddeb2864554ad0698bd53b13ea0

Add shell script to build bmpcmp with tiff and png support

toolbin/build_bmpcmp.sh


2020-05-20 18:15:40 +0100
Robin Watts <Robin.Watts@artifex.com>
6955a325826e84c77723bab03046c801930801df

Extend gsapi interface with _with_handle variants for callbacks.

This allows us to specify specific caller_handles for each
callback type rather than using a default one specified at
gs instance creation time. The old functions still work.

base/gp_mspol.c
base/gslibctx.c
base/gslibctx.h
base/strmio.c
pcl/pl/plapi.c
pcl/pl/plapi.h
psi/gsdll2.def
psi/gsdll32.def
psi/gsdll32metro.def
psi/gsdll64.def
psi/gsdll64metro.def
psi/gsdllARM32metro.def
psi/iapi.c
psi/iapi.h
psi/psapi.c
psi/ziodevsc.c


2020-05-21 08:21:05 +0100
Chris Liddell <chris.liddell@artifex.com>
b0d2c264eb53c1838957151f1e18abfd1f17dd54

Bug 702225(pt2): Check fontconfig is new enough.

Turns out FC_VARIABLE is a fairly new addition to fontconfig's search
parameters (<= 2.12.6 doesn't have it >=2.13.1 does), so add preprocessor
conditions so we'll only use when fontconfig is new enough.

base/gp_unix.c


2020-05-20 16:23:12 +0100
Chris Liddell <chris.liddell@artifex.com>
627942b74af81c1b9b76b07dba6e4ce6234a4ab6

Fix the Windows top makefile when using UFST

If the user chose to specify the build flags for using UFST directly on the
nmake command line (rather than using the predefined UFST build target), we'd
end up disabling Freetype, which has not been supported for some time.

psi/msvc.mak


2020-05-20 15:17:10 +0100
Robin Watts <Robin.Watts@artifex.com>
619e7f46c9c760879409f9efaa4b3e798986538e

lgtm.com fixes: float * float -> double.

Make casting explicit. Ideally we'd cast one of the floats to a
double to start with, so the multiplication happens in doubles,
but that produces lots of diffs.

base/gspaint.c


2020-05-20 11:39:08 -0700
Michael Vrhel <michael.vrhel@artifex.com>
e27d7babcbbbee07fe9c458228d941ce3b4f8890

Fix typo introduced in copy/paste

base/gdevp14.c


2020-05-19 12:18:29 -0700
Michael Vrhel <michael.vrhel@artifex.com>
c9142412c3ec52e2fcb42053706352a9ee5d9a74

Add tiff to bmpcmp

This upgrades the VS solution to 2019 for the bmpcmp project. Fixes a couple
minor issues that existed with some of the project configurations and add
tiff support.

toolbin/bmpcmp.c
toolbin/bmpcmp.sln
toolbin/bmpcmp.vcproj
toolbin/bmpcmp.vcxproj


2020-05-20 14:45:15 +0100
Robin Watts <Robin.Watts@artifex.com>
cf15813c35a75067e828608c665dae30999f8dd5

Update Acrobat2Tiff to VS2019

toolbin/Acrobat2Tiff/Acrobat2Tiff.sln
toolbin/Acrobat2Tiff/Acrobat2Tiff/Acrobat2Tiff.vb
toolbin/Acrobat2Tiff/Acrobat2Tiff/Acrobat2Tiff.vbproj
toolbin/Acrobat2Tiff/Acrobat2Tiff/Acrobat2Tiff/Application.Designer.vb
toolbin/Acrobat2Tiff/Acrobat2Tiff/Acrobat2Tiff/Resources.Designer.vb
toolbin/Acrobat2Tiff/Acrobat2Tiff/Acrobat2Tiff/Settings.Designer.vb


2020-05-20 16:02:07 +0100
Ken Sharp <ken.sharp@artifex.com>
8c7bd787defa071c96289b7da9397f673fddb874

txtwrite - address memory problems

Bug #702229 " txtwrite: use after free in 9.51 on some files (regression from 9.50)"
Also bug #702346 and the earlier report #701877.

The problems occur because its possible for a single character code in
a PDF file to map to more than a single Unicode code point. In the case
of the file for 701877 the character code maps to 'f' and 'i' (it is an
fi ligature).

The code should deal with this, but we need to ensure we are using the
correct index. In addition, if we do get more Unicode code points than
we expected, we need to set the widths of the 'extra' code points to
zero (we only want to consider the width of the original character).

This does mean increasing the size of the Widths array to cater for
the possibility of more entries on output than there were on input.

While working on it I noticed that the Unicode remapping on little-
endian machines was reversing the order of the Unicode values, when
there was more than a single code point returned, so fixed that at
the same time.

devices/vector/gdevtxtw.c


2020-05-20 12:44:45 +0100
Robin Watts <Robin.Watts@artifex.com>
be741930a01176ba8cfea1310866a1a1c69fa71c

Add yet another nmake version to the MSVC makefile.

psi/msvc.mak


2020-05-20 11:23:18 +0100
Robin Watts <Robin.Watts@artifex.com>
a10a03a4c9713b38c4cfcd07f0ba3c722778aae0

Rejig plftable.h

Rather than repeatedly including the same header to get multiple
versions of the font table built in, build the font table just
once with all the information in it.

This should be smaller (fractionally), and stop lgtm.com complaining.

pcl/pcl/pcfontpg.c
pcl/pcl/pcfsel.c
pcl/pl/plftable.c
pcl/pl/plftable.h
pcl/pl/pllfont.c


2020-05-20 12:15:12 +0100
Chris Liddell <chris.liddell@artifex.com>
ffbaace78bacb0421ae11c5a8fdef51cbd829218

Tweak fapiufst code to build with UFST 7.1.x

base/fapiufst.c


2020-05-19 16:20:49 +0100
Chris Liddell <chris.liddell@artifex.com>
7e7fa21f9e378303df8d8529cc3a94676e433f40

Exclude "variable fonts" from fontconfig search

Since we cannot used (and later skip over errors caused by) TTF variable
fonts (a sort of illigitimate offspring of Multiple Master and TTF!) we
may as well filter them out of our fontconfig search criteria.

Patch suggested by zdohnal@redhat.com

base/gp_unix.c


2020-05-19 18:43:48 +0100
Robin Watts <Robin.Watts@artifex.com>
9f1b19d0634ad611dc73a8c05c13c88f42cb8730

lgtm fixes: float * float -> double

When we do float * float, and then use the result in a context
where a double is expected, we implicitly cast the result of the
multiplication to be a double. This means we can overflow
the range of floats during the initial multiplication, when the
result would quite easily fit into a float.

It's better to cast to double to start with, then do the
multiplication (at the cost of potentially being slower - but
not really that much slower these days).

In some cases I've opted NOT to change the operations (merely to
make the casting explicit) so as to minimise diffs.

base/gdevp14.c
base/gshtscr.c
base/gxshade.c
base/gxstroke.c
pcl/pxl/pxpaint.c


2020-05-19 19:45:03 +0100
Robin Watts <Robin.Watts@artifex.com>
173e301c9908cf4656c462a89a146f7f1f5664f8

Fix "integer constant overflow" warning.

base/gsptype1.c


2020-05-18 13:16:20 +0100
Ken Sharp <ken.sharp@artifex.com>
ef0bc2a843783af2e5d76dadf801063ab6c785ef

Improve font copying for new PDF interpeter with pdfwrite

Since this commit:

http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=12c071547d

The 'copied font' stored by pdfwrite has maintained a pointer to the
interpreter's 'dir' (FontDirectory) and used it to mark the names in
the interpreter name table during GC pointer enumeration.

This doesn't work if the interpreter is pdfi and its working inside
the Ghostscript PostScript interpreter, because the enumeration can
take place after the pdfi interpreter has been destroyed. Its also not
necessary in this case, because the pdfi name table can't be relocated.

But for complex reasons (see the lengthy comment in the code) it has a
small but useful benefit when pdfwrite is being driven directly by the
PostScript interpreter.

In order to avoid losing that benefit, we now only store a pointer to
the interpreter's 'dir' member, and only mark the names during
enumeration, if the memory allocator of the font is a garbage-collecting
allocator.

devices/gxfcopy.c


2020-05-18 13:20:10 +0100
Robin Watts <Robin.Watts@artifex.com>
63df5adcad39572f94a0448c09598641c89f58db

lgtm.com fix: int * int may overflow before being converted to size_t.

base/gxdownscale.c


2020-05-15 13:06:19 +0100
Robin Watts <Robin.Watts@artifex.com>
c170fa2fc7dfe79dced44d7b628129e5bc7dd045

lgtm.com fixes: Don't define external functions in local scope.

base/gxpcmap.c
pcl/pxl/pxfont.c


2020-05-15 12:54:35 +0100
Robin Watts <Robin.Watts@artifex.com>
f8529a27e1c1768bd79ff19dfa7a29790ce9e275

lgtm.com: Add comment to empty conditional block to stop warning.

base/mkromfs.c


2020-05-15 12:36:00 +0100
Robin Watts <Robin.Watts@artifex.com>
53b712ea02903910a19980b28fbf8ae6fc5bdade

lgtm.com fixes: Avoid shadowing params with local vars.

base/ets.c
base/gdevmem.c
base/gsfcmap1.c
pcl/pcl/rtraster.c
pcl/pl/pjparse.c
psi/imain.c
psi/zchar.c


2020-05-15 11:43:13 -0700
Ray Johnston <ray.johnston@artifex.com>
8d9df30a48ac272e92666d52fef62580aacabfd7

Bug 702248: Spelling problem in error message.

Resource/Init/pdf_rbld.ps


2020-05-15 11:48:54 +0100
Robin Watts <Robin.Watts@artifex.com>
349d37844880567be4630e07c0518f6671300fc6

lgtm.com: Fix "comparison is always false" warning.

psi/ziodev.c


2020-05-15 11:48:07 +0100
Robin Watts <Robin.Watts@artifex.com>
2f768243df42031a3f37f256678e34c1ac97fdde

lgtm.com fixes: Multiplication of narrow type in wider context.

base/claptrap-init.c
base/gdevdrop.c
base/gdevprn.c
base/gsfunc.c
base/gsicc_monitorcm.c
base/gxccache.c
base/gxclip2.c
base/gxclipm.c
base/gxclread.c
base/gxclrect.c
base/gxdownscale.c
base/gxfapi.c
base/gxhtbit.c
base/gxidata.c
base/gxipixel.c
base/gxshade4.c
base/sjbig2.c
base/sjbig2.h
pcl/pcl/pcsfont.c
pcl/pl/plchar.c
pcl/pxl/pximage.c
psi/zfapi.c
xps/xpsimage.c
xps/xpsjxr.c
xps/xpspng.c
xps/xpszip.c


2020-05-14 21:00:34 +0100
Robin Watts <Robin.Watts@artifex.com>
b380ebb41878645d0d7bb2b07155667acac4fa99

lgtm.com fixes: Fix cases where comparisons are constant.

base/gdevdflt.c
base/gdevp14.c
base/gen_ordered.c
base/gscsepr.c
base/gsmisc.c
base/gstiffio.c
base/gxcmap.c
base/gxdownscale.c
base/mkromfs.c
base/ttfmain.c
pcl/pl/realmain.c
pcl/pxl/pxfont.c
pcl/pxl/pxink.c
psi/imain.c
psi/ireclaim.c
psi/iscannum.c
psi/zcolor.c
psi/zfont.c
psi/zfsample.c
psi/zfunc4.c


2020-05-13 16:52:42 -0700
Ray Johnston <ray.johnston@artifex.com>
d578f2517bbc6261a0cf31f8e2e88b2990241c0a

Fix 702400: Indeterminate SEGV due to GC confusion.

The GC 'clump_locate' macro relied on PTR_BETWEEN (yes, also a macro)
but on Windows MSC_VER caused pointers to be compared using only the
low 32-bits (unsigned long is 32-bits on Windows, even 64-bit).

Depending on addresses, and when the GC ran, this could result in the
GC logic being confused about addresses. This change works with 32-bit
Windows as well as 64-bit (and may not work with TURBOC on an OLD
CPU with segment+offset addresses, but so what?).

base/stdpre.h


2020-05-13 10:20:29 -0700
Nancy Durgin <nancy.durgin@artifex.com>
d703f355af5292e61dcd641332e249873ab5fb8a

Bug702398 -- Fix several annotation w/no AP bugs

1) In the case of an annotation with no BS or Border, the code was simply
incorrect, causing an error that meant the annotation didn't render.

2) annotation wasn't rendering if atan got error

Found this for a PolyLine case, but also fixed it for Line, just in case.

3) Fix 1st LE in Polyline

It was calculating dx,dy backwards, so the angle was off by 180 degrees.

4) Set the color for PolyLine annotation

Resource/Init/pdf_draw.ps


2020-05-13 11:31:57 +0100
Robin Watts <Robin.Watts@artifex.com>
d767c9e3297623e6708fe1c6dcab0583989ef63c

Assuage C++'s demands for whitespace in string literal concats.

base/stdint_.h


2020-05-11 18:05:50 +0100
Robin Watts <Robin.Watts@artifex.com>
0ccf0e77b1ee8e10335c2a80ddb180c9b5a4f5b6

lgtm.com fixes: Narrow multiply -> wider result.

base/gsfcmap.c
base/gxhintn.c


2020-05-12 13:58:30 +0100
Ken Sharp <ken.sharp@artifex.com>
bad9f11895cbb4c0f53b7b0ef8f3502789d81315

graphics library - improve gx_cpath_copy

This function does not, currently, appear to be called from anywhere.
For the new PDF interpreter we'd like to use it to copy the clip path(s)
from the PostScript environment to the PDF environment, but there's a
problem.

The problem is that the structures defining the list of rectangles are
allocated using the same memory allocator as the source clip path, but
when we come to free them, the destructor uses the memory allocator of
the clip list. So if the destination clip path was using a different
allocator from the source clip path, we will use the wrong allocator to
try and free the memory.

Chris thinks this may be an attempt to cope with stack-based allocations
of the clip path where the allocator is NULL. So to cope with that
we use the existing code (allocator from the source clip path) if the
destination clip path's allocator is NULL (stack based) and we use the
destination clip path's allocator otherwise.

base/gxcpath.c


2020-05-11 11:08:26 -0700
Michael Vrhel <michael.vrhel@artifex.com>
ae6b0b0e768f618728f66580227fffc92896903c

Remove "magic numbers" from profile type selection

base/gdevp14.c
base/gscms.h
base/gsequivc.c
base/gsicc.c
base/gsicc_cache.c
base/gsicc_manage.c
base/gstext.c
base/gxclthrd.c
base/gxcmap.c
base/gxiscale.c
devices/gdevjpeg.c
devices/gdevpdfimg.c
devices/gdevpng.c
devices/gdevtfnx.c
devices/gdevtifs.c
devices/gdevtsep.c
devices/vector/gdevxps.c
psi/zicc.c


2020-05-07 10:43:54 -0700
Michael Vrhel <michael.vrhel@artifex.com>
2bb52bc877645068977c17c8a433e5b959b51eba

Spot overprint in RGB Blend color spaces

If the blending color space is RGB based,
special consideration must be made for doing
overprint with separation and devicen color spaces.

In particular if we are going out to a separation
device we could have RGB+spot support but not
if the separation color was a process name like
Cyan.

Also implement the missing gxdso_pdf14_sep_device
special operation.

base/gdevdflt.c
base/gdevp14.c
base/gscdevn.c
base/gscspace.h
base/gsstate.c
base/gstext.c
base/gxblend.c
base/lib.mak


2020-05-11 15:41:09 +0100
Robin Watts <Robin.Watts@artifex.com>
a7def309186f123008dcedfc0a6b07b6328c9c13

lgtm.com: configuration file fixes.

.lgtm.yml


2020-05-11 00:57:18 +0100
Robin Watts <Robin.Watts@artifex.com>
4f03b3f51957fcaab6b953ba79bb32d2096ad49b

lgtm.com fixes: Avoid narrow mult cast to longer type.

Avoid masking overflows through relying on implicit casting.

base/gdevabuf.c
base/gdevdflt.c
base/gdevp14.c
base/gen_ordered.c
base/gsfcmap.c
base/gsfunc0.c
base/gsht.c
base/gshtscr.c
base/gsicc_create.c
base/gsptype1.c
base/gxblend1.c
base/gxdownscale.c
base/gxht_thresh.c
base/gxicolor.c
base/gximono.c
base/gxiscale.c
base/gxpcmap.c
base/sidscale.c
base/siscale.c
base/sjpx_openjpeg.c
devices/gdevdm24.c
devices/vector/gdevpdfg.c
devices/vector/gdevpsds.c
pcl/pcl/pglfill.c
pcl/pxl/pxpaint.c
xps/xpstiff.c


2020-05-10 12:31:02 +0100
Robin Watts <Robin.Watts@artifex.com>
4c305cb14b76bebfe0e147bcd90f4cc2ec7482ac

Add lgtm configuration file.

.lgtm.yml


2020-05-10 12:19:48 +0100
Robin Watts <Robin.Watts@artifex.com>
9b89ef860f52a6ca9696559c39104feba41e1de8

lgtm.com fixes: gpdl tweaks.

gpdl/jpgtop.c
gpdl/pngtop.c
gpdl/psitop.c
gpdl/tifftop.c


2020-05-09 17:42:37 +0100
Robin Watts <Robin.Watts@artifex.com>
b778f827810b9f14c758334dd94f3f8df4d27bd4

lgtm.com fix: Use | not || when combining bitflags.

base/gxclpath.c


2020-05-09 17:49:36 +0100
Robin Watts <Robin.Watts@artifex.com>
c2dbf6acdc8b86cc0d74ff74d222720558ceb397

lgtm.com fix: Remove code for duplicated "if" condition.

toolbin/halftone/ETS/ipview.html


2020-05-09 17:45:01 +0100
Robin Watts <Robin.Watts@artifex.com>
d9b37029db10bdeaf5eaee00bac2eb0653644c77

lgtm.com tweak: Make it clear that something isn't a typo.

Use "INTERPATCH_PADDING != 0" rather than "INTERPATCH_PADDING" to
avoid the appearance of a typo.

base/gxshade6.c


2020-05-09 17:38:24 +0100
Robin Watts <Robin.Watts@artifex.com>
8836aca9a03b99fc6f0ceb3994dbb78d442d634a

lgtm.com: Miscellaneous fixes in support scripts.

Remove unused local variables, correct semicolon usage. Avoid
"return fn()" where fn always returns None.

pcl/tools/check_deps.py
pcl/tools/makeromttf.py
pcl/tools/pxlasm.py
pcl/tools/pxldis.py
pcl/tools/revlist.py
psi/msvc.mak
toolbin/gitlog2changelog.py
toolbin/halftone/ETS/ipview.html
toolbin/ocheck.py


2020-05-09 12:35:27 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
8620f18686d3350590894590264f4cd71ef3dccb

Bug 697545 : Prevent SEGV during pjl_set_init_from_defaults.

Prevent SEGV by propagating all error codes.

Error created using :-
MEMENTO_FAILAT=25933 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./tests_private/pcl/pcl5efts/fts.0051

pcl/pl/pjparse.c
pcl/pl/pjparse.h
pcl/pl/pjparsei.c


2020-05-08 21:50:30 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
9e553991e4c99814eb342d83b4fb42b5af457390

Bug 697545 : Prevent numerous memory leaks.

Prevent memory leaks by propagating error codes and freeing loose objects.

Also resolve some compiler warnings.

Error created using :-
MEMENTO_FAILAT=19484 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5efts/fts.0051

base/gscspace.c
base/gxclrast.c
base/gxcpath.c


2020-05-08 14:50:08 +0100
Robin Watts <Robin.Watts@artifex.com>
a0a3ac239e990a76e937710dce75f3ace1e25be7

lgtm.com issue: Add some missing "repeat include" guards.

base/gximdecode.h
contrib/lips4/gdevlips.h
contrib/lips4/gdevlprn.h
devices/rinkj/evenbetter-rll.h
devices/rinkj/rinkj-byte-stream.h
devices/rinkj/rinkj-config.h
devices/rinkj/rinkj-device.h
devices/rinkj/rinkj-dither.h
devices/rinkj/rinkj-epson870.h
devices/rinkj/rinkj-screen-eb.h
devices/vector/gdevagl.h
devices/vector/gdevpdfg.h
ijs/ijs.h
ijs/ijs_client.h
jbig2dec/jbig2.h
lcms2mt/include/lcms2mt.h
lcms2mt/include/lcms2mt_plugin.h
lcms2mt/src/lcms2_internal.h
pcl/pcl/pgfdata.h
pcl/pl/plfapi.h
pcl/pl/plparams.h
pcl/pl/plufstlp.h
pcl/pl/plvocab.h
pcl/pxl/pxbfont.h
xps/ghostxps.h
xps/xpsfapi.h


2020-05-08 12:23:26 +0100
Robin Watts <Robin.Watts@artifex.com>
1883e1010c35da56bc47ad439b9e45401a3060da

lgtm.com fix: Remove duplicate keys from enumeration.

pcl/tools/pxlasm.py
pcl/tools/pxldis.py


2020-05-07 18:30:02 +0100
Robin Watts <Robin.Watts@artifex.com>
95fe80c3c670f1f5200c21ea8df3e6139b711acc

lgtm.com fixes: Fix comparison of narrow loop var with wider limit.

base/gxcmap.c
base/ttfmain.c


2020-05-07 18:14:23 +0100
Robin Watts <Robin.Watts@artifex.com>
7592dd988af75e40f0e449e17905751a5117e4f5

Fix implicit declaration of var in ETS support script.

toolbin/halftone/ETS/ipview.html


2020-05-07 18:12:30 +0100
Robin Watts <Robin.Watts@artifex.com>
de1f4bc1918fe1a972c3e8119f3c24266aff4cc4

Fix missing comma in pxlasm.py

pcl/tools/pxlasm.py


2020-05-07 17:48:08 +0100
Robin Watts <Robin.Watts@artifex.com>
fa4eb803adf41c0353fd7efbb4b45321eb2dec06

Tweak stream.h to avoid the use of "template".

"template" is a reserved word in C++, and so this header won't
compile when included from a .cpp file.

base/stream.h


2020-05-06 18:01:07 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
efd0b47fe66a99097e200d76be1a4846ae2ef692

Bug 697545 : Prevent memory leak in gx_path_assign_free.

Prevent memory leak by freeing path on all errors.

Error created using :-
MEMENTO_FAILAT=16246 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.2120

base/gxpath.c


2020-05-06 12:11:05 +0100
Robin Watts <Robin.Watts@artifex.com>
6d7c22dd453515d3f3f74af695a08abed26f657b

lgtm.com fixes for ghostscript.

Avoid using the same header include guard in more than one file.

Use the correct format specifier in a printf-like error string
in lcms2mt.

contrib/gdevbjc_.h
lcms2mt/src/cmsio0.c


2020-05-03 19:04:42 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
1ad7ac685aa07b1dceb0bf9e28e68a47492fb920

Bug 697545 : Prevent SEGV in hpgl_LB.

Prevent SEGV by cleanly freeing stick fonts on all errors.

Error created using :-
MEMENTO_FAILAT=15422 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.1920

pcl/pcl/pglabel.c


2020-05-04 10:29:06 -0700
Michael Vrhel <michael.vrhel@artifex.com>
c34c60394ebf68356866c6160fd0f7dfa1c4d0ce

Coverity 957905

base/gdevp14.c


2020-05-04 08:31:43 +0100
Ken Sharp <ken.sharp@artifex.com>
54e26f03a7403112463ad69874be9ab66cc4c863

PDF interpreter - minor fixes

Remove what looks like a left-over debugging print, make a couple of
indenting fixes.

Resource/Init/pdf_ops.ps


2020-05-02 23:31:30 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
92dc0f411477a0b920eea64ab305e60d2755ac9d

Bug 697545 : Prevent memory leaks in hpgl_fill_polyfill_background.

The code has been refactored to always call grestore to balance the gsave.

Error created using :-
MEMENTO_FAILAT=19724 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.1890

pcl/pcl/pgdraw.c


2020-05-02 12:58:21 -0700
Michael Vrhel <michael.vrhel@artifex.com>
160d2d57ebbe610b770206f6f9773d9300ca97f9

Coverity 357907

base/gdevp14.c


2020-05-02 12:25:59 -0700
Michael Vrhel <michael.vrhel@artifex.com>
5b96425e2414dfb130490bf0da2a5e03da099951

Fix mistake in debug print variable count

base/gstrans.c


2020-05-02 09:26:05 -0700
Michael Vrhel <michael.vrhel@artifex.com>
1407aa54f6c2df62d432a9b895a0001e62defcd8

Coverity 357906

base/gdevp14.c


2020-05-02 13:33:04 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
339ddd9dba998b82d4b71bdaee456ee80408c24f

Bug 697545 : Prevent memory leaks in hpgl_print_symbol_mode_char.

The code has been refactored to always call grestore to balance the gsave. The label buffer must
always be destroyed if it was successfully initialised.

Error created using :-
MEMENTO_FAILAT=18349 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.1850

pcl/pcl/pglabel.c


2020-05-01 16:24:38 -0700
Michael Vrhel <michael.vrhel@artifex.com>
8c432810d36e24613b84f8506ab3929f9d13e612

Squashed commit of the page_group branch

The issue this branch is trying to solve is to ensure
that the alpha blending occurs in the proper page group
color space. If the page group is CMYK and the device is
RGB then the final alpha blend must occur prior to the
color conversion. Currently with the head code this is
not the case. This work required a significant rework
of how the transparency group pop occurred since if it
is the final group, the blend will not occur until the
put_image operation. The group color handling was
completely reworked and simplified. The reworked code
now maintains a group_color object that is related to
its own color rather than the parent as before.

In addition, during the push_device operation, a buffer
is not created. Previously an entire page buffer was
created. If we have a page group that is smaller than
the whole page, this will save us in space. The downside
of this is that we need to ensure we have a buffer in place
when the first drawing operation occurs.

There were several issues with the bitrgbtags devices as
well as the pngalpha and psdcmyk16 devices that had to
be considered during the put_image operation.
operation

base/gdevdflt.c
base/gdevp14.c
base/gdevp14.h
base/gsicc_cache.c
base/gstparam.h
base/gstrans.c
base/gstrans.h
base/gxblend.h
base/gxblend1.c
base/gxdevsop.h
devices/devs.mak
devices/gdevpng.c
devices/vector/gdevpdft.c


2020-05-01 12:17:18 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
d41990615baaee9bba6ce7ae3e5a025a71744c51

Bug 697545 : Prevent SEGV in pcl_pattern_RF.

The call to pl_dict_put will free the pattern if an error occurs so the pcl_pattern_free_pattern
is not required. Freeing the pattern data is now handled here to prevent leaks and also to
prevent double freeing.

Two typos were also cleared up.

Error created using :-
MEMENTO_FAILAT=15000 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.1816

pcl/pcl/pcuptrn.c
pcl/pcl/pglfill.c


2020-04-29 20:43:17 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
8ba1ead91f1c051df75302dc49531d9f2497ef51

Bug 697545 : Prevent SEGV in hpgl_LB.

Update code to propagate error codes correctly and and clean up stick fonts.

Error created using :-
MEMENTO_FAILAT=17298 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.1640

pcl/pcl/pglabel.c


2020-04-30 08:33:48 +0100
Ken Sharp <ken.sharp@artifex.com>
2844006034232cb95fdd295d7fedf5fed8390a8e

PDF interpreter Ignore non-array Annots

Yet another customer file, so no bug report.

The supplied file is badly broken in several different ways. Most of
these Ghostscript already coped with but the file contains a new fault
we haven't seen before. The same object is referenced by different pages
once as a Font dictionary and once as an Annots array.

Since the object is actually a font dictionary, the page referencing it
as an array fails with an error, because it has the wrong type.

This commit simply ignores such errors and carries on, emitting the
usual warning. Its a little involved as there are several places where
we need to check the type of the object.

Resource/Init/pdf_main.ps


2020-04-28 14:49:14 +0100
Julian Smith <jules@op59.net>
45920485627a943f07eea0c5b1243b5eb540b498

clusterpush.pl: added excludes for mupdf's mupdfwrap.py.

Also add mudrawpy product.

toolbin/localcluster/clusterpush.pl


2020-04-27 11:04:57 +0100
Chris Liddell <chris.liddell@artifex.com>
1b4c3669a20cb2b63e49300b03082b189acfe347

Bug 702364: Fix missing echogs dependencies

contrib/contrib.mak


2020-04-27 10:36:11 +0100
Chris Liddell <chris.liddell@artifex.com>
9d2de2ee4c3858095d8dfb05cc7d113bf40d81c1

Rename devices/contrib.mak to devices/dcontrib.mak

because we also have contrib/contrib.mak

Makefile.in
base/unix-gcc.mak
base/winlib.mak
devices/dcontrib.mak
toolbin/headercompile.pl


2020-04-27 10:20:00 +0100
Chris Liddell <chris.liddell@artifex.com>
f210e4c009f7d401767336a264c2e4b9cf668216

Bug 702349: Fix symbol clash between lcms2mt and lcms2

Shared library (libgs) with lcms2mt could clash if the calling app also
included lcms2.

Using gcc (or compatible) this builds lcms2mt using the -fvisibility=hidden
option, so symbols are not exported.

Makefile.in
base/lcms2mt.mak
configure.ac


2020-04-23 18:23:17 -0700
Ray Johnston <ray.johnston@artifex.com>
7c96228899ea05b40cdb31dc5a4c3f61aa0d39e6

Fix Bug 702014: ps2epsi problems (regression?).

The ps2epsi and ps2epsi.ps were quite a mess, and relied on non-standard
operators only available with -dNOSAFER since we made SAFER the default.
Even running ps2epsi with -dNOSAFER (by export GS_OPTIONS=-dNOSAFER)
had problems -- it could not even convert examples/colorcir.ps to EPSI
(throwing an error about colorcirsave). Both of the aforementioned
files are replaced with this commit, and the ps2epsi.bat and ps2epsi.cmd
are updated to use the new ps2epsi.ps file

Also, input files with multiple pages were never correct since the preview
was derived only from the first page. The ps2epsi.ps checks if the file is
already an EPSF, then don't use eps2write on the input, but warn if the
%%Pages comment indicates that there is more than a single page.

Note that -dNOOUTERSAVE is needed in the invocation so that if we use
eps2write, the 'restore' will close the device and write the tempfile
with the EPSF.

Then ps2epsi.ps reads the input file, capturing the BBox, stops after
%%EndComments, removes any existing preview, constructs a new preview
using the 'bit' device with appropriate parameters, writes the preview
in the EPSI Preview format (using writehexstring) and then copies the
remainder of the EPSF file to the output.

The ps2epsi.ps has some checking for valid invocation, since someone
may try to use it without the scripts.

Since all of the actual conversion is done by the ps2epsi.ps, this change
makes windows and linux produce equivalent files.

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


2020-04-23 18:22:15 -0700
Ray Johnston <ray.johnston@artifex.com>
01b1eb1ef43952026ed8bf8728744522abfbfc19

Fix gssetgs.bat to use either 32 or 64 bit executables (64-bit preferred).

lib/gssetgs.bat


2020-04-24 14:13:54 +0100
Robin Watts <Robin.Watts@artifex.com>
f69f7a2c8b05c3f8a4e14d30453dcb599ca8b64d

Update msvc.mak to allow for new nmake version.

psi/msvc.mak


2020-04-23 11:42:57 +0100
Chris Liddell <chris.liddell@artifex.com>
6a46e31d5005cf136679ac7c54cb91d91654710d

Document that gsapi_set_stdio doesn't affect devices

Using -sOutputFile=%stdout (counterintuitively) does not direct device output
to the stdout handler callback set by gsapi_set_stdio().

doc/API.htm


2020-04-17 16:22:06 +0800
Sebastian Rasmussen <sebras@gmail.com>
60a535f9f49fece2761a1c0c8069f87f7514182c

Bug 702335: jbig2dec: Refill input buffer upon failure to parse segment header.

Before commit 2b2dcf4ccf401ed210f03c858b304994749fd2b3 there was
a debug message when attempting to parse a a segment header and
the data supplied to jbig2dec was not enough. Commit 2b2dcf4
incorrectly changed the debug message into a fatal error message,
due misinterpreting the message text as something that warranted
a fatal error.

When data was supplied in chunks to jbig2_data_in() in repeated
calls such that a segment header's referred-to segment numbers
field straddled a chunk boundary then jbig2dec would indicate a
fatal error. The file in bug 702335 caused this to happen.

Instead jbig2dec should be asking the caller for more data so
that the entire segment header can be parsed during a single call
to jbig2_data_in().

By convering the fatal error back to a a debug message the problem
is resolved. The message itself is also rewored to clearly
indicate that the situation is non-fatal and that the caller will
be asked to provide more data.

jbig2dec/jbig2_segment.c


2020-04-16 05:05:21 -0700
Robin Watts <Robin.Watts@artifex.com>
85b1119bb3493608b1e84acfaa7b27a6e5259b43

Fix URF filter configuration code.

I was missing some quoting.

configure.ac


2020-04-15 10:22:05 +0100
Ken Sharp <ken.sharp@artifex.com>
d845756b28a9cdadaf5374cc4fa130963ea65adc

PDF interpreter - reject insane Tc values early

No bug report, the file is from a customer and confidential.

The file has been created by a bfo.com product, but then additionally
modified by an unknown application. The problem is that the file
contains this sequence:

1 0 0 0.999999 21.6 9.900086 cm
/R3 9 Tf -2147483647 Tc -0.39301 Tw
4.8 -21.95 Td
[( )]TJ

The parameter supplied to Tc is clearly mad. Not invalid but it attempts
to move the current point (after drawing the space) by 2,147,483,647
unscaled text units. This works out at around 471 miles. Given that this
value is the maximum negative 32-bit integer (0xFFFFFFFF) I doubt this
is actually intentional.

The scaling by the CTM causes a limitcheck error when trying to draw
the text. We could fix this by running the TJ in a stopped context
but that would be expensive performance-wise because TJ is a very common
operator.

Instead this commit checks that the result of Tc, when scaled by the
CTM, will fit into our fixed-point representation. If it does not then
we throw an error there and then. The PDF interpreter then catches that
during the Tc operator (which is less commonly used than TJ) and emits
a warning, while ignoring the Tc value.

This may, of course, result in incorrect output, though it seems
unlikely given the size of the numbers involved, which is why we give
the user a warning.

Resource/Init/pdf_ops.ps
base/gsstate.c


2020-04-10 15:35:02 -0700
ray <Ray.Johnston@artifex.com>
b503c46c124cf5aaa82a71e28f624f2ef2b71e71

Bug 702320: Valgrind complains about UMR.

The file for this bug does show that the stroke_color stack based struct
in not initialized. Init fill_color and stroke_color. This is probably a
bug tail from the fill_stroke commit.

Also explicitly set 'zeros' to 0 to clarify the expected contents.

base/gxclbits.c
base/gxclrast.c


2020-04-10 18:04:14 +0100
Chris Liddell <chris.liddell@artifex.com>
1b08043d16bb10d939e858ea8d650807301d6e05

Remove some errant remains of Google analytics

The GA runes are now added by Apache when files are served from casper.

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/Internal.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


2020-04-10 11:11:15 +0100
Chris Liddell <chris.liddell@artifex.com>
8f52736b546329ae2e3ad760f722eac0dec6994e

Update/augment ETS source copyrights

base/ets.c
base/ets.h
base/ets_tm.h


2020-04-09 18:07:01 +0100
Chris Liddell <chris.liddell@artifex.com>
cbb82ba4baaa2a9da11c603d742a58a51c4e50e1

Update copyright to 2020

Resource/CIDFont/ArtifexBullet
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_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_init.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-impl.h
base/claptrap.c
base/claptrap.h
base/ctype_.h
base/dirent_.h
base/dos_.h
base/echogs.c
base/errno_.h
base/ets.h
base/ets_tm.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/gdevepo.c
base/gdevepo.h
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_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_winfs.c
base/gp_winfs2.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/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/gsdll.h
base/gsdllwin.h
base/gsdparam.c
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/gsftopts.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/gsgstate.h
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_lcms2mt.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/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/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/gximage3.c
base/gximage3.h
base/gximage4.c
base/gximask.c
base/gximask.h
base/gximdecode.c
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/lcms2mt.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/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/sfilter1.c
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/siscale_cal.c
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/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
contrib/gdevadmp.c
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/gdevchameleon.c
devices/gdevcif.c
devices/gdevclj.c
devices/gdevcljc.c
devices/gdevcmykog.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/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/gdevpdfimg.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/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Internal.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
gpdl/gpdl.mak
gpdl/jbig2top.c
gpdl/jp2ktop.c
gpdl/jpgtop.c
gpdl/pngtop.c
gpdl/psitop.c
gpdl/pspcl6_gcc.mak
gpdl/pspcl6_msvc.mak
gpdl/pwgtop.c
gpdl/tifftop.c
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.c
jbig2dec/jbig2_hufftab.h
jbig2dec/jbig2_image.c
jbig2dec/jbig2_image.h
jbig2dec/jbig2_image_pbm.c
jbig2dec/jbig2_image_png.c
jbig2dec/jbig2_image_rw.h
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_mmr.h
jbig2dec/jbig2_page.c
jbig2dec/jbig2_page.h
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_refinement.h
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_segment.h
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/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.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_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/pdf_info.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/viewmiff.ps
lib/viewpbm.ps
lib/viewpcx.ps
lib/viewps2a.ps
lib/viewraw.ps
lib/viewrgb.ps
lib/winmaps.ps
lib/zeroline.ps
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/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/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/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/psapi.c
psi/psapi.h
psi/psromfs.mak
psi/store.h
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/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/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/zht.c
psi/zht1.c
psi/zht2.c
psi/zht2.h
psi/zicc.c
psi/zicc.h
psi/zimage.c
psi/zimage3.c
psi/ziodev.c
psi/ziodev2.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/gen_ordered_main.c
toolbin/halftone/gen_stochastic/gen_stochastic.c
toolbin/headers.tcl
toolbin/jpxtopdf.c
toolbin/leaks.tcl
toolbin/makehist.tcl
toolbin/memory.py
toolbin/ocheck.py
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


2020-04-09 09:40:05 +0100
Chris Liddell <chris.liddell@artifex.com>
87688cd48fb52c305e159b785bd184232426a766

Bug 702322: fix uninitalized data reads

gs_scan_token() keeps a local copy of the scanner state, and copies from and to
the scanner state that is passed into it. There are several code paths that
can leave some important entries in the structure uninitalized when we copy the
local copy to the parameter.

This just ensures those specific entries are always set to *something* sane.

psi/iscan.c


2020-04-09 09:07:38 +0100
Chris Liddell <chris.liddell@artifex.com>
c96962212ed44463b3bd5cf34f3f790e9d14cd0b

Clarify path matching for SAFER controls

Make it explicit that the 'form' of the paths (e.g. absolute vs relative) must
match between --permit-file-* paramters and the actual path used to reference
the file

doc/Use.htm


2020-04-08 16:06:44 +0100
Ken Sharp <ken.sharp@artifex.com>
ebabebad34a3811230b7bfe351eface7f5efc8a9

PostScript interpreter - don't leave A85Decode pdf_rules uninitialised

Bug #702319 "Read of uninitialized value according to valgrind..."

There are a number of other bugs which relate to this particular problem:
690976, 692983 and 693485. The problem has come about as a cumulative
result of working on these bugs.

Starting with commit :
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=e0ecca32ecd12dae3310fac4b65dc224031c85a2
for bug 690976 a new flag 'pdf_rules' was added to the Ascii85Decode
state. This is initialised from the dictionary operand in PostScript
by zA85D() in zfdecode.c. When this flag is true the ASCII85Decode
filter will silently accept just '~' as a valid termination for a string
(should be '~>').

However this is not the only way to initialise an Ascii85Decode filter,
the PostScript token scanner can also use s_A85D_init_inline() which
does not initialise the flag. From this point we have the potential
for testing an unitialised variable in s_A85D_process(), if we get an
encoded string which terminates with a '~' and the filter was
instantiated from PostScript.

When fixing bug 692983, this commit:
http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=d561224d1495321d40012230abbcf835b298f557

Alex specifically added a comment that pdf_rules must not be initialised
in s_A85D_init_inline() but didn't say why! The reason is that the
regular stream initialisation code (s_A85D-init) also uses this inline
function, so if it altered pdf_rules it would overwrite the value
previously set by zA85D().

Since the initialisation is done in two places, the only way to fix this
is to initialise pdf_rules in gs_scan_token() which this commit duly
does. I've also added comments in s_A85D_init_inline to explain more
clearly *why* pdf_rules must not be initialised here.

base/sa85d.h
psi/iscan.c


2020-03-31 08:26:37 -0700
Ray Johnston <ray.johnston@artifex.com>
668917a10e7eada030f7d2dddec9f579fddeed3d

Change MaxLocalVM and MaxGlobalVM to be size_t instead of 'long'

The sizeof long differs between 64-bit Windows and linux, and
Robin changed the Max values for other params to be size_t in
commit d7961033. This change extends that to the other memory
size related params.

Also fix vm_threshold to be int64_t, not size_t since that
corresponds to the parameter setting in zusparam.c. This is
also limited to the max signed value that corresponds to
size_t (MAX_VM_THRESHOLD) in case size_t is < 64 bits.

base/gsalloc.c
base/gsalloc.h
base/std.h
psi/ireclaim.c
psi/ivmem2.h
psi/zusparam.c
psi/zvmem2.c


2020-04-05 12:24:36 +0800
Sebastian Rasmussen <sebras@gmail.com>
d8ed6363166841dcb067d7adc6ad6b52a1b1f90c

jbig2dec: Initiate variable before avoids using uninited data during cleanup.

Fixes OSS-fuzz issue 21571.
Also fixes Coverity CID 355467.

Thanks to OSS-fuzz for reporting.

jbig2dec/jbig2_text.c


2020-03-27 05:41:07 +0800
Sebastian Rasmussen <sebras@gmail.com>
dc6b8098b52db7e1a9b20c1ef6f1006555c04b1b

jbig2dec: Adjust number of bytes consumed by MMR decoder.

The MMR decoder pre-buffers up to 32 bits of encoded input data in a word
buffer before they are consumed by the MMR decoder. Once bits are consumed, the
pre-buffer will be filled up with more input data. When filling up the buffer
the decoder would previously stay clear of reading data belonging to succeeding
segments, but still indicated that it consumed those bytes it never read. Once
finished the MMR decoder lied to the caller by propagating the incorrect number
of consumed bytes. The caller subtracted the consumed number of bytes from the
size and end up in underflow causing the next MMR decoding to first read input
data at the wrong location, later ending up attempting to read outside the MMR
encoded input buffer.

Now, the MMR decoder keeps track of how many bits it has consumed and
accurately rounds this number up to a whole number of bytes to the caller.

Fixes OSS-fuzz issue 17855.

Thanks to OSS-fuzz for reporting.

jbig2dec/jbig2_mmr.c


2020-03-26 14:20:11 +0800
Sebastian Rasmussen <sebras@gmail.com>
f14f35c6e3218554cd351b848447cfa83b3c4256

jbig2dec: Plug leak of image upon error.

Fixes OSS-Fuzz issue 17513.

Thanks to OSS-fuzz for reporting.

jbig2dec/jbig2_text.c


2020-03-25 01:12:52 +0800
Sebastian Rasmussen <sebras@gmail.com>
d293095a593f7106e16027fb9782324ee7bb36f8

jbig2dec: Need to store local copy of error message.

jbig2dec/jbig2dec.c


2020-04-02 13:06:06 +0100
Ken Sharp <ken.sharp@artifex.com>
6728387b7f4b803ea5a26eb220ce24e4ff65e710

PDF interpreter - Fix incorrect CIDFontType2 with Type1C descendants

Customer bug report. The file contains a CIDFont declared like this:

16 0 obj
<<
...
/Subtype /CIDFontType2
...
>>

The /Subtype /CIDFontType2 means that the font is a CIDFont with
TrueType outlines. However the actual font:

10 0 obj
<<
/Subtype /Type1C
/Length 49432
/Length1 49432
>>

is a Type1C (Compact Font Format) font. The PDF file is, quite simply,
incorrect. The Subtype should be /CIDFontType0. Interestingly we already
have code in the CIDFontType2 case to handle an incorrect value of
Subtype being set to /CIDFontType0 so this is the reverse case.

If we discover we are reading a Type1C font, and the parent is a CIDFont
with a Subtype of CIDFontType2, then change the parent dictionary to
have a Subtype of /CIDFOntType0C and read the font as a CIDFont.

Resource/Init/pdf_font.ps


2020-04-01 19:48:03 +0100
Robin Watts <Robin.Watts@artifex.com>
1c363593d7880b305e5da0cae8964bf090af3e61

Speed up gx_get_bits_std_to_native.

We don't need to fetch the color_mapping_procs for every pixel;
just once will do.

base/gdevdgbr.c


2020-04-01 14:27:33 -0700
Michael Vrhel <michael.vrhel@artifex.com>
85225cda5e2b2d557942c6ff13887e418eccb6cc

Remove pgs->alpha

The alpha value in the graphic state is not used and will
only lead to confusion for people working on transparency.

base/gdevp14.c
base/gsalpha.c
base/gsalpha.h
base/gsstate.c
base/gxclpath.c
base/gxcmap.c
base/gxgstate.h
base/lib.mak
windows/ghostscript.vcxproj
windows/ghostscript.vcxproj.filters


2020-03-31 15:17:40 +0100
Robin Watts <Robin.Watts@artifex.com>
295bcef3b977c12885e30fdbae326f63d0771caa

Squash 'set but unused' warning in gdevcups.

cups/gdevcups.c


2020-03-31 14:59:04 +0100
Robin Watts <Robin.Watts@artifex.com>
a32c6fdce5fab7d5918d02d30a4cf6696af58db3

Squash some compiler warnings.

base/gsicc_cache.c
base/gsptype1.c


2020-03-31 13:00:40 +0100
Robin Watts <Robin.Watts@artifex.com>
4dd43e9ca448777bbd585ef3ce97e9cf593f395d

Coverity 355259: Avoid "Failure to restore" warning from coverity.

Coverity complains that pgs->fillconstantalpha isn't restored
before the file exits. While we're not too fussed about what
happens to it in an error condition, simply hoisting a couple
of lines up a bit solves the problem and should shut it up.

base/gdevp14.c


2020-03-30 19:01:10 +0100
Chris Liddell <chris.liddell@artifex.com>
32805b5689be664f9b76502669775baa53f55677

Redefine deprecated .setopacityalpha and .setshapealpha

.setopacityalpha and .setshapealpha have been replaced with
.setfillconstantalpha/.setstrokeconstantalpha and .setalphaisshape, operators
which actually do what PDF requires.

As an interim measure, to allow users that rely on these operators some time
to adjust, define versions of .setopacityalpha and .setshapealpha which
approximate what the old implementations did.

As with the rest of the transparency operators they only exist when gs is
given the -dALLOWPSTRANSPARENCY option. Also, they are in pdf_main.ps just so
they grouped in proximity to where the rest of the ALLOWPSTRANSPARENCY logic is
implemented.

Resource/Init/pdf_main.ps


2020-03-30 09:59:23 +0100
Chris Liddell <chris.liddell@artifex.com>
3ff82b33f24ed54c2d3bb88ec31da7d2f9fd2765

Fail configure with unsupported shared tiff/jpeg combo

With the changes to support consuming the various TIFF input forms, we cannot
support all combinations of mixing share and local libtiff and libjpeg.

For simplicity just reject mixing those configs.

configure.ac


2020-03-25 14:00:55 +0000
Chris Liddell <chris.liddell@artifex.com>
6756b355c238c319fe66087dece15174e62f9f15

Fix shared libtiff and libjpeg build

When building with shared libs, we should not try to include our custom libjpeg
memory management context into the TIFF reader implementation context.

gpdl/gpdl.mak
gpdl/tifftop.c


2020-03-30 14:47:25 -0700
Michael Vrhel <michael.vrhel@artifex.com>
b8bda01581b94e9159533460cfe79436f4d5ac21

Coverity 94826 Add missing offset to buffer size used for clist cmd.

base/gxclpath.c


2020-03-29 15:32:36 -0700
Ray Johnston <ray.johnston@artifex.com>
b09cbe8e577fb14504932dc8d9096187ec4e0840

Fix infinite loop in PDF interpreter 'pagespotcolors' procedure

The file tests_private/pdf/uploads/poc1_pdf_gs.pdf has the single page
Parent object as itself. This only showed up with "DeviceN" devices that
search the PDF for the number of spot colorants on the page.

Note that this file is broken in other respects since it has a /Count
of 9 pages, but only a single page. This change also adds handling for
the //null object returned when a page isn't found since there isn't
actually a second page, and adds an error message when this is the case.

Resource/Init/pdf_main.ps


2020-03-30 12:24:45 -0700
Michael Vrhel <michael.vrhel@artifex.com>
4dde07159da5786570ad4f8d2b7b3c0b828802ab

Coverity 141130 Initialize shape and alpha of group for image.

base/gdevp14.c


2020-03-30 19:51:57 +0100
Robin Watts <Robin.Watts@artifex.com>
baa1a80f7824e26fb31f5f5f782980518b6cbfd9

Coverity 355259: Fix precedence of assignment/comparison.

This was leading to code being thought of as being unreachable.

base/gxstroke.c


2020-03-30 10:45:25 -0700
Michael Vrhel <michael.vrhel@artifex.com>
22a31bda026deb8e3748f25bc2cf3b46263e689c

Update doc to deprecate transparency PS methods

doc/Language.htm


2020-03-27 13:54:02 -0700
Ray Johnston <ray.johnston@artifex.com>
6a3c36f8c5e83448f5d1e5f24ee01c0e80a92877

Fix Bug 702177: VMerrors with some BufferSpace and/or -K limits.

Interestingly, the two examples given in the bug succeed on Windows 64
but don't on linux. The difference is due to an 8 byte difference in the
size of gx_clist_state (the per band writer state). In the case of the
Bug690546.pdf file, the space left in the BufferSpace area after the
logic increased it was only 2,200 bytes on linux, but was 12k bytes on
Windows (it made an extra pass through the automatic "increase space"
loop in gdev_prn_setup_as_command_list. Fix the calculation in
clist_init_states so that the amount of extra space corresponds to the
amount expected by clist command writing (data_bits_size + cmd_largest_size)
rather than the insufficient and arbitrary "100".

Note that although the Bug692057.pdf returned VMerror from cmd_put_list_op, the
'fallback; method of gx_default_strip_tile_rectangle still produces the SAME
raster from psdcmyk16 and does not change the performance or clist file size
Robin's commit cbee0840 fixed this case.

base/gxclist.c


2020-03-27 14:46:05 -0700
Michael Vrhel <michael.vrhel@artifex.com>
d12d2085b5bd08ca1e813d97f3f7f7e630e791a0

Squashed commit of the opacity_shape branch

This commit removes shape.alpha and opacity.alpha from the
graphic state. This involved removal of methods in the
postscript based PDF interpreter, changes in the pdf14 device,
changes in pdfwrite, the XPS interpreter, and the PS
transparency test file that is present in examples and on
the cluster. The goal of this commit was to avoid
confusion and conflicts between shape.alpha opacity.alpha and
the stroke and fill alpha values (CA ca). This change
resulted in progressions in the XPS file. There were changes
in a couple PDF files that required some investigation. In
particular, the change in the dashed lines of Bug694981.pdf. Robin
and I looked at this. Robin determined it was due to
differences in stroke_add and stroke_fill not giving identical results.
In the end, the new output looks closer the what AR provides.

Resource/Init/pdf_draw.ps
Resource/Init/pdf_main.ps
Resource/Init/pdf_ops.ps
base/gdevp14.c
base/gdevp14.h
base/gstparam.h
base/gstrans.c
base/gstrans.h
base/gxblend.c
base/gxclimag.c
base/gxclpath.c
base/gxclpath.h
base/gxclrast.c
base/gxgstate.h
devices/vector/gdevpdft.c
examples/transparency_example.ps
psi/ztrans.c
xps/xpscolor.c
xps/xpsgradient.c
xps/xpsimage.c
xps/xpsopacity.c
xps/xpspath.c
xps/xpstile.c


2020-03-27 15:28:22 +0000
Ken Sharp <ken.sharp@artifex.com>
1241ea6848d254de9a9dbcb8c8edf10a59761d1d

PDF interpreter - cope with Form XObjects leaving junk on the stack

No bug report, customer supplied file. The file has a Form XObject
where the stream ends:

/Image20 Do Q
EMC Tendstream

which is clearly invalid. This leaves a T lying around which gets
converted to a name and remains on the stack. When we come to complete
the form processing we expect that the stack will be clean, because it
isn't we end up corrupting an internal variable, which causes the
*next* Form XObject to fail.

We cope with this here by adding code to check the objects on the stack
and remove them one by one until we get back to a dictionary which
contains a name we expect to find (because we pushed it on entry to the
procedure) or run out of stack objects in which case we will throw an
error.

Resource/Init/pdf_draw.ps


2020-03-26 19:50:51 +0000
Robin Watts <Robin.Watts@artifex.com>
f3e37d28f6a76cb7cfc2a291aeb98b8f1c6ba178

Add murun to the list of products for clusterpush.pl

toolbin/localcluster/clusterpush.pl


2020-03-26 07:21:57 -0700
Ray Johnston <ray.johnston@artifex.com>
3df1313a6ef334d9c6da2fcd78347fb5eb7a3859

Fix CID 355224. Non-zero return code not possible, but Coverity doesn't get it.

base/gsptype1.c


2020-03-24 10:15:39 +0000
Robin Watts <Robin.Watts@artifex.com>
748b5c3c86779dc0cf4ccc144530cf37f692375e

Rejig "fast" stroking of miter joins.

This spins out of Bug 702196, though it's not strictly speaking
related. Bug 702196 deals with lines being incorrectly recognised
as being "thin". Thin lines aren't mitred. When we fix the
erroneous classification of lines as thin, this causes more
lines to be mitre joined than before. This in turn exposes
the bug that we (partially) fix here.

gs -sDEVICE=pdfwrite -o out.pdf tests_private/ps/ps3cet/11-28.PS

gs -sDEVICE=png16m -o out%d.png -r300 -dMaxBitmap=2G out.pdf

Page 4 of the output shows strange mitre extrusions from the edge
of paths.

Investigation shows the file is 'strokepath'ing the path (with
mitre joins), and the stroking the resultant path (again with
mitre joins). The initial 'strokepath' conversion includes little
"wedges" of path internally to give the "underjoin" in the path.
When restroked, due to the mitre join still being set, these
wedges turn into spikes.

The fix, implemented here, is to revise the way we do mitre joins.
For paths stroked using the "fast" code, with miter joins, we
perform slightly more complicated calculations at each join. This
allows us to do the joins by moving the existing points of the
paths 'inline'. This removes the need for the 'wedges', and
actually gives us a much cleaner path overall.

This *should* help with pathological scan conversion cases too,
because it means we will have fewer 'sleepers' in the 'train
tracks' when strokepath is used.

This may not kick in in all cases where we'd like it to, because
for some files, we use 'traditional' stroking, and so don't
execute this code. One way around this would be to change
gs_strokepath to disable 'traditional' filling in the presence
of mitre joins, but that produces strange effects, so we're
leaving it for now.

base/gxstroke.c


2020-03-18 15:11:01 +0000
Robin Watts <Robin.Watts@artifex.com>
9dc0eb31d79bf819c97420aaf2f6fc5cf3a52c10

Bug 702196: Fix incorrect detection of "thin" lines while stroking.

When stroking lines, we spot whether a line is 'thin' (i.e. the
perpendicular width of the line is less than 1 pixel), and handle
those cases specially by using custom 'thin line' routines. This
gives more pleasing results than slavishly following the 'any part
of a pixel' rule.

The current code makes this determination in 2 places. Firstly,
we calculate 'always_thin', by scaling the perpendicular vector
and seeing if all possible lines will be 'thin'. Secondly, in
the case when we aren't 'always_thin', we calculate it for each
line segment in turn by calling 'width_is_thin'.

Unfortunately, the threshold used for the simple early rejection
test in 'width_is_thin' is wrong. Rather than checking against
0.5, we should be checking against sqrt(1/8). This causes lines
near 45 degrees to be improperly treated as thin. This is a
simple fix.

This gives lots of progressions - so many that you wonder how we
never spotted this before.

Unfortunately, buried in these progressions, there are a few files
which, while improved, are still imperfect.

In some files, that use 'non-uniform' scales, (such as
(53 0 0 21 0 0 )) a stroke of constant width can 'pop' between
thick and thin as we move around the path; a near vertical
line segment may be thin, whereas a near horizontal line segment
might be thick due to the difference in scale. This is visually
jarring.

To fix this, therefore, we'd need to modify the width_is_thin
testing in non-uniform cases, so that it gives us the same results
all the way around. Doing this would be complex, and ultimately
actually ends up equivalent to us just relying on "always_thin"
(with the exception of strictly vertical and horizontal line
segements). We therefore disable the non-orthogonal test in
'width_is_thin' entirely.

base/gxstroke.c


2020-03-24 16:49:13 -0700
ray <Ray.Johnston@artifex.com>
d49dbf133ac49d09d626bab08ee92835a50a646a

Fix bug 702182: VMerror due to leaks in pattern cache due to locking.

If the tile being loaded by the clist reader was already in the cache and
was locked, the slot would be re-loaded (with the same tile) without freeing
up the previously loaded tile. It would be nicer to be able to skip reading
the tile in this case, but we need to consume the data from the clist sequence,
so just unlock it so it can be freed, then re-load it (presumably setting the
lock again).

base/gsptype1.c


2020-03-24 18:09:16 +0000
Chris Liddell <chris.liddell@artifex.com>
1258814b0532f06217cbfaffc5254c9645f69b42

Don't delete copied libjpeg source files after use

For reasons I'm not totally convinced are still valid, we copy the libpeg source
files into the build directory (normally 'obj') and compile them from there,
then delete them.

This apparently causes problems with oss-fuzz coverage builds, and it also makes
debugging a pain, because the source files don't exist where the debug info
thinks they should.

base/jpeg.mak


2020-03-24 15:22:01 +0000
Chris Liddell <chris.liddell@artifex.com>
0ec0004cb9366002dbd97f40c32d8da6d33c1904

Remove unused base/gsalphac.[ch]

This was the compositing device used for Display Postscript/NeXT specific
alpha blending. Since we haven't supported DPS properly for many years, and
officially dropped it completely a couple of years ago, and this compositing
device has not been included in the build for several years....

....just delete the files and remove references to them.

base/gsalphac.c
base/gsalphac.h
doc/Develop.htm
windows/ghostscript.vcproj
windows/ghostscript.vcxproj
windows/ghostscript.vcxproj.filters
windows/ghostscript_rt.vcxproj


2020-03-24 15:19:23 +0000
Chris Liddell <chris.liddell@artifex.com>
1c9bd8e0aa41e69c4bd46a6c553320d97af1ce7c

Disable PPC optimisations in libpng

Since we don't include the libpng source file with the PowerPC optimizations
in our build, and it only applies to reading, which we don't rely on, just
disable calling the optimizations.

Cures a linker error on PowerPCle platforms

configure.ac


2020-03-23 15:27:37 -0700
ray <Ray.Johnston@artifex.com>
cca279886b3bbb4d3af5768880565c9f7b372c08

Fix Bug 702181: SEGV when BufferSpace is at or above -K alloc limit

The issue with this file is that one of the pages is done in page mode because
it was so small, but the 'resize' call when doing page 2 was not checking the
allocation request against the limit, so the malloc would succeed, but the very
next (and all subsequent) allocations would fail. The gdev_prn_allocate would
capture the ecode, but would still call the clist_enable_multi_thread_render
resulting in the SEGV.

Add the check in the gs_heap_resize_object function, and make sure and leave
the 'monitor' after failure, then don't call clist_enable_multi_thread if the
resize failed.

base/gdevprn.c
base/gsmalloc.c


2020-03-20 10:26:17 +0000
Chris Liddell <chris.liddell@artifex.com>
886347337de7e121e3e1ffa348aa74856c8290ed

Bug 702190: Set CFLAGS and CFLAGSAUX separately in Makefile

Building with -DGS_NO_FILESYSTEM allows support for environment without a
proper file system, by stubbing out the gp_ calls that would normally access
the file system.

Obviously, for Ghostscript to function, that means it requires its resource
and initialisation files to be built into the binary in the ROMFS.

A problem arises if you include the -DGS_NO_FILESYSTEM CFLAG when building the
mkromfs utility, which creates the ROMFS, since denying it access to the file
system results in an empty ROMFS. Previously, setting CFLAGS to include
-DGS_NO_FILESYSTEM when calling configure resulted in that flag being applied to
the main build, and the auxiliary tools build (including mkromfs), unless the
build specified was a cross-compilation.

This splits the CFLAGS and CFLAGSAUX so they are set separately in the Makefile
so configure can filter out unwanted flags from the auxtools flags.

Currently, the only one being filtered is -DGS_NO_FILESYSTEM

Makefile.in
configure.ac


2020-03-19 16:19:57 +0000
Chris Liddell <chris.liddell@artifex.com>
7710a398e132e13f9e0ff2f83188cbe7d2b59b1f

Bug 702115: use the offical method to detect gcc

In the early days of autoconf there was no defined way to check if the selected
compiler was gcc (or compatible) or not. Projects used the autoconf internal
shell variable ac_cv_prog_gcc to get that info.

autoconf introduced the GCC shell variable as the official way to know (a long
time ago), and we never revised our configure.ac to reflect that.

This does so.

configure.ac


2020-03-19 16:12:46 +0000
Chris Liddell <chris.liddell@artifex.com>
66c2469c7d4543f32d6dc93edf1d649e809b8419

Remove deprecated opvp/oprp devices from default build

They can currently be reinstated with --with-openprinting

That option does not appear in the --help output because we want people to have
to ask us about it, so we know if people actually use opvp/oprp, and still
need them.

configure.ac


2020-03-23 09:07:36 +0000
Chris Liddell <chris.liddell@artifex.com>
fedfb0e00755d9529d15751650864d304708f0e1

Remove analytics stuff.

Analytics and cookie stuff will be added at serve time by Apache.

See /etc/apache2/sites-available/ghostscript.com-le-ssl.conf for more info

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/Internal.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


2020-03-21 18:08:43 +0800
Sebastian Rasmussen <sebras@gmail.com>
d98ab1f82e64e11db6478c4ff3e3bcffcc69836e

jbig2dec: Cast literal to avoid shifting outside of valid range.

Fixes Coverity CID 355175.

jbig2dec/jbig2_arith_iaid.c


2020-03-21 16:49:33 +0800
Sebastian Rasmussen <sebras@gmail.com>
1677b6c0d7b090ad7691e766d4809f9badeecd20

jbig2dec: Record stream errors in separate struct field.

Previously the number of remaining bytes in a read word (>= 0) and the error
state (< 0) was stored in the same int field. Fixing signedness conversion
warnings changed the type of the field to an unsigned field. The error state
should have been stored separately at that time but it was overlooked. In this
commit the error state is separated out into its own field.

Fixes Coverity CID 355176.

jbig2dec/jbig2_arith.c


2020-03-21 15:59:21 +0800
Sebastian Rasmussen <sebras@gmail.com>
a80f7f12e7a2fb0caa1ea9ac6fa8981cc539a1bc

jbig2dec: Use correct define for maxium value of type.

Fixes Coverity CID 355177.

jbig2dec/jbig2_page.c


2020-03-21 16:20:28 +0800
Sebastian Rasmussen <sebras@gmail.com>
4f0c17451afb66e6fcf3bd453490b4b9d2b06b42

jbig2dec: Fix two overlooked warnings.

While working to fix all warnings seen when -Wsign-conversion is
enabled, these two warnings were accidentally introduced by commit
ff53af0d4ff9291aa5039522f5553a2850dd569d and not noticed in the
avalanche of warnings emitted due to -Wsign-conversion. This commit
changes the indicies to the type of the limit variable, fixing the
warnings.

jbig2dec/jbig2_page.c


2020-03-21 10:00:42 +0000
Ken Sharp <ken.sharp@artifex.com>
a45d7217c8c1578475ee9204d1f4ad46520f44d1

PDF interpreter - swallow errors reading ICC profiles and continue

Bug #702240 "Invalid ICC profile aborts PDF ineterpretation"

The file contains an ICCbased space which references an embedded ICC
profile, which is Flate compressed. The compressed stream has been
corrupted and cannot be decompressed.

This causes the colour space code to throw an ioerror and terminate
interpretation, Acrobat (as usual) doesn't even give a warning.

This commit checks for an error creating the ReusableStreamDecode and
if it fails sets the Data Source in the stream dictionary to null. We
will later use the /N value in the stream dictionary to set a reasonable
fallback space (in this case CMYK).

Resource/Init/pdf_draw.ps


2020-03-12 02:54:08 +0800
Sebastian Rasmussen <sebras@gmail.com>
9b2fc96b3ffc1c9d3d39b3d0ce27bf8abba7b8cf

jbig2dec: Fix signedness conversions.

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


2020-03-12 00:27:13 +0800
Sebastian Rasmussen <sebras@gmail.com>
f2613ed2159e8efc6b5b593e668a00d8bea9ace8

jbig2dec: Use uint32_t when counting segments.

jbig2dec/jbig2.c
jbig2dec/jbig2_priv.h


2020-03-12 00:26:59 +0800
Sebastian Rasmussen <sebras@gmail.com>
ff53af0d4ff9291aa5039522f5553a2850dd569d

jbig2dec: Always use uint32_t when counting pages.

jbig2dec/jbig2.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h


2020-03-11 20:56:06 +0800
Sebastian Rasmussen <sebras@gmail.com>
6073e803bd652cd8fdb17f6be6beea05a13fd4f0

jbig2dec: Handle errors from reading jbig2 streams.

jbig2dec/jbig2dec.c


2020-03-11 20:55:51 +0800
Sebastian Rasmussen <sebras@gmail.com>
1e9b5185c889266c9a3d6f25c9df558d41335d46

jbig2dec: Use size_t for string length.

jbig2dec/jbig2dec.c


2020-03-11 18:42:26 +0800
Sebastian Rasmussen <sebras@gmail.com>
dc3f780ee3c9e43f34ba1c0b1101b41c58b40710

jbig2dec: Avoid formatting error messages twice in error callback.

jbig2dec/jbig2dec.c


2020-03-11 16:35:53 +0800
Sebastian Rasmussen <sebras@gmail.com>
9b5008aa2bc1c6a6acb2c6f90d1ef8d6bad9e66a

jbig2dec: Pass segment numbers as unsigned values to error callback.

According to the JBIG2 specification segments numbers are 32 bit unsigned
integer. Previously any segment numbers larger than INT32_MAX would be passed
as negative numbers.

Some parts of the decoder do not yet know, or do not have access to the
currently decoded segment number, and this needs to be specially indicated.
Therefore jbig2dec appropriates the unlikely segment number 0xffffffff to
indicate an unknown segment number.

This is a change of the public API.

base/sjbig2.c
gpdl/jbig2top.c
jbig2dec/jbig2.c
jbig2dec/jbig2.h
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_image.c
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2dec.c


2019-10-17 01:48:00 +0200
Sebastian Rasmussen <sebras@gmail.com>
ea9b3a676a516a603fabb593085d14a67356db6f

Bug 701721: jbig2dec: Fix under/overflow handling in arithmetic integer decoder.

The previous detection logic caused GCC's -Wlogical-op to trip.
Not only that, but the detection logic never took into account
that underflow is not possible (the worst case is V == INT32_MIN,
but offset is always > 0, so underflow cannot happen), nor take
varying offset values into account (hardcoded limits meant that
the offset was ignored even if it could not cause an overflow),
but instead could cause non-clamped values to be emitted.

This corrected logic adheres to the Annex A. Table A.1 in the specification.

jbig2dec/jbig2_arith_int.c


2019-10-01 18:08:34 +0200
Sebastian Rasmussen <sebras@gmail.com>
92faea67b31570e84b978a77b43c8f38bdad7bd4

jbig2dec: Avoid warning by copying bytes instead of characters.

jbig2dec/jbig2dec.c


2019-09-29 17:10:00 +0200
Sebastian Rasmussen <sebras@gmail.com>
f20fc43d80e31780935be96393800cc1fac8ac50

jbig2dec: Enable warnings for signedness in comparisons.

jbig2dec/configure.ac.in


2019-09-29 12:09:40 +0200
Sebastian Rasmussen <sebras@gmail.com>
5947fb2f1c022982e82406639517ebacae8d5cf6

jbig2dec: Address all signedness comparison issues.

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


2019-09-29 12:09:22 +0200
Sebastian Rasmussen <sebras@gmail.com>
9394be6a45aea026f61900e1cb661a30db192c15

jbig2dec: Remove trailing whitespace.

jbig2dec/CHANGES
jbig2dec/autogen.sh
jbig2dec/configure.ac.in
jbig2dec/msvc.mak


2019-09-29 16:26:53 +0200
Sebastian Rasmussen <sebras@gmail.com>
1899ce3f1844cf941d19c38fc8de8f126bf7419d

jbig2dec: Avoid passing NULL buffer to snprintf().

jbig2dec/jbig2dec.c


2019-09-15 17:07:27 +0200
Sebastian Rasmussen <sebras@gmail.com>
4239ceeb4dd39e2ac183a01877b62761ae13bae4

jbig2dec: Avoid artificially limiting jbig2dec.

Commit 7366747076f3b75def52079bd4d5021539a16394 fixes bug 694949 by
adding an artificial limit (that does not come from the JBIG2
specification) to the sizes of generic regions compared with the image
they will be composed onto. A problem with such artificial limits is
that they are arbitrary. This is exemplified by the changes in
0d21a58ab12b9584faa54baa48ce0dab350af53e to make jbig2dec not error
out on commonly occurring images. It is impossible to know whether
this updated limit is enough, or whether an even large generic region
in a JBIG2 image will be found in the future.

Instead of imposing these kinds of limits, jbig2dec should attempt to
decode any JBIG2 image given to it. If the user wants to limit the
amount of memory jbig2dec may use for decoding any JBIG2 image, this
is a better way of implicitly limiting image sizes.

jbig2dec/configure.ac.in
jbig2dec/jbig2_generic.c
jbig2dec/snprintf.c


2019-09-15 19:01:05 +0200
Sebastian Rasmussen <sebras@gmail.com>
cd1ef5475a3bda7a97851abc679c75e2ee64dec3

Bug 702165: jbig2dec: Treat end of stream as fatal error, and remember errors.

* Treat reading beyond end of stream in arithmetic decoder as a fatal error.

* Remember previously encountered stream errors in arithmetic decoder.

* Ignore trailing bytes after terminating marker code in stream.

jbig2dec/jbig2_arith.c
jbig2dec/jbig2_huffman.c


2019-09-15 18:12:31 +0200
Sebastian Rasmussen <sebras@gmail.com>
30842ee99923fa10a7301494fd08b998e7acf57b

jbig2dec: Add overflow detection for IAID context size.

jbig2dec/jbig2_arith_iaid.c


2019-09-15 17:58:40 +0200
Sebastian Rasmussen <sebras@gmail.com>
17e84cb1a4903fab26b5fc5d2e4805a1097f5a33

jbig2dec: Let arithmetic decoder and the underlying stream report errors.

When a called function indicates an error, the caller should print warnings.
Since the arithmetic decoder now uses the normal way of reporting errors,
the callers of the decoder are changed to report warnings.

jbig2dec/jbig2.c
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith.h
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_refinement.c


2019-09-15 17:31:48 +0200
Sebastian Rasmussen <sebras@gmail.com>
716560bf5f2bc4b821ca6924ec648ca4949826bb

jbig2dec: Handle under-/overflow detection and messaging better.

Previously SYMWIDTH was capped too early in order to prevent underflow
Moreover TOTWIDTH was allowed to overflow.

Now the value DW is checked compared to SYMWIDTH, preventing over
underflow and overflow at the correct limits, and an overflow
check has been added for TOTWIDTH.

jbig2dec/jbig2_symbol_dict.c


2020-03-16 22:56:06 +0800
Sebastian Rasmussen <sebras@gmail.com>
cf43daf9f8381a9accf36d12bad2324d021ec8c6

jbig2dec: Use unsigned suffix when defining UINT32_MAX.

Also move UINT32_MAX/INT32_MAX to internal header so they are defined
(the same) in every jbig2 source code file.

jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_image.c
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_segment.c


2019-09-15 17:19:12 +0200
Sebastian Rasmussen <sebras@gmail.com>
a47257407ee8938051f14da81890869a5ade0c26

jbig2dec: Keep type of index and array length the same.

jbig2dec/jbig2_symbol_dict.c


2019-09-15 16:57:23 +0200
Sebastian Rasmussen <sebras@gmail.com>
b610aebdd36d939a878e336c255c734b4432e023

jbig2dec: Add more references to specification.

jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_symbol_dict.c


2019-09-15 15:52:26 +0200
Sebastian Rasmussen <sebras@gmail.com>
d4dc797e4a65871134f6a244cb8421a33fe91360

jbig2dec: Add command line option to limit memory usage.

jbig2dec/jbig2dec.c


2019-09-15 15:52:06 +0200
Sebastian Rasmussen <sebras@gmail.com>
a64ec1a232aa675e75d71da2632c6fca9a7fddcf

jbig2dec: Mention all long options in usage and manpage.

jbig2dec/jbig2dec.1
jbig2dec/jbig2dec.c


2019-09-15 15:45:47 +0200
Sebastian Rasmussen <sebras@gmail.com>
3f01ab3739773db83040d8c2a7c3562b9103ed4e

jbig2dec: Separate command line tool error callback state from parameters.

jbig2dec/jbig2dec.c


2020-03-05 03:31:43 +0800
Sebastian Rasmussen <sebras@gmail.com>
e4dd74c63031c705b3b6938fdac6b69e6317f00a

Propagate errors when closing pipe.

base/gdevpipe.c


2020-03-17 15:52:20 +0000
Chris Liddell <chris.liddell@artifex.com>
97ad9c044a1d3f87b16b2be754e088e49cc1f398

Bring master up to date 9.52 release branch

Add references to the 64 bit windows exes

Release notes for 9.52 release

Version, dates etc for 9.52 release

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/Internal.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


2020-03-19 08:12:38 +0000
Chris Liddell <chris.liddell@artifex.com>
c126cabcc5760aec6458b97729c78c821e24d122

Bump version prior to 9.52 release

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


2020-03-18 10:40:39 +0000
Robin Watts <Robin.Watts@artifex.com>
7ba3000d394406331c8e49c87e1d6494887c4e98

CID: 355082. Fix comparison of size_t < 0.

Now we're using param_read_size_t, we no longer need to check
for the returned value being < 0. This check is pickled into
the coertion code contained within that function.

base/gsdparam.c


2020-03-17 00:44:02 +0000
Robin Watts <Robin.Watts@artifex.com>
4cbc36fe4546bce70537bc65541f65b4d7259a5b

Bug 702151: Avoid truncating pointers in debug code.

Introduce a PRI_INTPTR and use that to consistently display
pointers. We avoid using %p, as that displays inconsistently
between platforms. Sometimes it does 0x%x, sometimes just %x.

base/gdevdrop.c
base/gdevnfwd.c
base/gdevprn.c
base/gsalloc.c
base/gschar0.c
base/gscie.c
base/gsciemap.c
base/gscspace.c
base/gsfcmap1.c
base/gsfont.c
base/gsht.c
base/gsicc_cache.c
base/gsicc_manage.c
base/gsicc_profilecache.c
base/gsimage.c
base/gsmalloc.c
base/gsmchunk.c
base/gsmemory.c
base/gsmisc.c
base/gsrefct.h
base/gsstate.c
base/gsstruct.h
base/gstrans.c
base/gstype1.c
base/gstype2.c
base/gxacpath.c
base/gxalloc.h
base/gxbcache.c
base/gxccache.c
base/gxccman.c
base/gxclist.c
base/gxclmem.c
base/gxclread.c
base/gxclthrd.c
base/gxclutil.c
base/gxcpath.c
base/gxcpath.h
base/gxfill.c
base/gxfillsl.h
base/gxht.c
base/gxpath.c
base/gxpcmap.c
base/scfd.c
base/scfe.c
base/sfxfd.c
base/sfxstdio.c
base/stdint_.h
base/stream.c
base/szlibc.c
devices/gdevfax.c
devices/gdevx.c
psi/ialloc.c
psi/idebug.c
psi/idict.c
psi/idicttpl.h
psi/idstack.c
psi/igc.c
psi/igcref.c
psi/igcstr.c
psi/iinit.c
psi/ilocate.c
psi/imain.c
psi/imainarg.c
psi/iname.c
psi/interp.c
psi/isave.c
psi/iutil.c
psi/zcie.c
psi/zcontrol.c
psi/zvmem.c
xps/xpshash.c
xps/xpsresource.c


2020-03-12 17:22:36 +0000
Robin Watts <Robin.Watts@artifex.com>
d7961033ee224fc5d2c96a16bea3f3399dd29561

Add support for 64bit and size_t paramaters.

Cope with both int64_t's and size_t's with appropriate
rangechecks when casting will cause problems.

-d values on the command line are read as int64_t's.

If we ever find outselves wanting to assign a size_t where
the 63rd bit matters, then we may have to rethink this :)

We also change various params (such as MaxBitmap, MaxPatternBitmap
etc) to be size_t's. This affects the device structure itself.

base/gsdparam.c
base/gslib.c
base/gsparam.c
base/gsparam.h
base/gsparam2.c
base/gsparams.c
base/gxdevcli.h
base/gxpcache.h
base/gxpcmap.c
base/gxpcolor.h
base/spprint.c
base/spprint.h
base/spsdf.c
devices/vector/gdevpsdp.c
pcl/pl/plmain.c
psi/imainarg.c
psi/iparam.c


2020-03-15 14:48:29 -0700
Ray Johnston <ray.johnston@artifex.com>
e1b322c8ca8f08b5af398a912c511dc041cd9c86

Fix bug 702142: SMask profile 'swap' could cause clist to use wrong profile

The SMask 'swap' of profiles for the 'default' colorspaces in the icc_manager
was not being detected by the clist logic since the colorspace id was still
set to the cs_Device*_id value (1, 3, or 4).

The fix is to have the clist writing check for unknown color_space check BOTH
the color_space.id and the color_space.space, and flag 'unknown' if either
differed. The color_space.space includes the icc_profile info.

This results in a few progressions as well as fixing the file of this bug.

base/gxclimag.c


2020-03-14 15:07:37 +0000
Chris Liddell <chris.liddell@artifex.com>
0fad2491ae5d9dae39807266b6f0f2584a02bdd8

Bug 702217: Reinstate dynamic libs LDFLAGS for MacOS

With the significant revamp of the platform detection functions in configure
the LDFLAGS for building the gs shared library on MacOS went astray. This
puts them back in.

configure.ac


2020-03-16 09:06:16 +0000
Ken Sharp <ken.sharp@artifex.com>
aaf5edb15fceaae962569bae30eb4633480c1d15

Repair device subclassing after fill+stroke commit

Bug 702221 "Ghostscript 9.51 - SIGFPE when -dFirstPage or -dLastPage is set"

The fill+stroke commit had an error with the default method for handling
fill_stroke_path which passed the subclassing device as a parameter to
the child, instead of passing the child device. This caused seg faults,
floating point exceptions, hangs, and possibly other problems.

In addition the object filtering device had been modified to pass the
fill+stroke method to the default handler, instead of checking to see
if vector operations should be dropped.

This commit fixes both problems.

base/gdevoflt.c
base/gdevsclass.c


2020-03-14 10:56:43 +0000
Chris Liddell <chris.liddell@artifex.com>
b5682afdd022f0c1f1a20f83568300655bc27bfe

Add ARCH_MAX_SIZE_T to configure's arch.h prototype

arch/arch_autoconf.h.in


2020-03-14 10:53:15 +0000
Chris Liddell <chris.liddell@artifex.com>
09d359ca87e47cac31c7f1466250b3299818ce86

Don't fail on missing freetype for auxtools run

When cross compiling, we shouldn't fail the recursive call to configure if
there's no freetype - since it's not required for auxtools.

configure.ac


2020-03-13 18:57:30 -0700
Ray Johnston <ray.johnston@artifex.com>
bba815fd5ab0427b96ad2f2d6d96e7d69b4964ad

Bug 702191. Change Tr modes 2 and 6 to use fill_stroke operation.

Thanks to Ken Sharp who made the change to the PDF interpreter pdf_ops.ps.
This showed a few files that had SEGV. This was due to both the fill and
stroke having pattern colors where the pattern bits did not fit in the cache.
The stroke color could eject the fill pattern from the cache. The fix is to
lock the fill pattern in the cache as well as the stroke pattern (and unlock
it as well after the fill_stroke).

Resource/Init/pdf_ops.ps
base/gspaint.c
psi/dwmainc.c


2020-03-13 13:01:23 +0000
Ken Sharp <ken.sharp@artifex.com>
3353e8f68c8b4b13db8f712e3d01503d9043df65

pdfwrite - fix previous commit

commit 2a691356aeb538388ecbf0cafdf422bde771bad0 accidentally left a
debugging hack in place, which would lead to lots of files including
a ToUnicode CMap when that wasn't necessary, fix it here.

devices/vector/gdevpdtw.c


2020-03-13 11:10:50 +0000
Ken Sharp <ken.sharp@artifex.com>
2a691356aeb538388ecbf0cafdf422bde771bad0

pdfwrite - preserve ToUnicode CMaps with non-standard mappings

Bug #702201 "pdfwrite changes ligature"

The title is incorrect, pdfwrite does not 'change ligature'. The PDF
file uses an ffi ligature glyph from the embedded font, but the
ToUnicode CMap does not map that to U+FB03, it maps it to 3 Unicode
code points; f, f and i.

When we emit a simple font we check its Encoding to see if it needs a
ToUnicode CMap, if it doesn't then we don't emit one. Because all the
glyphs in this font are named, and have standard names, we don't need to
emit a ToUnicode CMap and so we don't (keeps the file size down).

However, that means that PDF consumers will map the ligature glyph to a
ligature ffi when copy/pasting (it has no other effect).

Here we check the Unicode code points as they are added to the internal
record. If any of them is not 2 bytes long, then its not a standard
mapping (simple fonts can only map to a single point). In that case we
note the exception and when we come to write the font, in the code that
checks the Encoding to see if we need to write a ToUnicode, we check
this value, if we've seen a multiple code point in the ToUnicode CMap
then we don't elide it, we embed the one we picked up.

This is not actually a bug IMO, there's nothing wrong with the mapping
as it stands because an ffi glyph in the document really should map to
a single Unicode code point ffi ligature. However, the creator of the
PDF file obviously didn't want that, so we;ll now honour it.

NB this only affects the emission of a ToUnicode CMap, which is only
used for copy/paste/search. The PDF contents are not affected by this
commit.

devices/vector/gdevpdte.c
devices/vector/gdevpdtf.c
devices/vector/gdevpdtf.h
devices/vector/gdevpdtw.c


2020-03-13 08:16:34 +0000
Chris Liddell <chris.liddell@artifex.com>
0bb921da9e702375618aa5fe7e85bf589e9a0108

Tiny tweak to release notes

to say "in the 9.50 release notes" rather than "above".

doc/History9.htm
doc/News.htm


2020-02-12 11:37:33 +0000
Chris Liddell <chris.liddell@artifex.com>
6018c8989f1c670d0b8c44d79438faa68dbe5a06

Bring master up to date with 9.51 release branch

Dates etc for 9.51 RC1

Plus prelim changelog

Dates, changelog etc for 9.51rc2

Add mention of deprecating/removing opvp/oprp devices

Dates/logs for 9.51 release candidate 3

Dates, changelog etc for 9.51 release

Makefile.in
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/Internal.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
psi/winint.mak


2020-03-12 17:46:43 +0000
Chris Liddell <chris.liddell@artifex.com>
e61555d8b960f1a87664fc378f4ce63619a762aa

Change 9.28 to 9.50 in the SAFER section

doc/Use.htm


2020-03-11 15:48:13 +0000
Chris Liddell <chris.liddell@artifex.com>
b2d084d01a22261281fc35e990efc46dde6ea8f9

Improve debugging error messages in fontconfig code.

Change the order we retrieve values, so we get FC_FILE (which *should* always
succeed) first. Thus we can use that in subsequent DEBUG messages, giving
slightly more useful diagnostics.

base/gp_unix.c


2020-03-11 13:18:00 +0000
Chris Liddell <chris.liddell@artifex.com>
09a575f0fdc6edde7e42f325167318a1b199839f

(fontconfig) Don't stop enumerating fonts on error.

We only want to finish enumerating the fontconfig fonts list once the list
is exhausted, not when an individual font gives an error.

In the event a font gives an error, skip it and move on.

base/gp_unix.c


2020-03-05 13:12:12 +0000
Chris Liddell <chris.liddell@artifex.com>
32fde6e59a76fa7bcc7c3b977a77b871a740f568

More problems with TTF "notdef" glyphs

The font in this file is questionable according to the spec. The spec says GID 0
in a TTF *must* be the "notdef" glyph which, traditionally, is a hollow
rectangle glyph. This contradicts what Postscript and PDF expect which is that
the .notdef glyph will be non-marking.

The problem is many PDF embedded TTF fonts ignore this, and populate GID 0 with
a "meaningful" glyph rather than an actual notdef.

Previously, the fonts that did this were all ones that used MS Unicode cmap
tables and hence we used that to determine whether to image GID 0 or not in
TTFs.

This file does not use a Unicode cmap, but rather an Apple cmap table. In this
case, the cmap table maps every character code to GID 0, GID 0 being the only
glyph defined in the font.

So, tweak the heuristic so that in the event we have what *looks* like a
notdef, we'll look up the character code in the TTF cmap table, and if
the cmap table maps that code to GID 0, then we'll image the glyph.
Otherwise, we will force it to be non-marking.

(Bug 702167)

Resource/Init/gs_ttf.ps
psi/zfapi.c


2020-03-09 07:08:00 +0000
Ken Sharp <ken.sharp@artifex.com>
3f7832e4b9568e70bdf3bb32c877c4bf5e9dc3b4

PS interpreter - another 64-bit integer fix

Bug #702197 "Integer overflowin --for-- on Windows"

Both the limit and the control variable were being passed to types
which truncated values when long or int were not 64-bit types.

psi/zcontrol.c


2020-03-09 05:22:22 +0000
Ken Sharp <ken.sharp@artifex.com>
9a0c0303127e4dba3fdc244cf3d75684e5cc8358

PS interpreter - fix cvrs with 64-bit integers

Bug #702195 "Integer overflow in cvrs on Windows"

Another 64-bit integer fix, we were casting the result of the radix
calculation through a long which on Windows is not 64-bit (on Linux it
is), leading to truncation o the result.

Fixed by casting through ps_uint instead. We also need to check for
CPSI mode here as we must use a 32-bit intermediate integer if we are in
CPSI mode and emit a rangecheck if the integer overflows 32 bits.

psi/ztype.c


2020-03-08 00:26:16 +0000
Ken Sharp <ken.sharp@artifex.com>
56840269a9df474a029f12ce8e4e41bb2abea313

PS interpreter some 64-bit integer fixes

Bug #702194 "cvi produces incorrect results"

This was simply caused by a cast through long. However its not enough
merely to change the cast, we must also check for running in CPSI mode
and throw an error if the returned integer cannot be represented in a
32-bit word, for compatibility with test suites.

In addition (see bug #702134) when exp throws an undefinedresult error
delay setting the stack variable until after we have tested the result,
so that we do not end up returning a INF on the stack, as is done in
other code paths which check for NaN and INF.

Thirdly; in div cater for the case of an integer divided by a real and
check the result for NaN and INF (as the other cases do). This now
properly throws an error and does not return NaN or INF on the stack.

psi/zarith.c
psi/zmath.c
psi/ztype.c


2020-03-05 09:58:47 +0000
Julian Smith <jules@op59.net>
933a09069dea35d570694e157013f272995ca5c4

Fix Raspbian build failure with mm_constant_zeros.

Moved 'static __m128i mm_constant_zeros' inside MM_SETUP macro definition, so
it only appears if MM_SETUP() is actually used.

base/gsroprun.c


2020-03-03 16:56:59 -0800
Ray Johnston <ray.johnston@artifex.com>
417b80ba6b16de181b2eb2fe5ca2e04565228f5f

Bug 702166: Image pattern phase mismatch when using clist

The gxclimag.c code, when it does 'cmd_put_drawing_color' was not updating
the tile_phase. The Kanji text set the tile_phase to 100, but the begin_image
was supposed to be 0,0 but the writer was not performing the set_tile_phase.

base/gxclimag.c


2020-03-04 17:42:04 +0000
Robin Watts <Robin.Watts@artifex.com>
2a3b9b17cc32401b45382c42e081733d4f6d1a62

Cups device: Windows: avoid using an uninitialised mutex.

cups/libs/cups/globals.c


2020-03-03 16:40:31 +0000
Robin Watts <Robin.Watts@artifex.com>
cbee08400ca895bb5f52de6cf8cb44ba59cc5fd8

Bug 702177: Avoid SEGV on low memory in cmd_put_halftone.

Ensure that cmd_put_list_op cannot return NULL without
setting an error code.

base/gxclutil.c


2020-03-03 11:53:28 +0000
Robin Watts <Robin.Watts@artifex.com>
e9dc0327b8458ed7c3f1ca07870c7e54dbef6aa4

Simplify change to clusterpush.pl for ifilters.

No need to keep filters and ifilters separately as we pass
them through with "filter=" and "ifilter=" intact.

toolbin/localcluster/clusterpush.pl


2020-03-03 10:55:43 +0000
Robin Watts <Robin.Watts@artifex.com>
fa944725e4b3ca01e7a63608a2b5afc320d9a4d2

Add support to clusterpush.pl for ifilter.

Needs tweaks within the cluster too, so don't try using
this immediately!

toolbin/localcluster/clusterpush.pl


2020-03-03 10:02:57 +0000
Julian Smith <jules@op59.net>
ab41133a6852dbb3cecdfd19ccd4737f27d7be28

Avoid potential Memento leak in gs_lib_ctx_set_icc_directory().

Return gs_error_VMerror after alloc failure, not -1. This doesn't fix a
known memento squeeze test case, but returning -1 after alloc failure breaks
gs_main_finit()'s cleanup and leaks blocks.

base/gslibctx.c


2020-03-03 09:47:52 +0000
Julian Smith <jules@op59.net>
a07bf9d0dee6c44865c25ed8c36cf68150301b39

Fixed Memento leak in gs_seticcdirectory().

Return gs_error_VMerror instead of -1, after alloc failure. This enables
gs_main_finit() to clean up properly.

Fixes:
MEMENTO_FAILAT=111090 ./ghostpdl/membin/gs -sDEVICE=bit -o /dev/null examples/text_graphic_image.pdf

base/gsicc_manage.c


2020-03-02 20:05:57 +0000
Julian Smith <jules@op59.net>
05ebf9f3c38ff9b15f54122c682f88ee9dd9d55e

Avoid compiler warning for MM_SETUP() __m128i mm_constant_ones.

This avoids warning about mm_constant_ones being used uninitialised.

Generated code for release build is unchanged.

base/gsroprun.c


2020-02-26 17:12:23 +0000
Julian Smith <jules@op59.net>
612ca06e4a41db0f0023827c878a55423500237e

minor fix to toolbin/squeeze2text.py to cope with no input.

toolbin/squeeze2text.py


2020-03-02 19:13:07 +0000
Robin Watts <Robin.Watts@artifex.com>
968216b16318407a179e7907dd5d6d2ebc54bb25

Fix typo in 16bit saturation blending code.

base/gxblend.c


2020-03-02 17:10:43 +0000
Robin Watts <Robin.Watts@artifex.com>
2c5687fef9709b04dd96957677ff9accd16ee1f7

Fix 16bit blending problem.

Seen with:

gs -sDEVICE=psdcmyk16 -o out%d.psd -r72 -dMaxBitmap=2000M
tests_private/pdf/forms/v1.5/proxy_vol_1_number_1_1.pdf

on page 3.

base/gxblend.c


2020-02-27 12:08:22 +0000
Robin Watts <Robin.Watts@artifex.com>
155894abeb41e90f9e2c8cb942269c2a2e1a6018

Reimplement saturation blendmode.

To test the results of deep color rendering, we ran a psdcmyk vs
psdcmyk16 comparison. This showed differences on page 17 of the
Altona_technical_v20_x4.pdf file in one patch. Simplifying the
file showed that the saturation blend mode was showing a
significant difference in one tile.

Saturation blend mode is defined to not make any changes if we
are writing over a pure grey color (as there is no 'hue' for
it to saturate). You'd expect that the blending function would be
continuous (i.e. that a small peturbation of the background color
should only produce a small peturbation in the output), but this
is NOT the case around pure greys.

The example in the tested file, shows that psdcmyk is called with
7a, 7a, 7a, which therefore leaves the background unchanged. For
psdcmyk16, it's called with 7a01 7a03 7a01, which therefore does
NOT leave the background unchanged. Testing by changing the 8 bit
inputs to 7b 7a 7b (a small peturbation), gives output of 99 64 99
(a large change).

So, actually, the results given seem reasonable in that case.

HOWEVER, in investigating what now seems to be a red herring, I
believe I've spotted a problem in the implementation. The scaling
of the components subtracts y when it should be subtracting minb.

The only way I could actually work that out though, was to completely
reimplement the code, and optimise it. I believe the new code is
slightly clearer (in that it follows the spec more explicitly) and
possibly slightly more performant, so I am committing that rather
than attempting to patch the existing code.

base/gxblend.c


2020-03-02 11:04:32 +0000
Robin Watts <Robin.Watts@artifex.com>
549a133dfcbdf2b3b028134d287d334f8fd623fd

Fix 64bit non-console windows build.

The creation of the text window was truncating the pointer to
long (32bit) size. No idea how we've been getting away with this
in the past. I can only assume this has been exposed by
differences in the runtime lib with vs2019 as compared to
earlier versions.

psi/dwtext.c


2020-02-28 10:34:12 +0000
Ken Sharp <ken.sharp@artifex.com>
1a4e859544336c9034c49bd9f735529401422961

Remove trailing white space from a prior commit

base/gxblend.c


2020-02-26 17:16:26 -0800
Michael Vrhel <michael.vrhel@artifex.com>
fa1bc6dce44b6fc69e9852553aec4b7a419d0d9c

Bug 702155 Alternate tint transform and shadings

Add option to match AR shadings for corner case, which
is not as detailed in the PDF specification.

If the source space is DeviceN or Separation and the
colorants are not supported (i.e. if we are using the alternate tint
transform) the interpolation should occur in the source space to
accommodate non-linear tint transform functions.
e.g. We had a case where the transform function
was an increasing staircase. Including that function in the
gradient smoothness calculation gave us severe quantization. AR on
the other hand is doing the interpolation in device color space
and has a smooth result for that case. So AR is not following the spec. The
bit below solves the issues for Type 4 and Type 5 shadings as
this will avoid interpolations in source space. Type 6 and Type 7 will still
have interpolations in the source space even if pfs->cs_always_linear == true.
So the approach below does not solve those issues. To do that
without changing the shading code, we could make a linear
approximation to the alternate tint transform, which would
ensure smoothness like what AR provides.

base/gxshade.c


2020-02-27 07:46:32 -0800
Ray Johnston <ray.johnston@artifex.com>
55222ef42e6574967810f8591ea308dbfc81b0a4

Fix differences seen between page mode and clist mode exposed by commit b3a73575

The code in gxipixel.c skips gridfitting if fill_adjust is 0, but the clist
writer logic wasn't updating the fill_adjust, so the reader could have the
wrong value. Seen with fts_25_2505 and fts_25_2506 which have an image with
SMask and also have large text (non-cached, so painted with fill) preceding
(drawn under) the image. Text is drawn with fill_adjust 0.

base/gxclimag.c


2020-02-26 09:10:20 -0800
Nancy Durgin <nancy.durgin@artifex.com>
8539dd741abec3d5b8e4417e512ae0847224f7a0

Fixes needed for pdfi after fill/stroke -- check for null pattern

Change to test for pgs->colours.pattern.p_tile to be NULL before
attempting to dereference it.

pdfi has a 'null' pattern frequently, which didn't seem to matter before the
fill/stroke changes, but does matter now.

I think the gs/pdf implementation sets up a specific "null" pattern
that gets around this issue, but currently pdfi does not do this.
Maybe it should?

base/gspaint.c
base/gxclrast.c


2020-02-26 15:22:04 +0000
Robin Watts <Robin.Watts@artifex.com>
b6bd379a249b81213db5fdecf29ed11f2ce00e9e

Fix signed issue in 16bit alpha blending fill_rectangle routines.

As seen by the central spot in the pink region of page 1 of:

gs -sDEVICE=psdcmyk16 -o out%d.psd -dMaxBitmap=2000M
tests_private/pdf/pdf_1.7_ATS_EXXPA1DC_PDFACT.pdf

base/gxblend.c


2020-02-26 15:09:35 +0000
Ken Sharp <ken.sharp@artifex.com>
b942845ee596dbcf37cf2af2381f0b298b962317

pdfwrite - Fix indeterminism with QL shading tests

When creating a new colour space to put in a PDF file we perform various
tests to see if its a space we have already written, to prevent writing
duplicate spaces (we perform similar tests for most resources).

In some cases, when we write the resource to a file, we create an MD5
hash and compare those to see if the resources are the same. In the
case of colour spaces, however, they are retained in memory and so we
use a different method. We 'serialise' the colour space. This is not the
same as writing it to the PDF file, and its a graphics library thing not
a pdfwrite function. Basically this writes out the content of the
various C structures. The stream we use is an in-memory stream.

Unfortunately, for Separation colour spaces, there was a fault in the
function which writes the colour space name, and it was writing out
the bytes forming the address of the name instead of the actual string.

This could, very rarely, mean that we would mis-identify a new colour
space as being the same as an old colour space, and so would reuse the
old space instead of creating a new one.

I've checked the DeviceN code and it does not suffer the same problem.

base/gscsepr.c


2020-02-26 13:03:56 +0000
Robin Watts <Robin.Watts@artifex.com>
988cfb770d12441dfef9002f799757e5cd869e48

Fix the overflow case in 16 bit saturation blending.

As seen with the second apple of the bottom row of page 1
of:

gs -sDEVICE=psdcmyk16 -r72 -o out%d.psd -dMaxBitmap=2000M
../tests_private/pdf/PDF_1.7_ATS/AIX4G1C3.pdf

base/gxblend.c


2020-02-25 17:10:51 +0000
Julian Smith <jules@op59.net>
293e2b7f6298a6049254d18250d4f82f78ac2978

Fix for bug 702150: make pl_main_run_file_utf8() check for error from s_process_read_buf().

Avoids infinite loop in:
./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null .

pcl/pl/plmain.c


2020-02-25 18:24:55 +0000
Julian Smith <jules@op59.net>
342229c7533310f9a46fbfd7a7dd2eaa976746f0

minor improvements to toolbin/squeeze2text.py.

toolbin/squeeze2text.py


2020-02-26 08:25:13 +0000
Robin Watts <Robin.Watts@artifex.com>
dd0961426d3e1718c17fa226f3c2c06f7eb296ce

CID 354310: Remove pointless unsigned comparison with 0.

base/gxblend.c


2020-02-26 08:11:49 +0000
Chris Liddell <chris.liddell@artifex.com>
fae43bf37f78a2eef5a4418f428c41bdfd8a2738

CID 354291: Add error handling for inability to allocate

Coverity complained about setting dash.pattern = NULL and "Passing "&dash"
to "gstate_copy_dash", which dereferences null "dash.pattern" which is either
wrong, or *very* misleading. We assume that it means that gx_set_dash() *may*
access that pointer.

In truth, this can never happen in these circumstances.

Nevertheless, in gx_set_dash() is we have a NULL mem (allocator) pointer and the
dash pattern pointer is NULL at the point we have to copy into it, then throw
an error.

base/gsline.c


2020-02-25 19:59:03 -0800
Ray Johnston <ray.johnston@artifex.com>
b3a7357594634fbd89a4cbf782d094289628acd6

Fix bug 702139 - clist clipping bug.

When characters are filled as paths, the fill_adjust may be set to 0.
Clip paths are supposed to match fill paths, i.e. the 'any part of pixel'
rule, so we need fill_adjust of 0.5 (not 0). The most foolproof way to fix
this is to set it in the reader when processing 'begin_clip' and restore
it when handling the end_clip.

There are many progressions with this change, but it also exposes some
cases where the change in clipping allows other elements to be seen that
were previously hidden. Those few instances are minor and mostly seem to
occur when page mode differs from clist mode. Examination of some of those
cases shows that the clip path with clist mode now matches page mode and
other elements (e.g. images) differ in extent between page and clist mode.

base/gxclrast.c


2020-02-25 19:39:50 +0000
Robin Watts <Robin.Watts@artifex.com>
ea7aa02cc5c540c3332e0d4e81209a920360d45e

Fix gx_default_copy_alpha_hl_color for 16 bit operation.

The code to write the composite data back to buffers to be sent
to copy_alpha was getting the first byte of each 16 bit pair
wrong in the 16bit data case.

Also, when we 'restart' after skipping a zero byte in the 16bit
case we need to skip 2 bytes per pixel, not one.

This can be seen when running:

gs -r72 -o out%d.psd -sDEVICE=psdcmyk16 -dMaxBitmap=2000M
../tests_private/comparefiles/js.pdf

base/gdevdbit.c


2020-02-25 18:19:07 +0000
Robin Watts <Robin.Watts@artifex.com>
d720180603fcd3853436fb002c6ff9c7fc956b27

Fix psdcmyk16 blending issue.

Use uint32_t rather than int to avoid signedness issues.

Seen in the psdcmyk16 page mode rendering of

tests_private/comparefiles/Bug692766.pdf

(bad colors in 4th rgb circle intersection test).

base/gxblend.c


2020-02-25 15:57:36 +0000
Robin Watts <Robin.Watts@artifex.com>
8f038b63bc2fab4a71191583d36b1894ae3576f5

Fix coverity issues 354292 and 354293.

Don't bother testing an unsigned value for clipping against 0.

base/gxblend.c


2020-02-25 08:58:32 +0000
Chris Liddell <chris.liddell@artifex.com>
ed426e9202e04e7d90194d92daedf9a12610b9f9

Replace 0 with NULL for pointer validation/setting.

Also make validation an explicit comparison with NULL i.e.:
"if (mem != NULL)" rather than "if (mem)".

base/gsline.c


2020-02-24 17:30:54 +0000
Julian Smith <jules@op59.net>
b6fc7f2b05fa3cb7b120b05dbfa68a90da731a30

Add support for multiple squeezes in one run.

E.g. MEMENTO_SQUEEZES=115867-1..+3,119928-1..+3 ...

This is equivalent running multiple times with MEMENTO_FAILAT set to 115866,
115867, 11588, 119927, 119928, 119929.

base/memento.c


2020-02-24 10:38:53 +0000
Julian Smith <jules@op59.net>
cc6f92959507212b83130a24dd40b330e8ca9634

Fix for MEMENTO_FAILAT=119928: only call gs_grestoreall_for_restore() if vmsave->gsave not NULL.

Also fix error cleanup in gs_gsave_for_save(), otherwise this fix breaks
previous fix for MEMENTO_FAILAT=115802.

[Thanks to chrisl for this and various other recent fixes.]

Fixes:
MEMENTO_FAILAT=119928 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

base/gsstate.c
psi/isave.c


2020-02-24 11:21:53 +0000
Julian Smith <jules@op59.net>
c2a030517d269b020c99bcf754cefccb556ad7bd

toolbin/squeeze2text.py: improve log output.

With -p, if there is gap in 'Memory squeezing @ <N>' output (because of calls
to free()), output next <N>.

Also flush log output to avoid looking like we've hung.

toolbin/squeeze2text.py


2020-02-24 21:00:21 -0800
Michael Vrhel <michael.vrhel@artifex.com>
bab28178da29dabd691f7dee11ab5de62e329aa7

Fix issue with fts_14_1416.pdf and psdcmyk16

This was missed in the fix. Affected only 16 bit devices.

http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=b1ac0686eea6adcf2db8cabf7858796494b4459d

base/gxblend.c


2020-02-24 20:05:49 +0000
Robin Watts <Robin.Watts@artifex.com>
a2d4a7715f465911f174a8e764ab40b40455dd68

Fix Ink names leaking.

The cause of the leak was a typo in gx_final_DeviceN.

Once this is fixed, we hit a problem where ink names are set
to be a pointer to a static empty string, which can't be
freed. Change to using NULL to mean empty ink name.

base/gscdevn.c


2020-02-24 12:01:43 -0800
Robin Watts <Robin.Watts@artifex.com>
6d678da952f7f4a19fb8b9e12f8cb8013d31f04d

Memento/Valgrind tweak.

Ensure we mark the contents of a block readable before we
look for pointers in it, and don't overrun the end.

base/memento.c


2020-02-24 12:57:28 +0000
Robin Watts <Robin.Watts@artifex.com>
44f00686cbaea612747c336dc201ae3f682cc81b

Squash some unused variable warnings.

base/claptrap-planar.c
base/gp_unifs.c
base/gxclpath.c
gpdl/tifftop.c


2020-02-24 12:14:23 +0000
Robin Watts <Robin.Watts@artifex.com>
26c2173179946ec8f70445f5941a4a20e707af88

pdf14_{fill_stroke_path,clist_fill_stroke_path_pattern_setup} cleanups.

Use a nicer method of breaking const (to avoid warnings). Ensure
that we always put everything back as it was when we leave the
functions, even if we have an error.

Remove needless cleanup code to handle functions that can never
return an error to us returning an error.

base/gdevp14.c


2020-02-24 12:35:30 +0000
Robin Watts <Robin.Watts@artifex.com>
a8839dbb536440bce927c4cb4977643495eee26a

pdf14_clist_fill_stroke_path_pattern_setup overprint fix.

Only enable CompatibleOverprint for the stroke part of stroke/fill
patterns if we are in a subtractive space.

base/gdevp14.c


2020-02-24 11:24:28 +0000
Robin Watts <Robin.Watts@artifex.com>
3e84f1e1b0c52bd55145e35f8ddc0d5b8d1b65c5

Squash some warnings with gs_swapcolors_quick breaking const.

At various places in the code, we call gs_swapcolors_quick where
we only have a const pgs.

Properly, we should copy the pgs to a non-const pgs, and then use
that, but that would be a performance hit.

In all cases, we change the graphics state, then restore it before
exit, so effectively it is const over the entire call of the
enclosing procedure.

Rather than having lots of small hacky casts removing const, we
push the const breakage into gs_swapcolors_quick itself where we
do it in the "approved" way using a union.

base/gdevp14.c
base/gsstate.c
base/gxfill.c
base/gxgstate.h
devices/vector/gdevpdfd.c


2020-02-24 10:10:25 +0000
Robin Watts <Robin.Watts@artifex.com>
b61365607b75d456943f95360bff101c288ba555

Avoid floating point in gxblend.c

Use fixed point in preference.

base/gxblend.c


2020-02-24 08:23:59 +0000
Ken Sharp <ken.sharp@artifex.com>
f8cd087b8a7b8c9b5cf5b8fd4d29e237f6103c7b

Implement OPM tracking in pdfwrite

More than somewhat to my surprise, the release testing of 9.51 revealed
that pdfwrite was not tracking the state of overprint mode (OPM). It
could be set by setdistillerparams, and in no other way.

This commit adds tracking the OPM in the graphics state, removes the
old overprint_mode variable from the device, but preserves the ability
to alter the OPM using setdistillerparms.

This also alters the initial state of OPM, the distiller params
reference states that the 'factory default' of OPM is 1, but the PDF
Reference says that the initial state of OPM is 0. We need to start
with the correct setting of OPM so we change it form 1 to 0
in gs_pdfwr.ps.

In passing, cast a const gs_gstate * to a gs_gstate * when used by
gs_swapcolours_quick, in order to avoid a compiler warning.

This causes a small number of progressions in files using OPM (which is
rare, its even rarer to actually alter it during the course of the file)

Resource/Init/gs_pdfwr.ps
devices/vector/gdevpdfb.h
devices/vector/gdevpdfd.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfx.h


2020-02-20 16:24:12 -0800
Michael Vrhel <michael.vrhel@artifex.com>
b1ac0686eea6adcf2db8cabf7858796494b4459d

Bug 702117 Knockout groups containing non-isolated groups

So this ended up being rather complicated. The first issue was that
we were not setting the backdrop properly for non-isolated groups that
reside in knockout groups. When that was fixed, it was revealed that we
were not doing the recompositing operation for non-isolated knockout groups. This meant
that the backdrop was getting applied twice effectively (once in the original
fill and then again when the group was popped). The only file that showed
this issue was the crazy Altona page with the many overlapping groups. Customer
file added to provide a clearer case in the regression tests.

base/gdevp14.c
base/gxblend.c
base/gxblend1.c


2020-02-20 17:09:41 +0000
Julian Smith <jules@op59.net>
4ac299b11d53cf1d174a8351290918b536aa5859

Fix MEMENTO_FAILAT=115867 - segv in i_unregister_root() after failure in i_register_root().

In pl_main_delete_instance(), don't call gs_unregister_root() if
minst->device_root is NULL.

Also in pl_top_create_device(), check return from
gs_register_struct_root(). But this doesn't appear to make any difference to
the handling of the memento error.

Fixes:
MEMENTO_FAILAT=115867 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

pcl/pl/plmain.c


2020-02-20 16:51:56 +0000
Robin Watts <Robin.Watts@artifex.com>
9022073cb754ace5923c08e81d3b8d0be352abd9

Fix deep color group compose issue.

In commit bb7d57e84e9fe I reordered parameters to keep 8/16
branches consistent, and missed one case.

base/gxblend.c


2020-02-20 15:27:07 +0000
Robin Watts <Robin.Watts@artifex.com>
7c8c6c4ba0df88b5cbc4c0e8dab5f643a133603e

Remove needless "isolated" parameter from pdf14_mark_rect routines.

The value was carefully plumbed through (only in the 8bit case) in
a recent commit, but was never actually used. Remove it a) because
it's pointless passing a variable we don't use, and b) because it's
another difference between 8 and 16 bit versions.

base/gxblend.c


2020-02-20 15:21:30 +0000
Robin Watts <Robin.Watts@artifex.com>
c3c922510f0498d68d7a369f0ffd70379e3d5359

Fix typing mistake in 16bit transparency.

When promoting from 8 to 16 bit, shape and src_alpha become
uint16_ts rather than bytes.

base/gxblend.c


2020-02-20 15:06:38 +0000
Robin Watts <Robin.Watts@artifex.com>
713c776695f7a18cfd326e84fdef0b2911770609

Fix more overprint problems with deep color transparency.

Again, overprint changes to the 8 bit paths had not been
pulled across to the 16 bit path.

base/gxblend.c


2020-02-19 07:10:40 +0000
Julian Smith <jules@op59.net>
075abaaa9ffa03af26bed1a32d3e5114511ee786

Added toolbin/squeeze2text.py, for processing output from MEMENTO_SQUEEZEAT=...

An alternative to squeeze2html.pl, outputing just summary information.

toolbin/squeeze2text.py


2020-02-20 11:18:11 +0000
Julian Smith <jules@op59.net>
fbcf5865f688201fba239c5dde0078e6733538c4

Fix for MEMENTO_FAILAT=115802: make gs_gsave_for_save() call gs_gsave() so it can restore after error.

Previously, zsave() called gs_gsave_for_save() then gs_gsave(), but if
gs_gsave() failed we ended up with SEGV in finalise code.

To allow zsave() to restore things after gs_gsave() failure, we would need to
add an include of base/gxgstate.h.

Instead we remove the call of gs_gsave() from zsave() and append it to
gs_gsave_for_save(), where things can be easily restored if it fails.

[There are no other callers of gs_gsave_for_save().]

Fixes:
MEMENTO_FAILAT=115802 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

base/gsstate.c
psi/zvmem.c


2020-02-18 09:44:51 +0000
Julian Smith <jules@op59.net>
356e24a53c60710ecfee991bb91cd503e3d9873b

Avoid leaks if we get alloc failure when closing down (found by memento).

In gs_main_finit(), ignore gs_error_VMerror from interp_reclaim(). Such error
ultimately comes from gs_vmreclaim() calling context_state_load(), but the
missing info doesn't seem to be required for gs_main_finit() to carry on.

Fixes:
MEMENTO_FAILAT=147801 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

psi/imain.c


2020-02-13 17:40:51 +0000
Robin Watts <Robin.Watts@artifex.com>
e1257c1f03a4b16794d0c2df035b7ed8685a4254

Fix image_color_icc_prep to properly align planar buffers.

base/gxicolor.c


2020-02-13 10:50:10 +0000
Robin Watts <Robin.Watts@artifex.com>
5ee682a20c494e8f1c65a7a95470252df6d9cdf4

Enable CAL for gxicolor halftoning.

Looks like the calling code was unfinished, and the build
changes were not done.

Also, squash some warnings.

base/gxicolor.c
base/gximono.c
base/lib.mak
devices/gdevtsep.c


2020-02-17 15:57:47 +0000
Chris Liddell <chris.liddell@artifex.com>
d26e2d1c628d88263c4d946bdaf2145a438a1416

Ensure the memory entry in a cloned gstate is correct.

In theory, we could end up cloning a graphics state with one allocator, then
assigning the "memory" entry in the cloned state to that of the state we are
cloning.

In practice the two have (so far) been the same, but that is not guaranteed.

base/gsstate.c


2020-02-14 11:08:57 +0000
Chris Liddell <chris.liddell@artifex.com>
1faa24d998afa6ce98279f26514fe14edbd62e8e

Fix segfault cleaning up after gstate clone failure.

For me this happens with MEMENTO_FAILAT=112447 and for Julian it happens with
MEMENTO_FAILAT=115905.

Basically, the order of events was that we'd allocate a new gstate, copy the
contents of the existing gstate to the new one, then copy the dash pattern
(which could fail) and copy the "client_data" (which could and, in this case,
did fail). When either of those failed, we'd jump to the error handling and
exit with the error.

The problem is that, by jumping to the "fail" label, we skip over all the code
that fixes up the reference counts (and various other things) to account for
the newly created gstate.

This commit reorders things so we allocate the gstate, copy the client data,
copy the dash pattern, *then* assign the contents of the old gstate to the new
one, and carry on. Thus, by the time the gstate contents are copied, the
function cannot fail, and everything is sure to be correctly setup.

In the event that either the dash pattern or the client data fail to allocate,
the new gstate is still filled with NULLs, except for the subset of
"gs_gstate_parts" which are allocated and setup correctly so we can safely
free the graphics state object before returning the error.

Also, use NULL for pointer validation instead of 0.

base/gsstate.c


2020-02-18 17:43:18 -0800
Michael Vrhel <michael.vrhel@artifex.com>
f51ae6f4bf85dfa5be4b48a1a46ac69c653500c3

Make sure pattern fills use proper alpha settings

Fix for regression of fts_28_2804.pdf pdfwrite output rendering
with fill-stroke commit. This also fixes the rendering of fts_25_2526.pdf
Bug 702033. Required a minor change in the XPS interpreter to make
sure that patterns did not have their opacity double applied.

base/gdevp14.c
xps/xpstile.c


2020-02-19 17:20:09 +0000
Robin Watts <Robin.Watts@artifex.com>
59806f121beba543de6d78a1b5765919bce9b2cb

Bug 702105: Premature EOF Infinite loop in interpolated imagemask stream.

Fix supplied by Peter Cherepanov. Many thanks.

base/simscale.c


2020-02-19 16:58:06 +0000
Robin Watts <Robin.Watts@artifex.com>
f860dbd9e699fcef50018fbd7cf84565237d78a3

Fix "blue gradients" seen with psdrgb device.

Since the fill/stroke commit went in, some files have been showing
gradients in the wrong colours. For instance this one, spotted in
release testing:

gs -sDEVICE=psdrgb -r72 -dMaxBitmap=2000M -o out%d.psd
../tests_private/comparefiles/Layout.pdf

Bisecting the fill/stroke branch back, it seems the commit that
caused it is the one that stops psdrgb using 'devn' colors.

This causes gradients to drop to using the color_info.comp_bits and
comp_shift information, which the psd devices don't fill in.

The fix here is to make psd_prn_open call the standard function for
setting up these values.

devices/gdevpsd.c


2020-02-13 14:48:05 -0800
Nancy Durgin <nancy.durgin@artifex.com>
ddccae87e67a4ea101f289549e2d1692b0230509

Bug701972 -- fix pdfwrite image downscaling bug

Calculate the bits on the row using the input image width,
not the output image width.

I had to add an extra argument to a few functions to propagate the info
down to where it is needed.

Note obscure case involving calling psdf_setup_image_to_mask_filter()
for a Type 4 image and CompatibilityLevel < 1.3. This change just
adds the extra input_width arg, which doesn't change whatever it was
doing before. If there is a bug lurking here, it seems unlikely
anybody cares?

devices/vector/gdevpdfi.c
devices/vector/gdevpsdf.h
devices/vector/gdevpsdi.c
devices/vector/gdevpsds.c
devices/vector/gdevpsds.h


2020-02-12 09:22:55 -0800
Nancy Durgin <nancy.durgin@artifex.com>
4e2eaa8324ee4428de337ae3c31a695e68ede75b

Set the BitsPerComponent for alt stream in pdfwrite

Add this to the image[1] code where it was missing

This fixes bug where compressed images were correct, but if
-dEncodeGrayImages=false was used, then they were truncated.

This is related to trimmed/rescaled image for Bug701972.
See the sample trim-nobug.pdf attached to that bug.

devices/vector/gdevpdfi.c


2020-02-18 19:25:24 +0000
Robin Watts <Robin.Watts@artifex.com>
76fb18bc255a88cab5fbb2410b411e580f53486d

Bug 702131: Fix overprint in additive spaces.

We should only enter CompatibleOverprint blend mode if we
are in an subtractive space. This stops pdf14 trying to honour
drawn_comps even in additive spaces.

base/gdevp14.c


2020-02-14 14:02:24 -0800
Ray Johnston <ray.johnston@artifex.com>
f1b16fe2d0c6f23923fd26d03544030bc285365a

Fix bug 702079: SEGV with clist and PCL caused by wrong color in images.

The clist_image_plane_data function was called with the dev_color for a band
being type <pattern> when the image had type <pure>, but the code was not
calling cmd_put_drawing_color to update the bands for the image because uses_color
was false. Add rop3_uses_S(pgs0>log_op) as well as (||) rop3_uses_T(pgs->log_op)
when CombineWitColor is true.
Note that extra calls to cmd_put_drawing_color before an image are low cost
and do nothing if the current device color is already the same.

base/gxclimag.c


2020-02-18 09:48:07 -0800
Michael Vrhel <michael.vrhel@artifex.com>
646007af056447fefd61eabfcdae85bfd6017d24

Bug 702128 : clist pdf14 overprint state

This change ensures that gxdso_overprint_active
gets the proper state information.

When the clist writer is active with the pdf14 device, the writer maintains
the current overprint state (as the writer has no access to the pdf14 member variables)
and must know what to put in the clist.

When the clist writer is not present (i.e. page mode), the pdf14 device
maintains the information.

base/gdevp14.c


2020-02-18 11:46:45 +0000
Robin Watts <Robin.Watts@artifex.com>
6ace930c11984e64aded98f1ff8db47104424354

Bug 702068 continued: Fix smasked images with masks.

Release testing has shown up another case that needs help.

gs/bin -sDEVICE=ppmraw -o out.ppm -r300 -dMaxBitmap=1G
tests_private/pdf/sumatra/1901_-_tiling_inconsistencies.pdf

This shows horizontal white lines in the "Next" "Up" "Previous"
images at the top of the page.

Investigation shows this is due to the images having Masks as well
as SMasks.

The Mask image is run to a 1 bit memory device, which means that
the gxdso to check if we are in an SMask doesn't work. We work
around this by introducing a new flag to gs_pixel_image_common
that we can set to indicate that we are within an smask. We set
this when we set the masked image up (using the gxdso), and check
it when we come to do the gridfitting.

base/gsiparam.h
base/gxclrast.c
base/gximage.c
base/gximage3.c
base/gxipixel.c


2020-02-17 19:31:50 +0000
Robin Watts <Robin.Watts@artifex.com>
bb7d57e84e9fe615832b2d5811f4c9cd4d443cd1

Sync deep colour blending with recent changes to 8 bit blending.

Release testing reveals problems with deep color blending and
overprint. This is because changes were made to the 8bit
branches of gxblend.c that weren't fully reflected in the
16bit branches.

Reapply those changes here.

While we're at it, address some other minor code cleanups,
including keeping the ordering of parameters the same between 8
and 16 bit to avoid confusion in future.

The command that showed the inital problem was:

bin/gswin32c.exe -o out.psd -sDEVICE=psdcmyk16 tests_private/comparefiles/Bug695916.pdf

where the image of the Earth did not appear.

base/gxblend.c


2020-02-17 13:27:10 +0000
Robin Watts <Robin.Watts@artifex.com>
e51ba18f031c4b5f6a14c0a559391fe30f409dd1

Bug 702130: Fix JPEG memory failure problems.

The SEGV reported by Memento squeezing (which oddly is at 113600
for me, rather than Julian's higher number) is caused by jpeglib
calling 'mem_term' on something that failed to 'mem_init'.

The fix is to use gs_memory_chunk_unwrap rather than target/release,
and to check whether mem == cmem to see whether that actually did
unwrap.

This runs us into a further problem, where we are freeing the
custom memory descriptor using a gc memory pointer, where it was
allocated using a non gc one.

Rather than just changing the free to use the non gc one, we take
the opportunity to ensure that ALL the blocks are in non gc memory.
JPEGlib will take poorly to its memory being gc'd away, and none
of it needs to subject to gc.

Credit goes largely to Chris for this fix.

base/sjpegc.c


2020-02-14 18:44:53 +0000
Robin Watts <Robin.Watts@artifex.com>
55a7a41998f35ae23aedf2fdb83698dde1453d58

Bug 702124 (continued): Avoid FP errors leading to empty pattern cells.

The limited accuracy of floats can cause pattern cells to appear to
be empty when they are not.

Avoid adding the (often large) tx and ty components in until after we
have calculated the width/heights.

base/gsptype1.c


2020-02-14 18:43:00 +0000
Robin Watts <Robin.Watts@artifex.com>
182d5c10ed11570dd08e6203d832e06a73853f17

Bug 702124: Avoid VMerror when a pattern cell height is 0.

We detect buffer_height == 0 and take it to mean that we can't
get a large enough buffer for even a single scanline. Actually
it can mean that the pattern cell was empty, which gives a
spurious error.

base/gxmclip.c


2020-02-14 17:08:12 +0000
Julian Smith <jules@op59.net>
f5b7acb59c4f2e88591aab9f355813e0b7b68db5

Fix segv after memento squeeze in psdf_DCT_filter().

Fixes:
MEMENTO_FAILAT=117152 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

devices/vector/gdevpsdu.c


2020-02-13 14:54:42 +0000
Julian Smith <jules@op59.net>
9fd069e5c91126e78b51625c72d884615370098c

Fixed double free after alloc failure in gs_lib_ctx_set_icc_directory*() (found by memento).

After we've freed p_ctx->profiledir we need to set it to NULL otherwise if we
return an error it will be freed a second time when we close down.

Fixes:
MEMENTO_FAILAT=101810 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

base/gslibctx.c


2020-02-12 11:12:37 +0000
Julian Smith <jules@op59.net>
d86e9d8251e142ab9aae9f50923414c0c18bf1d3

Fixed leak on error in gs_fapi_ufst_init() (found by memento).

Fixes:
MEMENTO_FAILAT=22 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

base/fapiufst.c


2020-02-13 19:48:01 +0000
Robin Watts <Robin.Watts@artifex.com>
d7d68f45bfc227f7c7a6fdd5f8ef078bbf7ca77f

Bug 702121: PCL performance degradation

Henry chased the cause down to commit b399f84, an attempt to
fix Bug 700624. Looking at that code now, it has a silly typo
in it, that was causing it not be triggered in cases when it
should have been. Fixed here.

base/gxpcmap.c


2020-02-13 11:11:40 -0800
Robin Watts <Robin.Watts@artifex.com>
b58e9010ce17bce450e4c042b93bafc460b9d94a

Alternative fix for leaks after error in gs_main_init_with_args01()

When memory squeezing gpdl, Julian found leaks in the gpdl
startup of the postscript interpreter when allocations failed
in gs_main_init_with_args01().

Here, we fix the problem by making the psitop.c layer within gpdl
call the appropriate shutdown code when we catch the error. This
moves gpdl to being consistent with other users of the gs_main
layer.

Memento memory squeezing around the point of failure (event 2035)
now shows this to be OK.

MEMENTO_SQUEEZEAT=2034 ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

gpdl/psitop.c


2020-02-13 18:47:37 +0000
Robin Watts <Robin.Watts@artifex.com>
5fc8e7c0b656d4e2be8f5e316121f06039c35273

Revert "Fix leaks after error in gs_main_init_with_args01() (found by memento)."

This reverts commit f35924926cb35f08be5a12ded4a00eb2f42aed3e.

When memory squeezing gpdl, Julian found leaks in the gpdl
startup of the postscript interpreter when allocations failed
in gs_main_init_with_args01().

The initial fix attempted was to make gs_main_init_with_args01()
closedown the interpreter on such errors. This worked for the
tested cases, but hid problems with non-memory related errors
(such as not being able to open a file specified on the command
line) when called by gs (rather than gpdl).

The change attempted resulted in gs_main_finit() being called
twice as gs (and other users of the gs_main APIs) expect to have
to call gs_main_finit() to shut down after gs_main_init_with_args01()
returns an error code.

The real problem is that gpdl is not doing this in the same way as
other callers.

The gs_main layer has existed for donkeys years, so it's probably
best that we just take it as fixed and don't require callers to
start changing stuff now.

Accordingly, I am reverting the attempted fix here, and will
try a different fix for it that only affects gpdl shortly.

psi/imainarg.c


2020-02-13 16:48:21 -0800
Michael Vrhel <michael.vrhel@artifex.com>
cd5f21df6c710664ff0ba3f100ca5283d9367ed8

Bug 702116 Avoid NULL dereference

In certain cases if the source color space is separation or deviceN
and we are doing image interpolation with the use of fast color option
there was a potential dereference of a NULL pointer since the color
space will not have an ICC profile.

base/gxiscale.c


2020-02-11 16:48:24 -0800
Ray Johnston <ray.johnston@artifex.com>
1f6b351a5048b5a14d52431c833da6ed3386a7bf

Change to improve memory and speed (Bug 702099)

As described in the bug, the patch to disable high-level images in
pattern-clists when Interpolate is true is no longer needed (hasn't
been since 2015), and it causes the memory and performance problems
with this type of file.

base/gxclimag.c


2020-02-12 15:10:54 -0800
Michael Vrhel <michael.vrhel@artifex.com>
c5883877d1dc7abbd7600eb688f7cf4ad34db0cc

Bug 702114 non-isolated group in knockout group

Make sure to use the parents backdrop as our backdrop when we
push a non-isolated group that resides in a knockout group.
Note though that this apparently is not the case if we are
constructing a soft mask.

base/gdevp14.c


2020-02-12 10:54:47 -0800
Michael Vrhel <michael.vrhel@artifex.com>
06a08fca00194531df25652b46eca8f8e4dfd7cc

Bug 702113 Softmask with transfer function

In a couple spots we look at the value of the background value
of the softmask to decide if we really need the softmask in
areas outside the group bounding box. These checks were not
considering the impact of the transfer function.

base/gdevp14.c


2020-02-12 10:22:32 +0000
Chris Liddell <chris.liddell@artifex.com>
6fc5cbc5bc57ae2c47d1276f1ea0c0f16017b4bb

Bump version number pending 9.51 release

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


2020-03-19 08:14:27 +0000
Chris Liddell <chris.liddell@artifex.com>
e49830f8efdbc3a9f4e8acaf708b68a742f515aa

Version, dates etc for 9.52 release

Resource/Init/gs_init.ps
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/Internal.htm
doc/Language.htm
doc/Lib.htm
doc/Make.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


2020-03-17 15:54:28 +0000
Chris Liddell <chris.liddell@artifex.com>
0cade062486c0ae9c883970dea1c555a8ffcff84

Release notes for 9.52 release

doc/History9.htm
doc/News.htm
doc/Use.htm


2020-03-17 15:52:20 +0000
Chris Liddell <chris.liddell@artifex.com>
c76b5f64e0525e4ddf9e5c311a1b75fe738298dc

Add references to the 64 bit windows exes

doc/Use.htm


2020-03-14 15:07:37 +0000
Chris Liddell <chris.liddell@artifex.com>
eec073529fb8dc0c3bb6d612b61bf483d135c9cf

Bug 702217: Reinstate dynamic libs LDFLAGS for MacOS

With the significant revamp of the platform detection functions in configure
the LDFLAGS for building the gs shared library on MacOS went astray. This
puts them back in.

configure.ac


2020-03-16 09:06:16 +0000
Ken Sharp <ken.sharp@artifex.com>
a9cd9959372b9f14b493b87df57664ea831c5d80

Repair device subclassing after fill+stroke commit

Bug 702221 "Ghostscript 9.51 - SIGFPE when -dFirstPage or -dLastPage is set"

The fill+stroke commit had an error with the default method for handling
fill_stroke_path which passed the subclassing device as a parameter to
the child, instead of passing the child device. This caused seg faults,
floating point exceptions, hangs, and possibly other problems.

In addition the object filtering device had been modified to pass the
fill+stroke method to the default handler, instead of checking to see
if vector operations should be dropped.

This commit fixes both problems.

base/gdevoflt.c
base/gdevsclass.c


2020-03-14 10:56:43 +0000
Chris Liddell <chris.liddell@artifex.com>
f712440a2f251ae06277ec4a5ffe8ce7599aa4d8

Add ARCH_MAX_SIZE_T to configure's arch.h prototype

arch/arch_autoconf.h.in


2020-03-14 10:53:15 +0000
Chris Liddell <chris.liddell@artifex.com>
214d16924543fb3116a031463052e8b0eff3f1ae

Don't fail on missing freetype for auxtools run

When cross compiling, we shouldn't fail the recursive call to configure if
there's no freetype - since it's not required for auxtools.

configure.ac


2020-03-12 11:49:11 +0000
Chris Liddell <chris.liddell@artifex.com>
b02467bd535d50d221e4f7c371867603f5368f36

Dates, changelog etc for 9.51 release

base/gscdefs.h
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/Internal.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


2020-03-02 17:10:43 +0000
Robin Watts <Robin.Watts@artifex.com>
15f5f8bad503e9d3e63db9c3ca395deffd6b1e20

Fix 16bit blending problem.

Seen with:

gs -sDEVICE=psdcmyk16 -o out%d.psd -r72 -dMaxBitmap=2000M
tests_private/pdf/forms/v1.5/proxy_vol_1_number_1_1.pdf

on page 3.

base/gxblend.c


2020-03-02 11:16:51 +0000
Chris Liddell <chris.liddell@artifex.com>
d5809b79052b20c723700cce75e7e1543a3ddc23

Dates/logs for 9.51 release candidate 3

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/Internal.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


2020-03-02 11:04:32 +0000
Robin Watts <Robin.Watts@artifex.com>
f6e3e9238bb5cf7fe44c3c845be286a3314ed905

Fix 64bit non-console windows build.

The creation of the text window was truncating the pointer to
long (32bit) size. No idea how we've been getting away with this
in the past. I can only assume this has been exposed by
differences in the runtime lib with vs2019 as compared to
earlier versions.

psi/dwtext.c


2020-03-02 09:02:51 +0000
Chris Liddell <chris.liddell@artifex.com>
ffe0e5cf33feee7672e5f4281f0c0b0ff66bddda

Add mention of deprecating/removing opvp/oprp devices

doc/History9.htm
doc/News.htm


2020-02-28 08:30:36 +0000
Chris Liddell <chris.liddell@artifex.com>
a1478a72a3ccb8564c2b1c5c87d3dbe23a5ffff2

Dates, changelog etc for 9.51rc2

base/gscdefs.h
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/Internal.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


2020-02-26 15:22:04 +0000
Robin Watts <Robin.Watts@artifex.com>
dbaddcf6e251229a1506f2df33844365df39de44

Fix signed issue in 16bit alpha blending fill_rectangle routines.

As seen by the central spot in the pink region of page 1 of:

gs -sDEVICE=psdcmyk16 -o out%d.psd -dMaxBitmap=2000M
tests_private/pdf/pdf_1.7_ATS_EXXPA1DC_PDFACT.pdf

base/gxblend.c


2020-02-26 15:09:35 +0000
Ken Sharp <ken.sharp@artifex.com>
4ad8020c3cb63345dd76119e8978c3353940a68e

pdfwrite - Fix indeterminism with QL shading tests

When creating a new colour space to put in a PDF file we perform various
tests to see if its a space we have already written, to prevent writing
duplicate spaces (we perform similar tests for most resources).

In some cases, when we write the resource to a file, we create an MD5
hash and compare those to see if the resources are the same. In the
case of colour spaces, however, they are retained in memory and so we
use a different method. We 'serialise' the colour space. This is not the
same as writing it to the PDF file, and its a graphics library thing not
a pdfwrite function. Basically this writes out the content of the
various C structures. The stream we use is an in-memory stream.

Unfortunately, for Separation colour spaces, there was a fault in the
function which writes the colour space name, and it was writing out
the bytes forming the address of the name instead of the actual string.

This could, very rarely, mean that we would mis-identify a new colour
space as being the same as an old colour space, and so would reuse the
old space instead of creating a new one.

I've checked the DeviceN code and it does not suffer the same problem.

base/gscsepr.c


2020-02-26 13:03:56 +0000
Robin Watts <Robin.Watts@artifex.com>
3cb8b3a403450d617b2b96ec0349bb99ce0d8379

Fix the overflow case in 16 bit saturation blending.

As seen with the second apple of the bottom row of page 1
of:

gs -sDEVICE=psdcmyk16 -r72 -o out%d.psd -dMaxBitmap=2000M
../tests_private/pdf/PDF_1.7_ATS/AIX4G1C3.pdf

base/gxblend.c


2020-02-25 17:10:51 +0000
Julian Smith <jules@op59.net>
5d4305e916d3f75492d03dfd79ab1aaedf9545e3

Fix for bug 702150: make pl_main_run_file_utf8() check for error from s_process_read_buf().

Avoids infinite loop in:
./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null .

pcl/pl/plmain.c


2020-02-25 18:24:55 +0000
Julian Smith <jules@op59.net>
2c6efee0f594ad29394bf8a303f21d85dcb1d70a

minor improvements to toolbin/squeeze2text.py.

toolbin/squeeze2text.py


2020-02-26 08:25:13 +0000
Robin Watts <Robin.Watts@artifex.com>
ef5dfe7e3b3858bdfb20c168b4818c4d65fb932f

CID 354310: Remove pointless unsigned comparison with 0.

base/gxblend.c


2020-02-26 08:11:49 +0000
Chris Liddell <chris.liddell@artifex.com>
29335f43967a0f089d6f2f37883a22f1516f7bde

CID 354291: Add error handling for inability to allocate

Coverity complained about setting dash.pattern = NULL and "Passing "&dash"
to "gstate_copy_dash", which dereferences null "dash.pattern" which is either
wrong, or *very* misleading. We assume that it means that gx_set_dash() *may*
access that pointer.

In truth, this can never happen in these circumstances.

Nevertheless, in gx_set_dash() is we have a NULL mem (allocator) pointer and the
dash pattern pointer is NULL at the point we have to copy into it, then throw
an error.

base/gsline.c


2020-02-25 19:59:03 -0800
Ray Johnston <ray.johnston@artifex.com>
1d0889b9fcf3a5d5012fad021b4c53828879016e

Fix bug 702139 - clist clipping bug.

When characters are filled as paths, the fill_adjust may be set to 0.
Clip paths are supposed to match fill paths, i.e. the 'any part of pixel'
rule, so we need fill_adjust of 0.5 (not 0). The most foolproof way to fix
this is to set it in the reader when processing 'begin_clip' and restore
it when handling the end_clip.

There are many progressions with this change, but it also exposes some
cases where the change in clipping allows other elements to be seen that
were previously hidden. Those few instances are minor and mostly seem to
occur when page mode differs from clist mode. Examination of some of those
cases shows that the clip path with clist mode now matches page mode and
other elements (e.g. images) differ in extent between page and clist mode.

base/gxclrast.c


2020-02-25 19:39:50 +0000
Robin Watts <Robin.Watts@artifex.com>
86f81e9b799b66207c699768616a6e3ba3c311c3

Fix gx_default_copy_alpha_hl_color for 16 bit operation.

The code to write the composite data back to buffers to be sent
to copy_alpha was getting the first byte of each 16 bit pair
wrong in the 16bit data case.

Also, when we 'restart' after skipping a zero byte in the 16bit
case we need to skip 2 bytes per pixel, not one.

This can be seen when running:

gs -r72 -o out%d.psd -sDEVICE=psdcmyk16 -dMaxBitmap=2000M
../tests_private/comparefiles/js.pdf

base/gdevdbit.c


2020-02-25 18:19:07 +0000
Robin Watts <Robin.Watts@artifex.com>
635303ca7d8a36b3dabc9afbd9132f4b9a36dce5

Fix psdcmyk16 blending issue.

Use uint32_t rather than int to avoid signedness issues.

Seen in the psdcmyk16 page mode rendering of

tests_private/comparefiles/Bug692766.pdf

(bad colors in 4th rgb circle intersection test).

base/gxblend.c


2020-02-25 15:57:36 +0000
Robin Watts <Robin.Watts@artifex.com>
a00c75369e082798d82202a2b64d8e4b484d0c11

Fix coverity issues 354292 and 354293.

Don't bother testing an unsigned value for clipping against 0.

base/gxblend.c


2020-02-25 08:58:32 +0000
Chris Liddell <chris.liddell@artifex.com>
32f3d6703a7e5c6582c066837783c6697e98b1ca

Replace 0 with NULL for pointer validation/setting.

Also make validation an explicit comparison with NULL i.e.:
"if (mem != NULL)" rather than "if (mem)".

base/gsline.c


2020-02-24 17:30:54 +0000
Julian Smith <jules@op59.net>
6c1002cc251907e702fd5db9dc81365a964816c6

Add support for multiple squeezes in one run.

E.g. MEMENTO_SQUEEZES=115867-1..+3,119928-1..+3 ...

This is equivalent running multiple times with MEMENTO_FAILAT set to 115866,
115867, 11588, 119927, 119928, 119929.

base/memento.c


2020-02-24 10:38:53 +0000
Julian Smith <jules@op59.net>
39557bd53eee75a8b8f762457ce57a5437e79d6c

Fix for MEMENTO_FAILAT=119928: only call gs_grestoreall_for_restore() if vmsave->gsave not NULL.

Also fix error cleanup in gs_gsave_for_save(), otherwise this fix breaks
previous fix for MEMENTO_FAILAT=115802.

[Thanks to chrisl for this and various other recent fixes.]

Fixes:
MEMENTO_FAILAT=119928 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

base/gsstate.c
psi/isave.c


2020-02-24 11:21:53 +0000
Julian Smith <jules@op59.net>
60507d492507817bb5ae14a17a01d19c50d41e0a

toolbin/squeeze2text.py: improve log output.

With -p, if there is gap in 'Memory squeezing @ <N>' output (because of calls
to free()), output next <N>.

Also flush log output to avoid looking like we've hung.

toolbin/squeeze2text.py


2020-02-24 21:00:21 -0800
Michael Vrhel <michael.vrhel@artifex.com>
3a9ea36465e97ce729c5ab26dc8e0d1435b7b246

Fix issue with fts_14_1416.pdf and psdcmyk16

This was missed in the fix. Affected only 16 bit devices.

http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=b1ac0686eea6adcf2db8cabf7858796494b4459d

base/gxblend.c


2020-02-24 20:05:49 +0000
Robin Watts <Robin.Watts@artifex.com>
8f3320f9b6214907d24a4a9f77638b199aa95f8e

Fix Ink names leaking.

The cause of the leak was a typo in gx_final_DeviceN.

Once this is fixed, we hit a problem where ink names are set
to be a pointer to a static empty string, which can't be
freed. Change to using NULL to mean empty ink name.

base/gscdevn.c


2020-02-24 12:01:43 -0800
Robin Watts <Robin.Watts@artifex.com>
b28d57e7422d2d4df8c805342ad01dfc6c6e1232

Memento/Valgrind tweak.

Ensure we mark the contents of a block readable before we
look for pointers in it, and don't overrun the end.

base/memento.c


2020-02-24 12:57:28 +0000
Robin Watts <Robin.Watts@artifex.com>
0822ac2a5f1f02315a783504fccf615a55cf494f

Squash some unused variable warnings.

base/claptrap-planar.c
base/gp_unifs.c
base/gxclpath.c
gpdl/tifftop.c


2020-02-24 12:14:23 +0000
Robin Watts <Robin.Watts@artifex.com>
82a2d6356858c0a4ab9ff7fa294c0380d04aa9e3

pdf14_{fill_stroke_path,clist_fill_stroke_path_pattern_setup} cleanups.

Use a nicer method of breaking const (to avoid warnings). Ensure
that we always put everything back as it was when we leave the
functions, even if we have an error.

Remove needless cleanup code to handle functions that can never
return an error to us returning an error.

base/gdevp14.c


2020-02-24 12:35:30 +0000
Robin Watts <Robin.Watts@artifex.com>
b1ff23ccf08707af544de59d6c59971d0c17098c

pdf14_clist_fill_stroke_path_pattern_setup overprint fix.

Only enable CompatibleOverprint for the stroke part of stroke/fill
patterns if we are in a subtractive space.

base/gdevp14.c


2020-02-24 11:24:28 +0000
Robin Watts <Robin.Watts@artifex.com>
389324fd827e1172eb358b616a32af5fcb2633f6

Squash some warnings with gs_swapcolors_quick breaking const.

At various places in the code, we call gs_swapcolors_quick where
we only have a const pgs.

Properly, we should copy the pgs to a non-const pgs, and then use
that, but that would be a performance hit.

In all cases, we change the graphics state, then restore it before
exit, so effectively it is const over the entire call of the
enclosing procedure.

Rather than having lots of small hacky casts removing const, we
push the const breakage into gs_swapcolors_quick itself where we
do it in the "approved" way using a union.

base/gdevp14.c
base/gsstate.c
base/gxfill.c
base/gxgstate.h
devices/vector/gdevpdfd.c


2020-02-24 10:10:25 +0000
Robin Watts <Robin.Watts@artifex.com>
449433ff6689c603a56186dbde5721f6139aa939

Avoid floating point in gxblend.c

Use fixed point in preference.

base/gxblend.c


2020-02-24 08:23:59 +0000
Ken Sharp <ken.sharp@artifex.com>
6badfb362efe0fb4f0c3df106a33ecd5b0265ef7

Implement OPM tracking in pdfwrite

More than somewhat to my surprise, the release testing of 9.51 revealed
that pdfwrite was not tracking the state of overprint mode (OPM). It
could be set by setdistillerparams, and in no other way.

This commit adds tracking the OPM in the graphics state, removes the
old overprint_mode variable from the device, but preserves the ability
to alter the OPM using setdistillerparms.

This also alters the initial state of OPM, the distiller params
reference states that the 'factory default' of OPM is 1, but the PDF
Reference says that the initial state of OPM is 0. We need to start
with the correct setting of OPM so we change it form 1 to 0
in gs_pdfwr.ps.

In passing, cast a const gs_gstate * to a gs_gstate * when used by
gs_swapcolours_quick, in order to avoid a compiler warning.

This causes a small number of progressions in files using OPM (which is
rare, its even rarer to actually alter it during the course of the file)

Resource/Init/gs_pdfwr.ps
devices/vector/gdevpdfb.h
devices/vector/gdevpdfd.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfx.h


2020-02-20 16:24:12 -0800
Michael Vrhel <michael.vrhel@artifex.com>
3dc65600d6d4eb060398f06f148cfe4f07a82439

Bug 702117 Knockout groups containing non-isolated groups

So this ended up being rather complicated. The first issue was that
we were not setting the backdrop properly for non-isolated groups that
reside in knockout groups. When that was fixed, it was revealed that we
were not doing the recompositing operation for non-isolated knockout groups. This meant
that the backdrop was getting applied twice effectively (once in the original
fill and then again when the group was popped). The only file that showed
this issue was the crazy Altona page with the many overlapping groups. Customer
file added to provide a clearer case in the regression tests.

base/gdevp14.c
base/gxblend.c
base/gxblend1.c


2020-02-20 17:09:41 +0000
Julian Smith <jules@op59.net>
416baca7c4bcf0b1794b7b1647250bf09adaee9d

Fix MEMENTO_FAILAT=115867 - segv in i_unregister_root() after failure in i_register_root().

In pl_main_delete_instance(), don't call gs_unregister_root() if
minst->device_root is NULL.

Also in pl_top_create_device(), check return from
gs_register_struct_root(). But this doesn't appear to make any difference to
the handling of the memento error.

Fixes:
MEMENTO_FAILAT=115867 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

pcl/pl/plmain.c


2020-02-20 16:51:56 +0000
Robin Watts <Robin.Watts@artifex.com>
4eb54af16c69ef36371291bd43f853865adea1eb

Fix deep color group compose issue.

In commit bb7d57e84e9fe I reordered parameters to keep 8/16
branches consistent, and missed one case.

base/gxblend.c


2020-02-20 15:27:07 +0000
Robin Watts <Robin.Watts@artifex.com>
a2276988137021618bb3ca440aba50e126160bcd

Remove needless "isolated" parameter from pdf14_mark_rect routines.

The value was carefully plumbed through (only in the 8bit case) in
a recent commit, but was never actually used. Remove it a) because
it's pointless passing a variable we don't use, and b) because it's
another difference between 8 and 16 bit versions.

base/gxblend.c


2020-02-20 15:21:30 +0000
Robin Watts <Robin.Watts@artifex.com>
9ddcae93fe1629e81d36b17b7fec9de787b411cc

Fix typing mistake in 16bit transparency.

When promoting from 8 to 16 bit, shape and src_alpha become
uint16_ts rather than bytes.

base/gxblend.c


2020-02-20 15:06:38 +0000
Robin Watts <Robin.Watts@artifex.com>
7de8fe5a49df0f9154fa707a934e39c012c3cc2a

Fix more overprint problems with deep color transparency.

Again, overprint changes to the 8 bit paths had not been
pulled across to the 16 bit path.

base/gxblend.c


2020-02-19 07:10:40 +0000
Julian Smith <jules@op59.net>
2d3f8c01231d52a5595e2727b31b8044188a5af8

Added toolbin/squeeze2text.py, for processing output from MEMENTO_SQUEEZEAT=...

An alternative to squeeze2html.pl, outputing just summary information.

toolbin/squeeze2text.py


2020-02-20 11:18:11 +0000
Julian Smith <jules@op59.net>
777d79315e0094bef83d241bc0d5683ea6775a55

Fix for MEMENTO_FAILAT=115802: make gs_gsave_for_save() call gs_gsave() so it can restore after error.

Previously, zsave() called gs_gsave_for_save() then gs_gsave(), but if
gs_gsave() failed we ended up with SEGV in finalise code.

To allow zsave() to restore things after gs_gsave() failure, we would need to
add an include of base/gxgstate.h.

Instead we remove the call of gs_gsave() from zsave() and append it to
gs_gsave_for_save(), where things can be easily restored if it fails.

[There are no other callers of gs_gsave_for_save().]

Fixes:
MEMENTO_FAILAT=115802 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

base/gsstate.c
psi/zvmem.c


2020-02-18 09:44:51 +0000
Julian Smith <jules@op59.net>
6db4560f1e31bb92321894e0d008d310aa600097

Avoid leaks if we get alloc failure when closing down (found by memento).

In gs_main_finit(), ignore gs_error_VMerror from interp_reclaim(). Such error
ultimately comes from gs_vmreclaim() calling context_state_load(), but the
missing info doesn't seem to be required for gs_main_finit() to carry on.

Fixes:
MEMENTO_FAILAT=147801 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

psi/imain.c


2020-02-13 17:40:51 +0000
Robin Watts <Robin.Watts@artifex.com>
eb726fb4d2597cfcd4986dd9c105cf1ab71d09e3

Fix image_color_icc_prep to properly align planar buffers.

base/gxicolor.c


2020-02-13 10:50:10 +0000
Robin Watts <Robin.Watts@artifex.com>
e01371e00caa8f5d08ef150a6f594c93ca495be2

Enable CAL for gxicolor halftoning.

Looks like the calling code was unfinished, and the build
changes were not done.

Also, squash some warnings.

base/gxicolor.c
base/gximono.c
base/lib.mak
devices/gdevtsep.c


2020-02-17 15:57:47 +0000
Chris Liddell <chris.liddell@artifex.com>
c4e7cddc4d053f2850e697696e2498180547961a

Ensure the memory entry in a cloned gstate is correct.

In theory, we could end up cloning a graphics state with one allocator, then
assigning the "memory" entry in the cloned state to that of the state we are
cloning.

In practice the two have (so far) been the same, but that is not guaranteed.

base/gsstate.c


2020-02-14 11:08:57 +0000
Chris Liddell <chris.liddell@artifex.com>
239e70cd02491bab1cce9092c07c959427358646

Fix segfault cleaning up after gstate clone failure.

For me this happens with MEMENTO_FAILAT=112447 and for Julian it happens with
MEMENTO_FAILAT=115905.

Basically, the order of events was that we'd allocate a new gstate, copy the
contents of the existing gstate to the new one, then copy the dash pattern
(which could fail) and copy the "client_data" (which could and, in this case,
did fail). When either of those failed, we'd jump to the error handling and
exit with the error.

The problem is that, by jumping to the "fail" label, we skip over all the code
that fixes up the reference counts (and various other things) to account for
the newly created gstate.

This commit reorders things so we allocate the gstate, copy the client data,
copy the dash pattern, *then* assign the contents of the old gstate to the new
one, and carry on. Thus, by the time the gstate contents are copied, the
function cannot fail, and everything is sure to be correctly setup.

In the event that either the dash pattern or the client data fail to allocate,
the new gstate is still filled with NULLs, except for the subset of
"gs_gstate_parts" which are allocated and setup correctly so we can safely
free the graphics state object before returning the error.

Also, use NULL for pointer validation instead of 0.

base/gsstate.c


2020-02-18 17:43:18 -0800
Michael Vrhel <michael.vrhel@artifex.com>
db5b51109ddee39b17b2ff2c2ac12f41a70785ef

Make sure pattern fills use proper alpha settings

Fix for regression of fts_28_2804.pdf pdfwrite output rendering
with fill-stroke commit. This also fixes the rendering of fts_25_2526.pdf
Bug 702033. Required a minor change in the XPS interpreter to make
sure that patterns did not have their opacity double applied.

base/gdevp14.c
xps/xpstile.c


2020-02-19 17:20:09 +0000
Robin Watts <Robin.Watts@artifex.com>
cddd44e1bfcdaba1c289c3d83645613d136e5e3e

Bug 702105: Premature EOF Infinite loop in interpolated imagemask stream.

Fix supplied by Peter Cherepanov. Many thanks.

base/simscale.c


2020-02-19 16:58:06 +0000
Robin Watts <Robin.Watts@artifex.com>
59089ab66b3faaa683bb3aeb0bf856b7aa284f9b

Fix "blue gradients" seen with psdrgb device.

Since the fill/stroke commit went in, some files have been showing
gradients in the wrong colours. For instance this one, spotted in
release testing:

gs -sDEVICE=psdrgb -r72 -dMaxBitmap=2000M -o out%d.psd
../tests_private/comparefiles/Layout.pdf

Bisecting the fill/stroke branch back, it seems the commit that
caused it is the one that stops psdrgb using 'devn' colors.

This causes gradients to drop to using the color_info.comp_bits and
comp_shift information, which the psd devices don't fill in.

The fix here is to make psd_prn_open call the standard function for
setting up these values.

devices/gdevpsd.c


2020-02-13 14:48:05 -0800
Nancy Durgin <nancy.durgin@artifex.com>
25cd0c72b98f9efc6968254d1e3a2f33ec376369

Bug701972 -- fix pdfwrite image downscaling bug

Calculate the bits on the row using the input image width,
not the output image width.

I had to add an extra argument to a few functions to propagate the info
down to where it is needed.

Note obscure case involving calling psdf_setup_image_to_mask_filter()
for a Type 4 image and CompatibilityLevel < 1.3. This change just
adds the extra input_width arg, which doesn't change whatever it was
doing before. If there is a bug lurking here, it seems unlikely
anybody cares?

devices/vector/gdevpdfi.c
devices/vector/gdevpsdf.h
devices/vector/gdevpsdi.c
devices/vector/gdevpsds.c
devices/vector/gdevpsds.h


2020-02-12 09:22:55 -0800
Nancy Durgin <nancy.durgin@artifex.com>
e9523603ac713e365702b81c228edcaaac667dc4

Set the BitsPerComponent for alt stream in pdfwrite

Add this to the image[1] code where it was missing

This fixes bug where compressed images were correct, but if
-dEncodeGrayImages=false was used, then they were truncated.

This is related to trimmed/rescaled image for Bug701972.
See the sample trim-nobug.pdf attached to that bug.

devices/vector/gdevpdfi.c


2020-02-18 19:25:24 +0000
Robin Watts <Robin.Watts@artifex.com>
924f7ea07c7773a3b1510c6206c9a34227e4b39e

Bug 702131: Fix overprint in additive spaces.

We should only enter CompatibleOverprint blend mode if we
are in an subtractive space. This stops pdf14 trying to honour
drawn_comps even in additive spaces.

base/gdevp14.c


2020-02-14 14:02:24 -0800
Ray Johnston <ray.johnston@artifex.com>
d98b553c829fad94cd4338910468d2b1b6ee64f7

Fix bug 702079: SEGV with clist and PCL caused by wrong color in images.

The clist_image_plane_data function was called with the dev_color for a band
being type <pattern> when the image had type <pure>, but the code was not
calling cmd_put_drawing_color to update the bands for the image because uses_color
was false. Add rop3_uses_S(pgs0>log_op) as well as (||) rop3_uses_T(pgs->log_op)
when CombineWitColor is true.
Note that extra calls to cmd_put_drawing_color before an image are low cost
and do nothing if the current device color is already the same.

base/gxclimag.c


2020-02-18 09:48:07 -0800
Michael Vrhel <michael.vrhel@artifex.com>
4f55464d5c1640075a67a8b50557a48766783e08

Bug 702128 : clist pdf14 overprint state

This change ensures that gxdso_overprint_active
gets the proper state information.

When the clist writer is active with the pdf14 device, the writer maintains
the current overprint state (as the writer has no access to the pdf14 member variables)
and must know what to put in the clist.

When the clist writer is not present (i.e. page mode), the pdf14 device
maintains the information.

base/gdevp14.c


2020-02-18 11:46:45 +0000
Robin Watts <Robin.Watts@artifex.com>
f1887408860910c19c980f05fd0f8fc93b5f06a1

Bug 702068 continued: Fix smasked images with masks.

Release testing has shown up another case that needs help.

gs/bin -sDEVICE=ppmraw -o out.ppm -r300 -dMaxBitmap=1G
tests_private/pdf/sumatra/1901_-_tiling_inconsistencies.pdf

This shows horizontal white lines in the "Next" "Up" "Previous"
images at the top of the page.

Investigation shows this is due to the images having Masks as well
as SMasks.

The Mask image is run to a 1 bit memory device, which means that
the gxdso to check if we are in an SMask doesn't work. We work
around this by introducing a new flag to gs_pixel_image_common
that we can set to indicate that we are within an smask. We set
this when we set the masked image up (using the gxdso), and check
it when we come to do the gridfitting.

base/gsiparam.h
base/gxclrast.c
base/gximage.c
base/gximage3.c
base/gxipixel.c


2020-02-17 19:31:50 +0000
Robin Watts <Robin.Watts@artifex.com>
51a0be1a6ac3bae2dc1b8bcdd91f58f76b9132c9

Sync deep colour blending with recent changes to 8 bit blending.

Release testing reveals problems with deep color blending and
overprint. This is because changes were made to the 8bit
branches of gxblend.c that weren't fully reflected in the
16bit branches.

Reapply those changes here.

While we're at it, address some other minor code cleanups,
including keeping the ordering of parameters the same between 8
and 16 bit to avoid confusion in future.

The command that showed the inital problem was:

bin/gswin32c.exe -o out.psd -sDEVICE=psdcmyk16 tests_private/comparefiles/Bug695916.pdf

where the image of the Earth did not appear.

base/gxblend.c


2020-02-17 13:27:10 +0000
Robin Watts <Robin.Watts@artifex.com>
b7faa941d09db8856378e45d4f5c81b5f93e5f90

Bug 702130: Fix JPEG memory failure problems.

The SEGV reported by Memento squeezing (which oddly is at 113600
for me, rather than Julian's higher number) is caused by jpeglib
calling 'mem_term' on something that failed to 'mem_init'.

The fix is to use gs_memory_chunk_unwrap rather than target/release,
and to check whether mem == cmem to see whether that actually did
unwrap.

This runs us into a further problem, where we are freeing the
custom memory descriptor using a gc memory pointer, where it was
allocated using a non gc one.

Rather than just changing the free to use the non gc one, we take
the opportunity to ensure that ALL the blocks are in non gc memory.
JPEGlib will take poorly to its memory being gc'd away, and none
of it needs to subject to gc.

Credit goes largely to Chris for this fix.

base/sjpegc.c


2020-02-14 18:44:53 +0000
Robin Watts <Robin.Watts@artifex.com>
619c0231952c20cc14f0eaf603e0cb01aa937eff

Bug 702124 (continued): Avoid FP errors leading to empty pattern cells.

The limited accuracy of floats can cause pattern cells to appear to
be empty when they are not.

Avoid adding the (often large) tx and ty components in until after we
have calculated the width/heights.

base/gsptype1.c


2020-02-14 18:43:00 +0000
Robin Watts <Robin.Watts@artifex.com>
8edb1b1e7bb84ff4598819fe078eb0ed2c4948d5

Bug 702124: Avoid VMerror when a pattern cell height is 0.

We detect buffer_height == 0 and take it to mean that we can't
get a large enough buffer for even a single scanline. Actually
it can mean that the pattern cell was empty, which gives a
spurious error.

base/gxmclip.c


2020-02-14 17:08:12 +0000
Julian Smith <jules@op59.net>
6beaf42d25f3969b6dc3d8e1b1795017708000c5

Fix segv after memento squeeze in psdf_DCT_filter().

Fixes:
MEMENTO_FAILAT=117152 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

devices/vector/gdevpsdu.c


2020-02-13 14:54:42 +0000
Julian Smith <jules@op59.net>
8d052b3de78b8034daed23e668758c76a8d8c478

Fixed double free after alloc failure in gs_lib_ctx_set_icc_directory*() (found by memento).

After we've freed p_ctx->profiledir we need to set it to NULL otherwise if we
return an error it will be freed a second time when we close down.

Fixes:
MEMENTO_FAILAT=101810 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

base/gslibctx.c


2020-02-12 11:12:37 +0000
Julian Smith <jules@op59.net>
dbde03ca37da96a94f4b7a6f0ba22a47a7bc2cb1

Fixed leak on error in gs_fapi_ufst_init() (found by memento).

Fixes:
MEMENTO_FAILAT=22 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

base/fapiufst.c


2020-02-13 19:48:01 +0000
Robin Watts <Robin.Watts@artifex.com>
08695f8ccebb0d25eb2a5933ecee92281eefc1be

Bug 702121: PCL performance degradation

Henry chased the cause down to commit b399f84, an attempt to
fix Bug 700624. Looking at that code now, it has a silly typo
in it, that was causing it not be triggered in cases when it
should have been. Fixed here.

base/gxpcmap.c


2020-02-13 11:11:40 -0800
Robin Watts <Robin.Watts@artifex.com>
e2cdef26db058e84c2cf4dff5f638e669f961b52

Alternative fix for leaks after error in gs_main_init_with_args01()

When memory squeezing gpdl, Julian found leaks in the gpdl
startup of the postscript interpreter when allocations failed
in gs_main_init_with_args01().

Here, we fix the problem by making the psitop.c layer within gpdl
call the appropriate shutdown code when we catch the error. This
moves gpdl to being consistent with other users of the gs_main
layer.

Memento memory squeezing around the point of failure (event 2035)
now shows this to be OK.

MEMENTO_SQUEEZEAT=2034 ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

gpdl/psitop.c


2020-02-13 18:47:37 +0000
Robin Watts <Robin.Watts@artifex.com>
bbecd13cc34f3dcdcedd726e7de12c988da9794a

Revert "Fix leaks after error in gs_main_init_with_args01() (found by memento)."

This reverts commit f35924926cb35f08be5a12ded4a00eb2f42aed3e.

When memory squeezing gpdl, Julian found leaks in the gpdl
startup of the postscript interpreter when allocations failed
in gs_main_init_with_args01().

The initial fix attempted was to make gs_main_init_with_args01()
closedown the interpreter on such errors. This worked for the
tested cases, but hid problems with non-memory related errors
(such as not being able to open a file specified on the command
line) when called by gs (rather than gpdl).

The change attempted resulted in gs_main_finit() being called
twice as gs (and other users of the gs_main APIs) expect to have
to call gs_main_finit() to shut down after gs_main_init_with_args01()
returns an error code.

The real problem is that gpdl is not doing this in the same way as
other callers.

The gs_main layer has existed for donkeys years, so it's probably
best that we just take it as fixed and don't require callers to
start changing stuff now.

Accordingly, I am reverting the attempted fix here, and will
try a different fix for it that only affects gpdl shortly.

psi/imainarg.c


2020-02-11 16:48:24 -0800
Ray Johnston <ray.johnston@artifex.com>
68be233f36feb045e442a18c4f4e4d2ced52b197

Change to improve memory and speed (Bug 702099)

As described in the bug, the patch to disable high-level images in
pattern-clists when Interpolate is true is no longer needed (hasn't
been since 2015), and it causes the memory and performance problems
with this type of file.

base/gxclimag.c


2020-02-12 15:10:54 -0800
Michael Vrhel <michael.vrhel@artifex.com>
2dea734a6184668511758fe1929a1d3166df85b6

Bug 702114 non-isolated group in knockout group

Make sure to use the parents backdrop as our backdrop when we
push a non-isolated group that resides in a knockout group.
Note though that this apparently is not the case if we are
constructing a soft mask.

base/gdevp14.c


2020-02-12 10:54:47 -0800
Michael Vrhel <michael.vrhel@artifex.com>
9af467b71198710bc42509e00b730a716b8e4828

Bug 702113 Softmask with transfer function

In a couple spots we look at the value of the background value
of the softmask to decide if we really need the softmask in
areas outside the group bounding box. These checks were not
considering the impact of the transfer function.

base/gdevp14.c


2020-02-12 11:37:33 +0000
Chris Liddell <chris.liddell@artifex.com>
b6d36e3205a8b065014b3965cb3c8269408309ca

Dates etc for 9.51 RC1

Plus prelim changelog

Makefile.in
base/gscdefs.h
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/Internal.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
psi/winint.mak



Version 9.52 (2020-03-19)

Highlights in this release include:

  • The 9.52 release replaces the 9.51 release, after a problem was reported with 9.51 which warranted the quick turnaround. Thus, like 9.51, 9.52 is primarily a maintenance release, consolidating the changes we introduced in 9.50.

  • We have continued our work on code hygiene for this release, with a focus on the static analysis tool Coverity (from Synopsys, Inc) and we have now adopted a policy of maintaining zero Coverity issues in the Ghostscript/GhostPDL source base.

  • IMPORTANT: In consultation with a representative of (OpenPrinting) it is our intention to deprecate and, in the not distant future, remove the OpenPrinting Vector/Raster Printer Drivers (that is, the opvp and oprp devices).

    If you rely on either of these devices, please get in touch with us, so we can discuss your use case, and revise our plans accordingly.

  • IMPORTANT: We have forked LittleCMS2 into LittleCMS2mt (the "mt" indicating "multi-thread"). 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. If there is sufficient interest, 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

Included below are incompatible changes from recent releases (the specific release in question listed in parentheses). We include these, for now, as we are aware that not everyone upgrades with every release.

  • (9.52) As of 9.52, the Windows binaries released by the Ghostscript development team are built with Microsoft Visual Studio 2019. As a result Microsoft Windows XP and earlier are no longer supported by these binaries. This does not imply we are, or will start relying upon features only available in VS2019, so the nmake Makefiles will continue to allow older Visual Studio versions (back to VS2005) to build Ghostscript.

  • (9.52) -dALLOWPSTRANSPARENCY: The transparency compositor (and related features), whilst we are improving it, remains sensitive to being driven correctly, and incorrect use can have unexpected/undefined results. Hence, as part of improving security we limited access to these operators, originally using the -dSAFER feature. As we made "SAFER" the default mode, that became unacceptable, hence the new option -dALLOWPSTRANSPARENCY which enables access to the operators.

  • (9.50) There are a couple of subtle incompatibilities between the old and new SAFER implementations. Firstly, as mentioned in the 9.50 release notes, SAFER now leaves standard Postcript functionality unchanged (except for the file access limitations). Secondly, the interaction with save/restore operations, see SAFER.

    Important Note for Windows Users:
    The file/path pattern matching is case sensitive, even on Windows. This is a change in behaviour compared to the old code which, on Windows, was case insensitive. This is in recognition of changes in Windows behaviour, in that it now supports (although does not enforce) case sensitivity.

  • (9.27) The process of "tidying" the Postscript name space should have removed only non-standard and undocumented operators. Nevertheless, it is possible that any integrations or utilities that rely on those non-standard and undocumented operators may stop working, or may change behaviour.

    If you encounter such a case, please contact us (either the #ghostscript IRC channel, or the gs-devel mailing list would be best), and we'll work with you to either find an alternative solution or return the previous functionality, if there is genuinely no other option.

    One case we know this has occurred is GSView 5 (and earlier). GSView 5 support for PDF files relied upon internal use only features which are no longer available. GSView 5 will still work as previously for Postscript files. For PDF files, users are encouraged to look at MuPDF.

Changelog

2020-03-14 15:07:37 +0000
Chris Liddell <chris.liddell@artifex.com>
eec073529fb8dc0c3bb6d612b61bf483d135c9cf

Bug 702217: Reinstate dynamic libs LDFLAGS for MacOS

With the significant revamp of the platform detection functions in configure
the LDFLAGS for building the gs shared library on MacOS went astray. This
puts them back in.

configure.ac


2020-03-16 09:06:16 +0000
Ken Sharp <ken.sharp@artifex.com>
a9cd9959372b9f14b493b87df57664ea831c5d80

Repair device subclassing after fill+stroke commit

Bug 702221 "Ghostscript 9.51 - SIGFPE when -dFirstPage or -dLastPage is set"

The fill+stroke commit had an error with the default method for handling
fill_stroke_path which passed the subclassing device as a parameter to
the child, instead of passing the child device. This caused seg faults,
floating point exceptions, hangs, and possibly other problems.

In addition the object filtering device had been modified to pass the
fill+stroke method to the default handler, instead of checking to see
if vector operations should be dropped.

This commit fixes both problems.

base/gdevoflt.c
base/gdevsclass.c


2020-03-14 10:56:43 +0000
Chris Liddell <chris.liddell@artifex.com>
f712440a2f251ae06277ec4a5ffe8ce7599aa4d8

Add ARCH_MAX_SIZE_T to configure's arch.h prototype

arch/arch_autoconf.h.in


2020-03-14 10:53:15 +0000
Chris Liddell <chris.liddell@artifex.com>
214d16924543fb3116a031463052e8b0eff3f1ae

Don't fail on missing freetype for auxtools run

When cross compiling, we shouldn't fail the recursive call to configure if
there's no freetype - since it's not required for auxtools.

configure.ac


2020-03-02 17:10:43 +0000
Robin Watts <Robin.Watts@artifex.com>
15f5f8bad503e9d3e63db9c3ca395deffd6b1e20

Fix 16bit blending problem.

Seen with:

gs -sDEVICE=psdcmyk16 -o out%d.psd -r72 -dMaxBitmap=2000M
tests_private/pdf/forms/v1.5/proxy_vol_1_number_1_1.pdf

on page 3.

base/gxblend.c


2020-03-02 11:04:32 +0000
Robin Watts <Robin.Watts@artifex.com>
f6e3e9238bb5cf7fe44c3c845be286a3314ed905

Fix 64bit non-console windows build.

The creation of the text window was truncating the pointer to
long (32bit) size. No idea how we've been getting away with this
in the past. I can only assume this has been exposed by
differences in the runtime lib with vs2019 as compared to
earlier versions.

psi/dwtext.c


2020-03-02 09:02:51 +0000
Chris Liddell <chris.liddell@artifex.com>
ffe0e5cf33feee7672e5f4281f0c0b0ff66bddda

Add mention of deprecating/removing opvp/oprp devices

doc/History9.htm
doc/News.htm


2020-02-26 15:22:04 +0000
Robin Watts <Robin.Watts@artifex.com>
dbaddcf6e251229a1506f2df33844365df39de44

Fix signed issue in 16bit alpha blending fill_rectangle routines.

As seen by the central spot in the pink region of page 1 of:

gs -sDEVICE=psdcmyk16 -o out%d.psd -dMaxBitmap=2000M
tests_private/pdf/pdf_1.7_ATS_EXXPA1DC_PDFACT.pdf

base/gxblend.c


2020-02-26 15:09:35 +0000
Ken Sharp <ken.sharp@artifex.com>
4ad8020c3cb63345dd76119e8978c3353940a68e

pdfwrite - Fix indeterminism with QL shading tests

When creating a new colour space to put in a PDF file we perform various
tests to see if its a space we have already written, to prevent writing
duplicate spaces (we perform similar tests for most resources).

In some cases, when we write the resource to a file, we create an MD5
hash and compare those to see if the resources are the same. In the
case of colour spaces, however, they are retained in memory and so we
use a different method. We 'serialise' the colour space. This is not the
same as writing it to the PDF file, and its a graphics library thing not
a pdfwrite function. Basically this writes out the content of the
various C structures. The stream we use is an in-memory stream.

Unfortunately, for Separation colour spaces, there was a fault in the
function which writes the colour space name, and it was writing out
the bytes forming the address of the name instead of the actual string.

This could, very rarely, mean that we would mis-identify a new colour
space as being the same as an old colour space, and so would reuse the
old space instead of creating a new one.

I've checked the DeviceN code and it does not suffer the same problem.

base/gscsepr.c


2020-02-26 13:03:56 +0000
Robin Watts <Robin.Watts@artifex.com>
3cb8b3a403450d617b2b96ec0349bb99ce0d8379

Fix the overflow case in 16 bit saturation blending.

As seen with the second apple of the bottom row of page 1
of:

gs -sDEVICE=psdcmyk16 -r72 -o out%d.psd -dMaxBitmap=2000M
../tests_private/pdf/PDF_1.7_ATS/AIX4G1C3.pdf

base/gxblend.c


2020-02-25 17:10:51 +0000
Julian Smith <jules@op59.net>
5d4305e916d3f75492d03dfd79ab1aaedf9545e3

Fix for bug 702150: make pl_main_run_file_utf8() check for error from s_process_read_buf().

Avoids infinite loop in:
./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null .

pcl/pl/plmain.c


2020-02-25 18:24:55 +0000
Julian Smith <jules@op59.net>
2c6efee0f594ad29394bf8a303f21d85dcb1d70a

minor improvements to toolbin/squeeze2text.py.

toolbin/squeeze2text.py


2020-02-26 08:25:13 +0000
Robin Watts <Robin.Watts@artifex.com>
ef5dfe7e3b3858bdfb20c168b4818c4d65fb932f

CID 354310: Remove pointless unsigned comparison with 0.

base/gxblend.c


2020-02-26 08:11:49 +0000
Chris Liddell <chris.liddell@artifex.com>
29335f43967a0f089d6f2f37883a22f1516f7bde

CID 354291: Add error handling for inability to allocate

Coverity complained about setting dash.pattern = NULL and "Passing "&dash"
to "gstate_copy_dash", which dereferences null "dash.pattern" which is either
wrong, or *very* misleading. We assume that it means that gx_set_dash() *may*
access that pointer.

In truth, this can never happen in these circumstances.

Nevertheless, in gx_set_dash() is we have a NULL mem (allocator) pointer and the
dash pattern pointer is NULL at the point we have to copy into it, then throw
an error.

base/gsline.c


2020-02-25 19:59:03 -0800
Ray Johnston <ray.johnston@artifex.com>
1d0889b9fcf3a5d5012fad021b4c53828879016e

Fix bug 702139 - clist clipping bug.

When characters are filled as paths, the fill_adjust may be set to 0.
Clip paths are supposed to match fill paths, i.e. the 'any part of pixel'
rule, so we need fill_adjust of 0.5 (not 0). The most foolproof way to fix
this is to set it in the reader when processing 'begin_clip' and restore
it when handling the end_clip.

There are many progressions with this change, but it also exposes some
cases where the change in clipping allows other elements to be seen that
were previously hidden. Those few instances are minor and mostly seem to
occur when page mode differs from clist mode. Examination of some of those
cases shows that the clip path with clist mode now matches page mode and
other elements (e.g. images) differ in extent between page and clist mode.

base/gxclrast.c


2020-02-25 19:39:50 +0000
Robin Watts <Robin.Watts@artifex.com>
86f81e9b799b66207c699768616a6e3ba3c311c3

Fix gx_default_copy_alpha_hl_color for 16 bit operation.

The code to write the composite data back to buffers to be sent
to copy_alpha was getting the first byte of each 16 bit pair
wrong in the 16bit data case.

Also, when we 'restart' after skipping a zero byte in the 16bit
case we need to skip 2 bytes per pixel, not one.

This can be seen when running:

gs -r72 -o out%d.psd -sDEVICE=psdcmyk16 -dMaxBitmap=2000M
../tests_private/comparefiles/js.pdf

base/gdevdbit.c


2020-02-25 18:19:07 +0000
Robin Watts <Robin.Watts@artifex.com>
635303ca7d8a36b3dabc9afbd9132f4b9a36dce5

Fix psdcmyk16 blending issue.

Use uint32_t rather than int to avoid signedness issues.

Seen in the psdcmyk16 page mode rendering of

tests_private/comparefiles/Bug692766.pdf

(bad colors in 4th rgb circle intersection test).

base/gxblend.c


2020-02-25 15:57:36 +0000
Robin Watts <Robin.Watts@artifex.com>
a00c75369e082798d82202a2b64d8e4b484d0c11

Fix coverity issues 354292 and 354293.

Don't bother testing an unsigned value for clipping against 0.

base/gxblend.c


2020-02-25 08:58:32 +0000
Chris Liddell <chris.liddell@artifex.com>
32f3d6703a7e5c6582c066837783c6697e98b1ca

Replace 0 with NULL for pointer validation/setting.

Also make validation an explicit comparison with NULL i.e.:
"if (mem != NULL)" rather than "if (mem)".

base/gsline.c


2020-02-24 17:30:54 +0000
Julian Smith <jules@op59.net>
6c1002cc251907e702fd5db9dc81365a964816c6

Add support for multiple squeezes in one run.

E.g. MEMENTO_SQUEEZES=115867-1..+3,119928-1..+3 ...

This is equivalent running multiple times with MEMENTO_FAILAT set to 115866,
115867, 11588, 119927, 119928, 119929.

base/memento.c


2020-02-24 10:38:53 +0000
Julian Smith <jules@op59.net>
39557bd53eee75a8b8f762457ce57a5437e79d6c

Fix for MEMENTO_FAILAT=119928: only call gs_grestoreall_for_restore() if vmsave->gsave not NULL.

Also fix error cleanup in gs_gsave_for_save(), otherwise this fix breaks
previous fix for MEMENTO_FAILAT=115802.

[Thanks to chrisl for this and various other recent fixes.]

Fixes:
MEMENTO_FAILAT=119928 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

base/gsstate.c
psi/isave.c


2020-02-24 11:21:53 +0000
Julian Smith <jules@op59.net>
60507d492507817bb5ae14a17a01d19c50d41e0a

toolbin/squeeze2text.py: improve log output.

With -p, if there is gap in 'Memory squeezing @ <N>' output (because of calls
to free()), output next <N>.

Also flush log output to avoid looking like we've hung.

toolbin/squeeze2text.py


2020-02-24 21:00:21 -0800
Michael Vrhel <michael.vrhel@artifex.com>
3a9ea36465e97ce729c5ab26dc8e0d1435b7b246

Fix issue with fts_14_1416.pdf and psdcmyk16

This was missed in the fix. Affected only 16 bit devices.

http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=b1ac0686eea6adcf2db8cabf7858796494b4459d

base/gxblend.c


2020-02-24 20:05:49 +0000
Robin Watts <Robin.Watts@artifex.com>
8f3320f9b6214907d24a4a9f77638b199aa95f8e

Fix Ink names leaking.

The cause of the leak was a typo in gx_final_DeviceN.

Once this is fixed, we hit a problem where ink names are set
to be a pointer to a static empty string, which can't be
freed. Change to using NULL to mean empty ink name.

base/gscdevn.c


2020-02-24 12:01:43 -0800
Robin Watts <Robin.Watts@artifex.com>
b28d57e7422d2d4df8c805342ad01dfc6c6e1232

Memento/Valgrind tweak.

Ensure we mark the contents of a block readable before we
look for pointers in it, and don't overrun the end.

base/memento.c


2020-02-24 12:57:28 +0000
Robin Watts <Robin.Watts@artifex.com>
0822ac2a5f1f02315a783504fccf615a55cf494f

Squash some unused variable warnings.

base/claptrap-planar.c
base/gp_unifs.c
base/gxclpath.c
gpdl/tifftop.c


2020-02-24 12:14:23 +0000
Robin Watts <Robin.Watts@artifex.com>
82a2d6356858c0a4ab9ff7fa294c0380d04aa9e3

pdf14_{fill_stroke_path,clist_fill_stroke_path_pattern_setup} cleanups.

Use a nicer method of breaking const (to avoid warnings). Ensure
that we always put everything back as it was when we leave the
functions, even if we have an error.

Remove needless cleanup code to handle functions that can never
return an error to us returning an error.

base/gdevp14.c


2020-02-24 12:35:30 +0000
Robin Watts <Robin.Watts@artifex.com>
b1ff23ccf08707af544de59d6c59971d0c17098c

pdf14_clist_fill_stroke_path_pattern_setup overprint fix.

Only enable CompatibleOverprint for the stroke part of stroke/fill
patterns if we are in a subtractive space.

base/gdevp14.c


2020-02-24 11:24:28 +0000
Robin Watts <Robin.Watts@artifex.com>
389324fd827e1172eb358b616a32af5fcb2633f6

Squash some warnings with gs_swapcolors_quick breaking const.

At various places in the code, we call gs_swapcolors_quick where
we only have a const pgs.

Properly, we should copy the pgs to a non-const pgs, and then use
that, but that would be a performance hit.

In all cases, we change the graphics state, then restore it before
exit, so effectively it is const over the entire call of the
enclosing procedure.

Rather than having lots of small hacky casts removing const, we
push the const breakage into gs_swapcolors_quick itself where we
do it in the "approved" way using a union.

base/gdevp14.c
base/gsstate.c
base/gxfill.c
base/gxgstate.h
devices/vector/gdevpdfd.c


2020-02-24 10:10:25 +0000
Robin Watts <Robin.Watts@artifex.com>
449433ff6689c603a56186dbde5721f6139aa939

Avoid floating point in gxblend.c

Use fixed point in preference.

base/gxblend.c


2020-02-24 08:23:59 +0000
Ken Sharp <ken.sharp@artifex.com>
6badfb362efe0fb4f0c3df106a33ecd5b0265ef7

Implement OPM tracking in pdfwrite

More than somewhat to my surprise, the release testing of 9.51 revealed
that pdfwrite was not tracking the state of overprint mode (OPM). It
could be set by setdistillerparams, and in no other way.

This commit adds tracking the OPM in the graphics state, removes the
old overprint_mode variable from the device, but preserves the ability
to alter the OPM using setdistillerparms.

This also alters the initial state of OPM, the distiller params
reference states that the 'factory default' of OPM is 1, but the PDF
Reference says that the initial state of OPM is 0. We need to start
with the correct setting of OPM so we change it form 1 to 0
in gs_pdfwr.ps.

In passing, cast a const gs_gstate * to a gs_gstate * when used by
gs_swapcolours_quick, in order to avoid a compiler warning.

This causes a small number of progressions in files using OPM (which is
rare, its even rarer to actually alter it during the course of the file)

Resource/Init/gs_pdfwr.ps
devices/vector/gdevpdfb.h
devices/vector/gdevpdfd.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfx.h


2020-02-20 16:24:12 -0800
Michael Vrhel <michael.vrhel@artifex.com>
3dc65600d6d4eb060398f06f148cfe4f07a82439

Bug 702117 Knockout groups containing non-isolated groups

So this ended up being rather complicated. The first issue was that
we were not setting the backdrop properly for non-isolated groups that
reside in knockout groups. When that was fixed, it was revealed that we
were not doing the recompositing operation for non-isolated knockout groups. This meant
that the backdrop was getting applied twice effectively (once in the original
fill and then again when the group was popped). The only file that showed
this issue was the crazy Altona page with the many overlapping groups. Customer
file added to provide a clearer case in the regression tests.

base/gdevp14.c
base/gxblend.c
base/gxblend1.c


2020-02-20 17:09:41 +0000
Julian Smith <jules@op59.net>
416baca7c4bcf0b1794b7b1647250bf09adaee9d

Fix MEMENTO_FAILAT=115867 - segv in i_unregister_root() after failure in i_register_root().

In pl_main_delete_instance(), don't call gs_unregister_root() if
minst->device_root is NULL.

Also in pl_top_create_device(), check return from
gs_register_struct_root(). But this doesn't appear to make any difference to
the handling of the memento error.

Fixes:
MEMENTO_FAILAT=115867 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

pcl/pl/plmain.c


2020-02-20 16:51:56 +0000
Robin Watts <Robin.Watts@artifex.com>
4eb54af16c69ef36371291bd43f853865adea1eb

Fix deep color group compose issue.

In commit bb7d57e84e9fe I reordered parameters to keep 8/16
branches consistent, and missed one case.

base/gxblend.c


2020-02-20 15:27:07 +0000
Robin Watts <Robin.Watts@artifex.com>
a2276988137021618bb3ca440aba50e126160bcd

Remove needless "isolated" parameter from pdf14_mark_rect routines.

The value was carefully plumbed through (only in the 8bit case) in
a recent commit, but was never actually used. Remove it a) because
it's pointless passing a variable we don't use, and b) because it's
another difference between 8 and 16 bit versions.

base/gxblend.c


2020-02-20 15:21:30 +0000
Robin Watts <Robin.Watts@artifex.com>
9ddcae93fe1629e81d36b17b7fec9de787b411cc

Fix typing mistake in 16bit transparency.

When promoting from 8 to 16 bit, shape and src_alpha become
uint16_ts rather than bytes.

base/gxblend.c


2020-02-20 15:06:38 +0000
Robin Watts <Robin.Watts@artifex.com>
7de8fe5a49df0f9154fa707a934e39c012c3cc2a

Fix more overprint problems with deep color transparency.

Again, overprint changes to the 8 bit paths had not been
pulled across to the 16 bit path.

base/gxblend.c


2020-02-19 07:10:40 +0000
Julian Smith <jules@op59.net>
2d3f8c01231d52a5595e2727b31b8044188a5af8

Added toolbin/squeeze2text.py, for processing output from MEMENTO_SQUEEZEAT=...

An alternative to squeeze2html.pl, outputing just summary information.

toolbin/squeeze2text.py


2020-02-20 11:18:11 +0000
Julian Smith <jules@op59.net>
777d79315e0094bef83d241bc0d5683ea6775a55

Fix for MEMENTO_FAILAT=115802: make gs_gsave_for_save() call gs_gsave() so it can restore after error.

Previously, zsave() called gs_gsave_for_save() then gs_gsave(), but if
gs_gsave() failed we ended up with SEGV in finalise code.

To allow zsave() to restore things after gs_gsave() failure, we would need to
add an include of base/gxgstate.h.

Instead we remove the call of gs_gsave() from zsave() and append it to
gs_gsave_for_save(), where things can be easily restored if it fails.

[There are no other callers of gs_gsave_for_save().]

Fixes:
MEMENTO_FAILAT=115802 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

base/gsstate.c
psi/zvmem.c


2020-02-18 09:44:51 +0000
Julian Smith <jules@op59.net>
6db4560f1e31bb92321894e0d008d310aa600097

Avoid leaks if we get alloc failure when closing down (found by memento).

In gs_main_finit(), ignore gs_error_VMerror from interp_reclaim(). Such error
ultimately comes from gs_vmreclaim() calling context_state_load(), but the
missing info doesn't seem to be required for gs_main_finit() to carry on.

Fixes:
MEMENTO_FAILAT=147801 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

psi/imain.c


2020-02-13 17:40:51 +0000
Robin Watts <Robin.Watts@artifex.com>
eb726fb4d2597cfcd4986dd9c105cf1ab71d09e3

Fix image_color_icc_prep to properly align planar buffers.

base/gxicolor.c


2020-02-13 10:50:10 +0000
Robin Watts <Robin.Watts@artifex.com>
e01371e00caa8f5d08ef150a6f594c93ca495be2

Enable CAL for gxicolor halftoning.

Looks like the calling code was unfinished, and the build
changes were not done.

Also, squash some warnings.

base/gxicolor.c
base/gximono.c
base/lib.mak
devices/gdevtsep.c


2020-02-17 15:57:47 +0000
Chris Liddell <chris.liddell@artifex.com>
c4e7cddc4d053f2850e697696e2498180547961a

Ensure the memory entry in a cloned gstate is correct.

In theory, we could end up cloning a graphics state with one allocator, then
assigning the "memory" entry in the cloned state to that of the state we are
cloning.

In practice the two have (so far) been the same, but that is not guaranteed.

base/gsstate.c


2020-02-14 11:08:57 +0000
Chris Liddell <chris.liddell@artifex.com>
239e70cd02491bab1cce9092c07c959427358646

Fix segfault cleaning up after gstate clone failure.

For me this happens with MEMENTO_FAILAT=112447 and for Julian it happens with
MEMENTO_FAILAT=115905.

Basically, the order of events was that we'd allocate a new gstate, copy the
contents of the existing gstate to the new one, then copy the dash pattern
(which could fail) and copy the "client_data" (which could and, in this case,
did fail). When either of those failed, we'd jump to the error handling and
exit with the error.

The problem is that, by jumping to the "fail" label, we skip over all the code
that fixes up the reference counts (and various other things) to account for
the newly created gstate.

This commit reorders things so we allocate the gstate, copy the client data,
copy the dash pattern, *then* assign the contents of the old gstate to the new
one, and carry on. Thus, by the time the gstate contents are copied, the
function cannot fail, and everything is sure to be correctly setup.

In the event that either the dash pattern or the client data fail to allocate,
the new gstate is still filled with NULLs, except for the subset of
"gs_gstate_parts" which are allocated and setup correctly so we can safely
free the graphics state object before returning the error.

Also, use NULL for pointer validation instead of 0.

base/gsstate.c


2020-02-18 17:43:18 -0800
Michael Vrhel <michael.vrhel@artifex.com>
db5b51109ddee39b17b2ff2c2ac12f41a70785ef

Make sure pattern fills use proper alpha settings

Fix for regression of fts_28_2804.pdf pdfwrite output rendering
with fill-stroke commit. This also fixes the rendering of fts_25_2526.pdf
Bug 702033. Required a minor change in the XPS interpreter to make
sure that patterns did not have their opacity double applied.

base/gdevp14.c
xps/xpstile.c


2020-02-19 17:20:09 +0000
Robin Watts <Robin.Watts@artifex.com>
cddd44e1bfcdaba1c289c3d83645613d136e5e3e

Bug 702105: Premature EOF Infinite loop in interpolated imagemask stream.

Fix supplied by Peter Cherepanov. Many thanks.

base/simscale.c


2020-02-19 16:58:06 +0000
Robin Watts <Robin.Watts@artifex.com>
59089ab66b3faaa683bb3aeb0bf856b7aa284f9b

Fix "blue gradients" seen with psdrgb device.

Since the fill/stroke commit went in, some files have been showing
gradients in the wrong colours. For instance this one, spotted in
release testing:

gs -sDEVICE=psdrgb -r72 -dMaxBitmap=2000M -o out%d.psd
../tests_private/comparefiles/Layout.pdf

Bisecting the fill/stroke branch back, it seems the commit that
caused it is the one that stops psdrgb using 'devn' colors.

This causes gradients to drop to using the color_info.comp_bits and
comp_shift information, which the psd devices don't fill in.

The fix here is to make psd_prn_open call the standard function for
setting up these values.

devices/gdevpsd.c


2020-02-13 14:48:05 -0800
Nancy Durgin <nancy.durgin@artifex.com>
25cd0c72b98f9efc6968254d1e3a2f33ec376369

Bug701972 -- fix pdfwrite image downscaling bug

Calculate the bits on the row using the input image width,
not the output image width.

I had to add an extra argument to a few functions to propagate the info
down to where it is needed.

Note obscure case involving calling psdf_setup_image_to_mask_filter()
for a Type 4 image and CompatibilityLevel < 1.3. This change just
adds the extra input_width arg, which doesn't change whatever it was
doing before. If there is a bug lurking here, it seems unlikely
anybody cares?

devices/vector/gdevpdfi.c
devices/vector/gdevpsdf.h
devices/vector/gdevpsdi.c
devices/vector/gdevpsds.c
devices/vector/gdevpsds.h


2020-02-12 09:22:55 -0800
Nancy Durgin <nancy.durgin@artifex.com>
e9523603ac713e365702b81c228edcaaac667dc4

Set the BitsPerComponent for alt stream in pdfwrite

Add this to the image[1] code where it was missing

This fixes bug where compressed images were correct, but if
-dEncodeGrayImages=false was used, then they were truncated.

This is related to trimmed/rescaled image for Bug701972.
See the sample trim-nobug.pdf attached to that bug.

devices/vector/gdevpdfi.c


2020-02-18 19:25:24 +0000
Robin Watts <Robin.Watts@artifex.com>
924f7ea07c7773a3b1510c6206c9a34227e4b39e

Bug 702131: Fix overprint in additive spaces.

We should only enter CompatibleOverprint blend mode if we
are in an subtractive space. This stops pdf14 trying to honour
drawn_comps even in additive spaces.

base/gdevp14.c


2020-02-14 14:02:24 -0800
Ray Johnston <ray.johnston@artifex.com>
d98b553c829fad94cd4338910468d2b1b6ee64f7

Fix bug 702079: SEGV with clist and PCL caused by wrong color in images.

The clist_image_plane_data function was called with the dev_color for a band
being type <pattern> when the image had type <pure>, but the code was not
calling cmd_put_drawing_color to update the bands for the image because uses_color
was false. Add rop3_uses_S(pgs0>log_op) as well as (||) rop3_uses_T(pgs->log_op)
when CombineWitColor is true.
Note that extra calls to cmd_put_drawing_color before an image are low cost
and do nothing if the current device color is already the same.

base/gxclimag.c


2020-02-18 09:48:07 -0800
Michael Vrhel <michael.vrhel@artifex.com>
4f55464d5c1640075a67a8b50557a48766783e08

Bug 702128 : clist pdf14 overprint state

This change ensures that gxdso_overprint_active
gets the proper state information.

When the clist writer is active with the pdf14 device, the writer maintains
the current overprint state (as the writer has no access to the pdf14 member variables)
and must know what to put in the clist.

When the clist writer is not present (i.e. page mode), the pdf14 device
maintains the information.

base/gdevp14.c


2020-02-18 11:46:45 +0000
Robin Watts <Robin.Watts@artifex.com>
f1887408860910c19c980f05fd0f8fc93b5f06a1

Bug 702068 continued: Fix smasked images with masks.

Release testing has shown up another case that needs help.

gs/bin -sDEVICE=ppmraw -o out.ppm -r300 -dMaxBitmap=1G
tests_private/pdf/sumatra/1901_-_tiling_inconsistencies.pdf

This shows horizontal white lines in the "Next" "Up" "Previous"
images at the top of the page.

Investigation shows this is due to the images having Masks as well
as SMasks.

The Mask image is run to a 1 bit memory device, which means that
the gxdso to check if we are in an SMask doesn't work. We work
around this by introducing a new flag to gs_pixel_image_common
that we can set to indicate that we are within an smask. We set
this when we set the masked image up (using the gxdso), and check
it when we come to do the gridfitting.

base/gsiparam.h
base/gxclrast.c
base/gximage.c
base/gximage3.c
base/gxipixel.c


2020-02-17 19:31:50 +0000
Robin Watts <Robin.Watts@artifex.com>
51a0be1a6ac3bae2dc1b8bcdd91f58f76b9132c9

Sync deep colour blending with recent changes to 8 bit blending.

Release testing reveals problems with deep color blending and
overprint. This is because changes were made to the 8bit
branches of gxblend.c that weren't fully reflected in the
16bit branches.

Reapply those changes here.

While we're at it, address some other minor code cleanups,
including keeping the ordering of parameters the same between 8
and 16 bit to avoid confusion in future.

The command that showed the inital problem was:

bin/gswin32c.exe -o out.psd -sDEVICE=psdcmyk16 tests_private/comparefiles/Bug695916.pdf

where the image of the Earth did not appear.

base/gxblend.c


2020-02-17 13:27:10 +0000
Robin Watts <Robin.Watts@artifex.com>
b7faa941d09db8856378e45d4f5c81b5f93e5f90

Bug 702130: Fix JPEG memory failure problems.

The SEGV reported by Memento squeezing (which oddly is at 113600
for me, rather than Julian's higher number) is caused by jpeglib
calling 'mem_term' on something that failed to 'mem_init'.

The fix is to use gs_memory_chunk_unwrap rather than target/release,
and to check whether mem == cmem to see whether that actually did
unwrap.

This runs us into a further problem, where we are freeing the
custom memory descriptor using a gc memory pointer, where it was
allocated using a non gc one.

Rather than just changing the free to use the non gc one, we take
the opportunity to ensure that ALL the blocks are in non gc memory.
JPEGlib will take poorly to its memory being gc'd away, and none
of it needs to subject to gc.

Credit goes largely to Chris for this fix.

base/sjpegc.c


2020-02-14 18:44:53 +0000
Robin Watts <Robin.Watts@artifex.com>
619c0231952c20cc14f0eaf603e0cb01aa937eff

Bug 702124 (continued): Avoid FP errors leading to empty pattern cells.

The limited accuracy of floats can cause pattern cells to appear to
be empty when they are not.

Avoid adding the (often large) tx and ty components in until after we
have calculated the width/heights.

base/gsptype1.c


2020-02-14 18:43:00 +0000
Robin Watts <Robin.Watts@artifex.com>
8edb1b1e7bb84ff4598819fe078eb0ed2c4948d5

Bug 702124: Avoid VMerror when a pattern cell height is 0.

We detect buffer_height == 0 and take it to mean that we can't
get a large enough buffer for even a single scanline. Actually
it can mean that the pattern cell was empty, which gives a
spurious error.

base/gxmclip.c


2020-02-14 17:08:12 +0000
Julian Smith <jules@op59.net>
6beaf42d25f3969b6dc3d8e1b1795017708000c5

Fix segv after memento squeeze in psdf_DCT_filter().

Fixes:
MEMENTO_FAILAT=117152 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

devices/vector/gdevpsdu.c


2020-02-13 14:54:42 +0000
Julian Smith <jules@op59.net>
8d052b3de78b8034daed23e668758c76a8d8c478

Fixed double free after alloc failure in gs_lib_ctx_set_icc_directory*() (found by memento).

After we've freed p_ctx->profiledir we need to set it to NULL otherwise if we
return an error it will be freed a second time when we close down.

Fixes:
MEMENTO_FAILAT=101810 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

base/gslibctx.c


2020-02-12 11:12:37 +0000
Julian Smith <jules@op59.net>
dbde03ca37da96a94f4b7a6f0ba22a47a7bc2cb1

Fixed leak on error in gs_fapi_ufst_init() (found by memento).

Fixes:
MEMENTO_FAILAT=22 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

base/fapiufst.c


2020-02-13 19:48:01 +0000
Robin Watts <Robin.Watts@artifex.com>
08695f8ccebb0d25eb2a5933ecee92281eefc1be

Bug 702121: PCL performance degradation

Henry chased the cause down to commit b399f84, an attempt to
fix Bug 700624. Looking at that code now, it has a silly typo
in it, that was causing it not be triggered in cases when it
should have been. Fixed here.

base/gxpcmap.c


2020-02-13 11:11:40 -0800
Robin Watts <Robin.Watts@artifex.com>
e2cdef26db058e84c2cf4dff5f638e669f961b52

Alternative fix for leaks after error in gs_main_init_with_args01()

When memory squeezing gpdl, Julian found leaks in the gpdl
startup of the postscript interpreter when allocations failed
in gs_main_init_with_args01().

Here, we fix the problem by making the psitop.c layer within gpdl
call the appropriate shutdown code when we catch the error. This
moves gpdl to being consistent with other users of the gs_main
layer.

Memento memory squeezing around the point of failure (event 2035)
now shows this to be OK.

MEMENTO_SQUEEZEAT=2034 ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

gpdl/psitop.c


2020-02-13 18:47:37 +0000
Robin Watts <Robin.Watts@artifex.com>
bbecd13cc34f3dcdcedd726e7de12c988da9794a

Revert "Fix leaks after error in gs_main_init_with_args01() (found by memento)."

This reverts commit f35924926cb35f08be5a12ded4a00eb2f42aed3e.

When memory squeezing gpdl, Julian found leaks in the gpdl
startup of the postscript interpreter when allocations failed
in gs_main_init_with_args01().

The initial fix attempted was to make gs_main_init_with_args01()
closedown the interpreter on such errors. This worked for the
tested cases, but hid problems with non-memory related errors
(such as not being able to open a file specified on the command
line) when called by gs (rather than gpdl).

The change attempted resulted in gs_main_finit() being called
twice as gs (and other users of the gs_main APIs) expect to have
to call gs_main_finit() to shut down after gs_main_init_with_args01()
returns an error code.

The real problem is that gpdl is not doing this in the same way as
other callers.

The gs_main layer has existed for donkeys years, so it's probably
best that we just take it as fixed and don't require callers to
start changing stuff now.

Accordingly, I am reverting the attempted fix here, and will
try a different fix for it that only affects gpdl shortly.

psi/imainarg.c


2020-02-11 16:48:24 -0800
Ray Johnston <ray.johnston@artifex.com>
68be233f36feb045e442a18c4f4e4d2ced52b197

Change to improve memory and speed (Bug 702099)

As described in the bug, the patch to disable high-level images in
pattern-clists when Interpolate is true is no longer needed (hasn't
been since 2015), and it causes the memory and performance problems
with this type of file.

base/gxclimag.c


2020-02-12 15:10:54 -0800
Michael Vrhel <michael.vrhel@artifex.com>
2dea734a6184668511758fe1929a1d3166df85b6

Bug 702114 non-isolated group in knockout group

Make sure to use the parents backdrop as our backdrop when we
push a non-isolated group that resides in a knockout group.
Note though that this apparently is not the case if we are
constructing a soft mask.

base/gdevp14.c


2020-02-12 10:54:47 -0800
Michael Vrhel <michael.vrhel@artifex.com>
9af467b71198710bc42509e00b730a716b8e4828

Bug 702113 Softmask with transfer function

In a couple spots we look at the value of the background value
of the softmask to decide if we really need the softmask in
areas outside the group bounding box. These checks were not
considering the impact of the transfer function.

base/gdevp14.c


2020-02-12 11:37:33 +0000
Chris Liddell <chris.liddell@artifex.com>
9557cdc0b00894bc4c2c1fccb1f19c33fd7eb499

Dates etc for 9.51 RC1

Makefile.in
base/gscdefs.h
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/Internal.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
psi/winint.mak


2020-02-11 11:11:47 -0800
Ray Johnston <ray.johnston@artifex.com>
ad317d8d436f3ae282597631464313666451747f

Fix bug 702060: clip_transform_pixel_region was ignoring the 'transpose' flag.

base/gxclip.c


2020-02-12 00:24:25 +0800
Sebastian Rasmussen <sebras@gmail.com>
1c6bfa12cccb726974aa1c3ad5c4887600f7331d

Update jbig2dec stuff for 0.18 release.

jbig2dec/CHANGES
jbig2dec/jbig2.h
jbig2dec/jbig2dec.1


2020-02-12 00:27:41 +0800
Sebastian Rasmussen <sebras@gmail.com>
70f094ae147afdbbcfcff3351f3ec13db6a84c42

jbig2dec: Sync memento from ghostscript.

jbig2dec/memento.c


2020-02-10 16:19:49 +0000
Julian Smith <jules@op59.net>
f35924926cb35f08be5a12ded4a00eb2f42aed3e

Fix leaks after error in gs_main_init_with_args01() (found by memento).

Fixes various memento failures starting with:
MEMENTO_FAILAT=2034 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

psi/imainarg.c


2020-02-10 16:11:31 +0000
Julian Smith <jules@op59.net>
2704441705cb115b352350252480dbb2505d9767

Memento: show backtrace when we start failing.

base/memento.c


2020-02-10 16:11:06 +0000
Julian Smith <jules@op59.net>
c736329f36c2258011162c97eec59818fb6f147e

Fixed segv after alloc failure in ps_impl_allocate_interp_instance() (found by memento).

Fixes:
MEMENTO_FAILAT=2017 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

gpdl/psitop.c


2020-02-10 16:00:29 +0000
Julian Smith <jules@op59.net>
f1cb9e832424a1185fe081e2238b2ba42f805318

Fixed leak in xps_impl_allocate_interp_instance() (found by memento).

Fixes:
MEMENTO_FAILAT=2011 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

xps/xpstop.c


2020-02-10 15:40:01 +0000
Julian Smith <jules@op59.net>
59dba1a5a0f2d45c18249697b3429c250ae7311a

Fixed segv on error in gs_cspace_new_scrgb() (found by memento).

Fixes:
MEMENTO_FAILAT=2006 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

base/gscspace.c


2020-02-10 15:30:18 +0000
Julian Smith <jules@op59.net>
95378885483aa68969417c84e59be4eb1ad0f05e

Fixed segv on error in gsicc_set_iccsmaskprofile() (found by memento).

Fixes:
MEMENTO_FAILAT=1951 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

base/gsicc_manage.c


2020-02-10 12:21:24 +0000
Julian Smith <jules@op59.net>
691d2e37fc9f06bf6fb0ed009a880f4d40a86f48

Fixed leak on error in xps_impl_allocate_interp_instance() (found by memento).

Fixes:
MEMENTO_FAILAT=1938 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

xps/xpstop.c


2020-02-10 11:40:59 +0000
Julian Smith <jules@op59.net>
450eb91a0af4901b1f9a259cc69d8976113cbadb

Fix error handling in xps_impl_allocate_interp_instance() (detected by memento).

Handle error from gs_font_dir_alloc(), and moved all cleanup to end.

Fixes:
MEMENTO_FAILAT=1937 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

xps/xpstop.c


2020-02-10 11:21:37 +0000
Julian Smith <jules@op59.net>
33130c86c4d46bafe7613e3b4b114481c30d17ad

Fix segv in gsicc_alloc_link() error handling (detected by memento).

Set up placeholder values in *result before trying to set result->lock, so that
gs_free_object() works without segv.

Fixes:
MEMENTO_FAILAT=431 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

base/gsicc_cache.c


2020-02-07 19:01:01 +0000
Julian Smith <jules@op59.net>
da2759cd587e2a67134db469cb143643469f09f5

Fix leak on error in gsicc_profile_new() (detected by memento).

Fixes:
MEMENTO_FAILAT=369 ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps

base/gsicc_manage.c


2020-02-07 19:38:55 +0000
Robin Watts <Robin.Watts@artifex.com>
0ddc921923d36c19480223f3d92c19aee03df961

Pull in a couple of memento fixes from Sebastian.

base/memento.c


2019-09-29 16:59:29 +0200
Sebastian Rasmussen <sebras@gmail.com>
df70f85ce3f5dd300b5ce75b348e78dff528c2f4

jbig2dec: Invite user to define MEMENTO in CFLAGS.

Previously we invited the user to define MEMENTO in jbig2_priv.h.
The problem with doing that is that the flag is enabled for all .c
modules, except memento.c. This implies that while memento's wrapper
functions are called, the versions being called are the ones that
have memento features disabled.

Setting CFLAGS=-DMEMENTO while configuring/building is the better
option as CFLAGS will affect all .c modules.

jbig2dec/jbig2_priv.h


2019-09-29 16:55:51 +0200
Sebastian Rasmussen <sebras@gmail.com>
20009c9e35eca1d66f0c1d2fadb9956304692156

jbig2dec: Fix compilation issues with memento build.

jbig2dec/memento.c


2019-10-17 12:11:54 +0200
Sebastian Rasmussen <sebras@gmail.com>
5fde8364de28bc44965a57f1dd0190c0966bccb4

jbig2dec: Fix memento interfering with allocator callback names.

Memento changes the names of the callbacks when they are set, but
not when the structure is defined in the command line tool. Work
around this by including memento prior to the structure being
defined so that memento changes the names in both places.

The alternative would be changing the jbig2dec API yet again.

jbig2dec/jbig2dec.c


2020-02-08 03:18:09 +0800
Sebastian Rasmussen <sebras@gmail.com>
22665fbc3ff92c46952b07fcb99b8102e0fabde5

jbig2dec: Sync memento from ghostscript.

jbig2dec/memento.c
jbig2dec/memento.h


2020-01-11 01:51:19 +0100
Sebastian Rasmussen <sebras@gmail.com>
ebe1bfef330f4568c6ef394571cf800604dff277

Bug 702097: Import security fixes for OpenJPEG.

Upstream has merged two security fixes. At the moment there is
no new upstream release, so we merge the two fixes downstream:

* Fix for upstream issue #1228, registered as CVE-2020-6851:
https://github.com/uclouvain/openjpeg/commit/024b8407392cb0b82b04b58ed256094ed5799e04
"opj_j2k_update_image_dimensions(): reject images whose coordinates are beyond INT_MAX (fixes #1228)"

* Fix for upstream issue #1231, registered as CVE-2020-8112:
https://github.com/uclouvain/openjpeg/commit/05f9b91e60debda0e83977e5e63b2e66486f7074
"opj_tcd_init_tile(): avoid integer overflow
That could lead to later assertion failures.
Fixes #1231 / CVE-2020-8112"

openjpeg/src/lib/openjp2/j2k.c
openjpeg/src/lib/openjp2/tcd.c


2020-02-06 11:47:48 +0000
Julian Smith <jules@op59.net>
c6d8dcf8448235895759fb7e3268105c4092a194

clusterpush.pl: exclude all *-bin and *-obj directories.

toolbin/localcluster/clusterpush.pl


2020-02-07 14:27:12 +0000
Julian Smith <jules@op59.net>
e507f7e272cfe94099ed6a395a3fa584d56fd3aa

Fixed memento leak when squeezed in gs_main_init1().

Fixes leaked blocks in:
MEMENTO_FAILAT=202 ./membin/gs -sDEVICE=bit -o /dev/null examples/tiger.eps

Also in context_state_alloc(), ensure pcst->memory is valid even if we return
an error.

psi/icontext.c
psi/imain.c


2020-02-07 12:33:56 +0000
Robin Watts <Robin.Watts@artifex.com>
0e9f7fc153d92cbed9a4f1fcf60778176888625d

Bug 702100: Followup: Fix arch.h for OS-X to include size_t changes.

Our fix for Bug 702100 meant we were using newly defined size_t
limits from arch.h. While these were generated correctly for
things using arch.h, they were missed out of one of the
pregenerated files in the arch directory, namely the OS-X one.

Add those back here.

Thanks to Peter Skarpetis for reporting this.

arch/osx-x86-x86_64-ppc-gcc.h


2020-02-06 15:08:55 +0000
Robin Watts <Robin.Watts@artifex.com>
e193b5dc14a6029b2648a5712c154499d819186f

Bug 702100: Fix memory limit to be based on size_t not long.

I missed this when converting from longs to size_ts. This
resulted on different maximums for linux and windows 64bit
builds, due to the different size of longs on those two
platforms.

Update the debugging printfs to make use of the PRIdSIZE macros
rather than truncating.

base/gsalloc.c
base/gsmalloc.c
base/std.h


2020-02-06 14:39:10 +0000
Robin Watts <Robin.Watts@artifex.com>
3ac7d3c0ed5a339c8e2fe25c43feac92b9813b1b

Sync memento between mupdf and gs.

base/memento.c


2020-02-06 13:02:33 +0000
Robin Watts <Robin.Watts@artifex.com>
d185c5afea23e937edda368491d382650001f5b4

Memento: Remove MEMENTO_SQUEEZE_BUILD from the code.

Rather than relying on building with MEMENTO_SQUEEZE_BUILD,
instead nobble the pthread based threading functions themselves
to check Memento_squeezing in MEMENTO builds.

a) This means less pollution of the code overall as the changes
are restricted to just one module.

b) This will stop me forgetting to build with MEMENTO_SQUEEZE_BUILD
and not understanding the results - EVERY SINGLE TIME.

c) It means a single MEMENTO build can be used both for
memory squeezing (of single-threaded runs) and normal memento
testing (of both single- and multi-threaded runs).

base/gp_psync.c
base/gsicc_cache.c
base/gsicc_lcms2.c
base/gsicc_lcms2mt.c
base/gsicc_manage.c
base/gslibctx.c
base/gsmalloc.c
base/memento.c
base/memento.h
base/sjpx_openjpeg.c
psi/imain.c


2020-02-06 11:06:38 +0000
Julian Smith <jules@op59.net>
f40471ba6312a89cda81c23c1690dfbdbbc2722f

Fix MEMENTO_FAILAT=352 in gsicc_cache_new()

Ensure that result's fields are initialised before we attempt to allocate
result->lock. Otherwise if the latter fails and we attempt to clean up,
icc_linkcache_finalize() will get a SEGV.

base/gsicc_cache.c


2018-10-31 20:22:11 +0100
Sebastian Rasmussen <sebras@gmail.com>
37fae2058eb7216c60801dfdbd5b9c987446866a

Re-apply fix for bug 700088 lost in openjpeg 2.3.1 upgrade.

The original commit message read:

Bug 700088: Report error if all wanted J2K components are not decoded.

Ghostscript used to attempt to use even the undecoded components.
The source code for upstream's opj_decompress tool avoided this by
a workaround along with a comment indicating that this ought to be
done in the library (so all clients, e.g. Ghostscript will benefit
from it). With this commit the library will error out if not all
requested components are successfully decoded. Thus Ghostscript
will no longer crash.

Reported in https://github.com/uclouvain/openjpeg/issues/1158
sent upstream in https://github.com/uclouvain/openjpeg/pull/1164
and finally committed in e66125fe260deee49fdf6e9978d9bd29871dd5bb

openjpeg/src/lib/openjp2/j2k.c


2020-02-05 11:53:57 +0000
Robin Watts <Robin.Watts@artifex.com>
56e3ed1abc84ef0c8a718b458a5734b016e7b8cc

jbig2dec: Simplify jbig2_arith_decode.

Previously we passed in an int * to get errors back, and
used the return code for 0 or 1. Now we use the return code
for 0, 1 or -ve for error.

This saves between 1% and 2% of gs runtime for decoding
tests/pdf/Jbig2_042_06.pdf.

jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith.h
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_refinement.c


2020-02-04 11:10:41 +0000
Robin Watts <Robin.Watts@artifex.com>
db24ea3579f2fb6feef7eef98b7163ce6879ef98

Bug 702068 continued: Revised handling of images within smasks.

In an earlier commit, (Jan 27th, f6f8b8de) I updated the gridfitting
logic so that Images within SMask definitions were gridfitted. This
solved the original complaint.

Sadly, this caused problems with other things (thanks to Ken for
spotting them). Files sometimes use an image in an smask, and then
another "matching" image masked by that smask. The upshot of my
new code was that we'd treat them differently. 'Stretching' the
SMasked image, and not stretching the underlying image could cause
moire effects.

The solution, implemented here, is to apply gridfitting to images
both in SMask definitions and usage.

base/gdevp14.c
base/gdevp14.h
base/gxdevsop.h
base/gxipixel.c


2020-02-03 11:06:48 +0000
Robin Watts <Robin.Watts@artifex.com>
93ff4543685f8692db40a8911ad4605124b3433c

jbig2dec: Fix OSS-Fuzz issue 20493

The maximum x gbat works out as 126, where GBW is 32.
This makes right = GBW - gmax huge. Clip the value to
avoid problems.

Thanks for OSS-Fuzz for reporting.

jbig2dec/jbig2_arith.c


2020-02-04 11:33:02 +0000
Ken Sharp <ken.sharp@artifex.com>
a8572b92d6839abc60ecce6fae7a23b8b3a6bbbd

Fix test of uninitialised value in halftone screens

This is a result of bug #702077 and commit :
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=f434497caaf2624caabbbc62f36b745e096e95b5

There's nothing wrong with the commit, but a 64-bit release build on
Linux, using the customer file and 720 dpi, resulted in an infinite
loop. Valgrind suggested this was due to an uninitialised variable.

The problem here was that the code assumed that the first iteration
looking for the best match would succeed. However, because the halftone
has a Frequency of 1 the value of 'W' exceeded the maximum of a short,
which led to use running round the loop without finding a valid halftone.

Because we didn't find a valid halftone we would not set phcp to the
values in 'p' (which is set by gx_compute_cell_values) and so we would
test phcp->C which was uninitialised, and could end up going round the
loop retrying with different values of rt endlessly.

This commit simply short-circuits this by checking to see if we have
at least one valid match (rt is not 1) or that we have set phcp to p
(better is true). If we have done neither of these, then exit
immediately with an error to prevent testing phcp->C.

base/gshtscr.c


2020-02-03 16:29:59 +0000
Julian Smith <jules@op59.net>
b439a0a33f637254a831b3e76525002df3d41774

jbig2dec: Fix OSS-Fuzz issue 20505.

Previous code could overflow if w >= 2^32 - 32, breaking behaviour of 'if'
statements and causing incorrect behaviour (including assert failures).

The fix is due to sebras - change expressions such as (x + 32 > w) to (w - x <
32) to avoid overflow for very large w. (We know at all times that x <= w.)

Thanks for OSS-Fuzz for reporting.

jbig2dec/jbig2_mmr.c


2020-02-03 11:06:48 +0000
Robin Watts <Robin.Watts@artifex.com>
ece7a0b952d5dbca2a04682f38199444cb1ea16f

jbig2dec: Fix OSS-Fuzz issue 20493

The maximum x gbat works out as 126, where GBW is 32.
This makes right = GBW - gmax huge. Clip the value to
avoid problems.

Thanks for OSS-Fuzz for reporting.

jbig2dec/jbig2_generic.c


2020-02-03 10:54:09 +0000
Ken Sharp <ken.sharp@artifex.com>
f434497caaf2624caabbbc62f36b745e096e95b5

PDF interpreter - don't abort stream on halftone errors

Bug #702077 "Rangecheck error @720 dpi in sethalftone with SimpleDot"

The supplied PDF file has a legal but stupid Halftone, it has a type 5
halftone that does not specify a child halftone for each ink, for those
inks that it does specify it uses the same halftone for all of them, and
the child haftone has a /Frequency and /Angle of 1.

Chris suggests this is a Harlequin Rip specific halftone which is
intended not to be used, but to be replaced by something in the rip. Of
course this means that the PDF file is now device-specific because any
conforming PDF consumer which halftones should use the crazy halftone
in the file which will lead to terrible output.

However, poor quality isn't the complaint here, its the fact that we
simply cannot create a halftone tile large enough to produce a 1 lpi
screen at 720 dpi, so we throw an error.

I believe this is a reasonable error, so I'm not going to try and
change it. Instead this commit runs sethalftone in a stopped context
and, if it fails, does not abort the current content stream but instead
emits a warning and carries on.

Resource/Init/pdf_draw.ps


2020-02-03 10:15:30 +0000
Robin Watts <Robin.Watts@artifex.com>
6a32a890b95355165cbaf79ff679c2f774b41d26

Update msvc.mak to cope with new nmake version.

psi/msvc.mak


2020-01-30 19:08:55 -0800
Ray Johnston <ray.johnston@artifex.com>
a3bc57e11d62227a73e9d86d804966740a6a2196

Fix SEGV with -ZB debug in gx_image1_plane_data

Discovered while debugging. If the buffer is used "in place" without
copying, the 'buffer' pointer in the debug loop would be NULL. Instead
use the penum->buffer.

base/gxidata.c


2020-01-29 15:34:58 +0000
Robin Watts <Robin.Watts@artifex.com>
1c5a25063d6041902442334f633840bd8660451e

Further optimisations to jbig2_decode_generic functions.

Carry 'window' of pixel data across scanlines, and read
samples from it.

Write pixel data back in whole bytes rather than single bits.
Sadly, for cases where the adaptive pixels are non-standard we
need to write back after every pixel in case the adaptive
pixels read from it.

Profiling shows the time spent in the hotspot with jbig2_042_08.pdf
drops from 56% to 43% with this optimisation.

Particular thanks to Sebastian for spotting various issues with
this.

jbig2dec/jbig2_generic.c


2020-01-29 15:21:53 +0000
Robin Watts <Robin.Watts@artifex.com>
0e84a5f7ca660af4de1afb5bce79f6262b44ebd1

Solve warnings in jbig2_image.h.

Move some static inlines into the only file they are called
from rather than having them in the header.

jbig2dec/jbig2_generic.c
jbig2dec/jbig2_image.h


2020-01-30 09:39:40 +0000
Ken Sharp <ken.sharp@artifex.com>
e852e56f0413d5ecb70a83fc03d78ad4a0561433

More 'trailing white space' fixes.

base/gxblend.c


2020-01-30 09:12:13 +0000
Ken Sharp <ken.sharp@artifex.com>
97868a9e6c787ea988f43952ae5d4236e142db13

Fix trailing white spaces in a number of places.

Since I use the Git commit hooks to verify no white space problems I
can't merge master into the pdfi branch without first fixing these.

base/gp_unifs.c
base/gscolor2.c
base/gscspace.c
base/gsovrc.c
base/gxblend.c
base/gxccache.c
base/gxclthrd.c
contrib/gdevlx32.c


2020-01-29 15:10:06 +0000
Julian Smith <jules@op59.net>
3b2ae21ca594934728f623667db1a002286193ea

Fix plane_strip_copy_rop() to use correct color depth when processing the plane.

Temporarily change mdev->color_info.depth to mdev->planes[plane].depth
so that things work when we process the plane. E.g. this fixes bug where
mem_gray8_rgb24_strip_copy_rop() was overwriting into the line_ptrs[] array.

Fixes segv in:
./bin/gs -sOutputFile=foo -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -dMaxBitmap=10000 -sDEVICE=psdrgb -r300 -Z: -sDEFAULTPAPERSIZE=letter -dNOPAUSE -dBATCH -K2000000 -dClusterJob -dJOBSERVER ../fts_27_2709.pdf

base/gdevmpla.c


2020-01-27 15:50:44 +0000
Robin Watts <Robin.Watts@artifex.com>
f6f8b8de526266eebd850e43bf1d0037b6f62e4c

Bug 702068: Fix 'cracks' appearing around transparently blended regions.

As part of rendering SMasks, we take the bbox for the region, and round
it up to make the buffer in pdf14. If (as is frequently the case) the
SMask contents are an image, the PS rendering of that image can result
in it rounding DOWN (due to "any part of a pixel" vs "pixel centre
covered"). This can result in 'cracks' around the edge of smasked
groups.

The fix, implemented here, is to extend the logic that "gridfits"
images within pattern accumulator to also cover smasks.

To make this work we add a new gx_dev_spec_op to detect whether we are
in an smask definition.

base/gdevp14.c
base/gdevp14.h
base/gxdevsop.h
base/gxipixel.c


2020-01-29 12:40:14 +0000
Robin Watts <Robin.Watts@artifex.com>
e22376d9226b02ac8cb7951264dae2f3c1bc0b7f

jbig2dec: Fix OSS-Fuzz issue 20358

Avoid a signed/unsigned comparison which was implicitly casting
gmax=-1 to unsigned, and hence making right larger than it should
have been.

Apply similar fixes to equivalent places in the code.

jbig2dec/jbig2_generic.c


2020-01-29 11:00:18 +0000
Robin Watts <Robin.Watts@artifex.com>
dc48809733f2eec9ab96c012f62c9dd3a7c06c90

Tweak stdpre.h's definition of inline.

Ensure it's actually set when possible, in particular for
VS.

base/stdpre.h


2020-01-28 17:54:28 +0000
Robin Watts <Robin.Watts@artifex.com>
2450ea4feb89996e1107bb79d44a049bab5b971e

MSVC makefile tweaks for VS2019.

Spot a new version of nmake, as supplied with the latest version
of the platform tools.

Cope with both Community and Professional versions of VS2019.

psi/msvc.mak


2020-01-29 10:00:39 +0000
Ken Sharp <ken.sharp@artifex.com>
cb456c92a550e1af70a4e268b2f5b02f2df5b8c6

Fix jbig2dec compilation when inline is not defined.

VS 2008 defines __inline but not inline, later versions of Visual Studio
do define inline, but apparently also permit __inline (presumably for
backwards compatibility).

Since we now use inline for performance purposes in jbig2_image.h its
vital that inline is defined. Here we modify the win32 config file to
define inline in terms of __inline for VS 2008 and above, unless inline
is already defined in which case we use it as is. For VS 2005
Ghostscript defines inline as nothing, so we do the same.

Finally, add a last-ditch definition of inline (as nothing) to jbig2.h
to cover any build environment where inline is still undefined, so that
the code will at least compile.

jbig2dec/config_win32.h
jbig2dec/jbig2.h


2020-01-29 05:04:34 +0800
Sebastian Rasmussen <sebras@gmail.com>
440dca503ee663290227334415f0c482e87b4ad7

Bug 702041: Recognize pre-multiplied alpha when decoding with OpenJPEG.

The bug's attached PDF has an annotation where the apperance stream consists of
a JPEG2000 image with a softmask embedded in the image data (SMaskInData is
non-zero). The JPEG2000 bitstream provides all three RGB channels and has both
non-pre-multiplied and pre-multiplied alpha. The last alpha channel defined in
the bitstream happens to be the pre-multiplied alpha. Having more than than a
single alpha channel is not allowed according to PDF 2.0 if SMaskInData is
non-zero. So the JPEG2000 bitstream (and by inference the PDF file) is arguably
broken.

Adobe Acrobat renders the annotation as a mostly transparent image consisting
of a few hand-scribbled lines, but Ghostscript renders the annotation as a
solid black square. So a workaround to match Acrobat is needed even if the PDF
is broken.

OpenJPEG hides that the JPEG2000 bitstream has multiple alpha channels by
discarding all alpha channels except the last one defined, so Ghostscript can
only get at the pre-multipled alpha channel. Previously the OpenJPEG glue layer
therefore didn't recognize any alpha channels at all. The PDF interpreter has
its own JPX cdef header decoder in Resources/Init/pdf_draw.ps and it _did_
recognize that the file contained an alpha channel. This mismatch between the
OpenJPEG glue layer and the PDF interpreter meant that no alpha channel data
was propagated to the transparency compositor. It assumed that the alpha
channel was fully opaque and because the RGB channels are all zero the
annotation was rendered as a solid black square.

Now that pre-multiplied alpha channels are recognized both in the OpenJPEG glue
layer and in the PDF interpreter the pre-multiplied alpha channel data which
contains the hand-scribbling is propagated to the transparency compositor which
therefore can render the annotation similar to Acrobat.

base/sjpx_openjpeg.c


2020-01-28 10:48:34 +0000
Robin Watts <Robin.Watts@artifex.com>
0e529d11fa270f8a40ebc2512cfb19cf8d3b0e50

Remove "STANDARD_SLOW_VERSION" define from openjpeg makefile.

This was added (apparently) to workaround a bug causing SEGVs
in the optimised code. Sadly, this also halves the speed of the
code.

We have updated openjpeg since, so it shouldn't be necessary.
Tests with the cluster seem to bear this out.

base/openjpeg.mak


2020-01-28 17:35:37 +0000
Robin Watts <Robin.Watts@artifex.com>
9156c43b44b64c3928d2ef20f15d56bd44c6f897

gpdl: Update j2k reading code to spot modified header.

The JP2K spec says we should spot "jP ", where previously
we'd only been spotting "jP\1a\1a". No idea where that
latter one came from, but presumably we've been seeing it
in some files. Make the code cope with both.

gpdl/jp2ktop.c


2020-01-27 11:05:38 -0800
Ray Johnston <ray.johnston@artifex.com>
85cf3b3a7befbed4811d9460dc6a4637f929f8ab

Fix bug 702065: Multiple rendering threads run slower.

The image_render_color_DeviceN would remap colors using gx_remap_ICC
which would get the link from the icclink_cache every time. This would
temporarily lock the mutex for the cache which apparently caused delays.

This would only occur in devices that support spot colors, when the page
used transparency due to gx_device_uses_std_cmap_procs returning false in
this case.

The change refactors gx_remap_ICC to produce gx_remap_ICC_with_link that
can be used by image_render_color_DeviceN with an icc_link that is retained
in the image enum. The gs_image_class_4_color function is changed to get the
icc_link for the image_enum before checking the for std cmap procs so that
it will be available during image_render_color_DeviceN.

base/gsicc.c
base/gsicc.h
base/gxicolor.c


2020-01-28 10:47:04 +0000
Robin Watts <Robin.Watts@artifex.com>
fe9e85d882ade3ebd55c4da0baf1f10d4bb8542d

Remove stray defines from CAL makefile.

When I created the CAL makefile, I copied bits of it from elsewhere.
I obviously copied in a few stray defines. Remove those.

base/cal.mak


2020-01-27 13:07:00 -0800
Ray Johnston <ray.johnston@artifex.com>
ad285b8ae3e1871db43d35e87f49e1d099eaf047

Fix devn code that failed to check for allocation returning NULL

Discovered while fixing Coverity CID 353647. pdf14_spot_get_color_comp_index
failed to check, and since that code was copied from code in this file,
it had the same problem.

base/gdevdevn.c


2020-01-27 13:01:28 -0800
Ray Johnston <ray.johnston@artifex.com>
6efb69c6ae71b10b492ca194f92bfae17310c481

Fix Coverity ID 353647: Possible out of bounds access

The testing where separations were added in pdf14_spot_get_color_comp_index
was wrong since it failed to take into account the process colorants.

Also I found that the allocation of sep_name was not checked for NULL which
could lead to dreferencing location 0 if the allocation failed. Note that
there were other instances of this in gdevdevn.c which will be fixed in a
separate commit.

base/gdevp14.c


2020-01-23 11:19:45 -0800
Ray Johnston <ray.johnston@artifex.com>
089bff145f277d66afe4a3d9e19441aeccaed235

Fix bug 702062: Opacity being applied twice.

If an image has an SMask, the alpha was applied twice, during painting of
the transparency group and again when the transparencygroup was popped.
Thanks to Michael Vrhel for the analysis and suggested cure.

If the device has PreserveSMask (e.g., pdfwrite) the SMask will be processed
by the device and we should not push the group, nor change the opacity.

Resource/Init/pdf_draw.ps


2020-01-27 10:12:24 -0800
Robin Watts <Robin.Watts@artifex.com>
17411adec88c3a846c10cb583cb261f50ca878d6

Fix OSS-Fuzz issue 20332: buffer overflow in jbig2_image_compose.

With extreme values of x/y/w/h we can get overflow. Test for this
and exit safely.

Thanks for OSS-Fuzz for reporting.

jbig2dec/jbig2_image.c


2020-01-23 14:45:15 +0000
Robin Watts <Robin.Watts@artifex.com>
430b6a3eacd9648d029887081e99b3a3f0bba3c7

Further optimisation to jbig2_decode_generic_template0_TPGDON.

When the "standard" values for gbat are used, the pixel lookups
simplify nicely. Optimise for this case.

This brings the time spent in this function down to 17% (from 22%)
for JBig2_042_08.pdf.

jbig2dec/jbig2_generic.c


2020-01-23 12:55:27 +0000
Robin Watts <Robin.Watts@artifex.com>
94d8ea178fa7c36ad7b844d6d0912b6e090a35e2

Further optimisations to jbig2_decode_generic_template0_TPGDON.

Add a function to get a 'run' of pixels, and call that.

This takes the time spent in this function from 29% to 22% for
Jbig2_042_08.pdf.

jbig2dec/jbig2_generic.c
jbig2dec/jbig2_image.h


2020-01-23 12:09:08 +0000
Robin Watts <Robin.Watts@artifex.com>
124ef6a255de0a2816cce32c4fba0852eac1beb3

jbig2dec: Optimise jbig2_decode_generic_template0_TPGDON

Decodes of JBig2_042_08.pdf (the worst comparing file to
luratech in terms of time) show significant time in that
function (45%). With this patch that drops to 29%.

jbig2dec/jbig2_generic.c
jbig2dec/jbig2_image.h


2020-01-25 19:05:09 +0000
Julian Smith <jules@op59.net>
a2f9e74ece1690520cb77d7761cf0a5ddaa98474

Coverity 94484: try different spacing in coverity annotation.

base/gsbitcom.c


2020-01-24 18:08:22 +0000
Robin Watts <Robin.Watts@artifex.com>
34518a9aeaece63d97eda9b802824581846e289e

jbig2dec: Fix whitespace issues from jbig2_image.c

Introduced because I edited this in MuPDF and copied it back across.

jbig2dec/jbig2_image.c


2020-01-24 18:00:13 +0000
Robin Watts <Robin.Watts@artifex.com>
c1565a04a938408fe31c862f10ef91f9ab5a14b1

jbig2dec: reintroduce gcc attribute that got dropped by accident.

jbig2dec/jbig2_priv.h


2020-01-24 17:04:27 +0000
Julian Smith <jules@op59.net>
a2e8041383100db54d1ea949d1b2648330f5188a

Coverity 94484: added some asserts derived from bits_compress_scaled()'s preconditions.

These are enough to demonstrate to the reader that Coverity 94484's
negative_shift warning is spurious - in_shift_initial cannot be negative.

base/gsbitcom.c


2020-01-23 17:12:55 +0000
Julian Smith <jules@op59.net>
409baa5cc81b8d184dceb52c06c9a80c5dcd61d6

Coverity 94484: added annotation to avoid negative_shift issue.

base/gsbitcom.c


2020-01-22 12:24:43 +0000
Julian Smith <jules@op59.net>
77b7cce9253863ac48ef6eb9821880250c7e1307

jbig2dec/jbig2_mmr.c: optimised jbig2_find_changing_element().

This was a hotspot after optimsation of jbig2_compose_image.

Rather than step through each bit in turn, we now look 8, 16 and 32-bit at a
time.

jbig2dec/jbig2_mmr.c


2020-01-23 10:39:30 +0000
Robin Watts <Robin.Watts@artifex.com>
079117d95a3f07587624d6fd9ca388b300d0759e

jbig2dec: Insert missing "inline" in templating.

When using static inline templating to optimise a file, it's
generally best to actually use static inline, and not just
static.

jbig2dec/jbig2_image.c


2020-01-23 10:39:04 +0000
Robin Watts <Robin.Watts@artifex.com>
f8e918106400220ffe21aef6ef1d491a42991475

Squash some double -> fixed warnings.

base/gdevp14.c


2020-01-21 18:16:37 +0000
Robin Watts <Robin.Watts@artifex.com>
b1b3c83af56412a06eeade1ea26a4db10de923a5

Optimise jbig2_compose_image.

Work at byte level rather than bit level, and use static inline
templating methods to generate optimised versions for each
different operator.

jbig2dec/jbig2_image.c
jbig2dec/jbig2_priv.h


2020-01-22 09:54:25 -0800
Ray Johnston <ray.johnston@artifex.com>
bd73d0c1d0c42fd1671b56f1277b5e9f25391907

Bug 702052: MaxSpots > 58 caused exception with tiffsep device.

The MaxSpots devn parameter was allowed to be set according the the
capability of the tiffsep device (up to 60), but an array to hold the
equivalent CMYK parameter information was not that large. Get rid of
the MAX_DEVICE_PROCESS_COLORS #define and use the device num_std_colorants
and color_info.max_components to determine the maximum number of spot
colorants possible for this and PageSpotColors and update the Devices.htm
document to reflect the actual limit.

Also to reduce potential mischief, add range check error limits on the
DeviceN params based on the device component support, not the absolute max.

base/gdevdevn.c
base/gdevdevn.h
doc/Devices.htm


2020-01-22 17:53:24 +0000
Robin Watts <Robin.Watts@artifex.com>
8d548e306ae773e228dba331e614dd4cca2c56c7

Bug 702057: Avoid division by zero in old scan converter.

base/gxdtfill.h


2020-01-21 11:19:33 -0800
Michael Vrhel <michael.vrhel@artifex.com>
ba331d45f8e5be7723ff7bca9450f09c28910464

Bug 702053: Overprint precision issue

AR assumes for the purposes of overprint mode that a color
value that is less that 0.5/255 is essentially zero. Also
fix an issue in the Compatible overprint blend mode when
overprint mode is enabled.

base/gscspace.c
base/gxblend.c


2020-01-21 17:41:52 +0000
Chris Liddell <chris.liddell@artifex.com>
d6569b95a29bf86dbdca0bc95e095acaad003525

Fix segfaults in transparent patterns with -Z@

One gc'ed member (buf) of the structure for patterns with transparency was not
being initialised after allocation, meaning a debug build (which adds a
validation step to the garbager) would attempt to follow an uninitialised
pointer.

Adding the relevant initialisation meant almost identical code in two places,
so use the pre-existing function insteading of duplicating the code.

Segfaults spotted in weekly debug-Z@ test.

base/gxpcmap.c


2020-01-20 17:01:38 +0000
Chris Liddell <chris.liddell@artifex.com>
a0df672b0b65110d81f1e143b2e3681d660df8d2

Bug 702054: Fix threaded render segfault with shared ICC profiles

When creating the devices for individual rendering threads, if we cannot share
the ICC profiles, we also cannot share the device icc_struct. In such a case,
have each rendering thread device also create its own icc_struct.

base/gxclthrd.c


2020-01-20 14:23:50 +0000
Julian Smith <jules@op59.net>
df228c8f42962d696861cfc79f7b114ac887d3c4

Coverity 341118: avoid stat()/opendir() race in gp_enumerate_files_next_impl().

base/gp_unifs.c


2020-01-20 12:32:26 +0000
Julian Smith <jules@op59.net>
30f86d215ac5abba5cfe86f0307d642274b850e4

Coverity 350947: check return from gdev_prn_get_bits().

Also changed some fns from void to int so we can propogate any error.

contrib/gdevlx32.c


2020-01-20 12:31:00 +0000
Julian Smith <jules@op59.net>
bf2fcdc76fe0cec69e48f82e10144441b498a6b2

Coverity 94484: assert that shift is >= 0.

Have ran gs on 6,000 test files with some code that aborts if this shift is
-ve, and nothing failed.

base/gsbitcom.c


2020-01-17 12:58:14 +0000
Chris Liddell <chris.liddell@artifex.com>
144077b38b07119a0a5293ff8f3fc9e44f2813e1

Bug 702049: Handle format strings in pipe OutputFiles

When we implemented the new file access controls, we didn't realise that piped
output files could include formatted strings: "|md5sum > %03d.txt", for example.

This just tweaks the gs_add_control_path() logic so it will go through both
the formatted string section *and* the pipe output section (rather than one or
the other).

base/gslibctx.c


2020-01-17 11:32:10 +0000
Chris Liddell <chris.liddell@artifex.com>
bb8c4e0dbc304e404a09e9e6f9551e1e504822bb

Improve handling of current directory permissions

Tweak the file access permissions code to allow file names with a current
directory prefix to match "bare" file names - i.e. "file.ps" == "./file.ps".

This improves compatibility with the "-P" command line option, as well as
better matching user expectations.

base/gpmisc.c


2020-01-15 16:05:45 +0000
Chris Liddell <chris.liddell@artifex.com>
05d44f258a727d86b9d7d9cbe04e43f3e741a636

Bug 702037: Handle empty path from PDF text clip modes

When using one of the clipping Tr modes (4 to 7), if there is no valid
current point (i.e. no glyphs have been drawn, and no other previous operation
has established a current point), Acrobat ignores the operation, whilst gs was
treating that (as in Postscript) as an empty clip.

We now check for a valid current point before calling clip during the ET
handling.

Resource/Init/pdf_ops.ps


2020-01-16 09:33:47 -0800
Ray Johnston <ray.johnston@artifex.com>
dfdf07b07d4fd83fc606d50eaa7132fc9ea7a1ce

Coverity 353342: supposed Null pointer dereferences in gxclpath.c

Strange that it griped about passing pdevc_stroke to cmd_put_drawing_color,
but not earlier where it was passed to gx_default_fill_stroke_path.
Fix (hopefully) by checking for NULL color pointers before ANY use.

base/gxclpath.c


2020-01-15 12:23:21 -0800
Ray Johnston <ray.johnston@artifex.com>
27a3bf0bc16f492538434a9b1bfdbd588e29cedc

Fix coverity CID 353343.

Remove ppcs. When the code was changed to write the pgs->color[0],
the ppcs param was never removed.

base/gxclrast.c


2020-01-15 12:08:22 -0800
Michael Vrhel <michael.vrhel@artifex.com>
39eff9a56b2077d1a9adb48dfefd38e5e94b59c6

Make -dUseFastColor occur even when source color space is ICC based

The exception will be the CIELAB color space, the PS CIE color spaces,
named color, and DeviceN ICC profiles.

base/gsicc_cache.c
base/gsicc_manage.c
base/gsicc_manage.h
doc/Use.htm


2020-01-15 11:33:45 -0800
Michael Vrhel <michael.vrhel@artifex.com>
1b7690cdd644fd690c2480a88da62be6131e79ab

Coverity 353370 dead code removal

base/gdevp14.c


2020-01-15 13:42:33 +0000
Julian Smith <jules@op59.net>
4872417c26e9133e1f39fc5f9a361053aaee87a7

Coverity 350199: mark cf_encode_2d() as not tainting <lbuf> buffer.

After annotating cf_encode_1d(), this coverity issue appears to have changed
to worrying about cf_encode_2d(). Would have expected a new issue to have been
generated.

base/scfe.c


2020-01-15 11:09:53 +0000
Chris Liddell <chris.liddell@artifex.com>
c58f4c538404527cac25b549453f5b805652b445

Fix dependency for custom freetype config header

I'd missed the dependency to make sure the required directories were created
before attempting to copy the custom header into one of those directories.

base/lib.mak


2020-01-14 11:05:22 +0000
Julian Smith <jules@op59.net>
22618fc2fde49c8fc24ed7e88e98f9677e689c85

Coverity 350199: Final attempt to convince coverity that cf_encode_1d() doesn't taint lbuf.

base/scfe.c


2020-01-13 13:42:21 +0000
Chris Liddell <chris.liddell@artifex.com>
d824fb03a6653856dfe6e304bab8fe67a2c8f1f9

Bug 689279: Disable bitmap glyphs in freetype

The font in the XPS file has both outline and bitmap glyphs, and with such fonts
freetype ends up marking them as "bitmap" and "non-scalable" fonts, so when we
attempt to set a size for glyph scaling not equivalent to the included bitmaps,
freetype throws an error.

The file works with (a default build) of mupdf because mupdf disables freetype's
bitmap font support at build time. It is not possible to force freetype to
ignore bitmap glyphs at run time.

This commit adopts a similar approach to mupdf, and disables bitmap glyph
support using a custom options header file.

base/freetype.mak
base/gsftopts.h
base/lib.mak


2020-01-13 09:54:41 -0800
Michael Vrhel <michael.vrhel@artifex.com>
67559bed1c0dceb2a1a59be0349e3465a1361743

Fix error handling issue found by Coverity

base/gdevp14.c


2020-01-13 18:18:57 +0000
Julian Smith <jules@op59.net>
defe1d994b52100f535cb9e6a7e6a4f4255d2b2b

Coverity 350199: another attempt to quieten coverity.

Will clean up annotations once we've found one that works.

base/scfe.c


2020-01-13 16:48:32 +0000
Julian Smith <jules@op59.net>
3704918f3a987e95e7d06fc025de2dce04bab5e8

Coverity 350199: further attempt to quieten coverity using -tainted_data_sink tag.

base/scfe.c


2020-01-12 15:43:51 -0800
Michael Vrhel <michael.vrhel@artifex.com>
4ad96e96f1f929e444fdb0e220d2b05c1dde1bf1

Fix defects reported from fill-stroke3 merge

base/gdevp14.c
base/gscspace.c
base/gsovrc.c


2020-01-11 12:14:48 -0800
Michael Vrhel <michael.vrhel@artifex.com>
05c41c0dedaa512419f15798cbc3da92b6a90bbc

Squashed commit fill-stroke3 branch

This branch had several contributors including Robin Watts,
Ken Sharp and Ray Johnston.

The intent was to add a "fill and stroke" path device method
to ensure we get proper rendering when doing fill/stroke
methods with overprint and transparency. In addition,
adding the method made it possible for pdfwrite to match
the original pdf source file if it also had fill/stroke methods.

The interaction with overprint and transparency led to significant
changes in parts of the code related to those sections. In particular,
overprint was reworked to ensure that the overprint compositor and
the transparency compositor were aware if it was to be using
the overprint drawn_comps for stroke or for fill. The code was
rewritten so that the overprint compositor actions only occurred when
an actual operation occurred (e.g. fill, stroke, image, text) as opposed
to every time that the overprint graphic state values changed.

When there is a fill-stroke operation with transparency, depending upon the
graphic state values, a non-isolated knockout group may be pushed. From this,
an issue with knockout groups within knockout groups was revealed, which was
related to the backdrop selection. The backdrop selection code was simplified.

Resource/Init/pdf_ops.ps
base/gdbflags.h
base/gdevdflt.c
base/gdevepo.c
base/gdevflp.c
base/gdevmem.h
base/gdevmplt.c
base/gdevnfwd.c
base/gdevoflt.c
base/gdevp14.c
base/gdevp14.h
base/gdevsclass.c
base/gdevsclass.h
base/gscdevn.c
base/gscolor.c
base/gscolor2.c
base/gscolor3.c
base/gscpixel.c
base/gscsepr.c
base/gscspace.c
base/gscspace.h
base/gsdcolor.h
base/gsdevice.c
base/gsdparam.c
base/gsdps1.c
base/gsicc.c
base/gsicc_manage.c
base/gsimage.c
base/gsovrc.c
base/gsovrc.h
base/gspaint.c
base/gspaint.h
base/gspath.c
base/gspcolor.c
base/gsptype1.c
base/gsptype2.c
base/gsstate.c
base/gstext.c
base/gstrans.h
base/gxblend.c
base/gxblend1.c
base/gxccache.c
base/gxclimag.c
base/gxclip.c
base/gxclip.h
base/gxclipm.c
base/gxclist.c
base/gxclist.h
base/gxclpath.c
base/gxclpath.h
base/gxclrast.c
base/gxclrect.c
base/gxcmap.c
base/gxdevcli.h
base/gxdevice.h
base/gxdevsop.h
base/gxfill.c
base/gxgstate.h
base/gxpaint.c
base/gxpaint.h
base/gxpath.h
base/gxpath2.c
base/gxpcmap.c
base/gxpcolor.h
base/gxstroke.c
base/lib.mak
devices/gdevpsd.c
devices/vector/gdevpdfb.h
devices/vector/gdevpdfd.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfg.h
devices/vector/gdevpdfx.h
lcms2mt/ChangeLog
lcms2mt/Projects/VC2010/lcms2mt.rc
lcms2mt/config.guess
psi/int.mak
psi/zcolor.c
psi/zpaint.c


2020-01-10 16:50:08 +0000
Robin Watts <Robin.Watts@artifex.com>
5faf010d8e043d77ff10f3deee466e9fb2dc7b7e

Bug 702032: Fix overflow problem in scan converter.

Very wide regions to be filled (> 0x80000000) can cause problems
with overflow in clipping calculations, causing regions to be
filled 'the wrong way' (i.e. from -ve to x rather than from x to
+ve).

Fix this by tweaking calculations to promote to 64bit 1 step
earlier than before.

base/gxscanc.c


2020-01-10 11:56:54 +0000
Julian Smith <jules@op59.net>
419f528cf8625a7e2989068324e962c498c255ef

Coverity 94984: disabled code that had no affect other than to cause a coverity issue.

contrib/gdevgdi.c


2020-01-09 17:14:57 +0000
Julian Smith <jules@op59.net>
e3c394504318a9a6774d65c386842d3f568126ce

Coverity 94488: improved detection of uninitialised Jbig2HuffmanEntry.

When checking for an incorrect uninitialised entry, test for /either/ of
<flags> and <PREFLEN> being -1.

Previously we tested for /all/ of <flags>, <PREFLEN> and <entry->u.RANGELOW>
being -1, which made coverity think that the following code could be run with
PREFLEN=-1, which then triggers issue about illegal shifts.

[It seems that <entry->u.RANGELOW> can be -1 in normal operation, so have
excluded from the new test.]

jbig2dec/jbig2_huffman.c


2020-01-09 15:09:58 +0000
Julian Smith <jules@op59.net>
a9c19743cf5bc787ebbcbbff58c5cce0c923d0cc

Coverity 94740: added /* Fall through. */ comment.

contrib/lips4/gdevl4r.c


2020-01-09 15:07:21 +0000
Julian Smith <jules@op59.net>
7ee0bc7749eb7c2726bb593637de7653e2b62f10

Coverity 94747: removed 'if' with duplicate code.

contrib/lips4/gdevl4v.c


2020-01-09 14:40:54 +0000
Julian Smith <jules@op59.net>
ccd8370b09531128634b3f5bab76b1de426ab116

Coverity 94809: added /* Fall through. */ comment.

contrib/eplaser/gdevescv.c


2020-01-09 14:26:05 +0000
Julian Smith <jules@op59.net>
f563ab707b6068a653fb917974fb1e6a88c068d8

Coverity 121439: use gx_color_index instead of uint, to avoid overflow when shifting.

contrib/pcl3/eprn/eprnrend.c


2020-01-09 14:21:01 +0000
Julian Smith <jules@op59.net>
3acc9babb87048dda29ab766ca41750fc6f58eaf

Coverity 94905: disabled code that had no affect other than to cause a coverity issue.

contrib/gdevgdi.c


2020-01-09 11:32:11 +0000
Julian Smith <jules@op59.net>
bd6f5232dbaaa372b9fdcdb98134af8096c807be

Coverity 95087: use cast to indicate intermediate integer division is expected.

contrib/japanese/gdevmjc.c


2020-01-09 12:17:49 +0000
Chris Liddell <chris.liddell@artifex.com>
78773b740b3c0095fb4c5df59390f0eea84a6a49

Docs: Fix a link to a long gone file.

Reword the "What if I'm writing documentation?" so it makes some sense.

doc/Readme.htm


2019-12-17 15:50:13 +0000
Chris Liddell <chris.liddell@artifex.com>
1075fd1caba19e642c9713c3a07961c0a3f0f88d

Improve the English in section on Unicode TTFs

doc/Use.htm


2020-01-08 12:13:35 +0000
Julian Smith <jules@op59.net>
af1fe01f44f528fb1322cfcf1b48aa5e1aa76059

Coverity 95007: propogate error from eprn_check_colour_info().

contrib/pcl3/eprn/gdeveprn.c
contrib/pcl3/eprn/gdeveprn.h
contrib/pcl3/src/gdevpcl3.c


2020-01-08 14:25:52 +0000
Julian Smith <jules@op59.net>
e0a0c0ca0e16e8b598a7839011df4c3374ab561d

clusterpush.pl: also exclude luratech* directories.

toolbin/localcluster/clusterpush.pl


2020-01-08 13:08:07 +0000
Julian Smith <jules@op59.net>
aba372d8efa1ffdb11a496474f519b0015b31031

Coverity 94665: removed unnecessary if and refactored expression.

contrib/gdevdj9.c


2020-01-08 13:04:41 +0000
Julian Smith <jules@op59.net>
5e1685812864cfde94a5c0daee0cae3307078aa7

Coverity 94713: added {...} to match indentation.

contrib/lips4/gdevl4v.c


2020-01-08 13:02:35 +0000
Julian Smith <jules@op59.net>
3b727b709f40d6b93e874680ab307aa124de5422

Coverity 94729: oki4w_print_page()'s compress_code is always 2.

Simplified code accordingly, and removed static fn oki_compress() as no longer
referenced.

contrib/gdevop4w.c


2020-01-08 12:41:57 +0000
Julian Smith <jules@op59.net>
4e4edd2161b4b7f3ccb23a90a8ca90dccffd078c

Coverity 94757: avoid 'if (foo) return code; return code;' construct.

This code is slightly odd, and didn't want to make major changes, so have ended
up with odd-looking extended expression whose actual value we ignore.

contrib/gdevbjc_.c


2020-01-08 12:31:50 +0000
Julian Smith <jules@op59.net>
cef68e9a0ca0be10f08e415785f8b8fac37d7828

Coverity 94778: added missing {...}.

contrib/lips4/gdevl4v.c


2020-01-08 12:28:15 +0000
Julian Smith <jules@op59.net>
c517f26773cd3a63f029b1bf6e275b227e3af5e8

Coverity 94811: added break in switch block.

contrib/gdevlx32.c


2020-01-08 12:25:54 +0000
Julian Smith <jules@op59.net>
0c84b20c653444310c979a5df78542e9671a6692

Coverity 94846: don't dereference <data> without checking it isn't NULL.

contrib/pcl3/src/pclgen.c


2020-01-08 12:18:02 +0000
Julian Smith <jules@op59.net>
87c48dabcdb64262fc0d24ed81b38d28e7545cb2

Coverity 95006: improved use preprocessor to hopefully fix this warning.

contrib/opvp/gdevopvp.c


2020-01-08 11:58:50 +0000
Julian Smith <jules@op59.net>
4c1e5ac5d9def3cbe25c52c63a3d5ba11f2603ac

Coverity 121439: avoid overflow when shifting.

contrib/pcl3/eprn/eprnrend.c


2020-01-08 11:58:14 +0000
Julian Smith <jules@op59.net>
f71ebb708947e57eaf7cd33b319ec0676e03ba2e

Coverity 121442: avoid overflow when shifting.

contrib/opvp/gdevopvp.c


2020-01-08 11:41:50 +0000
Julian Smith <jules@op59.net>
4bb071925d68398f8efb493c6b529e897a9bc356

Coverity 350199: fix coverity annotation arg number.

base/scfe.c


2020-01-07 19:43:07 +0000
Robin Watts <Robin.Watts@artifex.com>
d24553cea74bda19ae7e3dd5a60302fdc49d1fb2

Fix indentation problems in examples in API.htm

doc/API.htm


2020-01-06 16:30:17 +0000
Ken Sharp <ken.sharp@artifex.com>
147591b7a8390d0e98418851b60ac67e659cf2f1

PDF interpreter - don't abort on errors in JBIG2 globals

This was due to Julian's work on comparing jbig2dec with Luratech.

The test file 'normal_716.pdf' and the cluster test file
jbig2_null_segments_and_glyphs.pdf throw errors when trying to read
the JBIG2 globals dictionary. Luratech doesn't cache the globals, while
jbig2dec does, and the problem was that jbig2dec was returning an error
at a point where the PDF interpreter wasn't able to ignore it, while
Luratech deferred the error to a later point, at a time when the
interpreter could, and did, ignore it.

This meant that Luratech continued to render any further content on the
page while jbig2dec did not, resulting in diffs.

This commit simply runs the global context extraction in a stopped
context. If it fails we clean up the stack and exit, which (effectively)
defers the error to the same point as the Luratech decoder.

Resource/Init/pdf_base.ps


2020-01-06 12:56:52 +0000
Robin Watts <Robin.Watts@artifex.com>
9a2414c7f88ef07cb9297bdeb3236cdba44c25ad

Bug 702018: Fix CAL build crash in tiffsep1.

The SSE code for CAL currently only copes with a maximum of 4
planes. Ensure the device falls back to non-CAL code in such
cases.

devices/gdevtsep.c


2020-01-06 11:40:37 +0000
Robin Watts <Robin.Watts@artifex.com>
1085ead1dd22e3908c341df160a722e71a9c7cfe

Fix VS2019 project getting many x64 builds wrong.

windows/GhostPDL.sln


2020-01-06 08:22:00 +0000
Chris Liddell <chris.liddell@artifex.com>
c53f9d984015b65bf234d65befa552fe9d18c886

Bug 702019: fix dependencies for cups devs and gdevp14

Any "printer" device depends on the low level 'page' device (page.dev),
unaccountably, the cups devices (cups and pwgraster) did not have that
dependency in the makefiles.

Also, the PDF transparency compositor now (and for some time) has also depended
upon page.dev, so update the makefiles for that, too.

base/lib.mak
devices/devs.mak


2020-01-04 20:04:03 -0800
Ray Johnston <ray.johnston@artifex.com>
d1aa5fdfdbea4c55445ee1bdbe08b822a1bd7a8c

Further refinement for Bug 701880. Make tiffsep better match pbmraw

The previous change attempted to fix the y-phase, but this was not a
180 degree rotation, so it caused the primary angle of the pattern to
shift by 90 degrees. A better correspondence is achieved by inverting
the polarity of the thresholds. This is slightly "darker" than pbmraw
but the angle and phase matches pbmraw closely.

Note that the phase using the CAL module does not match the non-CAL
or pbmraw, but the angle of the pattern does match.

devices/gdevtsep.c


2020-01-03 09:56:29 -0800
Ray Johnston <ray.johnston@artifex.com>
372c862f2050d82248316f54156e5bb33dd7520a

Fix Bug 701845. The devicen device would confuse transparency.

The devicen device defines 32-bit depth, but 0 components and no
standard process colors or names. This confused the pdf14 device into
writing a clist with 1-component (gray), but then because the icc_profile
had 4 components, would try and use 4 component when reading.

Fix by making it 32-bit CMYK, and also fix to write a valid PCX by
converting the 32-bit CMYK to 24-bit RGB on output. PCX cannot handle
32-bit CMYK. Prior to this, 32-bit CMYK would fail showpage with a
rangecheck error.

base/gdevdevn.c


2020-01-03 15:51:00 +0000
Robin Watts <Robin.Watts@artifex.com>
9608d275bd750b189dd52681791f31617a640817

Use CAL halftoning in tiffsep1 post processing.

A quick back to back test with/without cal using:

bin/gswin32c.exe -sDEVICE=tiffsep1 -o out.tif -r600 -dMaxBitmap=80000000
examples/tiger.eps

shows timings of 1.142s vs 1.297s on my machine.

devices/devs.mak
devices/gdevtsep.c


2020-01-03 15:52:41 +0000
Robin Watts <Robin.Watts@artifex.com>
59ed026565b5be1bd055d0fbd1b066b8c07274e0

Squash warnings (dropped from earlier commit).

These warnings were supposed to have been squashed a few
commits ago, but somehow got lost in a rebase. Thus they
were mentioned in the commit message, but didn't make it
in.

Avoid problems with 'errno' being a special thing that
shouldn't be used as a parameter name.

Explicitly cast time_t to long for printing.

base/gsioram.c
base/mkromfs.c
base/pack_ps.c


2020-01-03 10:21:18 +0000
Ken Sharp <ken.sharp@artifex.com>
d7d012bfe6c8f248db8b8474743618c53318ce40

PDF interpreter - increase robustness in face of invalid annotations

Bug #702016 "Invalid annotation causing an error"

The PDF file has an annotation where the creating application has
inserted the appearance stream directly into the annotation dictionary.
This breaks the code which attempts to parse the annotation dictionary
from an indirect reference into a dictionary object.

This commit tries to recover from such egregiously broken situations by
running the 'oforce' in a stopped context. This is complicated firstly
by the fact that we parse the annotation dictionary in two places, once
to check it for the presence of transparency and once to actually draw
it (if we are rendering annotations).

In addition, the code could potentially leave anything on the stack, so
we can't use a mark/cleartomark pair to tidy up. Instead, use a
(hopefully) unique name object, create it on the stack and in the case
of an error, unwind the stack back to the expected name.

Finally, report the error to the user in a more or less meaningnful way.

Resource/Init/pdf_main.ps


2019-12-13 12:40:44 +0000
Robin Watts <Robin.Watts@artifex.com>
92031bd1fb9084088a657b7d83339bf499dcc7d2

Update Visual Studio solution to VS2019.

Our belief is that this should work in all versions of VS from
2010 onwards.

By moving to VS2019, we lose support totally for Windows XP prior
to SP3. If this is a problem, either build using the Makefile, or
pull the old VS2005 solution out of git and use that. If customers
find this to be a problem, we can maintain the old VS2005 solution
alongside the new one with minimal effort.

Default builds lose support for Windows XP SP3/Windows Server 2003,
but the new "ReleaseXP", "DebugXP" and "MementoXP" configurations
will target these platforms (assuming the v141 tools have been
installed too).

These "XP" binaries will be build into {,debug,mem}objxp directories
and will produce binaries with an 'XP' suffix: i.e.
{,debug,mem}bin/{gs,gpcl6,gxps,gpdl}win{32,32}{,c}xp.exe.

psi/msvc.mak
windows/All.vcxproj
windows/GhostPDL.sln
windows/ghostpcl.vcxproj
windows/ghostpcl.vcxproj.filters
windows/ghostpdl.vcxproj
windows/ghostpdl.vcxproj.filters
windows/ghostscript.vcxproj
windows/ghostscript.vcxproj.filters
windows/ghostxps.vcxproj
windows/ghostxps.vcxproj.filters


2019-12-16 18:18:47 +0000
Robin Watts <Robin.Watts@artifex.com>
10d2678613d5a93bedc094a62b1b98972871f464

Tweak windows Makefiles to know about VS2017 and VS2019.

These builds have only been tested with "DEVSTUDIO=" (i.e.
relying on the paths to the compilers etc having been set up
in advance, such as happens when building from within the IDE
using the supplied solution). Logic has been added for
command like nmake builds, but this hasn't been tested.

Update the makefiles to avoid using flags that aren't supported
in later versions.

base/msvccmd.mak
base/msvclib.mak
psi/msvc.mak


2020-01-02 11:01:03 +0000
Robin Watts <Robin.Watts@artifex.com>
00cd7c475b173e5cdce7e1e4ff3f0880e1e70583

Squash warnings

Don't define STRICT multiple times.

Explicitly cast time_t's in printfs.

Avoid warnings due to errno being a #defined thing.

base/windows_.h


2019-12-26 13:14:43 -0800
Ray Johnston <ray.johnston@artifex.com>
bf689ee0bff720f202ebc98f301c765f34e2c1fa

Bug 701880: tiffsep1 threshold_from_order caused dots in full white.

For patterns with > 256 dots, threshold_from_order would put in 0 value
cells which would then always be imaged. Change this device to (finally)
use the gx_ht_construct_threshold used by the fast_ht thresholding code
so that it should match the other devices, such as pbmraw.

Also vertically invert the use of the threshold array to match the dots
of the other devices.

Add missing dependencies for gdevtsep.c in devs.mak

devices/devs.mak
devices/gdevtsep.c


2019-12-19 09:22:32 -0800
Nancy Durgin <nancy.durgin@artifex.com>
97ac0f6ef4010e0a49bf6f8f4515c32a5695df68

PDF interpreter -- take out manually drawn rectfill

We can now just draw the rectangle directly with rectfill.
Whatever issue ken ran into 5 years ago no longer applies.

See also Bug 693731

Resource/Init/pdf_draw.ps


2019-12-18 14:46:26 +0000
Ken Sharp <ken.sharp@artifex.com>
719bf1f2c4104d933767d37e62489535e8ba9a17

pdfwrite - use correct FontFile key

This was found as part of bug #701997, even if we set -dCompatibilityLevel
to 1.1, so that type 1 fonts are not converted to type 2 (1c, CFF) we
would still write out a FontFile3 key, instead of the correct
FontFile key.

Ghostscript doesn't care about this, but Acrobat refuses to parse the
font from the file when it has the wrong FontFile key.

The test we were using was incorrect anyway, we were checking
ResourcesBeforeUsgae and we should have been checking HaveCFF because
if HaveCFF is true we would convert type 1 to CFF, and if it isn't we
wouldn't.

devices/vector/gdevpdtb.c


2019-12-16 09:52:13 +0000
Ken Sharp <ken.sharp@artifex.com>
bb47dd4128481c2e62bbd6b5e354da8299f2f16b

PDF interpreter - use PDFDocEncoding for fonts in text annotations

Bug #701889 ""

We were often not applying PDFDocEncoding to fonts when we used them to
draw text for annotations. This commit re-encodes the selected font
which will give a better result.

We probably should also check for UTF16-BE text and use the FallBack
CIDFont in that case, but we'll wait for an example before trying to
code that.

Resource/Init/pdf_draw.ps


2019-12-14 19:13:27 +0000
Ken Sharp <ken.sharp@artifex.com>
c3b184c41144a2650e5520643bbb1cff42c18acc

PDF interpreter - fix line ending positions on Line annotations

Bug #701889 "Annotation objects missing or incorrectly interpreted when appearance stream missing"

The calculation of the position of the line ending was incorrect, and
we were applying the wrong LE entry to each end of the line.

Resource/Init/pdf_draw.ps


2019-12-14 15:24:57 +0000
Ken Sharp <ken.sharp@artifex.com>
1246085e17ee35928f737f1fbf69d69fe6b7a2ae

PDF interpreter - Add arrows to /CL lines in FreeText annotations

Bug #701889 "Annotation objects missing or incorrectly interpreted when appearance stream missing"

Add arrowheads to the ends of callout lines.

Resource/Init/pdf_draw.ps


2019-12-13 15:13:58 +0000
Ken Sharp <ken.sharp@artifex.com>
acccfd2fe90e25534e7d492ca2378dc32269e48e

PDF interpreter - Fix multi-line FreeText annotation with /Rotate 270

The calculation of the 'width' of the container for the text was
incorrect, as was the starting x co-ordinate. Fixed here.

Resource/Init/pdf_draw.ps


2019-12-13 11:55:15 +0000
Ken Sharp <ken.sharp@artifex.com>
5e5f7b41c080bdbd15fac5afbd09052a83e81a01

PDF interpreter - apply /C to more annotation types

Bug #701889 "Annotation objects missing or incorrectly interpreted when appearance stream missing"

Seems we also need to apply the /C colour to Polygon, Square and Circle
annotations before drawing them.

Resource/Init/pdf_draw.ps


2019-12-13 11:23:28 +0000
Ken Sharp <ken.sharp@artifex.com>
4940c5cb80916017d3ee0c9b53475323cf5ebbd6

PDF interpreter - more annotation improvements

Bug #701889 "Annotation objects missing or incorrectly interpreted when appearance stream missing"

Apply the /RD array (if present) to the annotation /Rect before using
the Rect to draw the border.

We were using the /C array in drawborder to set the colour before
stroking the border, there are two problems with this; firstly the /C
array is not used to specify a border colour, secondly we need to set
the colour for certain objects irrespective of whether they have a
border.

Remove annotsetcolor from drawborder and apply it to Squiggly, Strikeout,
Underline, Highlight, Line and Ink annotations in order to set the
colour before drawing the annotation. The specification says that this
is used for; the border of a Link annotation, the title bar of a
pop-up annotation's pop-up and the background of the annotation's icon
when closed, but in fact Acrobat also uses it to set the colour for all
the annotation types listed above.

There may still be more work needing done here, but this matches all the
test cases I currently have.

Resource/Init/pdf_draw.ps


2019-12-12 17:04:17 +0000
Ken Sharp <ken.sharp@artifex.com>
d95dd7a23f25e73042f3c8e6043c83285387d0a1

PDF interpreter - apply RD array to Circle, Square and FreeText, apply Rotate to FreeText

Bug #701889 "Annotation objects missing or incorrectly interpreted when appearance stream missing"

The /RD array makes certain kinds of annotations be drawn in a smaller
area. Although the spec does not mention it, Acrobat applies the
/Rotate key if found to the text in a FreeText annotation.

Still more to do on the text; we are nto fitting the text correctly
when Rotate is 270, not certain why. Also we are not drawing Borders
when we should, some text is missing and text is in the wrong colour
(due to not applying /DS)

Resource/Init/pdf_draw.ps


2019-12-12 19:47:18 +0000
Robin Watts <Robin.Watts@artifex.com>
f25987c838ea9437b60f8b3b93f90e187013b641

Tweak CAL makefile to include new intrinsics headers in dependencies.

base/cal.mak


2019-12-12 15:44:30 +0000
Robin Watts <Robin.Watts@artifex.com>
321cf6026a05e31140a87cc83a2653b048550df4

Fix arch.h dependency in cal build.

This was causing parallel makes of CAL enabled builds to
fail.

base/cal.mak


2019-11-29 17:48:29 +0000
Robin Watts <Robin.Watts@artifex.com>
b6f6adb5448fda1f33db4c92c030709618e4ee54

Support for YCbCr, LogL, LOGLUV and paletted TIFFs.

YCbCr TIFFs have to use TIFFRGBAImage as for the old JPEG
encapsulation.

gpdl/tifftop.c


2019-11-28 22:32:43 +0000
Robin Watts <Robin.Watts@artifex.com>
ae1cee743e56a7b654d9dbb2ea88ed90d48d298d

Further fixes for GPDL TIFF.

Support JPEG encoded TIFFs (both old and new formats).

Old JPEG format requires the whole image to be decoded to an
RGBAImage in memory at once; looks like that's just a limitation
of libtiff. This is particularly annoying because it looks like
the internals of libtiff are prepared to do scanline extraction
as you'd hope, but aren't exposed to the outside world.

base/msvclib.mak
base/tiff.mak
configure.ac
gpdl/gpdl.mak
gpdl/tifftop.c
psi/msvc.mak


2019-12-12 17:26:02 +0000
Robin Watts <Robin.Watts@artifex.com>
ef66198ade77d5d551b3045cd36bed81c0b04f54

Changes to libtiff for gpdl.

1) Ensure that libtiff doesn't mess with 'boolean' in GS builds
on Windows. Without this, the jpeg structures used by our JPEG
lib build are different in size when called from gs and libtiff,
resulting in runtime errors.

2) Update libtiff so that it can correctly call into the jpeg
library so that memory operations happen from our pools, not
malloc/free. Slightly horrid in that this is more complex with
OJPEG than JPEG files.

tiff/libtiff/tif_jpeg.c
tiff/libtiff/tif_ojpeg.c
tiff/libtiff/tif_open.c
tiff/libtiff/tiffio.h
tiff/libtiff/tiffiop.h


2019-11-28 10:52:49 +0000
Robin Watts <Robin.Watts@artifex.com>
0c248ced8997dfe8f253a07fc6cc5f47837ca12e

Fixes for GPDL TIFF support.

Support tiled TIFFs, planar TIFFs, and TIFFs where the resolution
isn't properly specified.

gpdl/tifftop.c


2019-12-12 14:33:27 +0000
Chris Liddell <chris.liddell@artifex.com>
76bd0d75823a571130f340ab6231e064d1f997f7

Move pdf_info.ps into lib (from toolbin)

And add it to the list of files to install on Unix systems.

Also, tweak the comments in pdf_info.ps to reflect its new home.

base/unixinst.mak
lib/pdf_info.ps


2019-12-12 14:26:30 +0000
Chris Liddell <chris.liddell@artifex.com>
e39d57f23585b6fe71db5433dc205459be7a3c22

Tweak to handle .shellarguments throwing an error

.shellarguments for quite some time has thrown an undefined error if Ghostscript
is not invoked with the '--' option, so handle that.

toolbin/pdf_info.ps


2019-12-12 14:16:41 +0000
Chris Liddell <chris.liddell@artifex.com>
72f6dd34cd0732cb7cdd9246d5063fc0f70ce79b

Add hex string representation of font names

Mainly CIDFonts come up with multibyte characters in their names, hence making
the normal Postscript string pretty meaningless. This adds a hex string
representation which can be used in Fontmap.GS or cidfmap for subsitution.

toolbin/pdf_info.ps


2019-12-12 13:07:46 +0000
Chris Liddell <chris.liddell@artifex.com>
bcb6fb284fcbe776d9ddd44f98d196da7df2c054

Add NDEBUG to the optimised build flags

Without that, asserts get included in an optimised build, which we don't want.

base/unix-gcc.mak
base/unixansi.mak
configure.ac
psi/msvc.mak


2019-12-10 15:37:35 +0000
Chris Liddell <chris.liddell@artifex.com>
044848a1752273471e9deab826045eca82030d62

Reinstate basic regular expression compatibility

In Basic Regular Expressions `+' is an ordinary character, use `*' instead.

This also maintains consistency with the equivalent code a few lines above in
the file.

jbig2dec/autogen.sh


2019-12-09 03:00:42 +0000
Ken Sharp <ken.sharp@artifex.com>
35828fce7ad795c546831520b7a57ef233453b43

txtwrite - don't close the device on media size changes

Bug #701971 "txtwrite incomplete for certain files and differs when stdout versus file is output"

The problem is nothing to do with stdout vs file. The difference is due
to the fact that the input PDF file has multiple pages with different
media sizes. When the media size is changed the default put_params()
method closes and reopens the device. When the txtwrite device is
closed it closes its output file. Re-opening the device opens a new
file, if the filename doesn not have a %d then the sam file is opened
which will of course truncate it.

Writing to stdout obviously doesn't have this behaviour when the output
file is closed.

We don't need to close the txtwrite device when the media size changes
so here we patch the 'is_open' flag to prevent the default method
from closing the device.

devices/vector/gdevtxtw.c


2019-12-06 21:45:09 +0000
Chris Liddell <chris.liddell@artifex.com>
b46142c94bde32f620bda18e3bc5912fbf999446

Bug 701973: Fix gssprintf.c includes for PRI macros

The header inclusion in gssprintf.c meant the definitions of the PRI macros
for string formatting could be inconsistent with other source files.

Adding the appropriate headers in the correct order resolves that issue.

base/gssprintf.c
base/lib.mak


2019-12-06 21:44:13 +0000
Chris Liddell <chris.liddell@artifex.com>
a4c78f01d9a1bd9862b575f33aa48afddd167005

Fix configure based build for post-Sun Solaris releases

base/stdint_.h
configure.ac


2019-12-07 15:02:15 +0000
Ken Sharp <ken.sharp@artifex.com>
3bf992e26006c8af9e137822159eb7c7540462c0

PDF interpreter - Accept /ColorSpace as well as /CS in group attribute dictionary

Again, no bug report, the customer has asked that the file be kept
confidential

The problem is due to a group attribute dictionary for an SMask. The
dictionary is required to contain a /CS (colour space) entry in order
to correctly set the background. In this case, however, the dictionary
contains a /ColorSpace entry.

I've chosen to implement treating the /ColorSpace as a /CS entry, this
is not what Acrobat does, but mimicking Acrobat's behaviour is more or
less impossible for us. We do emit a warning.

Resource/Init/pdf_draw.ps


2019-12-06 18:43:28 +0000
Ken Sharp <ken.sharp@artifex.com>
539fe73419fdf00ffd7747a2cf890e56bc6f0504

PDF interpreter - cope with legal but sub-optimal indirect /Pattern

No bug, the report is from a customer who wants the file to be treated
confidentially.

The files uses a Pattern colour space, which it defines in a highly
peculiar fashion:

stream
....
/CS0 cs /P0 scn

....
endstream

CS0 is defined as:
/CS0 22 0 R

and object 22 is:

22 0 obj
[ 23 0 R ]
endobj

23 0 obj
/Pattern
endobj

The PDF interpreter wasn't prepared to handle the name being an indirect
reference.

Resource/Init/pdf_draw.ps


2019-11-21 09:54:53 -0800
Ray Johnston <ray.johnston@artifex.com>
5dfca9b93a17806e11d54068a6e5b9705f3b6bc6

Fix problem with setup_trans being undone by grestore

Noticed with text from Bug688728.pdf, but the offending method was
also an issue with 'sh' and 'image' operations where the setup_trans
invocation was withing a gsave ... grestore. The BlendMode and other
graphics state parameters would be reset by the grestore.

Also some places could get errors from pathbbox and/or strokepath
due to a non-invertable matrix, so errors from these now just emit
an empty bbox [ 0 0 0 0 ].

Resource/Init/pdf_draw.ps
Resource/Init/pdf_main.ps
Resource/Init/pdf_ops.ps


2019-12-05 12:50:26 +0000
Chris Liddell <chris.liddell@artifex.com>
fbd776580b26bdf27bcf5778dea94b446c786f67

Coverity ID 351435: reduce buffer size passed to strncat()

Fixes an (unlikely) potential buffer overflow

base/gp_unix.c


2019-12-04 12:23:02 +0000
Chris Liddell <chris.liddell@artifex.com>
53ab3ecee8a60d412c2bf1406340bf9cb228e106

Bug 701969: Fix fontconfig path permissions handling

The paths from fontconfig to be added to the permit file reading list was not
having the trailing directory separator added to indicate we want to allow
the directory to be read.

Also, tweak the path/filename splitting (for the permit file read list) when
parsing the cidfmap so it matches the improved version in gs_fonts.ps

Resource/Init/gs_cidfm.ps
base/gp_unix.c


2019-12-02 18:24:09 +0000
Ken Sharp <ken.sharp@artifex.com>
c25d59001421845d0ff74735388d450d62b459d5

PDF interpreter - improve /Polygon annotation appearance creation

Bug #701889 "Annotation objects missing or incorrectly interpreted when appearance missing"

Another case of failing to stroke the border of an annotation if it had
no interior colour. We still don't support the 'Cloudy' Border Effect.

Resource/Init/pdf_draw.ps


2019-12-02 17:59:34 +0000
Ken Sharp <ken.sharp@artifex.com>
11f6202373fc546cc10d08acfb5ca0463df20437

PDF interpreter - generate callout (/CL) lines for FreeText annots

Bug #701889 "Annotation objects missing or incorrectly interpreted when appearance is missing"

FreeText annotations can have a /CL (callout) entry, which defines a
line to be drawn to the point referenced by the text.

This is a first pass at the problem, Acrobat generates arrow heads for
the callout lines, this patch does not.

Resource/Init/pdf_draw.ps


2019-12-02 17:19:00 +0000
Ken Sharp <ken.sharp@artifex.com>
182e228cee6b30c6e2f00d8abd20a6791d44323f

PDF interpreter - improve /Square annotation appearance creation

Bug #701889 "Annotation objects missing or incorrectly interpreted when appearance stream missing"

First of probably several changes. In this case we were failing to
stroke the border of a /Square annotation if it had no interior colour
(we did not render the annotation at all).

In addition, when element 3 of the Border array was 0 we were still
drawing a Border, which we should not do (this didn't show up until we
fixed the problem above).

Resource/Init/pdf_draw.ps


2019-12-01 22:04:21 +0000
Chris Liddell <chris.liddell@artifex.com>
c535c0c879162ccd7c88c5b8cc6c3a0847c0babe

Create devdevs.tr correctly

devdevs.tr is an interim list of output and core library "devs" that gets
created and then used, ultimately, to create the gconfig.h header file
(which has the bulid configuration of the graphics library), and the linker
scripts.

When devdevs.tr required creation, we were always appending to the file (if it
already existed), not overwriting it, meaning the list would grow indefinitely,
and contain duplicates.

This looks like a typo: the first line of devdevs.tr creation used a '-a'
echogs paramater, rather than the '-w' parameter.

I think this should solve the problem.

base/gs.mak


2019-12-01 21:55:48 +0000
Chris Liddell <chris.liddell@artifex.com>
aa4fa650fa837a6f7b22caad33699bbbf9156bc1

Bug 701957: Explicitly disable webp and ztsd for libtiff

configure.ac


2019-11-29 08:42:15 -0800
Ray Johnston <ray.johnston@artifex.com>
c2b492ad627bdcb476fa3cd15a1c31cc3b6b788d

Fix typo (inadvertent paste) in devices/gdevjbig2.c from f63270230 commit

devices/gdevjbig2.c


2019-11-29 14:40:47 +0000
Julian Smith <jules@op59.net>
8636935ac086f56464f0541ed735f1016f2c3895

Coverity 94659: removed cp_num - was allocated but never actually used.

contrib/opvp/gdevopvp.c


2019-11-29 14:35:25 +0000
Julian Smith <jules@op59.net>
a3f284624a68dcb1ecb72dcf307b42d194e78de1

Coverity 94653: fixed incorrect if() that was logically dead code.

contrib/lips4/gdevl4v.c


2019-11-29 14:15:57 +0000
Julian Smith <jules@op59.net>
ff02f8741f71830e7a4795645680a16b9d7ae106

Coverity 94652: return error from opvp_image_plane_data() rather than segv.

contrib/opvp/gdevopvp.c


2019-11-29 12:40:02 +0000
Julian Smith <jules@op59.net>
f977255de00bb71f5c2627b8692912bb3263ee48

Coverity 94645: added '/* Fall through. */ comments to switch statements.

This should convince Coverity that the fall-through's are intentional.

contrib/lips4/gdevl4r.c


2019-11-29 12:38:10 +0000
Julian Smith <jules@op59.net>
f877f5bc792206085f9edf4143983d4156fb3ae5

Coverity 94638: added '/* Fall through. */ comments to switch statements.

This should convince Coverity that the fall-through's are intentional.

contrib/gdevmd2k.c


2019-11-29 12:33:51 +0000
Julian Smith <jules@op59.net>
39286afa21126c193fcd0f3ccc0800f7c0662ed0

Coverity 94616: added '/* Fall through. */ comments to switch statements

This should convince Coverity that the fall-through's are intentional.

contrib/gdevgdi.c


2019-11-29 12:30:57 +0000
Julian Smith <jules@op59.net>
1c899fc1100f21f6e24096375e2daac26b23f33b

Coverity 94608: added '/* Fall through. */ comments to switch statements.

This should convince Coverity that the fall-through's are intentional.

contrib/lips4/gdevl4v.c


2019-11-29 12:10:19 +0000
Julian Smith <jules@op59.net>
adbf399b79b3e6b645e98acd53f42f9fd5ca9174

Coverity 94601: avoid out-of-bounds access of gendata->dev->hoffset[] if newhead < 0.

contrib/gdevlx32.c


2019-11-29 11:41:05 +0000
Julian Smith <jules@op59.net>
1d04fe90a4c3b82e1286a1b341cdb89a96625715

Coverity 94490: check return codes in opvp_fill_mask().

contrib/opvp/gdevopvp.c


2019-11-28 18:26:56 +0000
Julian Smith <jules@op59.net>
fbd78a0467afb2c66a41d55ee9b3aee0a7a01d7b

Coverity 94511: Use full range of frac when source is 8-bit.

Essentially we use frac2byte() and byte2frac(), instead of frac2cv() and
cv2frac(). This ensures we use full range of frac with the transfer fns.

Note that this change is untested. It is based on observation and discussion
between gs develpoers. This code has not been modified since initial import.

contrib/opvp/gdevopvp.c


2019-11-28 17:00:08 +0000
Julian Smith <jules@op59.net>
a537e5bd4252abdbdc3f90dfdce8dc9fb621b38d

Coverity 94505: converted macros into static fns.

This should avoid Coverity worrying about bits 8-15 always being zero in a call
of write_short().

contrib/gdevmd2k.c


2019-11-28 16:34:49 +0000
Julian Smith <jules@op59.net>
35e0c3f70ba2646b4bdfb41663a708a8594eeb68

Coverity 94553: fixed possible copy&paste error in lips4_image_out().

Use Len_rle instead of Len inside RLE block.

contrib/lips4/gdevl4r.c


2019-11-28 16:08:23 +0000
Julian Smith <jules@op59.net>
792c922fc83aed63090fb37ffc823e75ec8f9c5c

Coverity 95077: fixed various scan-build issues with contrib/japanese/gdevmjc.c.

Some of these will correspond to coverity issues also.

contrib/japanese/gdevmjc.c


2019-11-28 15:44:05 +0000
Julian Smith <jules@op59.net>
efff831b1f3a00c69a32b4edd48614d583f9034a

Coverity 95077: removed unused assignment to <H> variable.

contrib/japanese/gdevmjc.c


2019-11-28 12:05:43 +0000
Julian Smith <jules@op59.net>
94190ff3e48c36a8538a3aba252e2b56909f6984

Coverity 95034: avoid warnings about ignoring return from gs_note_error().

contrib/pcl3/src/gdevpcl3.c


2019-11-28 11:32:14 +0000
Julian Smith <jules@op59.net>
c9f669385954f205d395cbacb2b611d659b3ebf9

Coverity 350199: add '-tainted_data_return' annotation.

This makes this annotation match what has worked elsewhere.

base/scfe.c


2019-11-28 14:36:52 +0000
Chris Liddell <chris.liddell@artifex.com>
fd2b1946fe5a4a8c029324c15f9bd606a489f543

Include the source file libtiff webp compression support

If the webp lib is available, it could cause linker failures if we don't
include the source file.

base/tiff.mak


2019-11-28 11:29:03 +0000
Chris Liddell <chris.liddell@artifex.com>
874ef8cf7f0af2efae3d7fb6598013be5d277384

Enable jpeg support in libtiff if possible

base/tiff.mak
configure.ac
psi/msvc.mak


2019-11-27 15:29:04 +0000
Julian Smith <jules@op59.net>
15f3faeffff7d1b2658b824262314091f7af088b

Coverity 95034: move code so that we have one less call to pcl_cm_is_differential().

fixes scan-build issue, e.g.:
scan-build -o ../scan-build-out make sanitize

contrib/pcl3/src/gdevpcl3.c


2019-11-27 15:27:25 +0000
Julian Smith <jules@op59.net>
6e8c15137a70012776c1b163d7480e1a2cc7c61b

Coverity 95034: removed use of guard() macro.

Instead use static fn to convert error codes, with explicit inline code.

contrib/pcl3/src/gdevpcl3.c


2019-11-27 14:29:41 +0000
Julian Smith <jules@op59.net>
7e1c4da27805ab9b545bc8ab5b0747c37b69454c

Coverity 95034: refactor pcl3_print_page() to avoid leaks.

contrib/pcl3/src/gdevpcl3.c


2019-11-27 13:11:29 +0000
Julian Smith <jules@op59.net>
1df794e69d9f29dae215e50cf328ccad40fe29e8

Coverity 95027: fix off-by-one when bounds-checking against LIPS_MEDIACHAR_MAX.

contrib/lips4/gdevl4r.c


2019-11-27 12:52:17 +0000
Julian Smith <jules@op59.net>
e9ccb4139c5f3fb89a5f4d6554e73323dbf73641

Coverity 94957: Call dlclose() to avoid leaks of handles from dlopen().

contrib/opvp/gdevopvp.c


2019-11-27 11:39:28 +0000
Julian Smith <jules@op59.net>
e4dcc70672b447df52b0a3c7976ab6ece280841e

Coverity 350199: mark cf_encode_1d() as not tainting lbuf.

This may work better than the previous annotation.

base/scfe.c


2019-11-26 12:04:54 -0800
Ray Johnston <ray.johnston@artifex.com>
334132f45320ef35b54032c053c100d07e02ec98

Fix problems seen with m8510 device and improve gdev_prn_copy_scan_lines

Previous patch made this device pay attention to return code from the
gdev_prn_copy_scan_lines, which caused the all_devices test to get an error.

Also this device would get an ioerror if the page width was not a multiple
of 8. Fix m8510_output_run to round up when setting out_end, bullet proof
check of count so we don't try and print with a negative count.

Also fix gdev_prn_copy_scan_lines to return count == 0 if the starting
line is past the end of the page, and fill lines past end of page with
zeroes if the count did not fill it (or if there was an error from
gdev_prn_get_bits).

base/gdevprn.c
devices/gdev8510.c


2019-11-26 14:43:58 +0000
Robin Watts <Robin.Watts@artifex.com>
23b4705f975ee0d4288ad47e62ffb8737ced48a8

GPDL PNG support

gpdl/gpdl.mak
gpdl/jp2ktop.c
gpdl/pngtop.c
pcl/pl/plimpl.c
windows/ghostpdl.vcproj


2019-11-26 14:35:05 +0000
Robin Watts <Robin.Watts@artifex.com>
b772aaf901a3cd37baf5c06eb141c689829bf673

Bug 701949: Add 'omitEOD' flag to RLE compressor and use for PXL.

It turns out that some printers (Samsung ML-2250 and Canon
ImageRunner iRC2380i at least) object to the EOD byte appearing
in RLE data in PXL streams.

Ken kindly checked the PXL spec for me, and found that: "The PXL
spec does say a control code of -128 is ignored and not included
in the decompressed data and the byte following a control byte
of 128 (I assume they mean -128 here) is treated as the next
control byte. And PCL only uses RLE data for images, so they do
know how much data they expect."

Thus, the conclusion we reached is that PCL/PXL don't need
(indeed, really does not want) the EOD byte.

The Postscript spec clearly defines the EOD byte though. Rather
than break the streams for postscript, we introduce a flag
'omitEOD' that can be set for the encoder when we want to produce
a stream for use with PCL/PXL.

base/srle.c
base/srlx.h
devices/vector/gdevpx.c
psi/zfilter.c


2019-11-27 13:27:35 +0000
Chris Liddell <chris.liddell@artifex.com>
c9ed069d86f291dc3118ee96f76765432ac478e3

Update thirdparty.htm to reflect updated libs

doc/thirdparty.htm


2019-11-26 14:39:02 +0000
Chris Liddell <chris.liddell@artifex.com>
79ac3f84060fbd5447219264ab0bcf89c7caa2cf

Update Freetype to 2.4.10

Plus makefile updates to support it

Bug 701288: Handle SEAC ligature glyph metrics correctly.

As originally intended, a Type 1 SEAC charstring would be used for an accented
glyph (like an a-caron, or u-umlaut) where the advance with of the SEAC glyph
is the same as that of the 'base' glyph ('a' or 'u').

It this case, it is not uncommon for the SEAC to skip using an (H)SBW op code
and rely on the one from the base glyph.

But out of spec fonts also use SEAC glyphs ligature glyphs (like 'oe' or 'fi'),
and in those cases the overall advance width is greater than that of the 'base'
glyph.

In this case, we have to allow for the SEAC glyph having included an (H)SBW and
if it has, retain those values, rather than those from the base glyph.

Rename file and make file change to match

Avoids file name clash with freetype 2.4.10

Work around a change in the zlib API for 1.2.11

where it's used in the Freetype/zlib interface debugging code.

base/freetype.mak
base/lcupsi.mak
cups/libs/filter/cupsraster.c
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/ChangeLog.29
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/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/README
freetype/builds/mac/freetype-Info.plist
freetype/builds/mac/ftmac.c
freetype/builds/modules.mk
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.m4
freetype/builds/unix/ft-munmap.m4
freetype/builds/unix/ftconfig.in
freetype/builds/unix/ftsystem.c
freetype/builds/unix/install-sh
freetype/builds/unix/install.mk
freetype/builds/unix/ltmain.sh
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/LIBS.OPT_IA64
freetype/builds/vms/_LINK.OPT_IA64
freetype/builds/vms/ftconfig.h
freetype/builds/vms/ftsystem.c
freetype/builds/vms/vmslib.dat
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.sln
freetype/builds/windows/vc2005/freetype.vcproj
freetype/builds/windows/vc2005/index.html
freetype/builds/windows/vc2008/freetype.sln
freetype/builds/windows/vc2008/freetype.vcproj
freetype/builds/windows/vc2008/index.html
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.sln
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/DOCGUIDE
freetype/docs/INSTALL
freetype/docs/INSTALL.ANY
freetype/docs/INSTALL.CROSS
freetype/docs/INSTALL.GNU
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/README
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/reference/site/404.html
freetype/docs/reference/site/assets/fonts/font-awesome.css
freetype/docs/reference/site/assets/fonts/material-icons.css
freetype/docs/reference/site/assets/fonts/specimen/FontAwesome.ttf
freetype/docs/reference/site/assets/fonts/specimen/FontAwesome.woff
freetype/docs/reference/site/assets/fonts/specimen/FontAwesome.woff2
freetype/docs/reference/site/assets/fonts/specimen/MaterialIcons-Regular.ttf
freetype/docs/reference/site/assets/fonts/specimen/MaterialIcons-Regular.woff
freetype/docs/reference/site/assets/fonts/specimen/MaterialIcons-Regular.woff2
freetype/docs/reference/site/assets/images/favicon.png
freetype/docs/reference/site/assets/images/icons/bitbucket.1b09e088.svg
freetype/docs/reference/site/assets/images/icons/github.f0b8504a.svg
freetype/docs/reference/site/assets/images/icons/gitlab.6dd19c00.svg
freetype/docs/reference/site/assets/javascripts/application.d9aa80ab.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.da.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.de.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.du.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.es.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.fi.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.fr.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.hu.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.it.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.ja.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.jp.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.multi.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.nl.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.no.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.pt.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.ro.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.ru.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.stemmer.support.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.sv.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.th.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.tr.js
freetype/docs/reference/site/assets/javascripts/lunr/tinyseg.js
freetype/docs/reference/site/assets/javascripts/lunr/wordcut.js
freetype/docs/reference/site/assets/javascripts/modernizr.1f0bcf2b.js
freetype/docs/reference/site/assets/stylesheets/application-palette.224b79ff.css
freetype/docs/reference/site/assets/stylesheets/application.982221ab.css
freetype/docs/reference/site/ft2-auto_hinter.html
freetype/docs/reference/site/ft2-base_interface.html
freetype/docs/reference/site/ft2-basic_types.html
freetype/docs/reference/site/ft2-bdf_fonts.html
freetype/docs/reference/site/ft2-bitmap_handling.html
freetype/docs/reference/site/ft2-bzip2.html
freetype/docs/reference/site/ft2-cache_subsystem.html
freetype/docs/reference/site/ft2-cff_driver.html
freetype/docs/reference/site/ft2-cid_fonts.html
freetype/docs/reference/site/ft2-color_management.html
freetype/docs/reference/site/ft2-computations.html
freetype/docs/reference/site/ft2-error_code_values.html
freetype/docs/reference/site/ft2-error_enumerations.html
freetype/docs/reference/site/ft2-font_formats.html
freetype/docs/reference/site/ft2-gasp_table.html
freetype/docs/reference/site/ft2-glyph_management.html
freetype/docs/reference/site/ft2-glyph_stroker.html
freetype/docs/reference/site/ft2-glyph_variants.html
freetype/docs/reference/site/ft2-gx_validation.html
freetype/docs/reference/site/ft2-gzip.html
freetype/docs/reference/site/ft2-header_file_macros.html
freetype/docs/reference/site/ft2-header_inclusion.html
freetype/docs/reference/site/ft2-incremental.html
freetype/docs/reference/site/ft2-index.html
freetype/docs/reference/site/ft2-layer_management.html
freetype/docs/reference/site/ft2-lcd_rendering.html
freetype/docs/reference/site/ft2-list_processing.html
freetype/docs/reference/site/ft2-lzw.html
freetype/docs/reference/site/ft2-mac_specific.html
freetype/docs/reference/site/ft2-module_management.html
freetype/docs/reference/site/ft2-multiple_masters.html
freetype/docs/reference/site/ft2-ot_validation.html
freetype/docs/reference/site/ft2-outline_processing.html
freetype/docs/reference/site/ft2-parameter_tags.html
freetype/docs/reference/site/ft2-pcf_driver.html
freetype/docs/reference/site/ft2-pfr_fonts.html
freetype/docs/reference/site/ft2-properties.html
freetype/docs/reference/site/ft2-quick_advance.html
freetype/docs/reference/site/ft2-raster.html
freetype/docs/reference/site/ft2-sfnt_names.html
freetype/docs/reference/site/ft2-sizes_management.html
freetype/docs/reference/site/ft2-system_interface.html
freetype/docs/reference/site/ft2-t1_cid_driver.html
freetype/docs/reference/site/ft2-truetype_engine.html
freetype/docs/reference/site/ft2-truetype_tables.html
freetype/docs/reference/site/ft2-tt_driver.html
freetype/docs/reference/site/ft2-type1_tables.html
freetype/docs/reference/site/ft2-user_allocation.html
freetype/docs/reference/site/ft2-version.html
freetype/docs/reference/site/ft2-winfnt_fonts.html
freetype/docs/reference/site/images/favico.ico
freetype/docs/reference/site/index.html
freetype/docs/reference/site/javascripts/extra.js
freetype/docs/reference/site/search/search_index.json
freetype/docs/reference/site/sitemap.xml
freetype/docs/reference/site/sitemap.xml.gz
freetype/docs/reference/site/stylesheets/extra.css
freetype/docs/release
freetype/include/freetype/config/ftconfig.h
freetype/include/freetype/config/ftheader.h
freetype/include/freetype/config/ftmodule.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/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/ftchapters.h
freetype/include/freetype/ftcid.h
freetype/include/freetype/ftcolor.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/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/fthash.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/internal/wofftypes.h
freetype/include/freetype/t1tables.h
freetype/include/freetype/ttnameid.h
freetype/include/freetype/tttables.h
freetype/include/freetype/tttags.h
freetype/include/ft2build.h
freetype/modules.cfg
freetype/src/Jamfile
freetype/src/autofit/Jamfile
freetype/src/autofit/afangles.c
freetype/src/autofit/afangles.h
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/ftcolor.c
freetype/src/base/ftdbgmem.c
freetype/src/base/ftdebug.c
freetype/src/base/fterrors.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/fthash.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/bdf.h
freetype/src/bdf/bdfdrivr.c
freetype/src/bdf/bdfdrivr.h
freetype/src/bdf/bdferror.h
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/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/infblock.c
freetype/src/gzip/infcodes.c
freetype/src/gzip/inflate.c
freetype/src/gzip/rules.mk
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/pcf.h
freetype/src/pcf/pcfdrivr.c
freetype/src/pcf/pcfdrivr.h
freetype/src/pcf/pcferror.h
freetype/src/pcf/pcfread.c
freetype/src/pcf/pcfutil.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/sfwoff.c
freetype/src/sfnt/sfwoff.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/ttcolr.c
freetype/src/sfnt/ttcolr.h
freetype/src/sfnt/ttcpal.c
freetype/src/sfnt/ttcpal.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/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


2019-11-26 17:45:08 +0000
Chris Liddell <chris.liddell@artifex.com>
36cbd382b160ee4951d1911f85a4fa0723dd8db3

Update openjpeg to 2.3.1

openjpeg/.gitignore
openjpeg/.travis.yml
openjpeg/CHANGELOG.md
openjpeg/INSTALL.md
openjpeg/NEWS.md
openjpeg/appveyor.yml
openjpeg/doc/Doxyfile.dox.cmake.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/CMakeLists.txt
openjpeg/src/lib/openjp2/CMakeLists.txt
openjpeg/src/lib/openjp2/bench_dwt.c
openjpeg/src/lib/openjp2/dwt.c
openjpeg/src/lib/openjp2/image.c
openjpeg/src/lib/openjp2/j2k.c
openjpeg/src/lib/openjp2/jp2.c
openjpeg/src/lib/openjp2/openjpeg.h
openjpeg/src/lib/openjp2/opj_intmath.h
openjpeg/src/lib/openjp2/pi.c
openjpeg/src/lib/openjp2/t1.c
openjpeg/src/lib/openjp2/t2.c
openjpeg/src/lib/openjp2/tcd.c
openjpeg/src/lib/openjp2/thread.c


2019-11-26 13:19:03 +0000
Chris Liddell <chris.liddell@artifex.com>
107babf6d3652ed9bcf26b20823ac935ba86634b

Update expat to 2.2.9

And small makefile tweak to support it.

base/expat.mak
expat/CMake.README
expat/CMakeLists.txt
expat/Changes
expat/ConfigureChecks.cmake
expat/Makefile.am
expat/Makefile.in
expat/README.md
expat/acinclude.m4
expat/aclocal.m4
expat/cmake/expat-config.cmake.in
expat/cmake/mingw-toolchain.cmake
expat/configure
expat/configure.ac
expat/conftools/ac_c_bigendian_cross.m4
expat/conftools/ar-lib
expat/conftools/ax-append-compile-flags.m4
expat/conftools/ax-append-flag.m4
expat/conftools/ax-append-link-flags.m4
expat/conftools/ax-check-compile-flag.m4
expat/conftools/ax-check-link-flag.m4
expat/conftools/ax-require-defined.m4
expat/conftools/config.guess
expat/conftools/config.sub
expat/conftools/expatcfg-compiler-supports-visibility.m4
expat/conftools/install-sh
expat/conftools/ltmain.sh
expat/conftools/missing
expat/doc/Makefile.am
expat/doc/Makefile.in
expat/doc/reference.html
expat/examples/Makefile.in
expat/examples/elements.c
expat/examples/elements.vcxproj
expat/examples/elements.vcxproj.filters
expat/examples/outline.c
expat/examples/outline.vcxproj
expat/examples/outline.vcxproj.filters
expat/expat.sln
expat/expat_config.h
expat/expat_config.h.cmake
expat/expat_config.h.in
expat/fix-xmltest-log.sh
expat/lib/Makefile.am
expat/lib/Makefile.in
expat/lib/asciitab.h
expat/lib/expat.h
expat/lib/expat.vcxproj
expat/lib/expat.vcxproj.filters
expat/lib/expat_external.h
expat/lib/expat_static.vcxproj
expat/lib/expat_static.vcxproj.filters
expat/lib/expatw.vcxproj
expat/lib/expatw.vcxproj.filters
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/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/test-driver-wrapper.sh
expat/tests/Makefile.in
expat/tests/benchmark/Makefile.in
expat/tests/benchmark/benchmark.c
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/structdata.c
expat/tests/structdata.h
expat/tests/xmltest.sh
expat/win32/README.txt
expat/win32/build_expat_iss.bat
expat/win32/expat.iss
expat/xmlwf/Makefile.am
expat/xmlwf/Makefile.in
expat/xmlwf/codepage.c
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/xmltchar.h
expat/xmlwf/xmlurl.h
expat/xmlwf/xmlwf.c
expat/xmlwf/xmlwf.vcxproj
expat/xmlwf/xmlwf.vcxproj.filters
expat/xmlwf/xmlwf_helpgen.py
expat/xmlwf/xmlwf_helpgen.sh
expat/xmlwf/xmlwin32url.cxx


2019-11-26 13:13:11 +0000
Chris Liddell <chris.liddell@artifex.com>
f25387684b5df27653e7f89a67e04d6151b92d02

Update libpng to 1.6.37

base/png.mak
libpng/ANNOUNCE
libpng/AUTHORS
libpng/CHANGES
libpng/CMakeLists.txt
libpng/INSTALL
libpng/LICENSE
libpng/Makefile.am
libpng/Makefile.in
libpng/README
libpng/TODO
libpng/TRADEMARK
libpng/aclocal.m4
libpng/arm/arm_init.c
libpng/arm/filter_neon.S
libpng/arm/filter_neon_intrinsics.c
libpng/arm/palette_neon_intrinsics.c
libpng/autogen.sh
libpng/compile
libpng/config.guess
libpng/config.h.in
libpng/config.sub
libpng/configure
libpng/configure.ac
libpng/contrib/conftest/pngcp.dfa
libpng/contrib/examples/iccfrompng.c
libpng/contrib/examples/pngpixel.c
libpng/contrib/gregbook/readpng2.c
libpng/contrib/libtests/makepng.c
libpng/contrib/libtests/pngimage.c
libpng/contrib/libtests/pngstest.c
libpng/contrib/libtests/pngunknown.c
libpng/contrib/libtests/pngvalid.c
libpng/contrib/libtests/readpng.c
libpng/contrib/libtests/tarith.c
libpng/contrib/libtests/timepng.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/newcc
libpng/contrib/pngminus/CHANGES.txt
libpng/contrib/pngminus/CMakeLists.txt
libpng/contrib/pngminus/LICENSE.txt
libpng/contrib/pngminus/Makefile
libpng/contrib/pngminus/README.txt
libpng/contrib/pngminus/makefile.std
libpng/contrib/pngminus/makefile.tc3
libpng/contrib/pngminus/png2pnm.bat
libpng/contrib/pngminus/png2pnm.c
libpng/contrib/pngminus/png2pnm.sh
libpng/contrib/pngminus/pngminus.bat
libpng/contrib/pngminus/pngminus.sh
libpng/contrib/pngminus/pnm2png.bat
libpng/contrib/pngminus/pnm2png.c
libpng/contrib/pngminus/pnm2png.sh
libpng/contrib/pngsuite/README
libpng/contrib/pngsuite/bad_interlace_conversions.txt
libpng/contrib/pngsuite/ibasn0g08.png
libpng/contrib/pngsuite/ibasn0g16.png
libpng/contrib/pngsuite/ibasn2c08.png
libpng/contrib/pngsuite/ibasn2c16.png
libpng/contrib/pngsuite/ibasn3p08.png
libpng/contrib/pngsuite/ibasn4a08.png
libpng/contrib/pngsuite/ibasn4a16.png
libpng/contrib/pngsuite/ibasn6a08.png
libpng/contrib/pngsuite/ibasn6a16.png
libpng/contrib/pngsuite/iftbbn2c16.png
libpng/contrib/pngsuite/iftbbn3p08.png
libpng/contrib/pngsuite/iftbgn2c16.png
libpng/contrib/pngsuite/iftbgn3p08.png
libpng/contrib/pngsuite/iftbrn2c08.png
libpng/contrib/pngsuite/iftbwn0g16.png
libpng/contrib/pngsuite/iftbwn3p08.png
libpng/contrib/pngsuite/iftbyn3p08.png
libpng/contrib/pngsuite/iftp0n0g08.png
libpng/contrib/pngsuite/iftp0n2c08.png
libpng/contrib/pngsuite/iftp0n3p08.png
libpng/contrib/pngsuite/iftp1n3p08.png
libpng/contrib/pngsuite/interlaced/README
libpng/contrib/pngsuite/interlaced/ibasn0g01.png
libpng/contrib/pngsuite/interlaced/ibasn0g02.png
libpng/contrib/pngsuite/interlaced/ibasn0g04.png
libpng/contrib/pngsuite/interlaced/ibasn3p01.png
libpng/contrib/pngsuite/interlaced/ibasn3p02.png
libpng/contrib/pngsuite/interlaced/ibasn3p04.png
libpng/contrib/pngsuite/interlaced/iftbbn0g01.png
libpng/contrib/pngsuite/interlaced/iftbbn0g02.png
libpng/contrib/pngsuite/interlaced/iftbbn0g04.png
libpng/contrib/powerpc-vsx/README
libpng/contrib/powerpc-vsx/linux_aux.c
libpng/contrib/testpngs/makepngs.sh
libpng/contrib/tools/chkfmt
libpng/contrib/tools/makesRGB.c
libpng/contrib/tools/pngcp.c
libpng/contrib/tools/pngfix.c
libpng/contrib/visupng/PngFile.c
libpng/contrib/visupng/PngFile.h
libpng/contrib/visupng/VisualPng.c
libpng/depcomp
libpng/example.c
libpng/install-sh
libpng/intel/filter_sse2_intrinsics.c
libpng/intel/intel_init.c
libpng/libpng-manual.txt
libpng/libpng.3
libpng/libpngpf.3
libpng/mips/filter_msa_intrinsics.c
libpng/mips/mips_init.c
libpng/missing
libpng/png.5
libpng/png.c
libpng/png.h
libpng/pngconf.h
libpng/pngdebug.h
libpng/pngerror.c
libpng/pngget.c
libpng/pnginfo.h
libpng/pngmem.c
libpng/pngpread.c
libpng/pngpriv.h
libpng/pngread.c
libpng/pngrio.c
libpng/pngrtran.c
libpng/pngrutil.c
libpng/pngset.c
libpng/pngstruct.h
libpng/pngtest.c
libpng/pngtrans.c
libpng/pngwio.c
libpng/pngwrite.c
libpng/pngwtran.c
libpng/pngwutil.c
libpng/powerpc/filter_vsx_intrinsics.c
libpng/powerpc/powerpc_init.c
libpng/projects/owatcom/pngconfig.mak
libpng/projects/visualc71/README.txt
libpng/projects/vstudio/README.txt
libpng/projects/vstudio/zlib.props
libpng/scripts/README.txt
libpng/scripts/def.c
libpng/scripts/descrip.mms
libpng/scripts/libpng-config-head.in
libpng/scripts/libpng.pc.in
libpng/scripts/makefile.32sunu
libpng/scripts/makefile.64sunu
libpng/scripts/makefile.bor
libpng/scripts/makefile.cegcc
libpng/scripts/makefile.clang
libpng/scripts/makefile.clang-asan
libpng/scripts/makefile.darwin
libpng/scripts/makefile.freebsd
libpng/scripts/makefile.gcc
libpng/scripts/makefile.gcc-asan
libpng/scripts/makefile.hp64
libpng/scripts/makefile.hpgcc
libpng/scripts/makefile.hpux
libpng/scripts/makefile.knr
libpng/scripts/makefile.linux
libpng/scripts/makefile.linux-opt
libpng/scripts/makefile.mips
libpng/scripts/makefile.msc
libpng/scripts/makefile.msys
libpng/scripts/makefile.ne12bsd
libpng/scripts/makefile.netbsd
libpng/scripts/makefile.openbsd
libpng/scripts/makefile.sco
libpng/scripts/makefile.sggcc
libpng/scripts/makefile.sgi
libpng/scripts/makefile.so9
libpng/scripts/makefile.solaris
libpng/scripts/makefile.solaris-x86
libpng/scripts/makefile.std
libpng/scripts/makefile.sunos
libpng/scripts/makefile.tc3
libpng/scripts/options.awk
libpng/scripts/pnglibconf.dfa
libpng/scripts/pnglibconf.h.prebuilt
libpng/scripts/symbols.def
libpng/test-driver


2019-11-26 12:13:13 +0000
Chris Liddell <chris.liddell@artifex.com>
9282c39e6150befd80793b3221864c9f1f814b66

Update libtiff to 4.1.0

Add in portability changes to tiffiop.h

Portability tiffiop.h

Remove globals from tif_pixarlog.c

tiff/CMakeLists.txt
tiff/ChangeLog
tiff/HOWTO-RELEASE
tiff/Makefile.am
tiff/Makefile.in
tiff/Makefile.vc
tiff/README.md
tiff/README.vms
tiff/RELEASE-DATE
tiff/SConstruct
tiff/TODO
tiff/VERSION
tiff/aclocal.m4
tiff/build/Makefile.in
tiff/config/compile
tiff/config/config.guess
tiff/config/config.sub
tiff/config/depcomp
tiff/config/install-sh
tiff/config/ltmain.sh
tiff/config/missing
tiff/config/mkinstalldirs
tiff/config/test-driver
tiff/configure
tiff/configure.ac
tiff/configure.com
tiff/contrib/Makefile.in
tiff/contrib/addtiffo/Makefile.in
tiff/contrib/addtiffo/addtiffo.c
tiff/contrib/addtiffo/tif_overview.c
tiff/contrib/addtiffo/tif_ovrcache.c
tiff/contrib/dbs/Makefile.in
tiff/contrib/dbs/tiff-bi.c
tiff/contrib/dbs/tiff-grayscale.c
tiff/contrib/dbs/tiff-palette.c
tiff/contrib/dbs/tiff-rgb.c
tiff/contrib/dbs/xtiff/Makefile.in
tiff/contrib/dbs/xtiff/xtiff.c
tiff/contrib/iptcutil/Makefile.in
tiff/contrib/iptcutil/iptcutil.c
tiff/contrib/mfs/Makefile.in
tiff/contrib/pds/Makefile.in
tiff/contrib/pds/README
tiff/contrib/pds/tif_imageiter.c
tiff/contrib/pds/tif_imageiter.h
tiff/contrib/pds/tif_pdsdirread.c
tiff/contrib/pds/tif_pdsdirwrite.c
tiff/contrib/ras/Makefile.in
tiff/contrib/ras/tif2ras.c
tiff/contrib/stream/Makefile.in
tiff/contrib/tags/Makefile.in
tiff/contrib/tags/README
tiff/contrib/tags/xtif_dir.c
tiff/contrib/win_dib/Makefile.in
tiff/contrib/win_dib/Makefile.w95
tiff/contrib/win_dib/README.tiff2dib
tiff/contrib/win_dib/Tiffile.cpp
tiff/html/Makefile.am
tiff/html/Makefile.in
tiff/html/addingtags.html
tiff/html/bugs.html
tiff/html/build.html
tiff/html/document.html
tiff/html/images.html
tiff/html/images/Makefile.in
tiff/html/index.html
tiff/html/libtiff.html
tiff/html/man/Makefile.in
tiff/html/man/TIFFReadDirectory.3tiff.html
tiff/html/man/TIFFWriteDirectory.3tiff.html
tiff/html/man/TIFFmemory.3tiff.html
tiff/html/v3.4beta007.html
tiff/html/v3.4beta016.html
tiff/html/v3.4beta018.html
tiff/html/v3.4beta024.html
tiff/html/v3.4beta028.html
tiff/html/v3.4beta029.html
tiff/html/v3.4beta031.html
tiff/html/v3.4beta032.html
tiff/html/v3.4beta033.html
tiff/html/v3.4beta034.html
tiff/html/v3.4beta035.html
tiff/html/v3.4beta036.html
tiff/html/v3.5.1.html
tiff/html/v3.5.2.html
tiff/html/v3.5.3.html
tiff/html/v3.5.4.html
tiff/html/v3.5.5.html
tiff/html/v3.5.6-beta.html
tiff/html/v3.5.7.html
tiff/html/v3.6.0.html
tiff/html/v3.6.1.html
tiff/html/v3.7.0.html
tiff/html/v3.7.0alpha.html
tiff/html/v3.7.0beta.html
tiff/html/v3.7.0beta2.html
tiff/html/v3.7.1.html
tiff/html/v3.7.2.html
tiff/html/v3.7.3.html
tiff/html/v3.7.4.html
tiff/html/v3.8.0.html
tiff/html/v3.8.1.html
tiff/html/v3.8.2.html
tiff/html/v3.9.0beta.html
tiff/html/v3.9.1.html
tiff/html/v3.9.2.html
tiff/html/v4.0.0.html
tiff/html/v4.0.1.html
tiff/html/v4.0.10.html
tiff/html/v4.0.2.html
tiff/html/v4.0.3.html
tiff/html/v4.0.4.html
tiff/html/v4.0.4beta.html
tiff/html/v4.0.5.html
tiff/html/v4.0.6.html
tiff/html/v4.0.7.html
tiff/html/v4.0.8.html
tiff/html/v4.0.9.html
tiff/html/v4.1.0.html
tiff/libtiff/CMakeLists.txt
tiff/libtiff/Makefile.am
tiff/libtiff/Makefile.in
tiff/libtiff/Makefile.vc
tiff/libtiff/SConstruct
tiff/libtiff/libtiff.def
tiff/libtiff/mkg3states.c
tiff/libtiff/t4.h
tiff/libtiff/tif_aux.c
tiff/libtiff/tif_close.c
tiff/libtiff/tif_codec.c
tiff/libtiff/tif_color.c
tiff/libtiff/tif_compress.c
tiff/libtiff/tif_config.h.cmake.in
tiff/libtiff/tif_config.h.in
tiff/libtiff/tif_config.wince.h
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_dumpmode.c
tiff/libtiff/tif_error.c
tiff/libtiff/tif_extension.c
tiff/libtiff/tif_fax3.c
tiff/libtiff/tif_fax3.h
tiff/libtiff/tif_flush.c
tiff/libtiff/tif_getimage.c
tiff/libtiff/tif_jbig.c
tiff/libtiff/tif_jpeg.c
tiff/libtiff/tif_luv.c
tiff/libtiff/tif_lzma.c
tiff/libtiff/tif_lzw.c
tiff/libtiff/tif_next.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_predict.h
tiff/libtiff/tif_print.c
tiff/libtiff/tif_read.c
tiff/libtiff/tif_stream.cxx
tiff/libtiff/tif_strip.c
tiff/libtiff/tif_swab.c
tiff/libtiff/tif_thunder.c
tiff/libtiff/tif_tile.c
tiff/libtiff/tif_unix.c
tiff/libtiff/tif_version.c
tiff/libtiff/tif_warning.c
tiff/libtiff/tif_webp.c
tiff/libtiff/tif_win32.c
tiff/libtiff/tif_write.c
tiff/libtiff/tif_zip.c
tiff/libtiff/tif_zstd.c
tiff/libtiff/tiff.h
tiff/libtiff/tiffconf.h.cmake.in
tiff/libtiff/tiffconf.h.in
tiff/libtiff/tiffconf.vc.h
tiff/libtiff/tiffconf.wince.h
tiff/libtiff/tiffio.h
tiff/libtiff/tiffio.hxx
tiff/libtiff/tiffiop.h
tiff/libtiff/tiffvers.h
tiff/m4/libtool.m4
tiff/man/Makefile.in
tiff/man/TIFFClose.3tiff
tiff/man/TIFFDataWidth.3tiff
tiff/man/TIFFError.3tiff
tiff/man/TIFFFieldDataType.3tiff
tiff/man/TIFFFieldName.3tiff
tiff/man/TIFFFieldPassCount.3tiff
tiff/man/TIFFFieldReadCount.3tiff
tiff/man/TIFFFieldTag.3tiff
tiff/man/TIFFFieldWriteCount.3tiff
tiff/man/TIFFFlush.3tiff
tiff/man/TIFFGetField.3tiff
tiff/man/TIFFOpen.3tiff
tiff/man/TIFFPrintDirectory.3tiff
tiff/man/TIFFRGBAImage.3tiff
tiff/man/TIFFReadDirectory.3tiff
tiff/man/TIFFReadEncodedStrip.3tiff
tiff/man/TIFFReadEncodedTile.3tiff
tiff/man/TIFFReadRGBAImage.3tiff
tiff/man/TIFFReadRGBAStrip.3tiff
tiff/man/TIFFReadRGBATile.3tiff
tiff/man/TIFFReadRawStrip.3tiff
tiff/man/TIFFReadRawTile.3tiff
tiff/man/TIFFReadScanline.3tiff
tiff/man/TIFFReadTile.3tiff
tiff/man/TIFFSetDirectory.3tiff
tiff/man/TIFFSetField.3tiff
tiff/man/TIFFWarning.3tiff
tiff/man/TIFFWriteDirectory.3tiff
tiff/man/TIFFWriteEncodedStrip.3tiff
tiff/man/TIFFWriteEncodedTile.3tiff
tiff/man/TIFFWriteRawStrip.3tiff
tiff/man/TIFFWriteRawTile.3tiff
tiff/man/TIFFWriteScanline.3tiff
tiff/man/TIFFWriteTile.3tiff
tiff/man/TIFFbuffer.3tiff
tiff/man/TIFFcodec.3tiff
tiff/man/TIFFcolor.3tiff
tiff/man/TIFFmemory.3tiff
tiff/man/TIFFquery.3tiff
tiff/man/TIFFsize.3tiff
tiff/man/TIFFstrip.3tiff
tiff/man/TIFFswab.3tiff
tiff/man/TIFFtile.3tiff
tiff/man/fax2ps.1
tiff/man/fax2tiff.1
tiff/man/libtiff.3tiff
tiff/man/pal2rgb.1
tiff/man/ppm2tiff.1
tiff/man/raw2tiff.1
tiff/man/tiff2bw.1
tiff/man/tiff2pdf.1
tiff/man/tiff2ps.1
tiff/man/tiff2rgba.1
tiff/man/tiffcmp.1
tiff/man/tiffcp.1
tiff/man/tiffcrop.1
tiff/man/tiffdither.1
tiff/man/tiffdump.1
tiff/man/tiffgt.1
tiff/man/tiffinfo.1
tiff/man/tiffmedian.1
tiff/man/tiffset.1
tiff/man/tiffsplit.1
tiff/nmake.opt
tiff/port/CMakeLists.txt
tiff/port/Makefile.am
tiff/port/Makefile.in
tiff/port/Makefile.vc
tiff/port/_strtol.h
tiff/port/_strtoul.h
tiff/port/dummy.c
tiff/port/getopt.c
tiff/port/lfind.c
tiff/port/libport.h
tiff/port/snprintf.c
tiff/port/strcasecmp.c
tiff/port/strtol.c
tiff/port/strtoll.c
tiff/port/strtoul.c
tiff/port/strtoull.c
tiff/test/CMakeLists.txt
tiff/test/Makefile.am
tiff/test/Makefile.in
tiff/test/ascii_tag.c
tiff/test/check_tag.c
tiff/test/common.sh
tiff/test/custom_dir.c
tiff/test/defer_strile_loading.c
tiff/test/defer_strile_writing.c
tiff/test/fax2tiff.sh
tiff/test/images/README.txt
tiff/test/images/lzw-single-strip.tiff
tiff/test/images/miniswhite-1c-1b.g3
tiff/test/long_tag.c
tiff/test/raw_decode.c
tiff/test/refs/o-tiff2ps-EPS1.ps
tiff/test/refs/o-tiff2ps-PS1.ps
tiff/test/refs/o-tiff2ps-PS2.ps
tiff/test/refs/o-tiff2ps-PS3.ps
tiff/test/rewrite_tag.c
tiff/test/short_tag.c
tiff/test/strip.c
tiff/test/strip_rw.c
tiff/test/test_arrays.c
tiff/test/test_arrays.h
tiff/test/testtypes.c
tiff/test/tiff2ps-EPS1.sh
tiff/test/tiff2ps-PS1.sh
tiff/test/tiff2ps-PS2.sh
tiff/test/tiff2ps-PS3.sh
tiff/test/tiffcp-lzw-scanline-decode.sh
tiff/test/tifftest.h
tiff/tools/CMakeLists.txt
tiff/tools/Makefile.in
tiff/tools/Makefile.vc
tiff/tools/fax2ps.c
tiff/tools/fax2tiff.c
tiff/tools/pal2rgb.c
tiff/tools/ppm2tiff.c
tiff/tools/raw2tiff.c
tiff/tools/rgb2ycbcr.c
tiff/tools/thumbnail.c
tiff/tools/tiff2bw.c
tiff/tools/tiff2pdf.c
tiff/tools/tiff2ps.c
tiff/tools/tiff2rgba.c
tiff/tools/tiffcmp.c
tiff/tools/tiffcp.c
tiff/tools/tiffcrop.c
tiff/tools/tiffdither.c
tiff/tools/tiffdump.c
tiff/tools/tiffgt.c
tiff/tools/tiffinfo.c
tiff/tools/tiffmedian.c
tiff/tools/tiffset.c
tiff/tools/tiffsplit.c


2019-11-25 15:14:51 +0000
Julian Smith <jules@op59.net>
aa13e1a3fac84ada2b676f9c5fcffb30f5df74dd

Coverity 351088: check for errors in px_begin_error_page().

Had to change px_begin_error_page()'s API to use out-parameter, so that return
value is error code.

pcl/pxl/pxerrors.c
pcl/pxl/pxerrors.h
pcl/pxl/pxtop.c


2019-11-25 14:42:05 +0000
Julian Smith <jules@op59.net>
34fc5a7613eea288a8426d3be425c93647954668

Coverity 351086: Fix out-of-bounds access to score[2].

gpdl/psitop.c


2019-11-25 19:48:50 +0000
Robin Watts <Robin.Watts@artifex.com>
a570a05622cb178c031db64711b412cf640038b2

Coverity 350201, 350191: Add some notes to the code.

Coverity spots that pdf14_fill_path checks for ppath being
NULL in one branch, hence assumes that it can be NULL in all
cases. Furthermore it spots that it is passed into
gx_default_fill_path, which can in some circumstances, dereference
it without checking it first.

The reason for this is that fill_path can permissibly be called
with a NULL path if we want to fill the given clipping path. This
is only used for shadings and patterns, which is exactly the case
checked for within gx_default_fill_path and pdf14_fill_path.

We'll resolve this with a 'false positive' in Coverity, but have
added the comments for the benefit of future readers.

Coverity spots the same thing in pdf14_stroke_path, but there it
really makes no sense for ppath to be NULL, so just eliminate the
check.

Credit to Julian Smith for the investigation on this.

base/gdevp14.c


2019-11-25 18:30:33 +0000
Robin Watts <Robin.Watts@artifex.com>
fee6b609fbb8d1f0744f98ee3bf930c1fd733660

Fix indeterminism in gdevp201.c

The printers herein read 1bpp data from gs, and then compressed
in terms of bytes. For the case where w%8 != 0, we'd have
uninitialised bits. Solve this by masking the last byte of each
line as appropriate.

Also, ensure that we don't 'overread' lines, check the return
code from the get_bits call, and blank any lines of the buffer
required to bring us up to a multiple of the stripe height.

contrib/japanese/gdevp201.c


2019-11-25 09:44:29 -0800
Robin Watts <Robin.Watts@artifex.com>
f3b0a9e346a97b23f1f7e016944be514c8b0ec78

Fix indeterminism in gdevatx.c

The compression used by this device relies on compressing pairs of
bytes; as such we have to be careful that when we offset to the end
of the line we don't move inot uninitialised data.

We fix this here by blanking an extra byte, and being smarter about
where we start the search for trailing empties from.

This should resolve the differences we see in the all-devs test.

devices/gdevatx.c


2019-11-25 16:12:17 +0000
Robin Watts <Robin.Watts@artifex.com>
8a589c19d62884388cb9eff7d12bfba568e667ca

Fix incorrect transform in gpdl/pwgtop.c

gpdl/pwgtop.c


2019-11-22 19:43:46 +0000
Robin Watts <Robin.Watts@artifex.com>
79e11b98dc078fcd92cda588ab6157a4aa14d0f0

Add Jpeg2000 "language" interpreter for gpdl.

gpdl/gpdl.mak
gpdl/jp2ktop.c
pcl/pl/plimpl.c
windows/ghostpdl.vcproj


2019-11-25 15:59:00 +0000
Robin Watts <Robin.Watts@artifex.com>
113792dd347ac7b9436b9517aca91e1153fb230d

Ensure oki4w device properly closes device.

This was causing indetermisms in cluster runs.

contrib/gdevop4w.c


2019-11-25 14:50:05 +0000
Robin Watts <Robin.Watts@artifex.com>
12eef95ef9ed7a086ca02f06ef93acce9c9a2676

Remove FIXME and associated dead code in pwgtop.c

This should solve coverity 351087.

gpdl/pwgtop.c


2019-11-25 14:46:56 +0000
Robin Watts <Robin.Watts@artifex.com>
ab089bf9511ccaa30a33d6e269ab0dae98ff5517

Fix coverity #351085; toff_t's are unsigned.

The tiff lib uses a 'seek' function that apes 'fseek' in that
it takes a whence field. In order for the whence field to be
useful for 'SEEK_SET' (and half the cases of SEEK_CURR), it
needs to be able to take negative offsets. The tiff seek
function only passes positive offsets though as it uses an
unsigned type.

It is therefore pointless to test against 0.

gpdl/tifftop.c


2019-11-22 15:31:47 +0000
Chris Liddell <chris.liddell@artifex.com>
e056194328312f724089d52398e88c5a6a2fe277

Windows installer: offer to uninstall previous installations

If the installer detects previous gs installations (from the registry keys), an
additional page will appear in the installer, giving the user the option of
uninstalling each existing installation in turn - it allows uninstall a given
install, not uninstall it, or cancel out of uninstalling the remaining ones.

psi/nsisinst.nsi


2019-11-22 18:12:11 +0000
Julian Smith <jules@op59.net>
e9ff39ee82680ea1719ddf99cf3809e26df0c946

Coverity 351050: avoid buffer overflow warning.

For simplicity, have used a temp four-character buffer filled in by
parse_file_access_string(), then snprintf() to append gp_fmode_binary_suffix
safely.

psi/zfile.c


2019-11-22 18:08:05 +0000
Julian Smith <jules@op59.net>
354715346deed252ef7db53160b61d04bd630a2f

Coverity 351049: avoid buffer overflow warning.

We're actually safe because gp_fmode_binary_suffix is max one-character long,
but Coverity doesn't know that.

base/gxclfile.c


2019-11-22 18:05:35 +0000
Julian Smith <jules@op59.net>
b8c8a6410658fdfe57ad5de4ae57fdc4cbece2ab

Coverity 351048: avoid buffer overflow warning.

We're actually safe because gp_fmode_binary_suffix is max one-character long,
but Coverity doesn't know that.

base/gxclist.c


2019-11-22 17:45:51 +0000
Julian Smith <jules@op59.net>
882793bc7f35f21f7857e216966c0b777140a87c

Coverity 350209: fix bad return path in handle_dash_c().

Also refactored a little.

pcl/pl/plmain.c


2019-11-22 10:43:43 -0800
Michael Vrhel <michael.vrhel@artifex.com>
8f611a6c45fafbea495206773eccf3028cfb4765

Bug 701625 Treat CMY color space as additive

Our support of CMY devices is currently not ideal with
respect to proper color management and the transparency
imaging model as described in Bug 697965. My plan is
to make a psd cmy based device and get things working
properly in terms of spot colors and ICC color management.
This will take a bit of effort and likely have a bug
tail. For now for Bug 701625 an easy solution is to
treat the color space as additive. In this case, the
output looks reasonable.

cups/gdevcups.c


2019-11-22 11:42:29 +0000
Julian Smith <jules@op59.net>
f734274b455c321a4089d8ee7efa7511656ae9c6

Removed gp_fprintf(pstream, "") call that has no affect.

This was causing gcc warning because gp_fprintf() is now checked by gcc for
printf format warnings.

devices/gdevmgr.c


2019-11-21 18:39:21 +0000
Julian Smith <jules@op59.net>
17a947dcc56fee115d7b416de7648289b04185f8

Fix some -W -Wall warnings about printf format type mismatches.

contrib/gdevhl12.c
jbig2dec/jbig2.c
jbig2dec/jbig2_segment.c


2019-11-21 17:47:53 +0000
Julian Smith <jules@op59.net>
cbd8765cc2e5d67eae3d412a7584f37a9e02f2e9

Bug 701932: fixed up head dependencies for pxstate_h.

pcl/pxl/pxl.mak


2019-11-21 17:16:27 +0000
Julian Smith <jules@op59.net>
3ee9bb6efff8929ff8df4fb7ca42001c2aeacdf6

Coverity 350198: fixed jbig2_error() printf format / type mismatches.

Unfortunately stdint_.h isn't available to jbig2dec code so we can't use
PRIdSIZE. Have instead used %li with a cast to long.

[This commit addresses all printf warnings from gcc -W -Wall; it probably fixes
multiple similar coverity issues.]

jbig2dec/jbig2_symbol_dict.c


2019-11-21 17:11:43 +0000
Julian Smith <jules@op59.net>
67a59c12667bbdddf67e78d9496f94b34d55e702

Coverity 350195: check return from process_row().

pcl/pcl/rtraster.c


2019-11-21 17:01:55 +0000
Julian Smith <jules@op59.net>
3819f5121013dd93dd3653475e686d8f6df9b068

Coverity 350189: explicitly ignore return from hpgl_arg_c_int().

We already initialised variable 'type', and we don't mind whether
hpgl_arg_c_int() changes it before we switch on it. So cast hpgl_arg_c_int()'s
return to void to stop Coverity from warning.

pcl/pcl/pgconfig.c


2019-11-21 16:52:32 +0000
Julian Smith <jules@op59.net>
3b8f96dbe2dc0ab0cdbbf076cdb88e21c91639a5

Coverity 350185: fix printf format type mismatch.

Unfortunately stdint_.h isn't available to jbig2dec code so we can't use
PRIdSIZE. Have instead used %li with a cast to long.

jbig2dec/jbig2_generic.c


2019-11-21 16:49:51 +0000
Julian Smith <jules@op59.net>
4b31b05c2db5967c00d0b08023167935bbb3d015

If gcc, make gcc check jbig2_error()'s format string agrees with types of parameters.

jbig2dec/jbig2_priv.h


2019-11-21 16:23:32 +0000
Julian Smith <jules@op59.net>
1098cdd54a46dca9ca976b750ba25d0b714dfd9f

Add a --enable-mkromfs-quiet configure option.

Sets MKROMFS_FLAGS=-q and pass to all invocations of mkromfs.

[Makefile.in and configure.ac changes by chrisl]

Makefile.in
base/lib.mak
configure.ac


2019-11-21 12:52:41 +0000
Julian Smith <jules@op59.net>
1f60fa73b7c6b5acfae75b6e4a1fede2b75ea1c4

mkromfs: added -q option to reduce verbose diagnostics.

base/mkromfs.c


2019-11-15 16:45:33 +0000
Julian Smith <jules@op59.net>
3e01cc30c90094bcbef2966f1048c504e6b5361e

configure.ac: add -W -Wall to sanitize builds if supported.

configure.ac


2019-11-21 13:41:37 +0000
Julian Smith <jules@op59.net>
b93f218d418827b689c61b37941ffd4eef0c0d84

Mark gp_fprintf() with gcc's __attribute__ ((format (__printf__, 2, 3))).

This makes gcc check types match the format string.

base/gp.h


2019-11-21 13:40:45 +0000
Julian Smith <jules@op59.net>
87cd6160bf654a164469e75a9df7cc7b690b5aaa

Coverity 350172: fix gp_fprintf() call to use PRIdSIZE for ptrdiff_t.

contrib/japanese/gdevp201.c


2019-11-21 12:24:48 +0000
Julian Smith <jules@op59.net>
53a370b272a89df418ea563f1abde7d774579105

Coverity 350169: avoid buffer overflow when writing to cups->pageSizeRequested.

cups/gdevcups.c


2019-11-20 19:30:55 +0000
Julian Smith <jules@op59.net>
7fe9289f10c47fe7557375c23b54cd87e521d11c

Bug 701932: moved more global_* into px_state_s.

Specifically:

gs_point global_char_shear;
gs_point global_char_scale;
float global_char_bold_value;
float global_char_angle;

pcl/pxl/pxpthr.c
pcl/pxl/pxstate.h


2019-11-20 19:16:48 +0000
Julian Smith <jules@op59.net>
810c897c51e28dcdd589e1561af36769e72e0893

Bug 701932: moved more global_* into px_state_s.

Specifically:

static pcl_parser_state_t global_pcl_parser_state;
static hpgl_parser_state_t global_gl_parser_state;
static bool global_this_pass_contiguous = false;
static bool global_pass_first = true;

pcl/pxl/pxparse.c
pcl/pxl/pxpthr.c
pcl/pxl/pxpthr.h
pcl/pxl/pxstate.c
pcl/pxl/pxstate.h


2019-11-20 17:39:58 +0000
Julian Smith <jules@op59.net>
d48555f7777a983e0d15972f3838bb5583e20657

Bug 701932: moved global_pcs into px_state_s.

pcl/pxl/pxpthr.c
pcl/pxl/pxpthr.h
pcl/pxl/pxsessio.c
pcl/pxl/pxstate.c
pcl/pxl/pxstate.h


2019-11-20 12:42:16 +0000
Julian Smith <jules@op59.net>
4db291eb31b4dc8c6864e438acdd9283c3347671

Coverity 350170: cope with -ve from gs_vsprintf().

pcl/pcl/pcstatus.c


2019-11-22 13:02:39 +0000
Chris Liddell <chris.liddell@artifex.com>
0bc5d53fa1c0d7832008d1ae8e0e6804bf5f9e9e

Windows (un)installer: Fix case for registry key removal

psi/nsisinst.nsi


2019-11-22 10:30:14 +0000
Chris Liddell <chris.liddell@artifex.com>
efafc6f95b0bfedf63efafc55416846974a67bcc

"Promote" gpdl from experimental to actual product

Really, add gpdl to the default targets list.

Makefile.in
base/gs.mak
base/unix-gcc.mak
configure.ac
psi/msvc.mak


2019-11-22 11:49:02 +0000
Ken Sharp <ken.sharp@artifex.com>
0243f6288ca26b2985f0778040feebae7322ac0b

Coverity ID 94736

This was partially addressed in a previous commit (2 years ago) but
because the 'contrib' folder wasn't included in the ananlysis, this
second instance of the same problem didn't show up.

contrib/gdevcd8.c


2019-11-21 15:18:29 -0800
Michael Vrhel <michael.vrhel@artifex.com>
d9d92ab6b774914d81f63c8e19d78e4022ad9976

Bug 701357: Fix color document

Getting proper encoding of _ character requires use of
[T1]{fontenc} and lmodern.

doc/GS9_Color_Management.pdf
doc/GS9_Color_Management.tex


2019-11-21 14:06:50 -0800
Michael Vrhel <michael.vrhel@artifex.com>
0129596f6cf2d090ed46f9a9c8189ab60b56735f

Bug 700929: Pass object type rendering intent settings to pdf14 device

base/gdevp14.c


2019-11-21 18:45:55 +0000
Robin Watts <Robin.Watts@artifex.com>
e0c2e4d8f43d6e83a0a04e6d2c350d2d7fc1e7a6

gpdl: Fixup some warnings.

gpdl/gpdl.mak
gpdl/jpgtop.c
gpdl/pwgtop.c
gpdl/tifftop.c


2019-11-20 19:02:47 +0000
Robin Watts <Robin.Watts@artifex.com>
23ea32bf2bd205c44c9a7979b3a187199e47da59

gpdl: Add 'jbig2' language implementation.

gpdl/gpdl.mak
gpdl/jbig2top.c
pcl/pl/plimpl.c
windows/ghostpdl.vcproj


2019-11-20 19:01:31 +0000
Robin Watts <Robin.Watts@artifex.com>
0c30c4cda3c2487ce52f79a952e3d0febef1d8bd

Remove some dead code/variables from tifftop.c

gpdl/tifftop.c


2019-11-21 11:20:49 -0800
Michael Vrhel <michael.vrhel@artifex.com>
7043e985298f75291e1fc25ad272140be31ffe6d

Ghostscript Bug 701324. Improved robustness of lcms2mt

lcmsmt will give up if it can't find the perceptual MLUT.
This fix will have it check to see if the colorimetric or
saturation intents are present also.

lcms2mt/src/cmsio1.c


2019-11-21 10:45:59 -0800
Michael Vrhel <michael.vrhel@artifex.com>
aa30c0798d32decfd99ff8149553221917d4301e

Use gp_fwrite instead of fwrite.

base/gsicc_manage.c


2019-11-21 08:40:02 -0800
Michael Vrhel <michael.vrhel@artifex.com>
4640b5abd48430bfc76cc4e98cd626aa64075537

Bug 701717 Remove redundant check.

base/gdevp14.c


2019-11-19 15:40:02 +0000
Chris Liddell <chris.liddell@artifex.com>
9189e54333d33104a0de8aa92b1c5a7662762048

JBIG2_CFLAGS/JPX_CFLAGS handling and remove commented out code

The JBIG2_CFLAGS and JPX_CFLAGS allow a user to tweak the CFLAGS specific to
the JBIG2 and JPX/JPEG2000 decoders respectively.

There was also some commented out code that, with the above tweak, is no
longer required to be there.

configure.ac


2019-11-06 13:29:19 +0000
Chris Liddell <chris.liddell@artifex.com>
84a1bd8c73d740022877a5911851b8521ecc7458

Bug 701440: only include libs calling pkg-config for freetype

Only have the -l options, not the -L ones because they confuse genconf

configure.ac


2019-11-06 12:43:09 +0000
Chris Liddell <chris.liddell@artifex.com>
aaea09a9a0e357b2784536b8476f4ab4fee19b64

Allow configure to set size etc for size_t in arch.h

arch/arch_autoconf.h.in
configure.ac


2019-11-06 11:30:17 +0000
Chris Liddell <chris.liddell@artifex.com>
64a35dc73ee8256421b1dd2760be0c73c05eadb8

Bug 701439: use pkg-config for libidn

If pkg-config is available, and knows about libidn, use it to get the CFLAGS and
LIBS, otherwise fall back to the AC_CHECK_LIB/AC_CHECK_HEADER method

configure.ac


2019-11-06 10:44:16 +0000
Chris Liddell <chris.liddell@artifex.com>
317c0154a8141b8dde6e303f1e18a95e01f8ee33

Bug 701689: CPPFLAGS for aux tools when cross-compiling

Introduce CPPFLAGSAUX

Credit to Marvin Schmidt

configure.ac


2019-10-29 12:45:17 +0000
Chris Liddell <chris.liddell@artifex.com>
c7c6043bde1517e8fd6d645d7c34142aec462248

Spaces should be tab

base/gs.mak


2019-10-21 10:45:56 +0100
Chris Liddell <chris.liddell@artifex.com>
2d84ecc57837785b566ebd9d5909ba9edc9d697f

Use caller defined pkg-config and cups-config unconditionally

In an effort to better handle cross-compilation, we use a check combining
AC_PATH_TOOL() and AC_PATH_PROG() - where AC_CHECK_TOOL() will first attempt to
find the requested tool *with* a target-triplet prefix (for example,
"x86_64-linux-gnu-pkg-config") and if that fails, it will fall back to the
unadorned tool (e.g. "pkg-config"). If we are cross-compiling, and both
AC_PATH_TOOL() and AC_PATH_PROG() return the same value, we assume that
AC_PATH_TOOL() has fallen back to the default, non-cross-compile version, and we
disable using the given tool.

We do this for both pkg-config and cups-config.

This does not work well for every cross-compile environment, however, since not
all use the convention of the target triplet prefix.

We already allowed the caller to specify both a pkg-config and cups-config to
use, but we still applied the above outlined test.

Now, when the tool is explicitly specified, do *not* do the
AC_PATH_TOOL()/AC_PATH_PROG(), assume the caller knows what they are doing, and
just go ahead and use it.

Additionally, for cups-config, if the caller explicitly specified a cups-config,
and/or explicitly set --enable-cups then make not finding the cups libraries a
configure hard fail. By default, we'll still just warn, and exclude the cups
devices.

configure.ac


2019-10-18 09:46:03 +0100
Chris Liddell <chris.liddell@artifex.com>
327dc8943c0aac1c7be7a1fb6e93346b61cd0900

Bug #699331: better support for cross-compiling

This is mainly moving from using uname to identify the the target platform,
to using the 'host' value to identify the target platform, and 'host' and
'build' values to know when we're cross-compiling.

There are also a couple of tweaks related to cross-compiling to MSYS.

Also, make double sure API symbols are always visible. This affects builds with
gcc and compatible compilers.

Remove use of $cross_compiling variable

Credit to djcj for most of the changes

.gitignore
Makefile.in
autogen.sh
base/gp_unix.c
base/gsutil.c
base/lib.mak
base/unix-dll.mak
configure.ac
pcl/pl/pjparse.c
psi/iapi.h


2019-11-21 14:58:49 +0000
Chris Liddell <chris.liddell@artifex.com>
e20cd8d8fc1f40bf4218c18e545ca4ddb175c348

Remove gprf device from Windows makefile

psi/msvc.mak


2019-11-21 11:05:36 +0000
Chris Liddell <chris.liddell@artifex.com>
7a56ef4aed70a50bcd7731b61e59850e98d08a4d

Ensure paths from Fontmap end in a directory separator

Since it's normal for multiple font files to be grouped together in a directory,
we strip the file name off, and add just the directory to the permit read list,
rather than flood the list with every font file.

The problem is, we weren't appending the directory separator character showing
the directory was reading permitted.

This commit does that.

Also, add extra detail to the documentation about this aspect of file
permissions lists.

Resource/Init/gs_fonts.ps
doc/Fonts.htm
doc/Use.htm


2019-11-20 15:24:28 -0800
Michael Vrhel <michael.vrhel@artifex.com>
5e60fc862a73898ce048730d0c23c00b9ddb5578

Bug 701660 Trans. Text knockout missing ET

The file has contents that look like this

BT
stuff
BT
stuff
ET

more stuff

The first BT meets the conditions to push the text group.
Unfortunately it is missing the ET, so the group is never popped.
These fixes will make sure that if we are in a text group and
encounter another BT we popped the current text group.

base/gdevp14.c
base/gstrans.h


2019-11-20 13:15:18 +0000
Ken Sharp <ken.sharp@artifex.com>
d7118262b44939688c9143c278b8c76c6c620171

Remove trailing whitespace

gpdl/tifftop.c
pcl/pcl/pcfrgrnd.c
pcl/pxl/pxpthr.c


2019-11-20 12:32:06 +0000
Robin Watts <Robin.Watts@artifex.com>
31c4abe348de980ff7922e28f05cc3f788fab29a

Remove gproof device.

configure.ac
devices/devs.mak
devices/gdevgprf.c
windows/ghostscript.vcproj


2019-11-20 11:04:43 +0000
Julian Smith <jules@op59.net>
1a5a05cf164f6657e3cc52f6fa31524ed190b981

Coverity 95049: stop coverity taints for jbig2_get_int16() etc.

jbig2dec/jbig2.c


2019-11-20 10:34:33 +0000
Julian Smith <jules@op59.net>
9a26c1ee0ef8db26ba79f6804a4f09e1c88cb234

Coverity 350210: removed superflous extra param to jbig2_error().

jbig2dec/jbig2_segment.c


2019-11-20 10:24:09 +0000
Julian Smith <jules@op59.net>
9d8f69e1e37475775917e71ba9bf82b7a2098942

Coverity 350166: stop coverity taint warnings for get_u32_big_endian().

base/gsiorom.c


2019-11-20 10:19:46 +0000
Julian Smith <jules@op59.net>
09d9c492f135ceeb6d95323c1b340b1fc03f15ad

Coverity 341108: removed special coverity comment that didn't work.

base/gp_unifs.c


2019-11-20 10:13:03 +0000
Julian Smith <jules@op59.net>
d79e80b43f388d1e9dd53d86466e04bdb2e6be25

Coverity 102214: stop coverity worrying about pl_get_int16() etc.

These fns use byte swapping, which makes coverity think that they return
tainted data, and also that they taint the input buffer.

pcl/pl/plvalue.c


2019-11-19 17:58:10 +0000
Julian Smith <jules@op59.net>
b74cf2eff085b9270d26818e9064450ac4da41f9

Coverity 350199: try to stop coverity from thinking skip_white_pixels() taints buffer.

base/scfe.c


2019-11-19 17:30:52 +0000
Julian Smith <jules@op59.net>
763a96187a286432e3c90b564a2031278e3688d0

Coverity 350190, 350208: make raster unsigned, to avoid sign extension issue.

base/gsovrc.c


2019-11-19 19:13:40 +0000
Robin Watts <Robin.Watts@artifex.com>
1759596a7499d27e3d289bbff4c45f9206ad4798

Followon to fix for bug 701877.

This changes the 'extern' definitions for
{Single,Double,Treble,Quad}GlyphList to be more correct. This
enables us to use the simple castless form in the initialisations.
This works nicely in Visual Studio, and will hopefully assuage
Coverity.

devices/vector/gdevpdfu.c
devices/vector/gdevtxtw.c


2019-11-19 16:35:50 -0800
Michael Vrhel <michael.vrhel@artifex.com>
c5eb242fa82585aa21371919ca4a7a2d4d4effc3

Make sure blend mode is passed to tile with pdfi

base/gxpcmap.c
base/gxpcolor.h
psi/zpcolor.c


2019-11-19 18:13:08 +0000
Robin Watts <Robin.Watts@artifex.com>
69bdf79e10370ed16a17a346690fd630272f7346

gpdl: Add tiff "interpreter" to gpdl.

Makefile.in
configure.ac
gpdl/gpdl.mak
gpdl/tifftop.c
pcl/pl/plimpl.c
psi/msvc.mak
windows/ghostpdl.vcproj


2019-11-19 18:11:55 +0000
Robin Watts <Robin.Watts@artifex.com>
b5956ac8be8c923ad9e9fd3045724a5579cf4dce

gpdl: Fix compiler flags for pwgtop.c

Don't need to pass the JPEG include directory here.

gpdl/gpdl.mak


2019-11-19 18:10:54 +0000
Robin Watts <Robin.Watts@artifex.com>
0329372164611fdff22f8c02201ff1fbbf94aae7

gpdl: Fix jpeg/pwg behaviour with varying resolutions.

I thought this worked before, but tests revealed that it was
broken.

gpdl/jpgtop.c
gpdl/pwgtop.c


2019-11-18 11:36:30 +0000
Robin Watts <Robin.Watts@artifex.com>
cd8747382f47393efd0f0013700a8294c0ded15c

Slight reorganisation of gpdl interpreter files.

Rather than having each different "language" have a 'top' file
in gpdl/foo/footop.c, move them to be gpdl/foo.c. Extra directories
seem overkill at this point, and it simplifies the Makefile
slightly.

Also, rename IMG to JPG.

Makefile.in
gpdl/gpdl.mak
gpdl/jpgtop.c
gpdl/psitop.c
gpdl/pwgtop.c
pcl/pl/plimpl.c
windows/ghostpdl.vcproj


2019-11-19 16:40:16 +0000
Julian Smith <jules@op59.net>
e1b7dbc95945ef2afa38faeebfda56830f2762ab

Coverity 350182: check for error before dereferencing ptr from gs_cspace_build_ICC().

This allows us to remove the check for pcs == NULL after pcs has already been
dereferenced, which was the coverity issue.

Also fixed gs_cspace_build_ICC() to return gs_error_VMerror if
gs_cspace_alloc() fails - was returning zero with *ppcspace out-param set to
NULL. Have checked that all callers don't rely on the out-param being NULL to
indicate error. Though some of them make no checks at all.

base/gdevp14.c
base/gsicc.c


2019-11-19 16:07:23 +0000
Julian Smith <jules@op59.net>
e93430d762400247cdc4550be403a1f7c291112d

Coverity 350180: change gp_fmode_binary_suffix from char[] to char*.

Am hoping this will persuade Coverity that it is zero-terminated and not
zero-length, and thus safe to pass to strncat().

base/gp.h
base/gp_dosfs.c
base/gp_ntfs.c
base/gp_os2fs.c
base/gp_unifn.c
base/gp_vms.c


2019-11-19 15:19:16 +0000
Julian Smith <jules@op59.net>
bb2c2fbbc96b1f2de8e454ecb2adf3e58ddb52c3

Coverity 341108: disable mktemp() SECURE_TEMP issue, as mkstemp() not available.

base/gp_unifs.c


2019-11-19 14:50:01 +0000
Julian Smith <jules@op59.net>
a4c44cc7579ab80a1d49d721fad48e1ed9bbe976

Coverity 323321: remove unused goto label and 'code' variable from template_mem_transform_pixel_region_render_landscape().

The label and variable appear to have been copied from a similar function, but
they are never used, and actually it looks like this fn can't fail.

base/gdevdrop.c


2019-11-19 13:06:48 +0000
Julian Smith <jules@op59.net>
f804ebfa526bd36a808319225488fe9de416f350

Coverity: add additional annotation to jbig2_get_uint32().

Coverity thinks that jbig2_get_uint32() taints the buffer that it is passed,
which causes coverity issues in calling code.

So this commit adds an addional coverity annotation to ensure the buffer is not
tainted.

Am not 100% sure how to specify multiple annotations, but apparently doing
things like '// coverity[ foo, bar ]' does not work, so we put the new
annotation in a separate comment.

jbig2dec/jbig2.c


2019-11-19 12:26:18 +0000
Ken Sharp <ken.sharp@artifex.com>
7ff87e872888da0f5cfd392b3f8b90fa7ad0e27c

Fix the Lexmark contributed device

Bug #701905 "heap-buffer-overflow at contrib/gdevlx32.c:1509 in convbuf"

The problem here is actually much earlier. In encode_bw_buf() there is a
comment (line 1771) about starting before the first non-white pixels
in order to "give the head a little more room to accelerate properly".

If the first non-white pixel is less than 3 pixels from the left edge
of the raster, this will cause the calculation of 'left' to become
negative. It seems to me this will immediately corrupt the data. In
addition right is calculated in a similar fashion, if right is also
close to the right edge of the raster, then we can end up with numcols
being more than the width of the raster.

This argument is passed to convbuf() and that tries to read off the end
of the input data, because numcols exceeds the bytes in the raster.

I'm pretty dubious about this whole piece of code but since I don't
have a printer to test with I'm reluctant to make major changes. This
commit simply clamps left to 0 and right to the right edge of the
raster. The comment implies that the extra spacing probably isn't useful
and certainly suggests that removing it won't be harmful.

contrib/gdevlx32.c


2019-11-18 17:36:54 +0000
Julian Smith <jules@op59.net>
7e50bda19813d11555ff1ab4f7cb5c3e55ff0653

Coverity 341025: removed unreachable line of code.

pcl/pl/plmain.c


2019-11-18 17:34:49 +0000
Julian Smith <jules@op59.net>
05cfc3afb00404ddfd3c1eac635f369491995e5b

Coverity 331894: check return from gs_bbox_transform().

pcl/pl/plchar.c


2019-11-18 17:32:05 +0000
Julian Smith <jules@op59.net>
81e179af142575eab21633b2023e752e1e244c9a

Coverity 331893: check return code from gs_bbox_transform().

base/gxclimag.c


2019-11-18 17:28:42 +0000
Julian Smith <jules@op59.net>
d57aff5bbdb206f00e4b0cb3b324616be10d358e

Coverity 323321: avoid dead code.

base/gdevdrop.c


2019-11-18 15:24:44 +0000
Julian Smith <jules@op59.net>
3aa36ebc3df83d339695fff58a73332d5304c47d

Coverity 323317, 323320: avoid dead code.

Fixes coverity errors for transform_pixel_region_render_landscape() and
transform_pixel_region_render_skew().

base/gdevdflt.c


2019-11-18 14:49:38 +0000
Julian Smith <jules@op59.net>
4a1a4e8ad165e678d3affab483460ec8b926d5dd

Coverity 261213: make pxPassthrough_pcl_state_nonpage_exceptions() check return from pcl_set_graphics_state().

Also changed pxPassthrough_pcl_state_nonpage_exceptions() to return an int, and
made all of its callers check the return value.

pcl/pxl/pxpthr.c
pcl/pxl/pxpthr.h


2019-11-18 14:38:10 +0000
Julian Smith <jules@op59.net>
1ee350a81d5799785ab53b3eece6e853cc4c607b

Coverity 261210: wrap call of pcl_mark_page_for_path() in hpgl_call().

pcl/pcl/pgdraw.c


2019-11-18 12:31:33 +0000
Julian Smith <jules@op59.net>
884690a576e16043e674efb9d047a00760ac8443

Coverity 135902: remove support for USE_MAP_TYPE_IN_SPECIFICATION.

We now always treat map type 0 as map type 1. As suggested by henrystyles.

This will fix coverity issue.

pcl/pcl/pctext.c


2019-11-18 12:20:17 +0000
Julian Smith <jules@op59.net>
9763a006f7c566e92f60e799fb2270c09807e9c8

Coverity 135902: Fixed indentation in char_is_printable().

This commit has no output from 'git diff -w', and is in preparation for next
commit that fixes coverity issue.

pcl/pcl/pctext.c


2019-11-15 16:55:22 +0000
Julian Smith <jules@op59.net>
dd84fd3a36d0ef809ed697ed12f1bb04655a0388

Coverity 102254: avoid integer division when calculating double value.

It's possible that this could alter behaviour, but clusterpush showed no
additional regressions.

pcl/pcl/pctext.c


2019-11-18 12:08:38 +0000
Julian Smith <jules@op59.net>
a631e0d40337da58ba596a9499b71c1d7888c9d5

Coverity 126570: build_foreground(): return error if pindexed is NULL.

Previously we would dereference pindexed which would inevitably SEGV.

pcl/pcl/pcfrgrnd.c


2019-11-18 11:25:16 +0000
Julian Smith <jules@op59.net>
6fbd278d11e9ea567ea2dce0c7aa02e706d9a9e2

Coverity: try using C++ comment style for 'coverity[ -tainted_data_return ]'

E.g. for:
https://scan4.coverity.com/reports.htm#v46841/p11408/fileInstanceId=69767421&defectInstanceId=11904740&mergedDefectId=95049

jbig2dec/jbig2.c


2019-11-18 14:55:29 +0000
Ken Sharp <ken.sharp@artifex.com>
e05d0e17c75adab181413c8bf5bf6760c76683e4

'fix' buffer overrun in eps9mid device leading to SEGV

Bug #701853 "Segmentation fault at base/gsbitops.c:121 in bits_fill_rectangle"

The actual fault here is considerably earlier in the actual sequence of
execution.

The device(s) check for consecutive unchanged raster lines, and only
emit new lines when two lines differ. In addition under some conditions
the device can 'consolidate' runs by OR'ing the data in a raster with
the same data in the next raster (I don't understand why this is needed)

In order to ensure that there is sufficient data (24 rasters) for the
process to complete safely the raster data is copied into a buffer which
is allocated large enough, and is set to zero if less lines than 24 are
read from the device.

However the code doing the OR'ing wasn't using this memory, it was using
the single scan line pulled from the device to check whether consecutive
lines are the same. This caused it to run off the end of that buffer and
overwrite the 'line_ptrs' member of the device structure. *Much* later
we would attempt to use the corrupted data and that would cause a SEGV.

fixed by making the code OR'ing the lines use the workign buffer, as
(I think) it should.

devices/gdevepsn.c


2019-11-17 19:48:10 +0000
Ken Sharp <ken.sharp@artifex.com>
da03855bf9ca18eab05d4ac870d73f457758a77f

txtwrite - fix buffer overflow

Bug #701877 "heap-buffer-overflow at devices/vector/gdevtxtw.c:2114 in txt_add_fragment"

We were trying to read too many entries from the enumerator 'Widths'
array, because we were reading the number of Unicode code points,
instead of the number of character codes.

At the same time.....

re-instate the code which uses & on the glyph lists and casts them to
appropriate pointers. While gcc happily works with the code that was
modified to make Coverity happy, Visual Studio absolutely does not.
In order to make Visual Studio happy we do need the crazy pointers and
casting. I think this is wrong, but this way works on both compilers
and I couldn't find any other construction which did.

devices/vector/gdevtxtw.c


2019-11-16 10:00:58 +0000
Ken Sharp <ken.sharp@artifex.com>
0aa9d4f8237f7a0b459fc567e76ab8f0c4c2eebd

Coverity ID 350946

Not checking the return from gdev_prn_get_bits in two places

Again, no way for me to see this CID on the Coverity web interface.

contrib/gdevlx7.c


2019-11-16 09:55:36 +0000
Ken Sharp <ken.sharp@artifex.com>
ea274a722040b1186374a96d61715ae96d58c36b

Coverity IDs 350943, 350942 and 350947

Not checking the return value from gdev_prn_get_bits() in three places.

Again, cannot see this on the Coverity web interface.

contrib/gdevlx32.c


2019-11-16 09:52:40 +0000
Ken Sharp <ken.sharp@artifex.com>
3a913d9dc801508b19a8d5605e785852e1bfb082

Coverity ID 350944

Not checking the return value from gdev_prn_get_bits()

Slightly worryingly, I have the email from Coverity describing this
as a new issue, but I cannot persuade the Coverity web interface to
display it.

contrib/gdevmd2k.c


2019-11-16 09:48:23 +0000
Ken Sharp <ken.sharp@artifex.com>
8bf3152fe37368b49dcd23535a407c632d7157d2

Coverity IDs 350945 and 350948

In these routines code can only ever be 0 (OK) or 1 (error). So instead
of testing for code < 0 we need to test for code > 0 for an error.

devices/gdevicov.c


2019-11-16 09:31:32 +0000
Ken Sharp <ken.sharp@artifex.com>
5a4c29eeea1f0b63cc0b2fff3a1ca0f5b2d143b6

Coverity IDs 350163, 350949

previous fix for 350163 missed additional unchecked use of xps_fseek()

In addition; copying the cleanup code was not a complete fix, because
the existing cleanup code had a resource leak which Coverity did not
previously complain about.....

Fix that too

xps/xpsjxr.c


2019-11-15 18:50:56 +0000
Robin Watts <Robin.Watts@artifex.com>
7fc7881b00a43fe1017e593846a0baf28e8837db

Add simple PWG "interpreter" for gpdl.

base/spwgd.c
gpdl/gpdl.mak
gpdl/pwg/pwgtop.c
pcl/pl/plimpl.c
windows/ghostpdl.vcproj


2019-11-15 18:49:23 +0000
Robin Watts <Robin.Watts@artifex.com>
161adc70e0d6625618c5a6afcb5e04161acc2e2c

Squash a warning about an ininitialised variable.

jpegxr/cw_emit.c


2019-11-15 18:48:55 +0000
Robin Watts <Robin.Watts@artifex.com>
b8de03bdb8696517bff0259e827ece4f5746663c

Squash a float -> int warning.

contrib/japanese/gdevlbp3.c


2019-11-15 18:48:26 +0000
Robin Watts <Robin.Watts@artifex.com>
58bee0ad2c67888a52fa02e31de3120673525fda

Squash a double -> float warning.

contrib/gdevdj9.c


2019-11-13 18:08:20 +0000
Robin Watts <Robin.Watts@artifex.com>
372e4f29d3fcbfeaa83a5ee8cc530cbb948edab7

Squash a warning in gdevcif due to dropping const.

devices/gdevcif.c


2019-11-15 17:30:23 +0000
Ken Sharp <ken.sharp@artifex.com>
194c53ed02d657159a7be894b6d4b54ce1f435d4

Coverity ID 350163 unchecked return value

Check the return value of xps_fseek and throw an error if it fails.

xps/xpsjxr.c


2019-11-15 12:32:50 +0000
Julian Smith <jules@op59.net>
83c6e520ee6eddeaa1e548e519eb1b42941e3153

Coverity 102206: use snprintf() to avoid unsafe strcpy() and strcat().

pcl/pl/pjparse.c


2019-11-15 12:24:36 +0000
Julian Smith <jules@op59.net>
76c088b2b5468c1551c4636dc9d20f5b1ea5da36

Coverity 102205: cast ushort to final expression type (long) before bit-shift, to avoid sign extension.

pcl/pl/pllfont.c


2019-11-15 11:49:17 +0000
Julian Smith <jules@op59.net>
b51e2be557128054b0f1e8f6eb4c3b7de506cca2

Coverity 102204: cast byte to long to avoid possible sign extension.

pcl/pcl/pcwhtidx.c


2019-11-15 11:30:34 +0000
Julian Smith <jules@op59.net>
dd95eb235f00a600f8b8b99b8929e597283fa96c

Coverity 102189: removed less-than-zero comparison of unsigned.

pcl/pl/plfont.c


2019-11-15 11:27:53 +0000
Julian Smith <jules@op59.net>
95706a3ced4f1cfa50b2ea48f0095ed9423bafe5

Coverity 102173: removed unnecessary comparisons against hpgl_rm_character.

pcl/pcl/pgdraw.c


2019-11-15 14:22:04 +0000
Ken Sharp <ken.sharp@artifex.com>
5f24a32f0cc4513dfb9825900d561b3a6771b87c

Coverity ID 350216 - prevent dangling pointer

The variable pdcs is declared an immediately initialised to be
dsc->dcs2. Coverity correctly points out that if dsc->page_count is 1
we enter dsc_alloc_string, which can call dsc_reset() where,
if dsc->dcs2 is set, it will be freed and dsc->dcs2 will be set to
Null, leaving pdcs dangling.

By deferring the assignment of pdcs until it is actuallused we can
be certain that it is valid.

psi/dscparse.c


2019-11-15 13:28:38 +0000
Ken Sharp <ken.sharp@artifex.com>
de9dc99614f86e4aaa0a447766a58447e76ca8c1

Attempted fix for Coverity ID 350194

Thanks to Robin for pointing me at the right bit of code.

There was a pointer cast and address of (&) on an array which was
already a pointer. This is, of course, silly, so remove the cast and
&.

At the same time, the quad_glyph_list was using signed shorts to hold
the Unicode points, when it should have been using unsigned shorts, so
fix that here too.

devices/vector/gdevagl.h
devices/vector/gdevtxtw.c


2019-11-15 08:26:36 +0000
Chris Liddell <chris.liddell@artifex.com>
0ea433a1a172298eda11203d698ce6fe69be58d2

Support CIDFSubstFont being a path/file

Preivously, to use a custom CIDFont substitute in a custom location, it was
necessary to both both CIDFSubstPath (for the location) and CIDFSubstFont
(the file name).

We'll now check the CIDFSubstFont value and if it looks like it includes a path
(i.e. contains a directory/file separator string) then we'll use it as is,
ignoring the CIDFSubstPath

Resource/Init/gs_cidfm.ps


2019-11-14 13:22:11 +0000
Chris Liddell <chris.liddell@artifex.com>
51aff033bdc8744adfd86ce8b35ef00f23621de2

Bug 701903: (ps2write) clean up image enumerator streams.

At the end of an image (especially if the "end" is because of an error
condition) make sure we clean up any streams created for the handling of the
image data.

This saves leaving the streams around for gc to cleanup, and avoids a problem
where a special purpose stream (for color images) holds a reference to a
color space and graphics state either or both of which could be freed by a
Postscript restore before the garbager gets called to deal with unreferenced
objects.

devices/vector/gdevpdfi.c


2019-11-14 11:20:40 +0000
Ken Sharp <ken.sharp@artifex.com>
33f4f0c0ba5449fd535061e785090bc57849ae51

PDF interpreter - don't ignore SUBSTFONT

The PDF interpreter attempts to find a 'better' match for missing fonts
by using a list of TrueType mappings (eg ArialMT, CourierNew) and a
list of mappings (gs_font.ps, /.substitutefaces)

Failing to find a match there it attempts to use the FontDescriptor
Flags if present. As far as I can see that basically means we use
Times-Roman for serif fonts and Helvetica for sans serif.

This commit checks to see if SUBSTFONT is set. If it is we ignore all
this nonsense and simply use the substitute font the user told us to.
Otherwise we continue as before.

The diff is actually very simple, but the routine was very large so
I decided to move the actual substitution code out into a separate
function, to simplify the logic in pdffindfont which makes the
differences appear substantial. All that has really changed is that the
code to do the substitution, after checking for the existence of a
FontDescriptor, checks to see if SUBSTFONT is defined. If it is we
behave as if the font had no FontDescriptor and use the normal font
substitution machinery.

Resource/Init/pdf_font.ps


2019-11-07 15:36:55 +0000
Robin Watts <Robin.Watts@artifex.com>
98a8b291b135d49ffca23d9a289786971cf33a12

img language implementation

JPEGs only at this point.

Makefile.in
gpdl/gpdl.mak
gpdl/image/imagetop.c
pcl/pl/plimpl.c
psi/msvc.mak
windows/ghostpdl.vcproj


2019-11-07 15:36:55 +0000
Robin Watts <Robin.Watts@artifex.com>
91b104936ec55b3f1f22673d7e286ff67e4e2475

Public build changes to accommodate private URF support.

This includes build rubrik for devices to generate URF files
(urfgray, urfrgb, urfcmyk), a decompression filter for the
rle variant used in URF files and a urf "language" interpreter
implementation for gpdl.

Note, this is only the build framework for these things. The
actual implementation code lives in the private 'urf'
git module, and will be activated automatically as part of
the build if it is in position at configure time.

Makefile.in
base/lib.mak
base/unix-gcc.mak
configure.ac
devices/devs.mak
gpdl/gpdl.mak
pcl/pl/plimpl.c
psi/int.mak
psi/msvc.mak
psi/zfilter.c
windows/ghostpdl.vcproj
windows/ghostscript.vcproj


2019-11-13 16:35:05 +0000
Ken Sharp <ken.sharp@artifex.com>
af558a708b40a78eef9c0bc5b2ae229d771a3537

pdfwrite - Fix XMP emission

Bug #701895 "Ghostscript should leave the rdf:description rdf:about attribute empty (XMP Metadata)"

See the bug thread, it appears this value should be empty and this
commit makes that change.

devices/vector/gdevpdfe.c


2019-11-11 20:14:36 -0800
Ray Johnston <ray.johnston@artifex.com>
f63270230f329c6e89375af18d2bf2930421174a

Fix devices that ignore return codes from gdev_prn get_bits & copy_scan_lines

Discovered these when working on bug 701845 'devicen' device. Checking
uncovered a plethora of other places that used one of these functions
assuming success.

Also the gdev_prn_copy_scan_lines had places that assumed the return code
was a valid line_count, so if negative, could memset many lines in front of
an allocated buffer.

The code in a few of these usages is strange, and we don't have a way to
check them, so this may not match the original intent.

Also, while perusing all of these files, check devices for alloc's that
assume success and fix them (usually return gs_error_VMerror).

base/gdevdevn.c
devices/gdev3852.c
devices/gdev4081.c
devices/gdev4693.c
devices/gdev8510.c
devices/gdevatx.c
devices/gdevbit.c
devices/gdevbj10.c
devices/gdevbmp.c
devices/gdevccr.c
devices/gdevcdj.c
devices/gdevcfax.c
devices/gdevcif.c
devices/gdevclj.c
devices/gdevcljc.c
devices/gdevdjtc.c
devices/gdevdm24.c
devices/gdevepsc.c
devices/gdevepsn.c
devices/gdevescp.c
devices/gdevgprf.c
devices/gdevhl7x.c
devices/gdevicov.c
devices/gdevifno.c
devices/gdevimgn.c
devices/gdevjbig2.c
devices/gdevjpx.c
devices/gdevl31s.c
devices/gdevlbp8.c
devices/gdevlj56.c
devices/gdevlp8k.c
devices/gdevlxm.c
devices/gdevmgr.c
devices/gdevn533.c
devices/gdevokii.c
devices/gdevpbm.c
devices/gdevpdfimg.c
devices/gdevperm.c
devices/gdevphex.c
devices/gdevpjet.c
devices/gdevpsim.c
devices/gdevrinkj.c
devices/gdevsppr.c
devices/gdevstc.c
devices/gdevtifs.c
devices/gdevtknk.c
devices/gdevtsep.c
devices/gdevwpr2.c
devices/gdevxcf.c
devices/gdevxcmp.c


2019-11-13 13:51:27 +0000
Julian Smith <jules@op59.net>
97277fcf0f70d482481ac329ce473e5687e7a935

Bug 701906: Fix duplicate call to tiff_from_filep() that caused leak of TIFF object.

The code in tiff_rgb_print_page() did tfdev->tif = tiff_from_filep(), but
then calls gdev_tiff_begin_page() which does the same thing, overwriting the
original tfdev->tif.

Also changed tiff12_print_page() as it looks to have the same problem.

This fixes:
./sanbin/gs -dBATCH -dNOPAUSE -dSAFER -sOutputFile=tmp -sDEVICE=tiff48nc ../bug-701906.pdf

devices/gdevtfnx.c


2019-11-13 14:03:25 +0000
Ken Sharp <ken.sharp@artifex.com>
6690c60c3e1be875134150fa4909bff0de7d583f

pdfwrite - For PDF input, copy any UserUnit to the output

If the input is PDF, and the input file uses the ugly UserUnit hack to
work around MediaBox limits in Acrobat, and the CompatibilityLevel of
the output is at least PDF 1.6, then do not apply the UserUnit to the
MediaBox and do not scale the content. Instead pass the value of
UserUnit to the pdfwrite device and insert it into the output page.

We use a special_op to inquire whether the device would like us to pass
it the UserUnit. The pdfwrite device checks the current PDF level
being emitted and either returns true, or false if too low a level is
requested.

If it returns true the PDF interpreter does not apply the UserUnit
scaling but instead uses a second special_op to inform the device what
of the value of UserUnit.

The pdfwrite device adds any non-unity value of UserUnit to the page
dictionary when emitting it.

If -dNoUserUnit is set we neither apply the UserUnit scaling nor pass it
to the device.

Resource/Init/pdf_draw.ps
Resource/Init/pdf_main.ps
devices/vector/gdevpdf.c
devices/vector/gdevpdfb.h
devices/vector/gdevpdfp.c
devices/vector/gdevpdfx.h


2019-11-12 15:51:23 +0000
Julian Smith <jules@op59.net>
9e1d2f76cabf84576424af0c38dceef5881c2b21

jbig2_hd_new(): return error if params->GRAYMAX is large enough that N wraps to zero.

This was noticed when investigating coverity warnings about params->GRAYMAX
being tainted.

jbig2dec/jbig2_halftone.c


2019-11-12 15:48:50 +0000
Julian Smith <jules@op59.net>
e6d0fcd87934f01d4fb3c3029558fea134fbd086

Attempt to quieten coverity complaints about tainted data from jbig2_get_int32() and jbig2_get_uint32().

E.g. see Coverity p11408:94824.

jbig2dec/jbig2.c


2019-11-12 11:22:41 +0000
Julian Smith <jules@op59.net>
d11a43b64a2e623aebdfa34f8ee992887dc5b2b2

Coverity p11408:350203: Stop coverity overflow warning about array of floats.

&lutatobparts->matrix->cu.u points to something the size of three floats,
but add_matrixwithbias() takes pointer to nine floats, which makes coverity
complain.

This fix changes things so that we pass a pointer to something nine floats in
size, which satisfies coverity.

base/gsicc_create.c


2019-11-12 10:29:16 +0000
Chris Liddell <chris.liddell@artifex.com>
24ec06a27df63297796a379c95ee5d4b39040410

Bug 701894: fix the '--' and co options

The --, -+ and -@ need to add the file argument to the permit read list
before attempting to open and interpret them.

psi/imainarg.c


2019-11-11 13:45:59 +0000
Julian Smith <jules@op59.net>
592fb032180aac0fc22a7c860ef116b38da8ca71

Coverity p11408:350214: fix use of uninitialised 'file'.

base/gpmisc.c


2019-11-11 13:41:29 +0000
Julian Smith <jules@op59.net>
7da60037b788bec4217f6ee7017e238f541714ae

Coverity p11408:350217: avoid memcpy() with same buffers.

pcl/pcl/pcindxed.c


2019-11-11 12:44:26 +0000
Julian Smith <jules@op59.net>
658e14023fa84232c569ecc5528b77fd35bcf290

Coverity p11408:350197: fix issue by initialising 'file' to NULL.

base/gpmisc.c


2019-11-11 11:17:57 +0000
Julian Smith <jules@op59.net>
11f8439f49a3704bb4506e02382a0e697e5edf8e

Coverity p11408:350178: Stop coverity overflow warning about array of floats.

base/gsicc_create.c


2019-11-11 12:00:20 +0000
Chris Liddell <chris.liddell@artifex.com>
a1747b9267b4aac28e256820c5cea37af299af86

Make lack of freetype a hard error

configure.ac


2019-10-24 10:09:55 +0100
Chris Liddell <chris.liddell@artifex.com>
37a322fb93c5cd1e96a4cad2ffccdc397f7c0ea5

Reinstate Apple devices (gdevadmp.c) as contrib devices

configure.ac
contrib/contrib.mak
contrib/gdevadmp.c


2019-11-11 10:21:13 +0000
Chris Liddell <chris.liddell@artifex.com>
aad7bcab6a3aedc4e2bfecd7b1e6bf893c299d0e

Better solution for commit 68aeff88e95c

This is a simplified (and fixed) solution for the problem addressed in commit
68aeff88e95c: instead of assiging to the 'fixed' type, then converting to
ufixed (wrongly, in the original commit), just go straight to ufixed.

This solves coverity issues: 350493 and 350492

base/gxhintn.c


2019-11-11 10:42:11 +0000
Chris Liddell <chris.liddell@artifex.com>
2de09275898086e903a19812fd78e73381f7e71e

Bug 695873: reverse search to auto-set GenericResourceDir

A -I path like:

/path/to/Resources/share/ghostscript/9.15/Resource/Init

Would cause us to wrongly set GenericResourceDir and the ICCProfilesDir because
in both cases we'd search the path for the string 'Resource', and end up using:

/path/to/Resource

To work better, this uses the new and non-standard rsearch operator to search
the path backwards.

I opted not to include the trailing directory separator at this stage because
that complicates matters with platforms that uses different directory
separators (Unix vs Windows vs OpenVMS, for example)

Resource/Init/gs_lev2.ps
Resource/Init/gs_res.ps


2019-11-09 12:51:05 -0800
Ray Johnston <ray.johnston@artifex.com>
c198ac5dcb26fadc53074525cabb413e5395cdba

Clear out gs_gstate at the start of clist playback.

There are some elements of the (stack based) gs_gstate that were not being
set by either GS_STATE_INIT_VALUES_CLIST, or gs_gstate_initialize, so set
the entire structure to 0 before setting the values we care about. This
was prompted by a customer that has made modifications to the clist playback
that relied on gs_gstate.color[0/1].color_space being NULL or valid, but
since it is so quick and only happens once per band, go ahead and do it.

base/gxclrast.c


2019-11-09 10:27:22 +0000
Ken Sharp <ken.sharp@artifex.com>
7174b69e6c0027277fe1a9ece341c3380fe7979d

Fix PDF 2.0 /Square annotation appearance generation

All the routines to generate annotation appearances are supposed to
return a boolean value indicating whether an annotation has a valid
Appearance (returns true, caller must run the appearance stream) or
the appearance has been generated (false, caller must not attempt to
run the appearance stream).

The /Square annotation was failing to return false if there was no
appearance and one had been generated.

Resource/Init/pdf_draw.ps


2019-11-08 17:40:37 +0000
Julian Smith <jules@op59.net>
ba5b47dc979ca1590f280f482d432705e9b535bf

Coverity p11408:350177: avoid use of uninitialised state.start.x.

Probably not a problem in practise because we can't get gs_pe_closepat without
earlier gs_pe_moveto or similar.

base/gdevvec.c


2019-11-08 17:21:38 +0000
Julian Smith <jules@op59.net>
4a3401e5e4f5828c67d7c65f77a3bb0106753649

Coverity p11408:350167: fixed use of uninitialised gp_file*.

base/gpmisc.c


2019-11-08 16:40:00 +0000
Julian Smith <jules@op59.net>
f44249d69a36fa7233504bdb137af9ff5008ec37

Coverity Coverity p11408:350165: try to stop coverity warning about array of floats.

Coverity complains about passing &float to something that assumes it is
float[9]. Trying explicit cast of base object to float*.

base/gsicc_create.c


2019-11-08 16:25:01 +0000
Julian Smith <jules@op59.net>
2029235dc8997314c1925e5786212a6c7331f0cf

Coverity p11408:350164: only call memcpy() if buffers are different.

We could use memmove() instead, but this makes things a little clearer.

pcl/pcl/pcindxed.c


2019-11-08 12:31:08 +0000
Julian Smith <jules@op59.net>
5605c6c6a9677013560a6a3c947f4b100eae4e09

Coverity p11408:350160: attempt to avoid coverity issues when calling pl_dict_put().

Coverity doesn't like hard-coded 32 for the size of 'short
unicode_fontname[16]', so use sizeof().

pcl/pl/pllfont.c


2019-11-08 15:13:50 +0000
Ken Sharp <ken.sharp@artifex.com>
95151ae3c3c63100bc7ae958f59b8096e7a0f211

Improve handling of microscopic fonts with text rendering mode 3

Bug #701875 "empty TIFF-file is generated when using -r300, correct output with -r72"

In the past we've seen PDF producers set the text rendering mode to 3
and then (goodness knows why) set a CTM where one of the scale factors
is 0. In this case the scale factor isn't 0 but its absolutely minute,
5.3x10-6.

This evades our existing code, so here we improve it; we check to see
if the CTM scales in either direction by a really small amount instead
of 0 (0.000001).

In addition, we previously tried to patch up the CTM and use it anyway
but really this is only going to make sense is one scale factor is
tiny (or 0) and the other is sensible. If that's not the case then
any displacement due to drawing the text will also be tiny. So lets
simply ignore it.

Resource/Init/pdf_ops.ps


2019-11-08 12:47:59 +0000
Chris Liddell <chris.liddell@artifex.com>
0f7653fd4f1d1c5bf36719efcd8464eafcd46faf

Bug 701870: Use object number from Font rather than FontDescriptor

In case where two CIDFont /Font objects share a /FontDescriptor, because the
/Font objects can contain different details like /CIDSystemInfo contents and
/CIDToGIDMap, if we use the object number from the /FontDescriptor to validate
the instance of the font we should use, we can end up reusing a (Postscript)
font when we shouldn't. This can result in garbled or missing glyphs.

Resource/Init/pdf_font.ps


2019-11-08 12:08:52 +0000
Robin Watts <Robin.Watts@artifex.com>
6882df85d37819d849476cf2b4822a90e64d9b24

Add a couple of FIXMEs to the xps interpreter.

xps/xpsimage.c
xps/xpstop.c


2019-11-08 12:08:24 +0000
Robin Watts <Robin.Watts@artifex.com>
b7fac758d046c82d65fa69dd2c4bc0f1cf9712bc

Remove unused gpdlpsi.mak file.

gpdl/psi/gpdlpsi.mak


2019-11-08 11:32:41 +0000
Julian Smith <jules@op59.net>
328d27b3cccc89c4ff60529106489a9a635f0f72

Bug 701854: bj10v_print_page(): increase buffer by one byte to give space for sentinel.

Fixes:
./sanbin/gs -r928 -sOutputFile=tmp -sDEVICE=bj10v ../bug-701854.ps

contrib/japanese/gdev10v.c


2019-11-07 10:08:35 +0000
Chris Liddell <chris.liddell@artifex.com>
68aeff88e95ccfd1af430fe180597d624ad9f47e

Old Type 1 hinter: protect against signed overflow

To avoid overflow during hinting, we tweak the balance of the size of the
coordinates and the scaling in the hinter (this is only dealing with coords
so large that hinting is largely pointless anyway).

But the code that does that didn't protect against signed overflow in the
starting coordinates.

This is a naive protection to prevent an infinite (or near so) loop, but
a) it's old code that shouldn't be in use anymore, and b) in practice it will
make no difference to rendering with coordinates that large.

base/gxhintn.c


2019-11-06 14:17:33 +0000
Chris Liddell <chris.liddell@artifex.com>
713645137a2fc483e5509bfd0f92d7311faeb614

Some more transparency ops doc tweaks

doc/Language.htm


2019-11-07 16:55:15 +0000
Julian Smith <jules@op59.net>
6c3af6e12e4448b519d2b48c2047c0c83b3cf082

Coverity issue 102147:323319: transform_pixel_region_render_skew(): don't return pointer to local data.

base/gdevdflt.c


2019-11-07 16:18:32 +0000
Julian Smith <jules@op59.net>
66878fb30f37b06a532fdce39991f31642cdb09b

Bug 701856: fix bad bracketting in original fix.

devices/gdevepsn.c


2019-11-07 16:13:06 +0000
Julian Smith <jules@op59.net>
76db3df8090127482960b742f15831e59816a05e

Coverity issue 102147: initialise gx_device_color::type.

Might fix Coverity issue in base/gxiscale.c.

base/gxiscale.c


2019-11-07 12:34:24 +0000
Julian Smith <jules@op59.net>
9caccf9f09e06324f07822cc55e1737d881c6eb3

Bug 701856: fixed buffer overflow in devices/gdevepsn.c.

Need to protect aginst overflow with high x_dpi when using local
graphics_modes_24[] or graphics_modes_9[] arrays.

Fixes:
./sanbin/gs -dBATCH -dNOPAUSE -r914 -sOutputFile=tmp -sDEVICE=eps9high ../bug-701856.pdf

devices/gdevepsn.c


2019-11-07 11:57:35 +0000
Julian Smith <jules@op59.net>
018003614ad80910ca2c009eb1d523e8015756bc

Bug 701849: Fix buffer overflow in devices/gdevhl7x.c.

High values of pdev->x_pixels_per_inch result in Summary::pageWidth being
greater than Summary::previousData's fixed size of 1500 bytes, which causes
buffer overflow in resetPreviousData() (and possibly other places too).

So have changed to initSummary() to allocate Summary::previousData using
gs_malloc(), and added freeSummary() to clean up.

Fixes:
./sanbin/gs -r968 -dFitPage -dUseCropBox -sPAPERSIZE=legal -sOutputFile=tmp -sDEVICE=hl7x0 ../bug-701849.pdf

devices/gdevhl7x.c


2019-11-06 15:25:12 +0000
Julian Smith <jules@op59.net>
7da3de0c7662491fa2a0b6f5a638848bcf13a5fa

Bug 701847: make pj_common_print_page() work with any line_size.

Much of the code used to be hard-coded for fixed LINE_SIZE.

Fixes:
./sanbin/gs -dBATCH -dNOPAUSE -sOutputFile=tmp -sDEVICE=lj250 ../bug-701847.pdf

devices/gdevpjet.c


2019-11-06 14:44:13 +0000
Julian Smith <jules@op59.net>
494eeedf73d13fac5710e56f3a8fb2e7e2379d73

Bug 701846: fix use of uninitialised data in clj_media_size().

If param_read_float_array() fails, fres.data[] is unset. The values to use are
always in res[].

Fixes:
./sanbin/gs -dBATCH -dNOPAUSE -dSAFER -dFIXEDMEDIA -sOutputFile=tmp -sDEVICE=cljet5pr ../bug-701846.pdf

devices/gdevclj.c


2019-11-06 12:41:28 +0000
Julian Smith <jules@op59.net>
4f6bc662909ab79e8fbe9822afb36e8a0eafc2b7

Bug 701844: fixed output buffer size worst case in lp8000_print_page().

Fixes:
./sanbin/gs -dBATCH -dNOPAUSE -dSAFER -dFIXEDMEDIA -sPAPERSIZE=legal -sOutputFile=tmp -sDEVICE=lp8000 ../bug-701844.pdf

devices/gdevlp8k.c


2019-11-06 16:46:44 +0000
Ken Sharp <ken.sharp@artifex.com>
ce681338646435ca064ab2d1b8bde1614e5ed3f1

PDF interpreter - preserve colour space on Image XObjects with Do

No bug number the customer file is large and looks confidential.

The problem is that the PDF file sets a custom colour space, then
draws an image, the image is in a different colour space (DeviceRGB),
the file then sets a new colour in the original space.

The PDF interpreter was changing the colour space in order to draw
the image, but was not resetting it afterwards, which meant that the
attempt to set the colour failed as the colour space was inappropriate.

I'm *amazed* this hasn't arisen before, its so clearly wrong.

This commit gets the colour space before executing the image, and puts
it back again afterwards. We have to be careful to do the restoration
in a stopped context because this code can be called when drawing a
glyph, and we are not permitted to change colour space while in an
uncoloured glyph, it throws an error.

In addition, the appearance generation for /Square annotations (and
other types) was setting the colour space to white and filling the
annotation rectangle, even if the /IC (Interior Color) key was not
present. Acrobat appears not to do this so I've modified the code to
not fill the annotation if there is no /IC in the annotation dictionary.

Resource/Init/pdf_draw.ps


2019-11-06 11:56:07 +0000
Julian Smith <jules@op59.net>
4e713293de84b689c4ab358f3e110ea54aa81925

Bug 701843: avoid divide by zero in devices/gdevepsc.c:epsc_print_page().

Fixes:
./sanbin/gs -dBATCH -dNOPAUSE -dSAFER -r8 -dNOCIE -dFitPage -sOutputFile=tmp -sDEVICE=epsonc ../bug-701843.pdf

devices/gdevepsc.c


2019-11-06 11:46:10 +0000
Julian Smith <jules@op59.net>
f70ab2044429fe4b991801476ea3f4b4a5c0cdf4

Bug 701843: avoid divide by zero caused by custom resolution being too low.

Fixes:
./sanbin/gs -dBATCH -dNOPAUSE -dSAFER -r8 -dNOCIE -dFitPage -sOutputFile=tmp -sDEVICE=eps9mid ../bug-701843.pdf

devices/gdevepsn.c


2019-11-06 11:18:55 +0000
Julian Smith <jules@op59.net>
ce2afc4f02617dee51f3322ae8386c4b46047c18

Bug 701842: avoid buffer overflow in lxm5700m_print_page().

Fixes:
./sanbin/gs -dBATCH -sOutputFile=tmp -sDEVICE=lxm5700m ../bug-701842.ps

devices/gdevlxm.c


2019-11-05 18:18:50 +0000
Robin Watts <Robin.Watts@artifex.com>
027c546e0dd11e0526f1780a7f3c2c66acffe209

Bug 701842: Fix misindexing in gxicolor.c

We were incorrectly decrementing position per-component, rather
than per-pixel (in 2 places).

Also, take care of some whitespace oddities.

base/gxicolor.c


2019-11-05 15:02:23 +0000
Julian Smith <jules@op59.net>
1159afbcad927e1a32008b0ab87e257fc21da8e2

Ensure strncpy() terminates when called from pjl_parsed_filename_to_string().

Passing strlen()+1 to strncpy() ensures that it will terminate the
string. Possibly not required here because the code always terminates the
string, but this might fix coverity issue 102147.

pcl/pl/pjparse.c


2019-11-05 14:59:56 +0000
Robin Watts <Robin.Watts@artifex.com>
67b4efc310af7bf9d30f84a70c6b9858ab138e3d

Bug 701809: Fix out oob access in transform_pixel_region.

When collating pixels to write out using copy_color,
we can only write within our array. Clip maxx/minx accordingly.

base/gdevdflt.c


2019-11-05 14:54:22 +0000
Robin Watts <Robin.Watts@artifex.com>
02c566b4b5f3f60ff8ebd7f4523722c39c2d72e7

Memento: Unlock a block with valgrind before checking it.

This avoids false positives on closedown.

base/memento.c


2019-11-05 13:36:04 +0000
Julian Smith <jules@op59.net>
f38c6b08c6582872af25fc669a5fd3bde9f32753

Bug 701831: fixed buffer overflow in bjc_compress().

Fixes:
./sanbin/gs -dBATCH -dNOPAUSE -sOutputFile=tmp -sDEVICE=bjc800 ../bug-701831.ps

devices/gdevcdj.c


2019-11-05 12:03:23 +0000
Julian Smith <jules@op59.net>
b25cad42dc869e8e9d7ea58adae2c8baba0ee25d

Bug 701830: avoid buffer overflow in lips_rle_encode().

Worst case for lips_rle_encode() is 2*Length+2, so adjust corresponding alloc
to match.

Fixes:
./sanbin/gs -dBATCH -dNOPAUSE -r489 -dFitPage -sOutputFile=tmp -sDEVICE=lips4 ../bug-701830.eps

contrib/lips4/gdevl4r.c


2019-11-05 10:49:58 +0000
Chris Liddell <chris.liddell@artifex.com>
e7118494be4162b8c2c06d8b7d4cb2d7ebb57f61

Add -dALLOWPSTRANSPARENCY to the documentation.

doc/Use.htm


2019-11-05 09:45:27 +0000
Chris Liddell <chris.liddell@artifex.com>
485904772c5f0aa1140032746e5a0abfc40f4cef

Bug 701841: remove .forceput from /.charkeys

When loading Type 1 or Truetype fonts from disk, we attempt to extend the glyph
name table to include all identifiable glyph names from the Adobe Glyph List.

In the case of Type 1 fonts, the font itself (almost always) marks the
CharStrings dictionary as read-only, hence we have to use .forceput for that
case.

But for Truetype fonts, the CharStrings dictionary is created internally and is
not read-only until *after* we have fully populated it (including the extended
glyph names from the AGL), hence there is no need for .forceput, and no need to
carry the security risk of using it.

Replace with regular put.

Resource/Init/gs_ttf.ps


2019-11-04 14:23:30 +0000
Chris Liddell <chris.liddell@artifex.com>
94d8955cb7725eb5f3557ddc02310c76124fdd1a

Bug 701818: better handling of error during PS/PDF image

In the xps device, if an error occurred after xps_begin_image() but before
xps_image_end_image(), *if* the Postscript had called 'restore' as part of the
error handling, the image enumerator would have been freed (by the restore)
despite the xps device still holding a reference to it.

Simply changing to an allocator unaffected save/restore doesn't work because
the enumerator holds references to other objects (graphics state, color space,
possibly others) whose lifespans are inherently controlled by save/restore.

So, add a finalize method for the XPS device's image enumerator
(xps_image_enum_finalize()) which takes over cleaning up the memory it allocates
and also deals with cleaning up references from the device to the enumerator
and from the enumerator to the device.

devices/vector/gdevxps.c


2019-10-31 15:30:19 +0000
Chris Liddell <chris.liddell@artifex.com>
39b4cdb491c3e09434f5d2b9c334a898fb569850

Update docs for current state of transparency ops

doc/Language.htm


2019-10-31 10:19:01 +0000
Chris Liddell <chris.liddell@artifex.com>
d1eac80695b2c6f2a85942a82518715549541969

Add the ability to allow transparency ops in Postscript

-dALLOWPSTRANSPARENCY on the command line will prevent the undefining of the
non-standard gs Postscript transparency operators.

Driving these operators in the wrong way can cause undefined behavior, hence
not allowing them normally.

Also, use a better condition for dropping the transparency ops in:
examples/transparency_example.ps

Resource/Init/gs_init.ps
Resource/Init/pdf_main.ps
examples/transparency_example.ps


2019-11-05 08:50:45 +0000
Ken Sharp <ken.sharp@artifex.com>
27409d99b069e434c6863f43456cf8985bbdf7f8

Fix the quad glyph table

This might fix Coverity ID 350194. Even if it doesn't it is incorrect
so fix the initialisation of the table.

devices/vector/gdevagl.c


2019-11-05 08:48:10 +0000
Ken Sharp <ken.sharp@artifex.com>
407c98a38c3a6ac1681144ed45cc2f4fc374c91f

txtwrite - guard against using GS_NO_GLYPH to retrieve Unicode values

Bug 701822 "Segmentation fault at psi/iname.c:296 in names_index_ref"

Avoid using a glyph with the value GS_NO_GLYPH to retrieve a glyph
name or Unicode code point from the glyph ID, as this is not a valid
ID.

devices/vector/gdevtxtw.c
psi/zbfont.c


2019-11-04 16:12:04 +0000
Julian Smith <jules@op59.net>
af004276fd8f6c305727183c159b83021020f7d6

Bug 701829: ep_print_image(): protect against memcmp() beyond buffer.

Fixes:
./sanbin/gs -dBATCH -dNOPAUSE -r12 -sOutputFile=tmp -sDEVICE=escp ../bug-701829.pdf

devices/gdevcdj.c


2019-11-01 11:55:23 -0700
Ray Johnston <ray.johnston@artifex.com>
4f73e8b4d578e69a17f452fa60d2130c5faaefd6

Fix bugs 701787, 701806, 701810. Problems with cdj970 device.

As Robin mentioned in bug 701787, the device was changing resolution AFTER
the device had been opened and all of the buffers configured.

Move the "one time" initial setup into the open function, leaving the code
to write the header in the print_page function. Presumably that only needs
to be written once even if there are multiple pages.

Also add a check for valid resolutions since it appears that the intent was
to have the "Quality" parameter set up 300 or 600 dpi. Other deskjet devices
have this type of check.

Add a gs_closedevice if the Quality is changed since this will change the
resolution and thus the page buffer geometry.

Lastly, fix cdj970_put_params so that errors are not ignored for all but the
last (which happened to be BlackCorrect).

These changes prevent the bugs cited, but remain untested except for some
parameter testing to make sure bad values don't cause memory violations. It
does seem that some parameter values that are out of range (like Quality) are
ignored, but that may be intentional.

contrib/gdevdj9.c


2019-11-04 15:32:04 +0000
Julian Smith <jules@op59.net>
eaba1d97b62831b42c51840cc8ee2bc4576c942e

Bug 701828: make dot24_print_page() return error instead of divide by zero.

Fixes:
./sanbin/gs -dBATCH -dNOPAUSE -dSAFER -r2 -sOutputFile=tmp -sDEVICE=necp6 ../bug-701828.pdf

devices/gdevdm24.c


2019-11-04 13:00:04 +0000
Julian Smith <jules@op59.net>
a6f7464dddc689386668a38b92dfd03cc1b38a10

Bug 701827: fixed incorrect buffer expansion in lxm5700m_print_page().

Fixes:
./sanbin/gs -dBATCH -dNOPAUSE -r425 -dFitPage -sOutputFile=tmp -sDEVICE=lxm5700m ../bug-701827.eps

devices/gdevlxm.c


2019-11-04 12:30:33 +0000
Julian Smith <jules@op59.net>
2793769ff107d8d22dadd30c6e68cd781b569550

Bug 701819: fixed ordering in if expression to avoid out-of-bounds access.

Fixes:
./sanbin/gs -dBATCH -dNOPAUSE -r965 -sOutputFile=tmp -sDEVICE=pcx16 ../bug-701819.pdf

devices/gdevpcx.c


2019-11-01 18:09:30 +0000
Julian Smith <jules@op59.net>
366ad48d076c1aa4c8f83c65011258a04e348207

Bug 701815: avoid uninitialised bytes being >7, which broke indexing.

Fixes:
./sanbin/gs -dBATCH -dNOPAUSE -sOutputFile=tmp -sDEVICE=jetp3852 ../bug-701815.pdf

devices/gdev3852.c


2019-11-01 14:55:16 +0000
Robin Watts <Robin.Watts@artifex.com>
ec065fd285f8064ac34cc160106dd730569ebc75

Clear eol padding bits in "atx" devices.

This upsets the blank line detection and therefore can randomly
change the output.

devices/gdevatx.c


2019-11-01 14:26:52 +0000
Robin Watts <Robin.Watts@artifex.com>
e4dce29961108c6fef5c02bf4d5e527b265bf8d8

Mask eol padding bits for pngmono device in CLUSTER builds.

devices/gdevpng.c


2019-11-01 14:24:08 +0000
Robin Watts <Robin.Watts@artifex.com>
9076e48cf91ba6bf4e939b0562c53e6cbb62282e

Fix previous planm eol masking fix.

The previous attempt to fix the masking of eol padding bits
for planm would have failed in the width == multiple of 8 case.
Also make it dependent on CLUSTER here.

devices/gdevplan.c


2019-11-01 12:38:41 +0000
Robin Watts <Robin.Watts@artifex.com>
1126deff06d81d4fa1975ea0ed3a3b64e9cf0661

Update "planm" device to clear eol padding bits.

This should avoid md5 changes in the alldevs cluster test.

devices/gdevplan.c


2019-11-01 12:22:55 +0000
Robin Watts <Robin.Watts@artifex.com>
bcb881e566d90ae43648085ff1edfdcddcd6eb50

Fix "cif" device in CLUSTER builds.

Use a hardcoded "clusterout" filename for embedding rather
than the real one in CLUSTER builds. This stops the md5sum
from changing randomly.

devices/gdevcif.c


2019-11-01 10:26:44 +0000
Ken Sharp <ken.sharp@artifex.com>
aadb53eb834b3def3ef68d78865ff87a68901804

Tiffsep and Tiffsep1 - abort on multi-page input wtithout %d OutputFile

Bug #701821 "Segmentation fault at tiff//libtiff/tif_dirinfo.c:513 in TIFFFindField"

The tiffsep and tiffsep1 only set 'code' to an error when an attempt is
made to write a second output file without using %d in the OutputFile
specification.

This causes problems later when attempting to process the files. The
devices should exit without trying to further process the pages under
these conditions and this commit returns immediately on error.

The other devices like this already return immediately on error, it
looks like the code here was copied between devices without realising
that the tiffsep and tiffsep1 devices didn't exit when the error
condition was set.

devices/gdevtsep.c


2019-10-31 19:47:13 +0000
Robin Watts <Robin.Watts@artifex.com>
9c196bb7f6873b4fe43a649fc87cba363c6af8e5

Fix devicen device for new file security world.

Again, update the code to allow spot files to be written.

base/gdevdevn.c


2019-10-31 19:24:44 +0000
Robin Watts <Robin.Watts@artifex.com>
a6e36c29b69b4d15aac872e37303dcf9cb8d7739

Update spotcmyk device for new file access security.

This device writes the data to a file, then reads it back in,
and writes out various spot ".pcx" files. Accordingly we
need to make the file readable too, and then make the .pcx
files writable.

base/gdevdevn.c


2019-10-31 18:21:01 +0000
Robin Watts <Robin.Watts@artifex.com>
dbdb5f8527007b482d4e6037b558dbf3e6a06d3a

Fix spurious rangechecks from cljet5pr device.

The device would rangecheck whenever it was called with a
param list that didn't contain HWResolution. Now, if it's
not given an HWResolution, look at the device's current
value.

devices/gdevclj.c


2019-10-31 17:42:48 +0000
Robin Watts <Robin.Watts@artifex.com>
f5673b5a50f141440329c62ee5b53eefcd585a3f

pdfimg: Avoid ID's varying by filename in CLUSTER builds.

This was upsetting the alldevs runs.

devices/gdevpdfimg.c


2019-10-31 17:01:42 +0000
Julian Smith <jules@op59.net>
b5bc53eb7223f8999882a5d8e2e35c27fe7a0b57

Bug 701788: added comment about asn/valgrind detecting leaks in fontconfig.

base/gp_unix.c


2019-10-31 16:22:01 +0000
Robin Watts <Robin.Watts@artifex.com>
255eef0a7d9d24962ebbcbb4b1858e44b803f16b

mgr4 device: clear any unused trailing bits for each line.

This avoids valgrind errors and varying md5sums in the alldevs
cluster test.

devices/gdevmgr.c


2019-10-31 16:21:06 +0000
Robin Watts <Robin.Watts@artifex.com>
351a2251b4a80fa31ac15229036318b01d124532

Squash warning caused by previous fix.

Include the correct header for 'free' before using it.

contrib/eplaser/gdevescv.c


2019-10-31 13:12:47 +0000
Julian Smith <jules@op59.net>
f54414c8b15b2c27d1dcadd92cfe84f6d15f18dc

Bug 701808: return error from okiibm_print_page1() if x_dpi too high.

Avoids asan error in:
./sanbin/gs -dBATCH -dNOPAUSE -dSAFER -r599 -sOutputFile=tmp -sDEVICE=okiibm ../bug-701808.pdf

devices/gdevokii.c


2019-10-31 15:36:22 +0000
Robin Watts <Robin.Watts@artifex.com>
464107095e614d54417ffd2bedbdc852efee0961

Update lbp8 device to not use a fixed sized buffer for line data.

devices/gdevlbp8.c


2019-10-31 14:25:25 +0000
Robin Watts <Robin.Watts@artifex.com>
5eaccd845c9957dff754ebfdde417fe5d82e5e82

Update vdb.pl script to latest version.

toolbin/vdb.pl


2019-10-31 14:17:38 +0000
Robin Watts <Robin.Watts@artifex.com>
0d998f17c495a12b04904113ff676c7427089883

Fix gdevescv for operation with Memento.

Blocks returned by system malloc can't be freed by Memento_free.

Also, avoid a problem in CLUSTER builds.

contrib/eplaser/gdevescv.c


2019-10-31 11:55:38 +0000
Julian Smith <jules@op59.net>
714e8995cd582d418276915cbbec3c70711fb19e

Bug 701807: avoid buffer overflow in tiff12_print_page().

Fixes:
./sanbin/gs -r650 -sOutputFile=tmp -sDEVICE=tiff12nc ../bug-701807.pdf

devices/gdevtfnx.c


2019-10-31 10:33:10 +0000
Robin Watts <Robin.Watts@artifex.com>
c64d06deea998199a0e30180fd884286b4b2256c

Nobble various uses of "time" in the code in CLUSTER builds.

This causes the bjccolor device at least to give indeterminate
results. Nobbling the rest won't hurt.

contrib/eplaser/gdevescv.c
contrib/gdevbjca.c
devices/gdevpdfimg.c
devices/gdevtifs.c
devices/vector/gdevpdfe.c
devices/vector/gdevpsu.c


2019-10-31 10:31:24 +0000
Robin Watts <Robin.Watts@artifex.com>
bf72f1a3dd5392ee8291e3b1518a0c2c5dc6ba39

Fix valgrind problems with gdevbjca.c

2 problems here. Firstly, we could access off the end of a row
while looking for runs. Change the indexing to fix this.

Secondly, we could overrun our gamma tables due to unexpectedly
large values. Add some clamping.

contrib/gdevbjca.c


2019-10-31 10:29:32 +0000
Robin Watts <Robin.Watts@artifex.com>
fa7f0cde80ce734ddc22bde34d121c1be5c7deb4

Fix various incorrect casts in contrib devices.

Various contrib devices cast a gx_color_index (a 32 or 64
bit value typically containing 24 bits of data) down to
a gx_color_value before manipulating it. This is a typo,
copied into several places in the code. Correct it here.

contrib/gdevcd8.c
contrib/gdevdj9.c
contrib/japanese/gdevmjc.c


2019-10-31 10:17:09 +0000
Robin Watts <Robin.Watts@artifex.com>
f1fd4a73480c5a2f900b1541b45a62ffcc75e12d

Fix warnings when building contrib on windows.

MSVC is much more sensitive to casting types than gcc is, it
seems. Accordingly avoid making doubles when we want floats, and
make all casts down to int (or byte) explicit.

base/gxdevice.h
contrib/gdevbjc_.c
contrib/gdevbjc_.h
contrib/gdevcd8.c
contrib/gdevdj9.c
contrib/gdevgdi.c
contrib/gdevln03.c
contrib/gdevlx32.c
contrib/gdevmd2k.c
contrib/gdevop4w.c
contrib/japanese/gdev10v.c
contrib/japanese/gdevalps.c
contrib/japanese/gdevespg.c
contrib/japanese/gdevmjc.c
contrib/japanese/gdevnpdl.c
contrib/japanese/gdevrpdl.c
contrib/lips4/gdevl4r.c
contrib/lips4/gdevlips.h
contrib/pcl3/eprn/mediasize.c
contrib/pcl3/eprn/mediasize.h
contrib/pcl3/src/gdevpcl3.c
contrib/pcl3/src/pclcap.c
contrib/pcl3/src/pclgen.c
devices/gdevphex.c


2019-10-30 17:40:18 +0000
Robin Watts <Robin.Watts@artifex.com>
67a101f3eb888bc651cc13bfb06280a669a84967

Fix contrib.mak to work on windows.

Building Debug-contrib|win32 will currently attempt to run
contrib.mak 3 times due to poor commenting out of make lines.
For me, this manifested itself as new instances of Visual
Studio starting up and attempting to "upgrade" the makefile.

contrib/contrib.mak


2019-10-29 17:16:03 +0000
Robin Watts <Robin.Watts@artifex.com>
4fcbece468706e0e89ed2856729b2ccacbc112be

Avoid some devices dying due to inappropriate resolutions.

contrib/japanese/gdev10v.c
contrib/japanese/gdevalps.c


2019-10-29 16:01:39 +0000
Robin Watts <Robin.Watts@artifex.com>
19cebe708b9ee3d9e0f8bcdd79dbc6ef9ddc70d2

Avoid division by zero with bj10v device.

When called with a low resolution, we can end up dividing by zero.
Spot this in the open call and give a rangecheck error.

contrib/japanese/gdev10v.c


2019-10-29 17:28:53 +0000
Julian Smith <jules@op59.net>
849e74e5ab450dd581942192da7101e0664fa5af

Bug 701799: avoid out-of-range array access in mj_color_correct().

Code is obscure, so this fix merely avoids out-of-range access in the simplest
way possible, without understanding what the code is trying to do.

Fixes:
./sanbin/gs -sOutputFile=tmp -sDEVICE=mj6000c ../bug-701799.pdf

contrib/japanese/gdevmjc.c


2019-10-29 16:49:13 +0000
Julian Smith <jules@op59.net>
89f58f1aa95b3482cadf6977da49457194ee5358

Bug 701794: check for x_dpi out of range in epsc_print_page().

Avoids out-of-bounds of local arrays graphics_modes_9 and graphics_modes_24.

Larger diff than would like, because can't return error from within
declarations in old-style C.

Fixes:
./sanbin/gs -r680 -sOutputFile=tmp -sDEVICE=epsonc ../bug-701794.pdf

devices/gdevepsc.c


2019-10-29 16:20:56 +0000
Julian Smith <jules@op59.net>
863ada11f9a942a622a581312e2be022d9e2a6f7

Bug 701793: check we are within buffer before comparing buffer contents.

Fixes:
./sanbin/gs -sOutputFile=tmp -sDEVICE=mj700v2c ../bug-701793.pdf

contrib/japanese/gdevmjc.c


2019-10-29 15:49:25 +0000
Julian Smith <jules@op59.net>
9f39ed4a92578a020ae10459643e1fe72573d134

Bug 701792: Avoid going beyond buffer in GetNumSameData() and GetNumWrongData().

GetNumSameData() compared buffer contents before checking that we are still
within bounds of buffer, which caused the bug.

Have made similar fix to GetNumWrongData() because it has similar error.

Fixes address sanitizer error in:
./sanbin/gs -sOutputFile=tmp -sDEVICE=lips4v ../bug-701792.pdf

contrib/lips4/gdevlips.c


2019-10-29 14:13:25 +0000
Julian Smith <jules@op59.net>
d31e25ed5b130499e0d880e4609b1b4824699768

Bug 701788: include space for string terminator in call to malloc in cif_print_page().

Fixes ./sanbin/gs -sOutputFile=tmp -sDEVICE=cif ../bug-701788.pdf

devices/gdevcif.c


2019-10-28 17:29:34 -0600
Henry Stiles <henry.stiles@artifex.com>
6e6c69487094b877bc56fcc07b9840f6e5b95925

Bug #701803, fix missing Greek symbols.

New symbol set ISO/IEC 8859-7 Latin/Greek alphabet added.

pcl/pl/plsymbol.c


2019-10-28 10:37:46 -0700
Michael Vrhel <michael.vrhel@artifex.com>
7870f4951bcc6a153f317e3439e14d0e929fd231

Bug 701795: Segv due to image mask issue

base/gxblend.c


2019-10-28 14:56:56 +0000
Julian Smith <jules@op59.net>
1e6b2518ed4b130ad649b96bf914558e642e414d

clusterpush.pl: also exclude sanbin and sanobj directories.

toolbin/localcluster/clusterpush.pl


2019-10-28 14:41:35 +0000
Julian Smith <jules@op59.net>
a2df79b5fdf97e1e33503634910ad08672bcee39

Added support for MEMENTO_BREAKAT, equivalent to (gdb) call Memento_breakAt(...).

It can be more convenient to specify this on the command line rather than
manually stop in gdb.

base/memento.c


2019-10-28 14:37:48 +0000
Julian Smith <jules@op59.net>
450da26a76286a8342ec0864b3d113856709f8f6

Bug 701785: fixed sanitizer heap-buffer-overflow in lprn_is_black().

In contrib/lips4/gdevlprn.c:lprn_is_black(), it seems that bpl is not
necessarily a multiple of lprn->nBw, so we need to explicitly avoid straying
into the next line's data.

This also avoids accessing beyond our buffer if we are already on the last
line, and so fixes the sanitizer error.

Fixes:
./sanbin/gs -sOutputFile=tmp -sDEVICE=lips2p ../bug-701785.pdf

contrib/lips4/gdevlprn.c


2019-10-27 19:44:35 -0700
Ray Johnston <ray.johnston@artifex.com>
93cb0c0adbd9bcfefd021d59c472388f67d3300d

Fix Bug 701786: jetp3852 stack corruption caused by width/resolution

This "contrib" driver has a questionable design where it collects the raster
data from the graphics library into a stack based array, but the size of the
array cannot accomodate high resolutions or wide pages. Issue an error and
fail (without stack corruption).

devices/gdev3852.c


2019-10-26 17:14:23 +0100
Ken Sharp <ken.sharp@artifex.com>
2c2dc335c212750e0fb8ae157063bc06cafa8d3e

Color Laserjet device - properly check params

Bug #701796 "Segmentation fault at devices/gdevclj.c:269 in clj_media_size"

The test in clj_media_size() as incorrect, it didn't signal an error if
there was no HWResolution in the param list. This left the parameter
'fres' undefined leading to a potential invalid memory read, or a
divide-by-zero error.

This commit returns an error if we get a param list with no HWResolution
I'm not absolutely certain if this is correct, but at least signalling
an error is better than a seg fault.

devices/gdevclj.c


2019-10-26 15:43:38 +0100
Ken Sharp <ken.sharp@artifex.com>
bfeff28bb56ee4424ac78619792c18bf4f5104ef

Coverity ID #126579 take 2

Commit 13b3c67366aef69beed5f9c7e058c59a03714997 addressed this, but
there were 2 instances and that only fixed one. Fix the other here.

devices/vector/gdevpdfg.c


2019-10-26 15:04:26 +0100
Ken Sharp <ken.sharp@artifex.com>
aba3375ac24f8e02659d9b1eb9093909618cdb9f

Prevent a heap-buffer overrun

Bug #701791 "global-buffer-overflow at devices/gdevpjet.c:177 in pj_common_print_page"

We were not setting the unused bytes at the end of a line to 0, which
later caused us to read uninitialised data from the line, and attempt
to use that as the index into an 8-byte table. If the uninitialised
data was greater than 16 then we would read off the end of the table.

Its 'probably' benign since we aren't using tis data, and we probably
won't try to read from an invalid address, but its poor practice and
its easily fixed. Setting the buffer to 0x00 before we start ensures
that any padding bytes are in the valid range for the table.

devices/gdevpjet.c


2019-10-25 18:48:05 +0100
Robin Watts <Robin.Watts@artifex.com>
4b9e86a33b237740df682369300f1a9507dc63c5

Memento: Fix annoyance with %p

Windows displays %p without a leading 0x. Linux adds a leading 0x.
Use a macro to give consistent results on all platforms.

base/memento.c


2019-10-25 13:52:44 +0100
Chris Liddell <chris.liddell@artifex.com>
17ad4a12dd40799655b71a93de1209a6a0f24204

Coverity issues: Assignment of overlapping union members

Strictly speaking assigning one element of union to another, overlapping
element of a different size is undefined behavior, hence assign to intermediate
variables before setting the other element in the union.

Coverity #: 350159, 350173, 350205, 350176, 350215, 350192

base/gsfunc4.c
base/gsparam.c
pcl/pcl/pgparse.c
psi/zfont2.c
psi/ztype.c


2019-10-25 13:30:56 +0100
Chris Liddell <chris.liddell@artifex.com>
62a1c3cdbb374d2f90b00f7aa276be50961c580a

Tweak the section on building with Visual Studio

doc/Make.htm


2019-10-24 10:15:19 +0100
Chris Liddell <chris.liddell@artifex.com>
e80779ae9f53fac617d1416f7075a1b1b7f7688c

Reduce confusion about contrib.mak dependency

We have two contri.mak files, one in devices/ and one in contrib/, both have
dependency declarations:
CONTRIB_MAK=...

This changes the devices/contrib.mak to use:
DCONTRIB_MAK=...

Prepending the 'D' to avoid the two getting muddled.

devices/contrib.mak


2019-10-25 13:53:31 +0100
Robin Watts <Robin.Watts@artifex.com>
9ae928f80e70e04e89f0c36a7b58332fb0a9b19d

Fix CAL ETS compiler flags.

base/cal.mak


2019-10-24 15:04:58 +0100
Julian Smith <jules@op59.net>
9001678252cc6c4e45251db70b83daae39b7d4ec

Bug 697545 (Memory Squeezing): fixed hpgl_polyfill_using_current_line_type() leak on error.

Need to always call hpgl_grestore().

Fixes this leak:
MEMENTO_FAILAT=15840 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ../pcl5cfts/fts.1552

pcl/pcl/pgdraw.c


2019-10-24 08:31:38 -0700
Robin Watts <Robin.Watts@artifex.com>
d6746f08c592057dfd3abe1b957c8b23971508cc

Memento tweaks: libbacktrace warning/instructions.

If we can't load libbacktrace.so, give a warning that backtraces
will be cryptic.

Add info to memento.h about where people can get libbacktrace
from, how to build it, and where to install it.

Also add some code from Julian Smith to call gdb to extract
backtrace data; this doesn't work for me, so it's disabled
by default for now.

base/memento.c
base/memento.h


2019-10-23 13:29:38 -0700
Nancy Durgin <nancy.durgin@artifex.com>
de22d4d177a5911310d4af0777e87a8809a1622c

Change pdf implementation to use CalGray and CalRGB

It was previously mapping these to DeviceGray and DeviceRGB for some
reason.

See tests_private/pdf/PDF_1.7_FTS/fts_08_0829.pdf for example where this
matters.

Resource/Init/pdf_ops.ps


2019-10-21 17:37:59 +0100
Robin Watts <Robin.Watts@artifex.com>
a1cd6ee4a3724fbf70718483aa702c7af0f0a6cc

Use CAL implementation of ETS in WITH_CAL builds.

base/cal.mak
base/ets.h
base/gxdownscale.c
base/lib.mak


2019-09-27 11:16:23 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
a44d0ce727f2095fbbedb8bf6b1e062fca3c8f01

Bug 697545 : Prevent memory leaks in gx_cpath_assign_preserve.

Update functionality to propagate error codes correctly and release path segments.

Error created using :-
MEMENTO_FAILAT=15840 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.1552

base/gxacpath.c
base/gxcpath.c


2019-09-26 15:08:02 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
4637eeae2415b593d84bb60dbac5369eb2ecc54b

Bug 697545 : Prevent memory leaks in hpgl_LB.

Update code to propagate error codes correctly and prevent font leaks.

Error created using :-
MEMENTO_FAILAT=19935 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.1480

pcl/pcl/pglabel.c


2019-09-26 11:49:08 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
dc3b7d7f6882e1ed1ff41083ff22893efc5c5afa

Bug 697545 : Prevent memory leaks in hpgl_EP.

Update code to propagate error codes correctly and prevent graphic state leaks.

Error created using :-
MEMENTO_FAILAT=15166 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.1470

base/gxstroke.c
pcl/pcl/pgpoly.c


2019-10-23 14:08:02 +0100
Julian Smith <jules@op59.net>
3ff1490e231c8b02ce77386a75f23ac76e97cc29

Bug 697545 (Memory Squeezing): fixed owl.pcl leak in hpgl_draw_current_path().

In pcl/pcl/pgdraw.c:hpgl_draw_current_path() case hpgl_char_fill_edge, ensure
that we call hpgl_grestore() before looking at error from (*fill) (pgs).

Fixes leak at 10093 in:
MEMENTO_SQUEEZEAT=1 membin/gpcl6 -sDEVICE=bit -o /dev/null pcl/examples/owl.pcl

pcl/pcl/pgdraw.c


2019-10-23 15:08:29 +0100
Julian Smith <jules@op59.net>
5ce07cab3d1e9e38401cfaddd0312bd06f48422b

Fix hpgl_call_and_check() macro to not define <code> local variable.

This can conflict with surrounding code. Use <hpgl_call_and_check_code>
instead, which should be unique enough.

pcl/pcl/pgmisc.h


2019-10-23 10:02:02 +0100
Chris Liddell <chris.liddell@artifex.com>
1bb7a148bc6a4e4a8736d27a937465aab95069e5

Revision for a34130a136fa that will actually work

The Coverity report was misleading, and I missed a compiler warning with
commit a34130a136fa.

This resolves the compiler warning, and should keep coverity happy.

base/gstype42.c


2019-10-23 09:39:11 +0100
Chris Liddell <chris.liddell@artifex.com>
6d7243cea061373f592a6d9113626393ff0eb7d8

Coverity ID 350179: Add buffer size check for string

Before we append chars to a string buffer, check it's large enough

base/genconf.c


2019-10-23 09:22:14 +0100
Chris Liddell <chris.liddell@artifex.com>
a34130a136fa9a61af3991224438dbf31b834767

Coverity ID 350219: Fix mistake in TTF post table handling

Mistakenly passing a pointer into a macro, rather than the variable.

base/gstype42.c


2019-10-11 10:20:04 +0100
Robin Watts <Robin.Watts@artifex.com>
5573498b2d9abe918794d377729edeab6b28e1fb

Add arch.h dependency for CAL.

base/cal.mak


2019-10-21 15:12:57 -0700
Ray Johnston <ray.johnston@artifex.com>
a7fe4b47d438c78af0fc03adf030d465cfe0ba4f

Apply DOPS to "bare" PS operator in PDF's

PDF 1.2 defined a PS operator that could be used in streams to execute
PostScript. This went away with PDF 1.3 2nd edition spec., but Ghostscript
retained the functionality. In commit e7086fc6 we disabled the execution
of Subtype /PS streams (requiring -dDOPS to enable them), but the "PS"
operator, that sends PostScript strings to the underlying Postscript
interpreter remained unaffected, leading to Bug 700176 exploit.

This patch also disables the "PS" operator unless -dDOPS is specified.
Using -dDOPS is *NOT* recommended, although the fixes for Bug700176
should prevent that particular exploit.

Resource/Init/pdf_main.ps
doc/Use.htm


2019-10-22 10:57:59 +0100
Ken Sharp <ken.sharp@artifex.com>
b4521b891de48d7f62be739d02749c4aeca2fde8

Fix dvipdf script

Bug #701771 "dvipdf script broken"

Apparently the script requires a trailing '-'

lib/dvipdf


2019-10-22 09:32:05 +0100
Ken Sharp <ken.sharp@artifex.com>
7c836caa3e05a286ac56f39ed45dab65eb979ee9

Update genfontmap.ps for SAFER default

Bug #701766 " genfontmap.ps Unrecoverable error, exit code 1"

The genfontmap.ps program, supplied as part of the support tools in
'toolbin' rather than Ghostscript proper, relies on the non-standard
PostScript extension operator '.sort'.

As part of the security hardening, as many non-standard operators as
possible were removed from Ghostscript when SAFER is set, including
.sort, and with version 9.50 SAFER becomes the default.

This commit simply updates the genfontmap.ps program to check that it
is being run with NOSAFER, emits a warning and exits if this is not the
case. Also update the comments to indicate why we are doing this.

toolbin/genfontmap.ps


2019-10-17 11:51:59 +0100
Chris Liddell <chris.liddell@artifex.com>
95e76aad97b1b1c2da51f7fc7e904168fadb1399

Remove the 136 LL3 font set fontmap files

The fontmap for the type 1 136 set is now in the repo with the font files

lib/Fontmap.URW-136.T1
lib/Fontmap.URW-136.TT


2019-10-17 11:39:18 +0100
Chris Liddell <chris.liddell@artifex.com>
164db4ba0d766e591884079d6fb21ab63829549d

Fontmap: cope better with bare filename maps

We don't automatically add FontResourceDir to the libfile search path, so a
name to plain file name mapping will only work if the directory containing the
file is explicitly added to the search path. For example:

/Dingbats (d050000l.pfb) ;

With this change, in addition to the search path and the bare file name, we'll
also try opening the file in the FontResourceDir, so users can use such custom
mappings simply by adding the font files to the FontResourceDir (usually:
Resource/Font).

Resource/Init/gs_fonts.ps


2019-10-19 11:06:46 +0100
Ken Sharp <ken.sharp@artifex.com>
618c3867b8edec9d0ea757949c926d4290995ac7

Pattern handling- relax a heuristic

Bug #701753 "Error reading a content stream" with pdf using Type3 font"

This file uses a type 3 font with a FontMatrix more usually found in
type 1 font; [0.001 0 0 0.001 0 0]. It is also a coloured font, and
uses a Pattern colour space with a Shading function to colour the text.

The Pattern cell, when scaled by the Font Matrix, results in a mapping
of the step matrix to device space where the matrix determinant is less
than 1/1,000,000. We detect this as a degenerate matrix and throw an
error.

Acrobat renders an empty page.

So relax this heuristic further from 10^-6 to 10^-9, this allows the
file to render and doesn't cause any changes in our regression tests.

Of course, at this cell size, the pattern renders blank, just as it
does with Acrobat.

base/gsptype1.c


2019-10-16 08:18:59 -0700
Ray Johnston <ray.johnston@artifex.com>
7acf36de36e6972be8a892078d214eea8e311cdd

Fix bug 699457: Parameter range checking wrong (would not spot bad values).

devices/gdevtsep.c


2019-10-16 08:04:34 -0700
Ray Johnston <ray.johnston@artifex.com>
1170f928cc98b64a26edc275b66f081be9079cbb

Fix bug 701719: Parens seem wrong -- fixed for clarity.

base/gxclthrd.c


2019-10-16 16:12:50 +0100
Chris Liddell <chris.liddell@artifex.com>
928ae0dbcf9a2307bb33ba8d2abd83274fc34a7d

Change a URL string to a an href link in the footers.

doc/API.htm
doc/C-style.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/Internal.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/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/sample_downscale_device.htm
doc/thirdparty.htm


2019-10-16 06:52:51 -0700
Ray Johnston <ray.johnston@artifex.com>
65dbe88e660adcfba315fe559fcd7fd97628ee49

Fix bug 701718: Use separate 'if' in clist_fillpage.

The intent was to return the error code if clist_close_writer_and_init_reader
failed, THEN run clist_finish_page and similarly return if that fails.

base/gxclrect.c


2019-10-16 06:43:04 -0700
Ray Johnston <ray.johnston@artifex.com>
e22ef03cdd31263ba1266f3d53aef7be4467e405

Fix bug 701715. Problem in thresh_remap.c binary output.

I never use binary output -- just -p for PostScript output, so this
was untested.

toolbin/halftone/thresh_remap/thresh_remap.c


2019-08-15 11:39:51 +0100
Chris Liddell <chris.liddell@artifex.com>
8a3309451ded2335b7f7ab5ebf1c19eebad8b32c

Bring master up to date with 9.50 branch

docs, dates etc

Dates and versions for 9.28 RC 1

Date for 9.28 rc2

Doc updates, changelog, news etc

Update to note explicitly case sensitivity on Windsows

In News.htm and History9.htm

Dates, docs, etc for 9.28 rc3

Dates and docs for 9.28 rc4

Small changelog tweak

Change version to 9.50

Update changelog

Fix a mistake in the news section

Dates etc for 9.50 release

Plus a comment on going to 9.50, rather than 9.28.

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/Internal.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


2019-10-15 09:27:39 +0100
Chris Liddell <chris.liddell@artifex.com>
ac5c8747c9f9e2710a315ff25d41a7b9a592b583

Version number, to dovetail with release

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


2019-10-14 18:29:10 +0100
Chris Liddell <chris.liddell@artifex.com>
e7488d8a4d2bb48d6285d4ba3db1539206f0e67f

Have warning honor -dQUIET

Have the warning about calling .lockfileaccess or .setsafe when the controls are
already in place honor the -dQUIET/-q command line params.

Resource/Init/gs_init.ps


2019-10-14 18:07:29 +0100
Chris Liddell <chris.liddell@artifex.com>
75275c5c001699b32dfdc1d7d7977c8c4c9f2c80

Add words about .currentpathcontrolstate operator

doc/Language.htm


2019-10-14 10:20:19 +0100
Chris Liddell <chris.liddell@artifex.com>
74e468866b53e1a11d641549841b06027266ce39

Update docs on SAFER

to reflect that SAFER is now the default, and remove the comments about making
SAFER the default "in the future".

doc/Use.htm


2019-10-11 15:10:41 +0100
Ken Sharp <ken.sharp@artifex.com>
72ab3591097a2e5ae5201f4a28d3560b019a1019

PDF interpreter - handle ObjStm with contents which are non-delimited

No bug number, confidential file supplied by a customer.

This is in the same area as commit
d9889892feaac3ca09f85d9bbdc001b1aec50cc3

In this case the file is actually completely valid and exposes a flaw
in our processing of ObjStm streams. We 'tokenise' the entire contents
of the ObjStm, for performance reasons, when we first need to read an
object from it. This caused problems if we read too many objects which
was dealt with in the commit above.

In this case, however, what we have is objects which do not have any
delimiter, so the tokeniser carries straight on, instead of stopping
when it reaches the end of the object (as given by the difference
between successive offsets). For example, if we have three null objects
then the (decompressed) stream would read nullnullnull, each object
has a different offset and the length of each is given by subtracting
one offset from the next.

What we were reading was, literally, nullnullnull which of course is not
legal.

This commit leverages off the code in the commit to fix the extra
objects and uses the same approach, we set up a ReusableStream on the
decompressed ObjStm so we can seek around in it, then read each object
by seeking to the offset, setting up a SubFileDecode (so we stop at the
end of the object) and reading the object.

That works as well for this case, albeit with a (negligible in this
case) performance penalty). We check at the end of reading the objects
individually, and if we don't have enough objects then we raise a
warning.

Resource/Init/pdf_base.ps


2019-10-11 12:06:07 +0100
Ken Sharp <ken.sharp@artifex.com>
fbe920c86d42919620a425d0933d9dcbfaa1c3cb

PDF interpreter - do not unconditionally restore state in update_alpha

Bug #701644 "Error: /unregistered in --.pdfexectoken--"

The problem is caused by the insanely complicated (and inefficient)
way the file is constructed. We have a SMask in a Group, which is
enclosed within another Group.

When we call start a transparency mask we call pdf_prepare_drawing()
which calls pdf_update_alpha(). Crucially this is called after we have
entered a substream for an enclosing Group, but it does not begin a
new substream.

However, pdf_update_alpha() assumes that if the smask_id has changed
then a new viewer state has been saved, and the first thing it does
is restore that state. If no such state has been saved (as here) then
the code to restore the viewer state sees this as an error (which it is)

We fix this by checking to see if a viewer state has been pushed before
trying to restore to it.

devices/vector/gdevpdfg.c


2019-10-10 17:13:16 +0100
Ken Sharp <ken.sharp@artifex.com>
9dddc61852d012b867e0353c7897b9c5301e17e6

PDF interpreter - Ignore invalid MediaBox array

Again, no bug, the specimen file is a confidential customer file.

The file contains, on page 60, an invalid MediaBox:

/MediaBox[ 0 0 612 792 0 0 720 917]

The 8 values were unloaded onto the stack, but only 4 were consumed
leading to errors later in processing. This commit checks the length
of the array and if it isn't exactly 4 then it exits and uses the
current page size instead.

Resource/Init/pdf_main.ps


2019-10-10 15:51:13 +0100
Ken Sharp <ken.sharp@artifex.com>
d305e46c4af1af14dfe79f7ebab6d2edf168f068

PDF interpreter - match observed Acrobat processing of Widget annots

No bug for this, arising from a customer file.

It appears Acrobat does not render Widget annotations unless the
annotation dictionary contains a /FT and a /T key, either directly in
the annotation dictionary or inherited from a Form Definition Field
dictionary (via the AcroForm /Fields entry).

This commit checks annotations to see if they are Widgets, then checks
to see if both /FT sand /T are present. If either is missing we walk
back up the FDF heirarchy using the /Parent key, storing any FT or T
keys in the annotation dictionary as we go.

We don't actually care what the associated values are, we only care if
they keys are present, so reversing the lookup is acceptable here.

We then re-test the annotation dictionary for the presence of both keys
and if either is missing we do not render the annotation.

Resource/Init/pdf_draw.ps


2019-10-10 10:15:49 +0100
Chris Liddell <chris.liddell@artifex.com>
797ddfc6ef5f0cdfba664f550fe57acc43f309bb

Fix the logic for permitted directories

The logic to match a permitted path ending in a directory separator with any
file in that directory (but only that directory) was wrong, causing us to
reject such cases.

base/gpmisc.c


2019-10-10 09:29:48 +0100
Ken Sharp <ken.sharp@artifex.com>
d45d594ea5660976a21106ea864eb879801827b1

ps2write - restore missing %%PageTrailer comment

Bug #701659 "Missing %%PageTrailer commen"

An oversight in commit 96c381cce28c27eac182549441a6c5025b0dcdd6
caused the comment to be omitted.

devices/vector/gdevpdf.c


2019-10-09 16:45:31 +0100
Ken Sharp <ken.sharp@artifex.com>
34774ab185f17186b26949f5fee118dee9114d3a

PDF interpreter - fix /None case of Line Ending style

Bug #701622 "pdfwrite device fails with annotation appearance"

This is, in fact, nothing at all to do with pdfwrite. The problem is
that, when generating an Appearance stream for a /Line Annotation which
is defined without an Appearance stream, the /None line ending style
was not popping the copy of the annotation dictionary.

This led to an error in the annotation. If a previous annotation used
transparency, then this would cause the compositor to get confused,
because we would start the transparency in the Line annotation, but
the error meant we would not close the transparency group.

Resource/Init/pdf_draw.ps


2019-10-07 00:02:27 +0100
Ken Sharp <ken.sharp@artifex.com>
b2c1beac237865bde26c7fa921d24d17ecda6fab

pdfwrite - preserve rendering intent

bug #701487 "Renedring intent not preserved by pdfwrite"

The pdfwrite device was not previously handling rendering intent changes
this commit adds a rendering_intent member to the pdfwrite device
structure, initialises it to 1 (absolute colorimetric) and then tracks
changes to the graphics state, emitting /RI entries in ExtGSatet
dictionaries as required.

This shows a number of small progressions in the test suite, and marked
progressions with icc_v4_profile.pdf and icc_rendering_intent.pdf.

devices/vector/gdevpdfb.h
devices/vector/gdevpdfg.c
devices/vector/gdevpdfx.h


2019-10-06 17:42:53 +0100
Ken Sharp <ken.sharp@artifex.com>
faef233630240edfc3ad9f5ea154b5b32ed51c75

pdfwrite - Use CA and ca for text with transparency

Bug #701631 "pdfwrite: mishandling of alphas with Text render mode 2"

The problem is in both the PDF interpreter and pdfwrite. In the past
the PDF interpreter has never been able to create a fill+stroke
primitive, because PostScript doesn't support that. However we added
the ability for pdfwrite to maintain text rendering modes, for reasons
of quality, which breaks that assumption.

Although we added the stroke and fill constant alpha to the C graphics
state when we moved the PDF graphics state into the C graphics state,
nothing actually ever used them. Instead the PDF interpreter sets a
single 'opacity' alpha channel, based on whether the current operation
is a stroke or a fill. Because we could not emit a combined operation
this worked as we would set the opacity separately for each operation.

Of course for pdfwrite this doesn't work, and looking to the future
when the fill+stroke primitive is available in the graphics library,
we will need to do away with the opacity.alpha and properly use the
fill and stroke alphas stored in the graphics state. For now, however,
we need to continue to use the opacity.alpha, but when we are handling
text (in pdfwrite) actually use the values of stroke and fill alpha
instead of opacity.alpha.

So add a 'for_text' boolean to all the routines whihch need to set or
update the alpha, and when writing the ExtGState, if we are handling
text then use CA and ca instead of opacity.alpha.

This has also mean altering the XPS interpreter so that it sets the
stroke and fill alphas as well as opacity.alpha, otherwise pdfwrite
doesn't know which value to use for text operations.

devices/vector/gdevpdfd.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfg.h
devices/vector/gdevpdft.c
devices/vector/gdevpdts.c
devices/vector/gdevpdtt.c
xps/xpscolor.c
xps/xpsimage.c
xps/xpsopacity.c


2019-10-05 14:49:18 +0100
Ken Sharp <ken.sharp@artifex.com>
21a10f9e2cb9134c351fd568fc73222f2917e159

PDF interpreter - Improve PreserveAnnots

PreserveAnnots currenlty works in conjunction with ShowAnnotTypes, but
We should really have a separate control for this.

This commit adds a new /PreserveAnnotTypses (must be set from PostScript
in the same way as ShowAnnotTypes). PreserveAnnots and PreserveAnnotTypes
only work with a device which can preserve Annotations (currently this
is the pdfwrite device only).

If the device supports Annotation preservation, and PreserveAnnots is
true (the default0 then for each annotation we consult the Types array,
if the annotation is to be preserved then we pass it to the device. If
not, then we pass the annotation to the 'draw' routines which will
render teh annotation instead.

Using the two separate controls allows us to selectively control, by
type, whther annotations are preserved, rendered, or simply ignored
altogether.

Also fix an omission, and some typos, in the documentation for
ShowAnnots in Use.htm

Resource/Init/pdf_draw.ps
doc/Use.htm
doc/VectorDevices.htm


2019-10-07 18:41:10 +0100
Chris Liddell <chris.liddell@artifex.com>
61c489110685f7cab8cbbbca7b15d9b5cb2463d0

Bug 701657: Allocate "memory" device in immovable gc memory

Devices are supposed to be allocated in memory that cannot relocate (i.e.
non-gc memory or an immovable allocation). The memory device accessible from
Postscript (makeimagedevice/makewordimagedevice) was being created in regular,
relocatable gc memory.

This caused an invalid memory access when cleaning up subclassed devices, as the
one device in the chain may have moved. So switch to using an immovable
allocation.

base/gsdevmem.c


2019-10-01 10:35:48 +0100
Chris Liddell <chris.liddell@artifex.com>
2d990b065c228802b3913602b4309165e42c08e9

Fix memory corruption setting a halftone

When setting a new halftone in the graphics state, we try to re-use the data
from the existing device halftone.

The problem is that the device halftone can have higher component indices than
there are components in the new halftone we are creating. In this case, we can
end up writing off the end of the components array for the new halftone
structure.

Simply check that the new halftone has enough components before doing the
duplication.

base/gsht.c


2019-09-30 13:40:35 +0100
Ken Sharp <ken.sharp@artifex.com>
f03bac8ec2dabfff5583bf6afdd2b77f1885f8ef

pdfwrite - don't honour /Producer key in DOCINFO pdfmark

Bug #701639 "pdfwrite should not honour the /Producer key in DOCINFO pdfmark"

The Producer in the document information dictionary (and XML Metadata)
is defined quite clearly as the application which produced the PDF file
from its native format.

Ghostscript uses the Producer key (if present in the pdfmark) to set
the Producer, but it should not do so. Adobe Acrobat Distiller (at
least the end user version) does not permit this value to be altered.

On reflection we can see why; in the case of a problem with a PDF file
its important to know which application created it, and we should not
let PostScript obscure that (we already do not pass the Producer
information on when the input is PDF).

The code did already attempt to overwrite any Producer string which
contained 'Distiller' (I have no idea why) and that code contained an
error which could lead to an invalid Document Information dictionary
being created.

This commit removes the ability for DOCINFO pdfmarks to alter the
Producer, which obviously fixes the bug.

However..... it is actually important for our commercial customers to
be able to set this value. A problem with a PDF file created by one of
our customer's products should be reported to that customer, not us, as
we will not be able to investigate the problem while our customer
should be able to. At the very least our customer will know how to
retrieve the configuration of Ghostscript being used.

So permit the commercial version of Ghostscript to set the /Producer
from a pdfmark.

devices/vector/gdevpdfm.c


2019-09-27 13:26:01 +0100
Chris Liddell <chris.liddell@artifex.com>
77f79475fd0419d16f1efe7812a44a9720fef10b

Bug 701634: Correctly handle file name of "\0"

Attempting to open a file with a filename string starting with a NULL
character should be treated the same as if the string was zero length.

Not doing so created a broken file object leading to several operations
resulting in a segfault.

Also, add cleanup in the event of such an error, freeing memory allocated in
preparing the gs stream object.

base/sfxcommon.c
psi/zfile.c


2019-09-27 00:05:37 +0100
Robin Watts <Robin.Watts@artifex.com>
ef597bf4a05814a97d05866868f9b96b98746ae9

Correct Memento usage example in header.

base/memento.h


2019-09-26 10:47:01 +0100
Chris Liddell <chris.liddell@artifex.com>
7db398d549a03ff5d37ec991eb60f01378eac88d

Revised comment for 8992f00edfd1c39154c013489de2a01d2e9a92ee

Make it clearer why the revised behaviour is required.

base/gstiffio.c


2019-09-26 09:34:02 +0100
Chris Liddell <chris.liddell@artifex.com>
8992f00edfd1c39154c013489de2a01d2e9a92ee

Bug 701313: Disable libtiff callbacks when libtiff is shared

It seems that libtiff uses global variables to store the error/warning callbacks
so if two callers in the exe are using the libtiff shared lib, very bad things
happen (usually a segfault).

So, if that's how we're linked, set the callbacks to NULL.

base/gstiffio.c


2019-09-03 18:37:21 -0700
Ray Johnston <ray.johnston@artifex.com>
6293a99abfdc73b8881b2090cd7b01a1fbef5370

Fix pdf14_accum for DeviceN target devices such as display

Also fix display device for DeviceN (-dDisplayFormat=16#a0800).
Not sure when, but it had bit-rotted.

The pdf14_accum device now has the DeviceN devn_params available since
it now includes gx_devn_prn_device_common (rather than gx_prn_device_common).
A pdf14_accum_CMYKSpot device is added that is used when the target device
has more than 4 components. The pdf14_accum_CMYKSpot keeps the target device
(e.g. display) device equiv_cmyk_colors and devn_params updated as the clist
is being written.

base/gdevp14.c
base/gscdevn.c
base/lib.mak
devices/gdevdsp.c


2019-09-25 04:57:22 -0700
Robin Watts <Robin.Watts@artifex.com>
74787042b3259d51538d31556c38239d72539e3f

Run toolbin/headercompile.pl and update dependencies in Makefiles.

Move the definition of x_pixel within the headers to ensure
gdevcmp.h stands alone.

Include a ufst header to ensure that gxfapiu.h stands alone.

base/gxfapiu.h
base/lib.mak
base/tiff.mak
devices/contrib.mak
devices/devs.mak
devices/gdevx.h
devices/gdevxcmp.h
psi/int.mak
toolbin/headercompile.pl


2019-09-25 14:35:00 +0100
Robin Watts <Robin.Watts@artifex.com>
eb7802dc979aaa0e9e43310de0f1e8dcc7b31b2c

Bug 578865: Fix typo

Fix typo in previous commit.

base/gdevp14.c


2019-09-19 12:07:00 +0100
Robin Watts <Robin.Watts@artifex.com>
73bd448d2ebabad9ee31053abf897325a639cba1

Bug 578865: Push transparency group for non idempotent shadings.

Shadings that write the same pixels more than once can be
rendered incorrectly for blendmodes that aren't idempotent
(or for non solid opacities). In such cases, push a transparency
group so that the shading can be written just once, and
then safely blended.

Note that this doesn't capture shadings that are rendered
via zshfill.

base/gdevp14.c
base/gstparam.h


2019-09-23 18:52:16 +0100
Robin Watts <Robin.Watts@artifex.com>
1d1d6dc851e23edb36ac6e5db1bdf0edbba262bd

Knockout groups should knockout the group alpha (and shape) too.

When marking within a knockout group, for each pixel we mark, we
throw away the current colorant values in the destination, and
base the calculations of the new colorant values on the stored
backdrop values.

We were failing to do this for the group alpha and shape
calculations. This could lead to the group alpha getting out of
sync with the actual colorant values. We were seeing this with
shadings (particularly gradient shadings) where the shadings
paint some pixels more than once.

This becomes much more obvious with the forthcoming commit to
use knockout groups for shadings with either transparency or
non-idempotent blend modes.

base/gdevp14.c


2019-09-24 15:48:54 +0100
Chris Liddell <chris.liddell@artifex.com>
05e794d14a2853c45a08d5c49d50d1fa5cadaf6c

Cope with .setsafe(global) being called when already 'SAFER'

As we default to SAFER file controls now, we want to cope with .setsafe and
.setsafeglobal being called either when already SAFER, or called multiple times.

This means adding a .currentpathcontrolstate operator so we don't try to
influence the path control lists after control is activated.

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


2019-09-24 09:18:47 +0100
Chris Liddell <chris.liddell@artifex.com>
5ca729649efc3b041237b8b45bd2d011b70143ff

tiffsep(1): Cope with .tiff ending as well as .tif

devices/gdevtsep.c


2019-09-23 20:04:49 +0100
Robin Watts <Robin.Watts@artifex.com>
d1daff4546ae8fae46fc4acb8b0bef013753488a

Recast validate to use gs_file_name_check_separator.

Avoid using gp_file_name_directory_separator, as windows can
have 2 different directory separators.

base/gpmisc.c


2019-09-23 18:05:00 +0100
Chris Liddell <chris.liddell@artifex.com>
3f4fc81482ecfef51adb4af98f6ac214c7e64bdb

Remove spurious call to gp_validate_path_len()...

...in gx_device_open_output_file()

There is no need to validate the path in gx_device_open_output_file() as it will
be done at a lower level (gp_fopen) for paths that require it (we only validate
*after* the Postscript style %device% paths have been expanded into 'real'
paths).

This also interacts badly with the revised handling of formatted string
file names, hence remove it.

base/gsdevice.c


2019-09-23 17:56:34 +0100
Chris Liddell <chris.liddell@artifex.com>
f874c5b9d2d5a3798dc00e53149c4a470ce5da01

Fix tiffsep(1) interaction with file permissions lists

The previous solution didn't quite work, when using formatted strings for
output file names (i.e. output-%d.tif).

This adds a dedicated gs_remove_outputfile_control_path() to mirror
gs_add_outputfile_control_path() and uses those for the dynamic adding and
removing of separation output file names.

base/gslibctx.c
base/gslibctx.h
devices/gdevtsep.c


2019-09-23 17:11:47 +0100
Robin Watts <Robin.Watts@artifex.com>
a1c253838b0e1ccbadc5c0bdb6e3bde59b3b00a1

Update path validation to accept multiple *'s as special case.

Previously we interpretted multiple *'s as meaning the same as
single *'s. Now we use them to mean "just those chars that
might be created by the use of a %...{d,x,u,i,o,X} format
specifier".

base/gpmisc.c
doc/Use.htm


2019-09-23 16:41:09 +0100
Robin Watts <Robin.Watts@artifex.com>
3147ffb314f344520fb22c8bc57d4afcdc3c9c62

Improve OutputFile handling of %d etc.

Only accept %d (and friends) (as opposed to anything starting with %).
Only accept legal combinations of flags/widths/precision etc.
Generate a more conservative wildcard.

base/gslibctx.c


2019-09-23 09:25:27 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
a38bf66e8e041f21ebb25492e576262a55b318b1

Bug 697545 : Prevent memory leaks and SEGV in pcl_font_header.

Update pcl_font_header to avoid freeing uninitialised font structure and also
double freeing the font.

Error created using :-
MEMENTO_FAILAT=17247 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0573

pcl/pcl/pcsfont.c


2019-09-22 20:11:00 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
893018e1c7aca3218555701208cc41daee34b8c4

Bug 697545 : Prevent memory leaks in pcl_execute_macro.

Prevent memory leaks on error.

Error created using :-
MEMENTO_FAILAT=15270 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.1100

pcl/pcl/pcmacros.c


2019-09-20 12:38:02 -0700
Ray Johnston <ray.johnston@artifex.com>
adc3adfdf30f625444203a7c624c3fa123cfddd2

Slight improvement to "permit-file-***" parameter documentation.

doc/Use.htm


2019-09-20 11:17:53 -0700
Ray Johnston <ray.johnston@artifex.com>
829bfe72c69091da7f0d7c1243a7647114619070

Fix tiffsep and tiffsep1 with new file access control and SAFER mode

The tiffsep and tiffsep1 synthesize output file names with the outputfile
and the separation color name, but the 'open' of these filenames would
fail since they were not included on the permit_file_writing list.
Add the full filename before opening, and remove the names after closing.

devices/gdevtsep.c


2019-09-20 11:53:10 -0700
Robin Watts <Robin.Watts@artifex.com>
baad48ab4b35dc9edf0317a1773d9efc7631f2d7

Squash stupid const warning.

base/gslibctx.c


2019-09-20 19:42:01 +0100
Robin Watts <Robin.Watts@artifex.com>
3aa9b059018bb49ddf67a87ddd87e01157143b99

Squash some "const" warnings.

pcl/pl/plmain.c


2019-09-19 11:51:40 +0100
Robin Watts <Robin.Watts@artifex.com>
a09321624369d215a733fb991bf48c300c90107a

Remove some needlessly passed parameters.

For I am a bear of tiny brain, and such things confuse me.

base/gdevp14.c


2019-09-20 17:49:57 +0100
Robin Watts <Robin.Watts@artifex.com>
02108ce46f9beafbfa733598164a6ad254ada7ca

Fix "permit-file-xxxx" handling.

Ray spotted that gs_add_explicit_control_path was adding 17
to arg before using it. 17 happens to be the right amount
to add for "--permit-file-read=", but the wrong amount for
write/control/all.

Update the code to call it with the correct arg pointer
to start with.

Also, update a couple of routines to cope with being called
with NULL strings.

Also use enum values in switch rather than 0, 1, 2.

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


2019-09-18 20:40:42 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
c0df83637a6234f804bef5a7ef31fe1bc5b66d78

Bug 697545 : Prevent SEGV in append_macro.

Prevent SEGV if append_macro is called with a NULL pointer and safe guarded
calls to chunk_resize_object and chunk_object_size. Also resolved leak when
resetting macros.

Error created using :-
MEMENTO_FAILAT=14839 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.1060

base/gsmchunk.c
pcl/pcl/pcmacros.c
pcl/pcl/pcparse.c


2019-09-19 11:02:48 +0100
Chris Liddell <chris.liddell@artifex.com>
071b96290c5e524291bb33b132e2cea3efd5f98e

Make missing jbig2 decoder fatal error.

If we have neither Luratech nor jbig2dec, have configure fail, unless
explicitly run with --without-jbig2dec

configure.ac


2019-09-18 17:18:29 +0100
Ken Sharp <ken.sharp@artifex.com>
d9889892feaac3ca09f85d9bbdc001b1aec50cc3

PDF interpreter - handle ObjStm containing more objects than declared

There's no bug number for this one, I can't easily create a reduced file
without inadvertently fixing the problem, and I don't want to put the
customer file into Bugzilla.

The problem is that the file contains an ObjStm (a compressed stream
containing a sequence of PDF objects) which contains more objects than
the stream declares. Not only that, but the extra object is neither the
first nor the last object, so its not trivial to ignore.

Most consumers handle ObjStm constructs by using the 'catalog' at the
head of the stream to find the offset of each object in the stream and
then reposition to that object and read a single PDF object (note that
objects in an ObjStm do not begin with 'obj' and do not end with
'endobj') which is IMO putting a lot of faith in the consumer's
ability to detect a single object.

For performance reasons Ghostscript's PDF interpreter reads *all* the
objects in the ObjStm immediately and stores them, thus trading memory
use for performance (we only need to read and decompress the objects
once). This approach is totally defeated when there are more objects
than expected, because we don't know which object relates to which
object number (no 'x y obj' in an ObjStm).

In this commit we spot the discrepancy; if there are too few objects we
exit immediately with an error (technically we could do something about
this too, provided the missing object is never used). If there are extra
objects then we move to a fallback.

We discard all the objects we've read, then use the offsets in the
'catalog' to calculate the position and length of each object in the
ObjStm. We position the file pointer to the start of the object and
use a SubFileDecode filter to limit the number of bytes read to the
difference between the offsets. We then use the existing code to read
all the objects in that stream. If we get more than one then we discard
all but the first.

Repeat the above until we reach the last object in the catalog; that has
no known length so just read from there to the end of the stream.

The complications are all around getting the objects on the stack in
the order expected by the code which follows, and defines the actual
objects.

Resource/Init/pdf_base.ps


2019-09-18 14:28:32 +0100
Robin Watts <Robin.Watts@artifex.com>
107aae1f353db3b62f8b714c5100ec7bc180f2fb

Tri/QuadriLinear changes for lcms2mt.

Add a mechanism so that we can force lcms2mt to use
TriLinear (or QuadriLinear) interpolation for specific
transforms. This is primarily useful so we can get
"best case" transforms which we can use as a baseline
for our accelerations.

The use of TriLinear/QuadriLinear is governed by a new
cmsFLAG bit, passed in to link creation. Unfortunately,
these flag bits are not passed all the way down to where
we actually need them. To avoid having to add an extra
flags argument in many places, I stash the flags in a
new field in the cmsContext. This is safe, if not entirely
pretty, as each context will only be used in a single
thread at a time. If this was a function used for more
than just testing, we'd consider doing it in the neater
(but more invasive) way.

lcms2mt/include/lcms2mt.h
lcms2mt/src/cmscnvrt.c
lcms2mt/src/cmsintrp.c
lcms2mt/src/cmsopt.c
lcms2mt/src/lcms2_internal.h


2019-09-16 11:32:33 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
0b05dca78aaa456ba7b55b853917a4ae68a6fd38

Bug 697545 : Prevent memory leaks in show_char_background.

Prevent memory leaks on error and then later releasing graphic state.

Error created using :-
MEMENTO_FAILAT=15988 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0891

pcl/pcl/pctext.c


2019-09-17 10:37:58 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f40631e7592ed1287b2121840b3345acb1bdb1a8

Bug 697545 : Prevent leak in gx_image_enum_begin.

Prevent leak in gx_image_enum_begin by freeing clip_dev.

Error created using :-
MEMENTO_FAILAT=15565 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0954

base/gxipixel.c


2019-09-17 09:02:49 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
91d18aec6a19a0d3b341701d10355278f4703fdd

Bug 697545 : Prevent SEGV in download_pcl_pattern.

The pattern is consumed by pl_dict_put during errors so remove second attempt to free it.

Error created using :-
MEMENTO_FAILAT=15501 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0954

pcl/pcl/pcuptrn.c


2019-09-17 11:42:13 +0100
Chris Liddell <chris.liddell@artifex.com>
8c5348ae5fc35b449aa68eb6668cb6cbc6f345e0

Fix file permissions interaction with '@' command line

If an options file (prefixed '@' on the command line) followed something that
required initialising the Postscript interpreter (such as a '-c' option),
opening the file would potentially fail because file permissions had been
activated by the interpreter.

Add and remove the file from the permit reading list before attempting to open
it.

base/gsargs.c


2019-09-16 15:10:46 +0100
Chris Liddell <chris.liddell@artifex.com>
955c431ab611efd9a74e62a762cdc1ab9f64e14a

Add explicit "flush" after warning message.

The warning messages could get trampled on (due to buffering) by messages on
stderr, flushing ensures the warning is emitted as intended.

Resource/Init/gs_init.ps


2019-09-13 09:33:20 +0100
Chris Liddell <chris.liddell@artifex.com>
2b3ed0ea5d07005e64badfb9212911a725fefb94

Have .setsafe/.setsafeglobal undefine operators

In SAFER, we undefine certain delicate operators (mostly transparency related
ones), but we weren't doing so if SAFER was enabled using .setsafe

This means some rejigging to keep NOSAFER and DELAYBIND working.

Resource/Init/gs_init.ps


2019-09-12 14:23:10 +0100
Chris Liddell <chris.liddell@artifex.com>
b3a1114d04a82e534d915b125eb34de21317993a

If set, add PCLFONTSOURCE value to permit_file_reading list

pcl/pl/pjparse.c


2019-09-11 13:07:02 +0100
Chris Liddell <chris.liddell@artifex.com>
0350a0ab56e7b180d62af9423313d6c70345b386

Bug 701561: 'reduce' paths before adding to permit lists

Before attempting to open files, we pre-process the requested file name to
remove surplus/unnecessary elements: i.e. './././file' would be reduced to just
'./file', or '../dir/../dir/../dir/file' would be reduced to '../dir/file'.

The 'reduced' path is what we try to open, hence it is also what we check
against the file permissions list before we allow files to be accessed.

That being so, we should also 'reduce' paths as we add them to the permissions
lists - thus the permissions list creation and checking are consistent.

base/gslibctx.c
base/lib.mak


2019-09-15 12:18:48 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
511260d72a4b6df9bd2ba48e022f7c3921b547cb

Bug 697545 : Propagate error codes from pcl_break_underline correctly.

The code has been updated to correctly propagate error codes from all
instances of pcl_break_underline.

pcl/pcl/pccprint.c
pcl/pcl/pcfont.h
pcl/pcl/pcpage.c
pcl/pcl/pcpatrn.c
pcl/pcl/pcpatxfm.c
pcl/pcl/pctext.c
pcl/pcl/pcursor.c


2019-09-11 14:10:27 -0700
Ray Johnston <ray.johnston@artifex.com>
c917d64d73fae679d445b233662e0ef4480078f6

Fix Bug 696333. Allow large bitmaps in clist when writing tile cache.

When writing bits to update the tile cache, we don't need to restrict to
a single command buffer as with the copy_mono and copy_color commands.

Progressions on:
tests_private/comparefiles/Bug694385.pdf.psdcmyk.300.1..gs
tests_private/pdf/sumatra/2028_-_invisible_patterns.pdf.psdcmyk.300.1..gs
tests_private/ps/ps3cet/09-47B.PS.pdf.pkmraw.300.0..gs_pdf
tests_private/ps/ps3fts/176-01.ps.psdcmyk.300.1..gs

base/gxclbits.c
base/gxcldev.h
base/gxclrect.c


2019-09-12 10:37:42 -0700
Ray Johnston <ray.johnston@artifex.com>
d79d17251261637b672f8518144ffffc42e1eb0e

Fix SEGV with flp device and PCL with clist mode and large BandHeight.

If the 'clist_init' fails initially (with rangecheck) due to the buffer
space too small for the BandHeight specified, we loop in the caller after
increasing the buffer size, but clist_init left "is_open" false when failing.
Add save_is_open in gdev_prn_setup_as_command_list so that we can restore it
if the clist_init eventually suceeds.

The SEGV was with image_data because re-opening the flp device reset the
"obsolete" procs to the default, so flp_image_data was replaced by the
gx_default_image_data, but no begin_image had been performed (flp_begin_image
skipped this since we were not yet at the FirstPage).

base/gdevprn.c
base/gxclist.c


2019-09-16 18:53:49 +0200
Sebastian Rasmussen <sebras@gmail.com>
8b0ed52ead9605cae14939362dbf9cdf22b9746c

Update jbig2dec stuff for 0.17 release.

jbig2dec/CHANGES
jbig2dec/jbig2.h
jbig2dec/jbig2dec.1


2019-09-16 18:48:36 +0200
Sebastian Rasmussen <sebras@gmail.com>
79e2d671b672f3bc4cca09808dd683b71eff702a

jbig2dec: Use the same contact information everywhere.

jbig2dec/README
jbig2dec/configure.ac.in
jbig2dec/jbig2dec.1


2019-09-16 16:12:32 +0100
Paul Vojta <vojta@math.berkely.edu>
7e49d51de2b14f9a4ca873135ba3c8d7aa56256f

Documentation - fix some typos

Bug #701589 "Minor documentation problems in 9.28-rc2"

Thanks to Paul Vojta for pointing these out. Unfortunately we cannot use the
supplied patch, as it includes alterations to History9.htm, which is auto-
generated from the commit logs. The remaining changes are applied here.

doc/Language.htm
doc/Use.htm


2019-09-11 12:18:51 +0100
Chris Liddell <chris.liddell@artifex.com>
e3d2cd4b2f13573962105d1761e7bb58d5f079c9

Bug 701563: pdfwrite annotation pdfmark /Border key

Despite the spec saying the values for the /Border key are in user space
coordinates, Distiller appears to pass the values through to the output PDF
untouched (no rescaling - unlike the values for /Rect, also in user space,
according to the spec, which it does scale/translate). Ghostscript/pdfwrite
did scale the /Border values.

This just changes pdfwrite to write the values out unchanged.

devices/vector/gdevpdfm.c


2019-09-16 09:56:52 +0100
Ken Sharp <ken.sharp@artifex.com>
4ca426a86125b7bf2f52c00fbba1cef1395ea011

Documentation - add a note about SAFER for PDF/X ICC profiles

Bug #701553 "Examples of PDF/X and PDF/A conversion should be updated for Ghostscript 9.28"

ICC profiles required for PDF/X and PDF/A output need to be readable
in order to work when -dSAFER is true (the new default). This wasn't
clear from the documentation, so add a note about it.

As noted in the bug report, it is possible to embed the profile in the
PostScript code, but as Chris says this is probably beyond reasonable
expectations of the average user; they simply won't change the example
and will then complain that it isn't correct. Users capable of making
this work almost certainly have enough knowledge to realise they can
do this instead of making the profile readable.

doc/VectorDevices.htm


2019-09-13 10:28:37 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e0238104296a361d2dfcc678075e32f4c2070c52

Bug 697545 : Propagate error codes from pcl_set_cap_x and pcl_set_cap_y correctly.

The code has been updated to correctly propagate error codes from all instances
of pcl_set_cap_x and pcl_set_cap_y.

pcl/pcl/pcfontpg.c
pcl/pcl/pcjob.c
pcl/pcl/pcpage.c
pcl/pcl/pcsfont.c
pcl/pcl/pcstatus.c
pcl/pcl/pcursor.c
pcl/pcl/pcursor.h
pcl/pcl/rtgmode.c


2019-09-12 07:59:03 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
29f3e8d45595f443170bf13290404be4d34b5a2e

Bug 697545 : Propagate error codes from pcl_do_CR and pcl_do_LF correctly.

The code has been updated to correctly propagate error codes from all instances
of pcl_do_CR and pcl_do_LF.

pcl/pcl/pcfontpg.c
pcl/pcl/pcparse.c
pcl/pcl/pctext.c
pcl/pcl/pcursor.c
pcl/pcl/pcursor.h


2019-09-12 19:41:47 +0100
Robin Watts <Robin.Watts@artifex.com>
afe11ca136aa173541ed0df09b8c189d2344f381

Fix various printer devices to properly call spec ops.

Various printer devices (psd, psdcmykog, tiffsep, tiffscaled)
were passing the spec ops on to gx_default_dev_spec_op rather
than gdev_prn_dev_spec_op.

The most obvious implication of this was that we'd sometimes
get a warning about printer devices having a private spec op.

devices/gdevcmykog.c
devices/gdevpsd.c
devices/gdevtsep.c


2019-09-12 17:09:50 +0100
Robin Watts <Robin.Watts@artifex.com>
3b2ad1f24d2e9705481f9feb6835aa3e851726ac

Bug 701568 followup: Fix RLE compressor.

The previous fix to the RLE compressor reveals an additional
existing issue to do with us not checking whether we have
space in the buffer to write the EOD byte.

Fixed here.

base/srle.c


2019-09-12 09:35:01 +0100
Robin Watts <Robin.Watts@artifex.com>
68c7275d4a580dca6c0ed3798f3717eea3513403

Bug 701568: Fix gdevpx.c RLE stream handling.

The current code in pclxl_write_image_data_RLE passes
lines of data to the RLE compression routine. It tells
each invocation of that routine that this is the "last"
block of data, when clearly it is not.

Accordingly, the compression routine inserts the "EOD" byte
into the stream, and returns EOFC.

Independently of the return value used, having multiple EOD
bytes in the data is clearly wrong. Update the caller to only
pass "last" in for the last block.

The code still returns EOFC at the end of the data, so update
this final call to accept (indeed, expect) that return value
there.

devices/vector/gdevpx.c


2019-09-10 14:22:32 +0100
Robin Watts <Robin.Watts@artifex.com>
13a560a4d13d51e4dd9f7dd48b27a6ebe681f877

Update CAL makefile for NEON cms functions (correction)

Add NEON flags and includes.

base/cal.mak


2019-09-10 14:22:32 +0100
Robin Watts <Robin.Watts@artifex.com>
61cff6434022bb4c444bd500da0628302abfb35e

Update CAL makefile for NEON cms functions.

base/cal.mak


2019-09-10 20:26:38 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
be793aa94180e06135fd7fec36b6f6ab9ab67519

Bug 697545 : Prevent memory leaks in gx_image_enum_begin.

Prevent memory leaks on error and then later releasing graphic state.

Error created using :-
MEMENTO_FAILAT=15242 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0720

base/gxipixel.c
pcl/pcl/pcparse.c


2019-09-09 21:41:16 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
08c1e576fc09fcc7fdf5cd935d91fdfea1e7f0f9

Bug 697545 : Propagate error code in pcl_enter_graphics_mode.

Propagate error code in pcl_enter_graphics_mode to prevent trying to use an
uninitialised variable later leading to SEGV.

Error created using :-
MEMENTO_FAILAT=15210 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0720

pcl/pcl/rtgmode.c


2019-09-10 09:04:46 -0700
Ray Johnston <ray.johnston@artifex.com>
8675b40266cbf9771a08f4178a6009cfd17e0ba1

Fix bug 701550, problem with forall on strings.

Hard to believe, but this problem has existed since at least version 3.33.
The 'string_continue' function altered the size which was used to decide if
there were still characters to be processed BEFORE invoking the 'push(#)' macro.
If the 'push(1)' encountered a full stack segment, it would return stackoverflow
so that the operand stack could be extended. This meant that the decision to
stop enumerating the string would end early (depending on how many times the
stackoverflow occurred).

Usually the procedure of the forall would either consume the character (reducing
the stack), or add an element to the stack triggering the stack extension before
the next execution of string_continue, but -c "401 string { dup } forall count ="
results in only 800 stack elements (rather than 802 as expected).

psi/zgeneric.c


2019-09-08 13:30:52 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
d9e1d9474e5e21fe8ed9a451b91c48233e629eee

Bug 697545 : Prevent memory leaks and memory corruption.

Prevent several memory leaks in pcl_enter_graphics_mode by releasing graphic state.
Also prevent memory corruption by propagating error code from pcl_set_drawing_color.

Error created using :-
MEMENTO_FAILAT=14648 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0861.new

pcl/pcl/pcdraw.c
pcl/pcl/rtgmode.c


2019-09-09 14:19:33 +0100
Robin Watts <Robin.Watts@artifex.com>
bc48c29c5e86e6c528e23140c71ecfb58588333f

Optimise Eval{5,6,7,8}Inputs{,Float}.

Only use 1 Temporary array, and avoid needless work in the
0xFFFF cases.

lcms2mt/src/cmsintrp.c


2019-09-09 11:03:59 +0100
Robin Watts <Robin.Watts@artifex.com>
63e1fd40674a4f89f6593098cf100382061753e5

Tweak Eval4InputsFloat for speed.

Move to the Pentachoronal Interpolation algorithm.

lcms2mt/src/cmsintrp.c


2019-09-06 18:04:17 +0100
Robin Watts <Robin.Watts@artifex.com>
1cc72912138544dcf00ed0dbc77ceaf47de04e91

Tweak Eval4Inputs for speed.

In coding the SSE version for CAL, I spotted a slightly
preferable test that allows us to capture some special
cases for free. These special cases accelerate some
useful cases including:

* C=M=Y=K (such as when all 0 = white?)
* C=M=Y (such as when pure black)
* M=Y=K (possibly useful in case we ever have profiles that
store K first).

lcms2mt/src/cmsintrp.c


2019-09-06 17:10:22 +0100
Robin Watts <Robin.Watts@artifex.com>
3f46434c0fe3707f53a825f39fa1bab8c0875c03

Update CAL initialisation to register second lcms2mt plugin.

The first plugin deals with transformations. The second deals
with interpolation.

base/gsicc_lcms2mt.c


2019-06-13 01:35:36 +0200
Sebastian Rasmussen <sebras@gmail.com>
b5e5ed8620f348e0fa619171d6f05a966a4bcf83

jbig2dec: Validate coordinates when add image onto page.

Detected by Coverity in CID 94850.

jbig2dec/jbig2_page.c


2019-06-12 18:55:16 +0200
Sebastian Rasmussen <sebras@gmail.com>
ccc1a52f59194193450747e41006982d322c43a5

jbig2dec: Avoid extending page image beyond INT_MAX pixels high.

Detected by Coverity in CID 95080.

jbig2dec/jbig2_page.c


2019-06-12 18:52:44 +0200
Sebastian Rasmussen <sebras@gmail.com>
758951f873b4b80de3c11294c3bc76ca0d6144d7

jbig2dec: Validate range of Huffman Table range values.

Detected by Coverity in CID 94835.

jbig2dec/jbig2_huffman.c


2019-06-07 13:29:40 +0200
Sebastian Rasmussen <sebras@gmail.com>
cd815dfe5e8db6e997466765218c80bb54902234

jbig2dec: Avoid double checks for negative coordinates.

Negative coordinates are already handled prior in the function
by falling back to the unoptimized case.

This was detected by Coverity in CID 303984 and CID 303985.

jbig2dec/jbig2_image.c


2019-07-03 02:27:40 +0200
Sebastian Rasmussen <sebras@gmail.com>
1ae9b9b92bfa6fef04a50b8f27c3dc6e9e03fba0

jbig2dec: A small collection of code cleanups.

* Refer to Jbig2ArithCx for memsetting in case it ever changes.
* Fix typo.
* Avoid using local variable when unnecessary.

jbig2dec/jbig2.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2019-06-21 15:02:14 +0200
Sebastian Rasmussen <sebras@gmail.com>
14cc5cb07861b8bd8c3a2cfd1d7ac21dd98fa202

jbig2dec: Add all ubc test files.

jbig2dec/test_jbig2dec.py


2019-06-14 03:27:31 +0200
Sebastian Rasmussen <sebras@gmail.com>
49a6ff2b166a4cda4d7b8c9d8192bb6f419c7ca3

Bug 701197: jbig2dec: Fix incorrectly computed halftone skip mask.

Halftone regions using a skip mask and negative horizontal grid origin
offsets caused issues due to multiplying signed and unsigned integers.
The mixed types expression was computed unsigned unsigned arithmetic
before being converted back to a signed integer. This meant that an
expected negative value became positive.

Several of the test files mentioned in the README rendered incorrectly,
e.g. 200-6-45.jb2. With this fix all files render correctly again.

jbig2dec/jbig2_halftone.c


2019-06-14 15:09:12 +0200
Sebastian Rasmussen <sebras@gmail.com>
8719833a6a4242880ad8b81cb8fe19e03667af52

jbig2dec: Avoid duplicate declarations of Huffman tables in test code.

This is done by moving the tables into a separate compilation module and
declaring the tables extern in the header file that is used elsewhere.

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


2019-06-14 14:51:01 +0200
Sebastian Rasmussen <sebras@gmail.com>
d75727a7fd5efb2245c7b0d0b33ee8611446c150

jbig2dec: Fix leak of huffman decoder state in test code.

jbig2dec/jbig2_huffman.c


2019-06-14 14:50:09 +0200
Sebastian Rasmussen <sebras@gmail.com>
b3f859987f152e13ab141143234f686749f2caf7

jbig2dec: Declare internal data array static.

jbig2dec/jbig2_arith.c


2019-06-14 14:47:44 +0200
Sebastian Rasmussen <sebras@gmail.com>
49fa7d21bc555a96e19318b56301185f12f68c55

jbig2dec: Fix leak of log message in command line tool.

jbig2dec/jbig2dec.c


2019-06-21 15:02:02 +0200
Sebastian Rasmussen <sebras@gmail.com>
314250a3126243a228249ebf1e6272c0beaec9d6

jbig2dec: Verify file hashes of test files during testing.

Previously jbig2dec would accept any file with the same name.

jbig2dec/test_jbig2dec.py


2019-06-14 14:49:21 +0200
Sebastian Rasmussen <sebras@gmail.com>
a9b92d33e7ed5e06d0728d6a1be771d8b464c50e

jbig2dec: Expect test files to reside inside jbig2dec directory.

jbig2dec/test_jbig2dec.py


2019-06-14 15:18:45 +0200
Sebastian Rasmussen <sebras@gmail.com>
8b3ffd237746e2bab2867ad460e8635a79cd5916

jbig2dec: Indent test code by spaces like the rest of the code.

jbig2dec/test_jbig2dec.py


2019-06-14 22:18:14 +0200
Sebastian Rasmussen <sebras@gmail.com>
2e957c0b1afc6d2d705c9d075fc55db2de5df854

jbig2dec: Make tests expect that some test files return white image.

Previously these tests would just error out and jbig2dec would not
return any output file at all. Now, jbig2dec parses as much as
possible, while emitting warning/error messages. In the case of a
few of the test files the end result is a white image.

jbig2dec/test_jbig2dec.py


2019-06-14 15:15:53 +0200
Sebastian Rasmussen <sebras@gmail.com>
1c5c3a1f14c85582d09ab58f55b1fd83435b6562

jbig2dec: Indent Makefiles with tabs like the rest of the Makefiles.

base/jbig2.mak


2019-09-03 23:54:52 +0100
Robin Watts <Robin.Watts@artifex.com>
5a6832ca60dfc34cb9a0680590cbd086f528fd22

Implement HyperPentahedral interpolation within lcms2mt.

This accelerates conversions from 4 component spaces, such as
CMYK.

base/gxfill.c
lcms2mt/src/cmsintrp.c


2018-10-31 20:22:11 +0100
Sebastian Rasmussen <sebras@gmail.com>
1c6d485f4ba59072fba1a73f8f61071b00d7a7e6

Bug 700088: Report error if all wanted J2K components are not decoded.

Ghostscript used to attempt to use even the undecoded components.
The source code for upstream's opj_decompress tool avoided this by
a workaround along with a comment indicating that this ought to be
done in the library (so all clients, e.g. Ghostscript will benefit
from it). With this commit the library will error out if not all
requested components are successfully decoded. Thus Ghostscript
will no longer crash.

Reported in https://github.com/uclouvain/openjpeg/issues/1158
sent upstream in https://github.com/uclouvain/openjpeg/pull/1164
and finally committed in e66125fe260deee49fdf6e9978d9bd29871dd5bb

openjpeg/src/bin/jp2/opj_decompress.c
openjpeg/src/lib/openjp2/j2k.c


2019-09-03 12:34:55 -0700
Michael Vrhel <michael.vrhel@artifex.com>
b7d32c453538bee41c34f8a77a3feb1dcc0ce759

Undo commit 95f7befcec1b30fd5014c8ad616485d32901ce33 for release

Proper handling of the page group color space is going to require
a more complex solution whereby we ensure that we do the final
alpha blending in the page group color space and not the target
device color space.

base/gstrans.c


2019-09-03 08:52:16 -0700
Michael Vrhel <michael.vrhel@artifex.com>
40934a68930a1d6a41a26df694e1e50fe3c60202

Add -sBlendColorProfile into Use.htm

doc/Use.htm


2019-09-03 18:15:56 +0100
Robin Watts <Robin.Watts@artifex.com>
e63504054baea4275af88e95418b5282c4394685

Avoid potential UMR with arg checking in arg sanitization code.

base/gslibctx.c


2019-09-02 17:16:45 +0100
Robin Watts <Robin.Watts@artifex.com>
cfdb64eec150da48dea5063b14ae7596e6b7050a

Proper fix for deep color overprint.

The previous fix confused memset and memcpy. Properly write the
(native endian) 16 bit color values into the big endian buffer.

base/gsovrc.c


2019-09-02 12:59:33 +0100
Robin Watts <Robin.Watts@artifex.com>
eeeb033d21f22b128900ebc998668c87be725f7d

Fix deep color mattes.

As seen with the content vanishing when rendering
tests_private/pdf/sumatra/uninitialized_value_with_JPX_images.pdf
to psdcmyk16. The Softmask on the image has a Matte of [1,1,1]
and the calculations in the current code overflow, meaning that
it comes out as completely white.

We resort to 64bit to avoid the overflow. Mattes are vanishingly
rare, so speed shouldn't be an issue. We can revisit if we ever
find a case that matters.

base/gdevp14.c


2019-08-31 12:45:47 +0100
Robin Watts <Robin.Watts@artifex.com>
5569e2b2057a25ff1fe0b2b5106e71f2b5142f5c

Update overprint hl_color code to cope with 16bit devices too.

base/gsovrc.c


2019-08-31 12:16:40 +0100
Robin Watts <Robin.Watts@artifex.com>
51dbfc90fdc681f4500b498cec52056fb0d2224b

Fix deep color transparency overprint.

The component copy loop at the end of the blend could fail to copy
enough entries.

base/gxblend.c


2019-08-30 15:16:34 +0100
Robin Watts <Robin.Watts@artifex.com>
1e48a71a99beb5870edadf0754e2c3bcf6a86f87

Avoid overflow in deep color luminosity calculations.

Resort to 64bit as scale calculations are not constrained
to the usual 16bit range.

base/gxblend.c


2019-08-29 10:02:49 +0100
Chris Liddell <chris.liddell@artifex.com>
59660b5d998b53df383192aee71b7439a424be47

Fix clearing of the drag and drop file list

Because we have to store the list of file names from drag and drop events, in
order to correctly add and remove them from the permit file read list, we also
want to clear the lists before we destroy the "text" window object.

The problem is, this happens after we shutdown Ghostscript and unload the dll.

This moves that clearing of the list into function that we call before we
shut down.

psi/dwmain.c
psi/dwtext.c
psi/dwtext.h


2019-08-28 10:14:52 +0100
Chris Liddell <chris.liddell@artifex.com>
94742723659fb4bba6b50ad29123d4ff38a9ebd6

Fix path permissions added from cidfmap.

From the cidfmap, we accumulate a list of unique directory paths a we process
cidfmap and then add them - when I did that code, I forgot that to allow access
to the directory, we need a trailing directory separator.

Add that before calling .addcontrolpath

Resource/Init/gs_cidfm.ps


2019-08-27 16:49:30 +0100
Chris Liddell <chris.liddell@artifex.com>
4135d3b50a66dc67eb7f4f4ad360fdf703783141

Fix font file finding with -P

In trying to reproduce the issue that inspired commit dea69cd04964, I noticed
that font file searching wasn't working correctly with -P specified on the
command line.

Previously, it could just end up with us not finding a font we should have, but
with dea69cd04964 it would result in a typecheck error.

This ensures the stack is always how it should be after the findlibfile
call

Resource/Init/gs_fonts.ps


2019-08-22 16:10:03 +0100
Chris Liddell <chris.liddell@artifex.com>
2b9ab0d54ab2299b3db94e57f45cfc52f6045e62

Make it clear: file/path matching is always case sensitive

even on Windows.

doc/Use.htm


2019-08-29 19:50:08 +0100
Robin Watts <Robin.Watts@artifex.com>
cc2cbb8c78acdff736a966eb40ca22a6a7c52b26

Fix overflow in 16bit blending calculations.

The blending code uses the following construction in
several places:

src_scale = ...; /* a value between 0 and 0x10000 */
tmp = (y-z) * src_scale + 0x8000;
foo = x + (tmp>>16);

Where x,y,z, are all expected to be in the 0...0xffff range.

Due to y-z having a sign bit, this can overflow a 32 bit tmp.

We therefore sacrifice a bit of accuracy in src_scale to get
correctness.

base/gxblend.c
base/gxblend1.c


2019-08-28 14:13:27 +0100
Robin Watts <Robin.Watts@artifex.com>
8c5059661a48e2e17d0f15c7c6936510192728b6

Remove outdated FIXME's.

base/gdevp14.c


2019-08-28 12:50:36 +0100
Robin Watts <Robin.Watts@artifex.com>
f531552c99a04f003412f7a83d4661e927f88d40

Bug 701446: Avoid divide by zero in shading.

The previous commit for this bug was enough to solve the problem
for ppmraw, but not, it seems, for other devices. This addresses
the division by zero more directly.

base/gxshade6.c


2019-08-27 20:13:02 +0100
Robin Watts <Robin.Watts@artifex.com>
25f7cb4da347610dd49bd8001746605f1a29caa8

Fix deep color transparency saturation blending.

Problem seen with:

tests_private/pdf/PDF_1.7_FTS/fts_25_2513.pdf.psdcmyk16.300.1

base/gxblend.c


2019-08-27 17:45:57 +0100
Robin Watts <Robin.Watts@artifex.com>
b9e4b4e4d97a2f0c32596fed0342fb83773a56c2

Bug 701446: Avoid division by zero in gx_shade_trapezoid

Remove some incorrect clipping code.

base/gxshade6.c


2019-08-27 15:54:36 +0100
Robin Watts <Robin.Watts@artifex.com>
0d46b4f51b5efba7e72b7d45517d0fba642477aa

Exit early from gx_shade_trapezoid in more cases.

A zero height trap isn't plotted, so we can bail out early in
that case.

base/gxshade6.c


2019-08-26 17:02:03 +0100
Robin Watts <Robin.Watts@artifex.com>
42f386a85d3998310f0317501b54780ffbe6dc6b

Fix deep colour transparency "uncompositing".

Uncompositing a group uses a scale factor that is greater in range
than we'd like; we need to resort to 64bit to do this to avoid
losing accuracy.

This solves problems seen in:

tests_private/comparefiles/Bug689918.pdf.psdcmyk16.300.1

base/gxblend.c


2019-08-27 14:26:41 +0100
Chris Liddell <chris.liddell@artifex.com>
dea69cd04964b27a08c8b340476d58031cb9e517

Handle relative FONTPATH values

Prior to 9.21 (specifically: 8abd22010eb4db0fb1b10e430d5f5d83e015ef70), relative
paths for FONTPATH worked, but did so due to a logic fault with how we search
for "lib" files.

When attempting to open file names specified on the command line, we used a
flag set in the command line handling (starting_arg_file) to know whether the
lib file searching logic should try to open the file name directly (as well as
trying the file combined with each path in the search path).

In versions prior to commit 8abd22010eb4 that flag (starting_arg_file) could
remain set to true, even after the command line file(s) had been opened. This
represented a (minor) security risk. Commit 8abd22010eb4 ensured the flag was
properly (re)set, and that caused relative paths for FONTPATH stopped working.

Rather than reintroduce the security risk, update the code that checks whether
the font files exist so it explicitly tries the file name directly, rather than
assuming .libfile (or findlibfile, in this case) does that automatically.

Also remove an extraneous (but benign) dup of the font name.

Resource/Init/gs_fonts.ps


2019-08-27 15:27:05 +0100
Ken Sharp <ken.sharp@artifex.com>
5d10fde23ccd74c2721e4870c5914fe7373a7816

pdfwrite - fix corner case with Color Conversion

Bug #701456 "Ghostscript creates broken PDF file after color conversion"

The test file is, essentially weird. The image on page 3 is not a single
image, its a series of images, all of which are in a /Indexed /DeviceRGB
colour space.

In addition, these images are drawn on *top* of another set of images
(thereby completely obscuring them). These images are also drawn in
/Indexed /DeviceRGB. However, these images are in fact monochrome, the
Indexed space consists of 2 colours. This means that (highly unusually)
we have a DeviceRGB image with 1 Bit Per Component.

This caused problems for the pdfwrite compression filter chooser because
it chose (and configured) a compression scheme suitable for 1 BPC data
and then actually output 8 BPC data. This led to the compression filter
writing too little data.

Fix this here by setting the BPC to 8 if we are doing colour conversion,
and have the colour conversion setup code use the original value in the
image enumerator (the conversion code *does* need to know the input is
1 BPC).

devices/vector/gdevpdfi.c


2019-08-27 11:36:35 +0100
Ken Sharp <ken.sharp@artifex.com>
02c252f00e7bbc9a9a23d0a0996e88ba1839f127

PDF interpreter - more /Mask strangeness in Acrobat

Bug #701468 " More weirdness with images containing invalid /Mask values"

In order to render this file as per Acrobat, we need to ignore the /Mask
array. However, in order to render bug 689717 correctly we need to fix
the /Mask array.

Both cases are 1 BitsPerComponent DeviceGray images, the only difference
is the actual /Mask values. Bug 689717 has [255 255] while 701468 has
[243 255]. We can differentiate based on whether we have DeviceGray
1 BPC image, where the Mask values are not the same. In the case they
are different we use the existing technique of calculating the maximum
value and using that (for both, so there is no range). Where there is a
range (ie not a single colour) this is clearly unusable in a 2-colour
image, so ignore the /Mask altogether.

Resource/Init/pdf_draw.ps


2019-08-26 15:28:33 +0100
Robin Watts <Robin.Watts@artifex.com>
3554f0fc4dadebad2e816adbd7cf4a548f76de74

Fix deep colour knockout logic.

Problem seen with:

tests_private/pdf/PDF_1.7_FTS/fts_25_2507.pdf.psdcmyk16.72.0

base/gxblend.c


2019-08-26 14:34:46 +0100
Robin Watts <Robin.Watts@artifex.com>
5280581fd0c075da7dc0632937e294a9fa3fe736

Squash a couple of warnings.

base/gdevmem.c
base/gdevp14.c


2019-08-26 14:01:39 +0100
Robin Watts <Robin.Watts@artifex.com>
2e872508d683302b556a160004a9ca3d64e7b4f1

Fix SoftLight blending in deep color transparency.

As seen with:

gs -sDEVICE=psdcmyk16 -r72 -dMaxBitmap=80000000 -o out.psd
tests_private/pdf/PDF_1.7_FTS/fts_09_0919.pdf

base/gxblend.c


2019-08-26 11:28:40 +0100
Robin Watts <Robin.Watts@artifex.com>
1fe43c3ba4423631129925d789c936b9e461d1d6

Fix problems with pngalpha and deep color transparency filling.

The pngalpha device is created with a depth of 32, with 3 color
components; this was confusing pdf14 into thinking that more
than 8 bits per color were being used, and so deep color buffers
were required.

To fix this we update the logic to be smarter; in cases where we
don't have a clear determination based on bits alone, we look
at the max_color and max_gray values. Because this code is now
more complex than before, we pull it into a shared function.

base/gdevdflt.c
base/gdevmem.c
base/gdevp14.c
base/gdevprn.c
base/gsptype1.c
base/gstrans.c
base/gxclthrd.c
base/gxdevcli.h


2019-08-23 15:06:17 +0100
Robin Watts <Robin.Watts@artifex.com>
0ac36b1eb87a919d3df19b7fb555d277d959396b

Fix deep color transparency issue.

Fix overflow in art_pdf_composite_knockout_16, seen in:

tests_private/comparefiles/Bug690546.pdf.psdcmyk16.72.0

base/gdevp14.c
base/gxblend.c


2019-08-22 18:24:49 +0100
Robin Watts <Robin.Watts@artifex.com>
cda2b1e057951dc4687c4d2ad489100d1ea6ea4b

Fix deep color transparent pattern problems.

Transparency buffers are held as native endian. Pattern cache
tiles are held as big endian. When we make pattern cache tiles
from transparency buffers we therefore need a conversion.

base/gdevp14.c
base/gxblend.c
base/gxp1fill.c
base/gxpcolor.h


2019-08-25 19:35:14 +0200
Till Kamppeter <till.kamppeter@gmail.com>
4e220de447dc5cc79a00e8bb57b69c6ea242fe75

"cups"/"pwgraster" output device: Do not output LUTs with CUPS_DEBUG set

This change lets complete LUTs in the debug output only be listed when
CUPS_DEBUG2 is set and not already with CUPS_DEBUG.

cups/gdevcups.c


2019-08-25 19:08:52 +0200
Till Kamppeter <till.kamppeter@gmail.com>
30575d50af5f8dd17ef20ccbbf2b2d8afae51589

"cups"/"pwgraster" output device: Prefer the page size requested by user

Without special scaling/cropping options ("fit-to-page", "fill",
"crop-to-fit΅, ...) PDF and PostScript files printed with CUPS will be
printed with the page sizes of the document's pages and not the size
requested by the user via the "PageSize" or "media" option. This
allows correct printing of jobs with differently sized pages on
printers which have the appropriate sizes loaded without need of
manual intervention. Therefore the CUPS output device is matching each
input page against the sizes listed in the PPD to generate a correct
page geometry for the printer for each page.

Problem is if there are several equally-sized page size entries in the
PPD. Without further guiding always the first match is used, making
access to special functions provided by the others (like
full-bleed/borderless printing) inaccessible.

This commit adds the functionality of the user-requested page size
(via "PageSize" or "media" option) being preferred under the matching
page sizes, so that if for example a user selects a full-bleed version
of the desired page size and sends a photo, the photo gets rendered
and printed with the page geometry which the PPD reports for the
full-bleed version.

Nothing changes if the size of the user-requested page size does not
match the size of the input page at all.

cups/gdevcups.c


2019-08-25 12:45:27 +0200
Till Kamppeter <till.kamppeter@gmail.com>
3283e6d5ce389f5b6d5ebf4adb309b1259a5fe1d

"cups"/"pwgraster" output device: Small fix on size matching improvements

This is a fix for one little oversight on the changes to support matching
the input page size against the imageable areas of the PPD's page sizes.

This completes the fix of bug 701438.

cups/gdevcups.c


2019-08-24 23:11:10 +0200
Till Kamppeter <till.kamppeter@gmail.com>
3e09cede82a3b8c5c7a6e30a5934336f20dfa1f8

"cups"/"pwgraster" output device: Improved page size matching with PPD

Applied the following improvements for finding the correct page size
of the PPD file for the input page:

- Do not try to match by page size name, the input files do not
contain page size names.

- Do not only match the input page size against the actual media sizes
reported by the PPD but also to the imageable areas. Media size match
is preferred but if there is no media size match, we accept also
a match of the imageable area. In case of a match of the imageable
area we position the input page in the imageable area of the output
page.

- More debug output.

- In case of a custom page size (no match with PPD sizes) the page
size name in the CUPS Raster output is a correct "Custom.XXXxYYY"
and not the default page size name.

This should fix bug #701438.

cups/gdevcups.c


2019-08-23 18:09:32 +0200
Till Kamppeter <till.kamppeter@gmail.com>
2d6bb6e69feb0a75be98d03f550258d4b7540aef

"cups"/"pwgraster" output device: Reduced page size comparison tolerances

Before each page gets rendered its size is compared to the page sizes
of the PPD file to select the actual page size for the output. Reduced
the tolerances from 7% for the long edge and 5% for the short edge to
1%, as before easily wrong sizes got picked (See also bug 701438).

cups/gdevcups.c


2019-08-23 10:11:05 +0100
Chris Liddell <chris.liddell@artifex.com>
5ab40cc018d8ac76758cebc7b4962e9b19fffc86

Windows Installer: cope with COMPILE_INITS=0

We default to COMPILE_INITS=1, and that was the only case that the installer
handled - i.e. building the installer with COMPILE_INITS=0 would install an
executable that wouldn't work without extra action (-I.. or similar).

This changes the installer compiler invocation, and the installer creation
so it behaves as it does now with COMPILE_INITS=1, but with COMPILE_INITS=0 the
installer will write the path to Resource/Init into the GS_LIB registry
key.

psi/nsisinst.nsi
psi/winint.mak


2019-08-22 23:30:34 +0200
Till Kamppeter <till.kamppeter@gmail.com>
863d77f731c6144dcf139e06e64a857754d8327f

"cups"/"pwgraster" output device: Produce more debug output

When building with CUPS_DEBUG now debug output for the process of
matching the page geometry with the PPD file's page sizes is
produced.

cups/gdevcups.c


2019-08-22 08:58:01 +0100
Chris Liddell <chris.liddell@artifex.com>
24478335925f891673160893513fac43b0334c48

Handle explicit '\' escaping in path matching

As well as having to cope with both '/' and '\' as directory separators on
Windows, it turns out we also need to cope with the backslash separator being
explicitly escaped ("\\") - the explicit is added by the Postcript path
templating code in gs_init.ps.

I don't want to change templating code because that would likely have
implications in a lot of other places.

base/gpmisc.c


2019-08-22 10:51:28 +0100
Robin Watts <Robin.Watts@artifex.com>
7c9794ee644a904527006922e4fc387ad33be2a4

Better CMYK conversion for bmpcmp

toolbin/bmpcmp.c
toolbin/bmpcmptab.h


2019-08-21 17:49:32 +0100
Robin Watts <Robin.Watts@artifex.com>
079ea7d9e0c713a7834fc8f08d52ce42e6a03666

Update bmpcmp.c to read psdrgb rather than psdbgr.

toolbin/bmpcmp.c


2019-08-21 15:33:27 +0100
Chris Liddell <chris.liddell@artifex.com>
935408d6205742e40471b18d7f0f1fe4febc437c

Fix commit ec0b35fed3de: "Handle directory separators..."

The logic in the above fix was wrong.

base/gpmisc.c


2019-08-21 14:28:20 +0100
Robin Watts <Robin.Watts@artifex.com>
4041906852365a602c2f9e011703e4174bdc8040

Bug 701451: Fix clist color_usage calculations for shadings.

Or rather, don't attempt to calculate them badly, and just
use the safe "all colors" value.

base/gxclrect.c


2019-08-21 10:10:51 +0100
Ken Sharp <ken.sharp@artifex.com>
cd1b1cacadac2479e291efe611979bdc1b3bdb19

PDF interpreter - review .forceput security

Bug #701450 "Safer Mode Bypass by .forceput Exposure in .pdfexectoken"

By abusing the error handler it was possible to get the PDFDEBUG portion
of .pdfexectoken, which uses .forceput left readable.

Add an executeonly appropriately to make sure that clause isn't readable
no mstter what.

Review all the uses of .forceput searching for similar cases, add
executeonly as required to secure those. All cases in the PostScript
support files seem to be covered already.

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


2019-08-21 10:56:02 +0100
Chris Liddell <chris.liddell@artifex.com>
ec0b35fed3de9f313c7c992844daac5f3f28618d

Handle directory separators in access control matching

On Windows, we end up dealing with a mishmash of "/" and "\" as directory
separators, so a simple equality check isn't sufficient.

Since there is already (platform specific) function for checking whether a
string (or part thereof) is a directory separation, use it.

base/gpmisc.c


2019-08-20 21:50:18 -0700
Michael Vrhel <michael.vrhel@artifex.com>
453ef45209143ecf3c3e25dafd9fbe6698e2c5a1

Disable use of alternate tint transform ICC profile

A prior commit introduced the use of color management
if the DeviceN or Separation device had an ICC profile
associated with the colorants. While there is an argument
for doing this, it is not the standard behavior seen in
AR. Disabling for now and will likely turn this into a
command line option.

base/gxcmap.c


2019-08-20 18:48:49 +0100
Robin Watts <Robin.Watts@artifex.com>
cc656558a289fa28dbb491d70478fd18973b287a

Fix crashes in RAW_DUMP debug code.

Dump the buffer before freeing the device, or the pointer will no
longer be valid.

Also, don't access through ppatdev14 when we know it's NULL.

base/gdevp14.c


2019-08-20 18:47:09 +0100
Robin Watts <Robin.Watts@artifex.com>
633c454261c95e3d1771ad93b7bd6c481119c0d0

Fix deep color transparency pattern copying problem.

The following test:

tests/pdf/pattrans_solid_nonrect.pdf.psdcmyk16.300.1..gs

among others, was showing problems, due to us treating the offset
as bytes rather than shorts.

base/gxp1fill.c


2019-08-20 14:29:33 +0100
Robin Watts <Robin.Watts@artifex.com>
69b066540069330a8a046039b93e1dcadecfa153

Avoid signed overflow in deep transparency calculations.

base/gxblend.c


2019-08-20 12:24:03 +0100
Robin Watts <Robin.Watts@artifex.com>
825f77eabdbfaa9d566d38c4b2be918143cd5778

Fix overflow in deep color blending.

Multiplying a 16bit unsigned value with a 16 bit signed value
in a 32bit int means we lose the sign bit. Sacrifice a bit of
accuracy to avoid that.

base/gxblend.c


2019-08-20 10:10:28 +0100
Ken Sharp <ken.sharp@artifex.com>
885444fcbe10dc42787ecb76686c8ee4dd33bf33

make .forceput inaccessible

Bug #701343, #701344, #701345

More defensive programming. We don't want people to access .forecput
even though it is no longer sufficient to bypass SAFER. The exploit
in #701343 didn't work anyway because of earlier work to stop the error
handler being used, but nevertheless, prevent access to .forceput from
.setuserparams2.

Resource/Init/gs_lev2.ps
Resource/Init/gs_pdfwr.ps


2019-08-19 10:03:57 +0100
Chris Liddell <chris.liddell@artifex.com>
9dae3b271e781c076e49d94dc8590ed95e3f38c9

Handle drag'n'drop file name/paths

Because we now run by default with the file access permission active,
we need to do additional work for Windows drag and drop files, so they don't
throw an invalidaccess error (since we implement drag and drop by sending
characters to the gs console to do '(file) run').

The problem is, we cannot add the file to read list, send the characters to the
console, and remove the file from the read list because, although SendMessage()
blocks until the message is handles, WriteConsoleInput() does not block until
the console buffers are consumed (i.e. it is asynchronous). So, there is no
certainty when the final SendMessage() in WM_DROPFILES case is finished that
Ghostcript will actually have run the file.

So, we create a list of dropped file names, add them to the permit read list,
when the next WM_DROPFILES event happens, or a WM_DESTROY event, we drop
file names from the permit read list before, if necessary, adding the current
ones.

psi/dwimg.c
psi/dwmain.c
psi/dwmainc.c
psi/dwtext.c
psi/dwtext.h


2019-08-16 15:43:32 +0100
Robin Watts <Robin.Watts@artifex.com>
6c18c7092e8945dcd932226bfea790c842ae21a0

Squash warnings in claptrap.

Thanks to William Bader for highlighting these.

base/claptrap-planar.c


2019-08-16 15:28:49 +0100
Robin Watts <Robin.Watts@artifex.com>
89f63112bd8ef15ba7df1fca5b962561c1f756c8

Squash warning in gdevpsd.c

Thanks to William Bader for spotting this.

devices/gdevpsd.c


2019-08-16 13:08:14 +0100
Robin Watts <Robin.Watts@artifex.com>
f74553992b28ca536d62aa93cf9208bb7aa670b3

Squash some compiler warnings.

base/gslibctx.c
base/gslibctx.h
devices/gdevpdfimg.c
devices/vector/gdevpdfu.c
pcl/pl/plmain.c


2019-08-16 11:45:01 +0100
Chris Liddell <chris.liddell@artifex.com>
924f701fdc990ac981fb08c4f6c21c668b8b74ef

Fix X11 device ICC profile memory leaks

When the x11 devices are running in "buffered mode" (i.e. we render to a
pixmap, then blit the pixmap to the X11 Window), we create a memory device
which actually does the rendering.

The memory device takes a reference to the ICC profiles from the x11 device
and it is reference counted.

Firstly, we always incremented the reference count, ignoring the posibility
that we were resizing an existing memory device rather than creating a new one.

Secondly, when shutting down the x11 device, we ignored posibility that
buffering was in force, and failed to free the memory device - most of the
memory was hoovered up by the garbager, but the ICC profile data isn't in
gc memory, hence showing a leak.

So, fix the memory device ICC reference counting, and reconfigure the device
as non-buffering before we shut it down.

devices/gdevxini.c


2019-08-15 17:06:02 +0100
Chris Liddell <chris.liddell@artifex.com>
79350a5f0fc9514746f34ff0820f0b6a89f67117

Add -dNOSAFER for Windows installer cidfmap creation

psi/nsisinst.nsi


2019-08-15 11:35:15 +0100
Chris Liddell <chris.liddell@artifex.com>
443e60cd379c3a8b5fca89b59280573b2c651e33

Bump the version number for release.

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


2019-08-15 14:36:55 +0100
Ken Sharp <ken.sharp@artifex.com>
f1ae75eb9d43d9773915ab66b0c97086d0252257

ps2write - don't password encrypt PostScript output!

Noticed while testing the args commit; if we set -sOwnerPassword (to
create a password-protected PDF file), but select (e)ps2write as the
device, then the resulting PostScript file would have all the streams
(in a PDF sense) encrypted with PDF password encryption.

Unsurprisingly, this result in a completely unusable PostScript file.
Lets not permit that....

devices/vector/gdevpdfp.c


2019-10-15 10:03:54 +0100
Chris Liddell <chris.liddell@artifex.com>
d2897b976cf065874516f9f8e2a040965b2a384b

Remove RC string for real release

base/gscdefs.h


2019-10-15 08:54:21 +0100
Chris Liddell <chris.liddell@artifex.com>
18eedc30986ed2dfaf2357c0b0ca962532ace896

Dates etc for 9.50 release

Plus a comment on going to 9.50, rather than 9.28.

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/Internal.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


2019-10-15 08:48:43 +0100
Chris Liddell <chris.liddell@artifex.com>
80f8dff6c57620dd5acae9ebc5b9ab64674b88f0

Fix a mistake in the news section

doc/History9.htm
doc/News.htm


2019-10-14 18:29:10 +0100
Chris Liddell <chris.liddell@artifex.com>
24a66f42d67d83714ad971347488c0246e3e8f7c

Have warning honor -dQUIET

Have the warning about calling .lockfileaccess or .setsafe when the controls are
already in place honor the -dQUIET/-q command line params.

Resource/Init/gs_init.ps


2019-10-14 18:10:31 +0100
Chris Liddell <chris.liddell@artifex.com>
dad10464de52d344287843ca872b56c8e7f33ccb

Update changelog

doc/History9.htm


2019-10-14 18:07:29 +0100
Chris Liddell <chris.liddell@artifex.com>
f2e2a3fe85d64cabde82d0f6eb982643bc6e8427

Add words about .currentpathcontrolstate operator

doc/Language.htm


2019-10-14 10:28:15 +0100
Chris Liddell <chris.liddell@artifex.com>
ad5b08d8be2e7a91599d3bbbc6aa841144662239

Change version to 9.50

Resource/Init/gs_init.ps
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/Internal.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


2019-10-14 10:20:19 +0100
Chris Liddell <chris.liddell@artifex.com>
1937e14f17e5de54b57d0e911e828639d197a08c

Update docs on SAFER

to reflect that SAFER is now the default, and remove the comments about making
SAFER the default "in the future".

doc/Use.htm


2019-10-10 09:29:48 +0100
Ken Sharp <ken.sharp@artifex.com>
9c63f39ead4aab30addf213f0ab6843ac87b56cf

ps2write - restore missing %%PageTrailer comment

Bug #701659 "Missing %%PageTrailer commen"

An oversight in commit 96c381cce28c27eac182549441a6c5025b0dcdd6
caused the comment to be omitted.

devices/vector/gdevpdf.c


2019-10-07 18:41:10 +0100
Chris Liddell <chris.liddell@artifex.com>
1d89e1aa9cf65e5345a1f009b6d317db024719fe

Bug 701657: Allocate "memory" device in immovable gc memory

Devices are supposed to be allocated in memory that cannot relocate (i.e.
non-gc memory or an immovable allocation). The memory device accessible from
Postscript (makeimagedevice/makewordimagedevice) was being created in regular,
relocatable gc memory.

This caused an invalid memory access when cleaning up subclassed devices, as the
one device in the chain may have moved. So switch to using an immovable
allocation.

base/gsdevmem.c


2019-10-02 00:01:17 +0200
Sebastian Rasmussen <sebras@gmail.com>
458f715b0d59278f0788e0c89ee5eb04d48871ef

Update jbig2dec stuff for 0.17 release.

jbig2dec/CHANGES


2019-10-01 10:35:48 +0100
Chris Liddell <chris.liddell@artifex.com>
f8ba9e017cdfab836f62853629d75f484127342e

Fix memory corruption setting a halftone

When setting a new halftone in the graphics state, we try to re-use the data
from the existing device halftone.

The problem is that the device halftone can have higher component indices than
there are components in the new halftone we are creating. In this case, we can
end up writing off the end of the components array for the new halftone
structure.

Simply check that the new halftone has enough components before doing the
duplication.

base/gsht.c


2019-09-30 13:40:35 +0100
Ken Sharp <ken.sharp@artifex.com>
1681c7ebb5a338002d5f7dd8da9bffda675f0656

pdfwrite - don't honour /Producer key in DOCINFO pdfmark

Bug #701639 "pdfwrite should not honour the /Producer key in DOCINFO pdfmark"

The Producer in the document information dictionary (and XML Metadata)
is defined quite clearly as the application which produced the PDF file
from its native format.

Ghostscript uses the Producer key (if present in the pdfmark) to set
the Producer, but it should not do so. Adobe Acrobat Distiller (at
least the end user version) does not permit this value to be altered.

On reflection we can see why; in the case of a problem with a PDF file
its important to know which application created it, and we should not
let PostScript obscure that (we already do not pass the Producer
information on when the input is PDF).

The code did already attempt to overwrite any Producer string which
contained 'Distiller' (I have no idea why) and that code contained an
error which could lead to an invalid Document Information dictionary
being created.

This commit removes the ability for DOCINFO pdfmarks to alter the
Producer, which obviously fixes the bug.

However..... it is actually important for our commercial customers to
be able to set this value. A problem with a PDF file created by one of
our customer's products should be reported to that customer, not us, as
we will not be able to investigate the problem while our customer
should be able to. At the very least our customer will know how to
retrieve the configuration of Ghostscript being used.

So permit the commercial version of Ghostscript to set the /Producer
from a pdfmark.

devices/vector/gdevpdfm.c


2019-09-30 09:16:28 +0100
Chris Liddell <chris.liddell@artifex.com>
a27af00c8727ec4eaf0f4730963b8a81aab8590d

Small changelog tweak

doc/History9.htm


2019-09-30 08:33:08 +0100
Chris Liddell <chris.liddell@artifex.com>
84864d86363a3e5b53f4b75fae7c850c2c22e5ee

Dates and docs for 9.28 rc4

base/gscdefs.h
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/Internal.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


2019-09-27 13:26:01 +0100
Chris Liddell <chris.liddell@artifex.com>
55fef678a69b921b548d5e1ffb93d9162fedfdc3

Bug 701634: Correctly handle file name of "\0"

Attempting to open a file with a filename string starting with a NULL
character should be treated the same as if the string was zero length.

Not doing so created a broken file object leading to several operations
resulting in a segfault.

Also, add cleanup in the event of such an error, freeing memory allocated in
preparing the gs stream object.

base/sfxcommon.c
psi/zfile.c


2019-09-26 10:47:01 +0100
Chris Liddell <chris.liddell@artifex.com>
51e6a6103f9fa51e14c737e134bcef8a3daf7ef8

Revised comment for 8992f00edfd1c39154c013489de2a01d2e9a92ee

Make it clearer why the revised behaviour is required.

base/gstiffio.c


2019-09-26 09:34:02 +0100
Chris Liddell <chris.liddell@artifex.com>
833fc0371d2ca44ca603b2fd1a42fa1ef820f7eb

Bug 701313: Disable libtiff callbacks when libtiff is shared

It seems that libtiff uses global variables to store the error/warning callbacks
so if two callers in the exe are using the libtiff shared lib, very bad things
happen (usually a segfault).

So, if that's how we're linked, set the callbacks to NULL.

base/gstiffio.c


2019-09-24 15:48:54 +0100
Chris Liddell <chris.liddell@artifex.com>
cfd109650c2328300b21f7e5853c0e4bec669876

Cope with .setsafe(global) being called when already 'SAFER'

As we default to SAFER file controls now, we want to cope with .setsafe and
.setsafeglobal being called either when already SAFER, or called multiple times.

This means adding a .currentpathcontrolstate operator so we don't try to
influence the path control lists after control is activated.

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


2019-09-24 09:18:47 +0100
Chris Liddell <chris.liddell@artifex.com>
45013b96f1e7ef06c64028122ec8870f3a71335d

tiffsep(1): Cope with .tiff ending as well as .tif

devices/gdevtsep.c


2019-09-23 20:04:49 +0100
Robin Watts <Robin.Watts@artifex.com>
6aea104cc48170a4064a12e89c72a898c6bd5967

Recast validate to use gs_file_name_check_separator.

Avoid using gp_file_name_directory_separator, as windows can
have 2 different directory separators.

base/gpmisc.c


2019-09-23 18:05:00 +0100
Chris Liddell <chris.liddell@artifex.com>
f1a661c69f78ea42828f94fe829163d20bcf7706

Remove spurious call to gp_validate_path_len()...

...in gx_device_open_output_file()

There is no need to validate the path in gx_device_open_output_file() as it will
be done at a lower level (gp_fopen) for paths that require it (we only validate
*after* the Postscript style %device% paths have been expanded into 'real'
paths).

This also interacts badly with the revised handling of formatted string
file names, hence remove it.

base/gsdevice.c


2019-09-23 17:56:34 +0100
Chris Liddell <chris.liddell@artifex.com>
eed7d85ac16ae516e1c4e51bcdea3924a973da5e

Fix tiffsep(1) interaction with file permissions lists

The previous solution didn't quite work, when using formatted strings for
output file names (i.e. output-%d.tif).

This adds a dedicated gs_remove_outputfile_control_path() to mirror
gs_add_outputfile_control_path() and uses those for the dynamic adding and
removing of separation output file names.

base/gslibctx.c
base/gslibctx.h
devices/gdevtsep.c


2019-09-23 17:11:47 +0100
Robin Watts <Robin.Watts@artifex.com>
76ca3dd29559dd72da3f154e2ba18f86cd46fff6

Update path validation to accept multiple *'s as special case.

Previously we interpretted multiple *'s as meaning the same as
single *'s. Now we use them to mean "just those chars that
might be created by the use of a %...{d,x,u,i,o,X} format
specifier".

base/gpmisc.c
doc/Use.htm


2019-09-23 16:41:09 +0100
Robin Watts <Robin.Watts@artifex.com>
dfc93423545c8a9a927b1f240ba4bdc22b39f0b6

Improve OutputFile handling of %d etc.

Only accept %d (and friends) (as opposed to anything starting with %).
Only accept legal combinations of flags/widths/precision etc.
Generate a more conservative wildcard.

base/gslibctx.c


2019-09-20 12:38:02 -0700
Ray Johnston <ray.johnston@artifex.com>
cd3db03d3e04c9146b596280d6da76cec23f60a6

Slight improvement to "permit-file-***" parameter documentation.

doc/Use.htm


2019-09-20 11:17:53 -0700
Ray Johnston <ray.johnston@artifex.com>
4baa696cc3498ae834052440f9f9d9fc0b8ad122

Fix tiffsep and tiffsep1 with new file access control and SAFER mode

The tiffsep and tiffsep1 synthesize output file names with the outputfile
and the separation color name, but the 'open' of these filenames would
fail since they were not included on the permit_file_writing list.
Add the full filename before opening, and remove the names after closing.

devices/gdevtsep.c


2019-09-20 11:53:10 -0700
Robin Watts <Robin.Watts@artifex.com>
41d79063acee7244f5990d2a8e19c567e24051af

Squash stupid const warning.

base/gslibctx.c


2019-09-20 19:42:01 +0100
Robin Watts <Robin.Watts@artifex.com>
b58f45daa9007f482a49132cbfaa47c8b86ce7d5

Squash some "const" warnings.

pcl/pl/plmain.c


2019-09-20 17:49:57 +0100
Robin Watts <Robin.Watts@artifex.com>
0e7039d7a83a7e35b8b41d59d7fb9a8b4fda7fb0

Fix "permit-file-xxxx" handling.

Ray spotted that gs_add_explicit_control_path was adding 17
to arg before using it. 17 happens to be the right amount
to add for "--permit-file-read=", but the wrong amount for
write/control/all.

Update the code to call it with the correct arg pointer
to start with.

Also, update a couple of routines to cope with being called
with NULL strings.

Also use enum values in switch rather than 0, 1, 2.

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


2019-09-19 11:02:48 +0100
Chris Liddell <chris.liddell@artifex.com>
18316aba11fafc57ee77dbd7774b2c88b964a9d9

Make missing jbig2 decoder fatal error.

If we have neither Luratech nor jbig2dec, have configure fail, unless
explicitly run with --without-jbig2dec

configure.ac


2019-09-18 09:24:25 +0100
Chris Liddell <chris.liddell@artifex.com>
569a551f2a57f6e6c1e692f6b834c765dcbe7cfa

Dates, docs, etc for 9.28 rc3

base/gscdefs.h
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/Internal.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


2019-09-17 11:42:13 +0100
Chris Liddell <chris.liddell@artifex.com>
2ff44c7c8a09dd1c6b7cd750323ee4087b5cebc5

Fix file permissions interaction with '@' command line

If an options file (prefixed '@' on the command line) followed something that
required initialising the Postscript interpreter (such as a '-c' option),
opening the file would potentially fail because file permissions had been
activated by the interpreter.

Add and remove the file from the permit reading list before attempting to open
it.

base/gsargs.c


2019-09-12 14:23:10 +0100
Chris Liddell <chris.liddell@artifex.com>
3695b7f576c607bd3627e6e28dc982fdf68b1b32

If set, add PCLFONTSOURCE value to permit_file_reading list

pcl/pl/pjparse.c


2019-09-11 13:07:02 +0100
Chris Liddell <chris.liddell@artifex.com>
4196e26a9cf3c8afd6c069a789ac649019ae096a

Bug 701561: 'reduce' paths before adding to permit lists

Before attempting to open files, we pre-process the requested file name to
remove surplus/unnecessary elements: i.e. './././file' would be reduced to just
'./file', or '../dir/../dir/../dir/file' would be reduced to '../dir/file'.

The 'reduced' path is what we try to open, hence it is also what we check
against the file permissions list before we allow files to be accessed.

That being so, we should also 'reduce' paths as we add them to the permissions
lists - thus the permissions list creation and checking are consistent.

base/gslibctx.c
base/lib.mak


2019-09-11 14:10:27 -0700
Ray Johnston <ray.johnston@artifex.com>
3d55799ea64088e08fc2783012957035c77a66ca

Fix Bug 696333. Allow large bitmaps in clist when writing tile cache.

When writing bits to update the tile cache, we don't need to restrict to
a single command buffer as with the copy_mono and copy_color commands.

Progressions on:
tests_private/comparefiles/Bug694385.pdf.psdcmyk.300.1..gs
tests_private/pdf/sumatra/2028_-_invisible_patterns.pdf.psdcmyk.300.1..gs
tests_private/ps/ps3cet/09-47B.PS.pdf.pkmraw.300.0..gs_pdf
tests_private/ps/ps3fts/176-01.ps.psdcmyk.300.1..gs

base/gxclbits.c
base/gxcldev.h
base/gxclrect.c


2019-09-12 10:37:42 -0700
Ray Johnston <ray.johnston@artifex.com>
1613502f83ddba352cc8e98e7dd3182c9d7732bc

Fix SEGV with flp device and PCL with clist mode and large BandHeight.

If the 'clist_init' fails initially (with rangecheck) due to the buffer
space too small for the BandHeight specified, we loop in the caller after
increasing the buffer size, but clist_init left "is_open" false when failing.
Add save_is_open in gdev_prn_setup_as_command_list so that we can restore it
if the clist_init eventually suceeds.

The SEGV was with image_data because re-opening the flp device reset the
"obsolete" procs to the default, so flp_image_data was replaced by the
gx_default_image_data, but no begin_image had been performed (flp_begin_image
skipped this since we were not yet at the FirstPage).

base/gdevprn.c
base/gxclist.c


2019-09-16 18:53:49 +0200
Sebastian Rasmussen <sebras@gmail.com>
f2d03f59e04a053c14285d8dbdd869bf9a4435e7

Update jbig2dec stuff for 0.17 release.

jbig2dec/CHANGES
jbig2dec/jbig2.h
jbig2dec/jbig2dec.1


2019-09-16 18:48:36 +0200
Sebastian Rasmussen <sebras@gmail.com>
8da8fbaeb6074161bc3a9b22e89265f5942db0d9

jbig2dec: Use the same contact information everywhere.

jbig2dec/README
jbig2dec/configure.ac.in
jbig2dec/jbig2dec.1


2019-09-16 16:12:32 +0100
Paul Vojta <vojta@math.berkely.edu>
6c6e19334062d12189612b84f53fe393a7808f74

Documentation - fix some typos

Bug #701589 "Minor documentation problems in 9.28-rc2"

Thanks to Paul Vojta for pointing these out. Unfortunately we cannot use the
supplied patch, as it includes alterations to History9.htm, which is auto-
generated from the commit logs. The remaining changes are applied here.

doc/Language.htm
doc/Use.htm


2019-09-11 12:18:51 +0100
Chris Liddell <chris.liddell@artifex.com>
90bdf83d696562e4136b8f565cac06cc32b161ae

Bug 701563: pdfwrite annotation pdfmark /Border key

Despite the spec saying the values for the /Border key are in user space
coordinates, Distiller appears to pass the values through to the output PDF
untouched (no rescaling - unlike the values for /Rect, also in user space,
according to the spec, which it does scale/translate). Ghostscript/pdfwrite
did scale the /Border values.

This just changes pdfwrite to write the values out unchanged.

devices/vector/gdevpdfm.c


2019-09-16 09:56:52 +0100
Ken Sharp <ken.sharp@artifex.com>
a9e997cb97a274bebfc028e8831a43d6f66be0f9

Documentation - add a note about SAFER for PDF/X ICC profiles

Bug #701553 "Examples of PDF/X and PDF/A conversion should be updated for Ghostscript 9.28"

ICC profiles required for PDF/X and PDF/A output need to be readable
in order to work when -dSAFER is true (the new default). This wasn't
clear from the documentation, so add a note about it.

As noted in the bug report, it is possible to embed the profile in the
PostScript code, but as Chris says this is probably beyond reasonable
expectations of the average user; they simply won't change the example
and will then complain that it isn't correct. Users capable of making
this work almost certainly have enough knowledge to realise they can
do this instead of making the profile readable.

doc/VectorDevices.htm


2019-09-12 19:41:47 +0100
Robin Watts <Robin.Watts@artifex.com>
cea41505580dfe55234bd4972fbb09af5e2e6bb8

Fix various printer devices to properly call spec ops.

Various printer devices (psd, psdcmykog, tiffsep, tiffscaled)
were passing the spec ops on to gx_default_dev_spec_op rather
than gdev_prn_dev_spec_op.

The most obvious implication of this was that we'd sometimes
get a warning about printer devices having a private spec op.

devices/gdevcmykog.c
devices/gdevpsd.c
devices/gdevtsep.c


2019-09-12 17:09:50 +0100
Robin Watts <Robin.Watts@artifex.com>
89f3d6001728678755aca8c5a02e57bba72a0813

Bug 701568 followup: Fix RLE compressor.

The previous fix to the RLE compressor reveals an additional
existing issue to do with us not checking whether we have
space in the buffer to write the EOD byte.

Fixed here.

base/srle.c


2019-09-12 09:35:01 +0100
Robin Watts <Robin.Watts@artifex.com>
f394c0722d3415ba03f57dc32dcd8484d3173b62

Bug 701568: Fix gdevpx.c RLE stream handling.

The current code in pclxl_write_image_data_RLE passes
lines of data to the RLE compression routine. It tells
each invocation of that routine that this is the "last"
block of data, when clearly it is not.

Accordingly, the compression routine inserts the "EOD" byte
into the stream, and returns EOFC.

Independently of the return value used, having multiple EOD
bytes in the data is clearly wrong. Update the caller to only
pass "last" in for the last block.

The code still returns EOFC at the end of the data, so update
this final call to accept (indeed, expect) that return value
there.

devices/vector/gdevpx.c


2019-09-10 09:04:46 -0700
Ray Johnston <ray.johnston@artifex.com>
6cd0b941d86fe54b7e818e563dc702a147bab95a

Fix bug 701550, problem with forall on strings.

Hard to believe, but this problem has existed since at least version 3.33.
The 'string_continue' function altered the size which was used to decide if
there were still characters to be processed BEFORE invoking the 'push(#)' macro.
If the 'push(1)' encountered a full stack segment, it would return stackoverflow
so that the operand stack could be extended. This meant that the decision to
stop enumerating the string would end early (depending on how many times the
stackoverflow occurred).

Usually the procedure of the forall would either consume the character (reducing
the stack), or add an element to the stack triggering the stack extension before
the next execution of string_continue, but -c "401 string { dup } forall count ="
results in only 800 stack elements (rather than 802 as expected).

psi/zgeneric.c


2019-08-15 15:54:04 +0100
Chris Liddell <chris.liddell@artifex.com>
f560f3c468ac187eca8cd55ee46a46e2924e0924

Doc updates, changelog, news etc

Update to note explicitly case sensitivity on Windsows

In News.htm and History9.htm

doc/History9.htm
doc/News.htm
doc/Use.htm


2019-09-05 09:09:38 +0100
Chris Liddell <chris.liddell@artifex.com>
cc86598152465c85dfca5ba265608931672f730f

Date for 9.28 rc2

base/gscdefs.h
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/Internal.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-10-31 20:22:11 +0100
Sebastian Rasmussen <sebras@gmail.com>
350a5cd8b7bddee3fa914c914dd40a685fed54e7

Bug 700088: Report error if all wanted J2K components are not decoded.

Ghostscript used to attempt to use even the undecoded components.
The source code for upstream's opj_decompress tool avoided this by
a workaround along with a comment indicating that this ought to be
done in the library (so all clients, e.g. Ghostscript will benefit
from it). With this commit the library will error out if not all
requested components are successfully decoded. Thus Ghostscript
will no longer crash.

Reported in https://github.com/uclouvain/openjpeg/issues/1158
sent upstream in https://github.com/uclouvain/openjpeg/pull/1164
and finally committed in e66125fe260deee49fdf6e9978d9bd29871dd5bb

openjpeg/src/bin/jp2/opj_decompress.c
openjpeg/src/lib/openjp2/j2k.c


2019-09-03 12:34:55 -0700
Michael Vrhel <michael.vrhel@artifex.com>
b944e875baed62e718eee8e7ad2b351cd4f4aa07

Undo commit 95f7befcec1b30fd5014c8ad616485d32901ce33 for release

Proper handling of the page group color space is going to require
a more complex solution whereby we ensure that we do the final
alpha blending in the page group color space and not the target
device color space.

base/gstrans.c


2019-09-03 08:52:16 -0700
Michael Vrhel <michael.vrhel@artifex.com>
ebfe16357f3484209e69d6788cc52b20dbdb81a0

Add -sBlendColorProfile into Use.htm

doc/Use.htm


2019-09-03 18:15:56 +0100
Robin Watts <Robin.Watts@artifex.com>
bbdfaa56b00f2ba556476f0265e65e4ad370f641

Avoid potential UMR with arg checking in arg sanitization code.

base/gslibctx.c


2019-09-02 17:16:45 +0100
Robin Watts <Robin.Watts@artifex.com>
00d4696ea2de6c48a57d5a4ce0c3bbfd99201e3a

Proper fix for deep color overprint.

The previous fix confused memset and memcpy. Properly write the
(native endian) 16 bit color values into the big endian buffer.

base/gsovrc.c


2019-09-02 12:59:33 +0100
Robin Watts <Robin.Watts@artifex.com>
c6d448b3fe616fdc2ba1e52766c9a4417e4e738f

Fix deep color mattes.

As seen with the content vanishing when rendering
tests_private/pdf/sumatra/uninitialized_value_with_JPX_images.pdf
to psdcmyk16. The Softmask on the image has a Matte of [1,1,1]
and the calculations in the current code overflow, meaning that
it comes out as completely white.

We resort to 64bit to avoid the overflow. Mattes are vanishingly
rare, so speed shouldn't be an issue. We can revisit if we ever
find a case that matters.

base/gdevp14.c


2019-08-31 12:45:47 +0100
Robin Watts <Robin.Watts@artifex.com>
4c1f255c2e825ab5e0a3d0f7bfa88538c7cbb912

Update overprint hl_color code to cope with 16bit devices too.

base/gsovrc.c


2019-08-31 12:16:40 +0100
Robin Watts <Robin.Watts@artifex.com>
373787ee145e906c8d19d5ccda84b4f267db2010

Fix deep color transparency overprint.

The component copy loop at the end of the blend could fail to copy
enough entries.

base/gxblend.c


2019-08-30 15:16:34 +0100
Robin Watts <Robin.Watts@artifex.com>
361c4dd1e18ca0675173c0ad0104ffb910e93bb4

Avoid overflow in deep color luminosity calculations.

Resort to 64bit as scale calculations are not constrained
to the usual 16bit range.

base/gxblend.c


2019-08-29 10:02:49 +0100
Chris Liddell <chris.liddell@artifex.com>
51d57fafbdc021c8c73475db505156f77e96ce39

Fix clearing of the drag and drop file list

Because we have to store the list of file names from drag and drop events, in
order to correctly add and remove them from the permit file read list, we also
want to clear the lists before we destroy the "text" window object.

The problem is, this happens after we shutdown Ghostscript and unload the dll.

This moves that clearing of the list into function that we call before we
shut down.

psi/dwmain.c
psi/dwtext.c
psi/dwtext.h


2019-08-28 10:14:52 +0100
Chris Liddell <chris.liddell@artifex.com>
ad0532e379a9eb6eb8a6fc0a6305679b25cd9ecb

Fix path permissions added from cidfmap.

From the cidfmap, we accumulate a list of unique directory paths a we process
cidfmap and then add them - when I did that code, I forgot that to allow access
to the directory, we need a trailing directory separator.

Add that before calling .addcontrolpath

Resource/Init/gs_cidfm.ps


2019-08-27 16:49:30 +0100
Chris Liddell <chris.liddell@artifex.com>
f0fedf1f77a9fe70627355b45fdb809e83df3568

Fix font file finding with -P

In trying to reproduce the issue that inspired commit dea69cd04964, I noticed
that font file searching wasn't working correctly with -P specified on the
command line.

Previously, it could just end up with us not finding a font we should have, but
with dea69cd04964 it would result in a typecheck error.

This ensures the stack is always how it should be after the findlibfile
call

Resource/Init/gs_fonts.ps


2019-08-22 16:10:03 +0100
Chris Liddell <chris.liddell@artifex.com>
5c28996d19d5e10cb177e72c47037ec0c7b3e4d5

Make it clear: file/path matching is always case sensitive

even on Windows.

doc/Use.htm


2019-08-29 19:50:08 +0100
Robin Watts <Robin.Watts@artifex.com>
24532ce9371fd1f69dd343cbd6ac8187a86c5c96

Fix overflow in 16bit blending calculations.

The blending code uses the following construction in
several places:

src_scale = ...; /* a value between 0 and 0x10000 */
tmp = (y-z) * src_scale + 0x8000;
foo = x + (tmp>>16);

Where x,y,z, are all expected to be in the 0...0xffff range.

Due to y-z having a sign bit, this can overflow a 32 bit tmp.

We therefore sacrifice a bit of accuracy in src_scale to get
correctness.

base/gxblend.c
base/gxblend1.c


2019-08-28 14:13:27 +0100
Robin Watts <Robin.Watts@artifex.com>
ca52028b90a09d056190548c41ae0b9a9fbadb4e

Remove outdated FIXME's.

base/gdevp14.c


2019-08-28 12:50:36 +0100
Robin Watts <Robin.Watts@artifex.com>
bd59dc145252282d8f586c36082e63a0eba95c15

Bug 701446: Avoid divide by zero in shading.

The previous commit for this bug was enough to solve the problem
for ppmraw, but not, it seems, for other devices. This addresses
the division by zero more directly.

base/gxshade6.c


2019-08-27 20:13:02 +0100
Robin Watts <Robin.Watts@artifex.com>
9a32a379933f4ba27ff1ad5734ec8c24c42eb513

Fix deep color transparency saturation blending.

Problem seen with:

tests_private/pdf/PDF_1.7_FTS/fts_25_2513.pdf.psdcmyk16.300.1

base/gxblend.c


2019-08-27 17:45:57 +0100
Robin Watts <Robin.Watts@artifex.com>
68af4dbc7ca2d6bfdbe938b840799cb8883c973e

Bug 701446: Avoid division by zero in gx_shade_trapezoid

Remove some incorrect clipping code.

base/gxshade6.c


2019-08-27 15:54:36 +0100
Robin Watts <Robin.Watts@artifex.com>
4be058791ae19131f19a8303364be53619abc280

Exit early from gx_shade_trapezoid in more cases.

A zero height trap isn't plotted, so we can bail out early in
that case.

base/gxshade6.c


2019-08-26 17:02:03 +0100
Robin Watts <Robin.Watts@artifex.com>
9423e84178071f16b83d18412b22b0b479b1938b

Fix deep colour transparency "uncompositing".

Uncompositing a group uses a scale factor that is greater in range
than we'd like; we need to resort to 64bit to do this to avoid
losing accuracy.

This solves problems seen in:

tests_private/comparefiles/Bug689918.pdf.psdcmyk16.300.1

base/gxblend.c


2019-08-27 14:26:41 +0100
Chris Liddell <chris.liddell@artifex.com>
131768114453972469296658b795406b79630538

Handle relative FONTPATH values

Prior to 9.21 (specifically: 8abd22010eb4db0fb1b10e430d5f5d83e015ef70), relative
paths for FONTPATH worked, but did so due to a logic fault with how we search
for "lib" files.

When attempting to open file names specified on the command line, we used a
flag set in the command line handling (starting_arg_file) to know whether the
lib file searching logic should try to open the file name directly (as well as
trying the file combined with each path in the search path).

In versions prior to commit 8abd22010eb4 that flag (starting_arg_file) could
remain set to true, even after the command line file(s) had been opened. This
represented a (minor) security risk. Commit 8abd22010eb4 ensured the flag was
properly (re)set, and that caused relative paths for FONTPATH stopped working.

Rather than reintroduce the security risk, update the code that checks whether
the font files exist so it explicitly tries the file name directly, rather than
assuming .libfile (or findlibfile, in this case) does that automatically.

Also remove an extraneous (but benign) dup of the font name.

Resource/Init/gs_fonts.ps


2019-08-27 15:27:05 +0100
Ken Sharp <ken.sharp@artifex.com>
98310063bdbe8c67bcfe84e2c648cfa286a05738

pdfwrite - fix corner case with Color Conversion

Bug #701456 "Ghostscript creates broken PDF file after color conversion"

The test file is, essentially weird. The image on page 3 is not a single
image, its a series of images, all of which are in a /Indexed /DeviceRGB
colour space.

In addition, these images are drawn on *top* of another set of images
(thereby completely obscuring them). These images are also drawn in
/Indexed /DeviceRGB. However, these images are in fact monochrome, the
Indexed space consists of 2 colours. This means that (highly unusually)
we have a DeviceRGB image with 1 Bit Per Component.

This caused problems for the pdfwrite compression filter chooser because
it chose (and configured) a compression scheme suitable for 1 BPC data
and then actually output 8 BPC data. This led to the compression filter
writing too little data.

Fix this here by setting the BPC to 8 if we are doing colour conversion,
and have the colour conversion setup code use the original value in the
image enumerator (the conversion code *does* need to know the input is
1 BPC).

devices/vector/gdevpdfi.c


2019-08-27 11:36:35 +0100
Ken Sharp <ken.sharp@artifex.com>
aee3b922087674ddd7c64444988018fafc3da127

PDF interpreter - more /Mask strangeness in Acrobat

Bug #701468 " More weirdness with images containing invalid /Mask values"

In order to render this file as per Acrobat, we need to ignore the /Mask
array. However, in order to render bug 689717 correctly we need to fix
the /Mask array.

Both cases are 1 BitsPerComponent DeviceGray images, the only difference
is the actual /Mask values. Bug 689717 has [255 255] while 701468 has
[243 255]. We can differentiate based on whether we have DeviceGray
1 BPC image, where the Mask values are not the same. In the case they
are different we use the existing technique of calculating the maximum
value and using that (for both, so there is no range). Where there is a
range (ie not a single colour) this is clearly unusable in a 2-colour
image, so ignore the /Mask altogether.

Resource/Init/pdf_draw.ps


2019-08-26 15:28:33 +0100
Robin Watts <Robin.Watts@artifex.com>
ad22dcaa078fd16f2ac395f65b6ad87ba24c8903

Fix deep colour knockout logic.

Problem seen with:

tests_private/pdf/PDF_1.7_FTS/fts_25_2507.pdf.psdcmyk16.72.0

base/gxblend.c


2019-08-26 14:34:46 +0100
Robin Watts <Robin.Watts@artifex.com>
4cda7bfc8cc8c5c4dcd36167191012aa379100ac

Squash a couple of warnings.

base/gdevmem.c
base/gdevp14.c


2019-08-26 14:01:39 +0100
Robin Watts <Robin.Watts@artifex.com>
7b5166b5c65703abb02c15a31c9f8341f54d1470

Fix SoftLight blending in deep color transparency.

As seen with:

gs -sDEVICE=psdcmyk16 -r72 -dMaxBitmap=80000000 -o out.psd
tests_private/pdf/PDF_1.7_FTS/fts_09_0919.pdf

base/gxblend.c


2019-08-26 11:28:40 +0100
Robin Watts <Robin.Watts@artifex.com>
5875be5edeb034787a11760c9330cac039f13044

Fix problems with pngalpha and deep color transparency filling.

The pngalpha device is created with a depth of 32, with 3 color
components; this was confusing pdf14 into thinking that more
than 8 bits per color were being used, and so deep color buffers
were required.

To fix this we update the logic to be smarter; in cases where we
don't have a clear determination based on bits alone, we look
at the max_color and max_gray values. Because this code is now
more complex than before, we pull it into a shared function.

base/gdevdflt.c
base/gdevmem.c
base/gdevp14.c
base/gdevprn.c
base/gsptype1.c
base/gstrans.c
base/gxclthrd.c
base/gxdevcli.h


2019-08-23 15:06:17 +0100
Robin Watts <Robin.Watts@artifex.com>
6e7283fa5bcea9ffbe4bb9da440dd8fa4820e4d6

Fix deep color transparency issue.

Fix overflow in art_pdf_composite_knockout_16, seen in:

tests_private/comparefiles/Bug690546.pdf.psdcmyk16.72.0

base/gdevp14.c
base/gxblend.c


2019-08-22 18:24:49 +0100
Robin Watts <Robin.Watts@artifex.com>
628c9741323ea69b0be8e4008a81b1db3d644ab8

Fix deep color transparent pattern problems.

Transparency buffers are held as native endian. Pattern cache
tiles are held as big endian. When we make pattern cache tiles
from transparency buffers we therefore need a conversion.

base/gdevp14.c
base/gxblend.c
base/gxp1fill.c
base/gxpcolor.h


2019-08-25 19:35:14 +0200
Till Kamppeter <till.kamppeter@gmail.com>
be4da9d67cbec784be740086681f96a63496ae48

"cups"/"pwgraster" output device: Do not output LUTs with CUPS_DEBUG set

This change lets complete LUTs in the debug output only be listed when
CUPS_DEBUG2 is set and not already with CUPS_DEBUG.

cups/gdevcups.c


2019-08-25 19:08:52 +0200
Till Kamppeter <till.kamppeter@gmail.com>
0e28c843e56d1be4638bf9d84a499794534ea0d9

"cups"/"pwgraster" output device: Prefer the page size requested by user

Without special scaling/cropping options ("fit-to-page", "fill",
"crop-to-fit΅, ...) PDF and PostScript files printed with CUPS will be
printed with the page sizes of the document's pages and not the size
requested by the user via the "PageSize" or "media" option. This
allows correct printing of jobs with differently sized pages on
printers which have the appropriate sizes loaded without need of
manual intervention. Therefore the CUPS output device is matching each
input page against the sizes listed in the PPD to generate a correct
page geometry for the printer for each page.

Problem is if there are several equally-sized page size entries in the
PPD. Without further guiding always the first match is used, making
access to special functions provided by the others (like
full-bleed/borderless printing) inaccessible.

This commit adds the functionality of the user-requested page size
(via "PageSize" or "media" option) being preferred under the matching
page sizes, so that if for example a user selects a full-bleed version
of the desired page size and sends a photo, the photo gets rendered
and printed with the page geometry which the PPD reports for the
full-bleed version.

Nothing changes if the size of the user-requested page size does not
match the size of the input page at all.

cups/gdevcups.c


2019-08-25 12:45:27 +0200
Till Kamppeter <till.kamppeter@gmail.com>
a5ccd009fd632e058b4f0bc2849cfc293b39d1f2

"cups"/"pwgraster" output device: Small fix on size matching improvements

This is a fix for one little oversight on the changes to support matching
the input page size against the imageable areas of the PPD's page sizes.

This completes the fix of bug 701438.

cups/gdevcups.c


2019-08-24 23:11:10 +0200
Till Kamppeter <till.kamppeter@gmail.com>
a0284b5ac8c59014eab90c5a5ec388cd1676b79d

"cups"/"pwgraster" output device: Improved page size matching with PPD

Applied the following improvements for finding the correct page size
of the PPD file for the input page:

- Do not try to match by page size name, the input files do not
contain page size names.

- Do not only match the input page size against the actual media sizes
reported by the PPD but also to the imageable areas. Media size match
is preferred but if there is no media size match, we accept also
a match of the imageable area. In case of a match of the imageable
area we position the input page in the imageable area of the output
page.

- More debug output.

- In case of a custom page size (no match with PPD sizes) the page
size name in the CUPS Raster output is a correct "Custom.XXXxYYY"
and not the default page size name.

This should fix bug #701438.

cups/gdevcups.c


2019-08-23 18:09:32 +0200
Till Kamppeter <till.kamppeter@gmail.com>
ee43ff891b51f0ccec3ba38d538d3e23441ed439

"cups"/"pwgraster" output device: Reduced page size comparison tolerances

Before each page gets rendered its size is compared to the page sizes
of the PPD file to select the actual page size for the output. Reduced
the tolerances from 7% for the long edge and 5% for the short edge to
1%, as before easily wrong sizes got picked (See also bug 701438).

cups/gdevcups.c


2019-08-23 10:11:05 +0100
Chris Liddell <chris.liddell@artifex.com>
0311b61d5df67cd98e2c2d23ef3cec1cc4faa800

Windows Installer: cope with COMPILE_INITS=0

We default to COMPILE_INITS=1, and that was the only case that the installer
handled - i.e. building the installer with COMPILE_INITS=0 would install an
executable that wouldn't work without extra action (-I.. or similar).

This changes the installer compiler invocation, and the installer creation
so it behaves as it does now with COMPILE_INITS=1, but with COMPILE_INITS=0 the
installer will write the path to Resource/Init into the GS_LIB registry
key.

psi/nsisinst.nsi
psi/winint.mak


2019-08-22 23:30:34 +0200
Till Kamppeter <till.kamppeter@gmail.com>
137a0bda39f861600488b5a11c63914854c454c8

"cups"/"pwgraster" output device: Produce more debug output

When building with CUPS_DEBUG now debug output for the process of
matching the page geometry with the PPD file's page sizes is
produced.

cups/gdevcups.c


2019-08-22 08:58:01 +0100
Chris Liddell <chris.liddell@artifex.com>
09b53ebdc674f9f6e7a9c445e92617312dd93ab3

Handle explicit '\' escaping in path matching

As well as having to cope with both '/' and '\' as directory separators on
Windows, it turns out we also need to cope with the backslash separator being
explicitly escaped ("\\") - the explicit is added by the Postcript path
templating code in gs_init.ps.

I don't want to change templating code because that would likely have
implications in a lot of other places.

base/gpmisc.c


2019-08-22 10:51:28 +0100
Robin Watts <Robin.Watts@artifex.com>
f1692a288f1a17930f0b71e540908398a17d5366

Better CMYK conversion for bmpcmp

toolbin/bmpcmp.c
toolbin/bmpcmptab.h


2019-08-21 17:49:32 +0100
Robin Watts <Robin.Watts@artifex.com>
c8aaf3b7bc4232997d434170827fffd6887fc88f

Update bmpcmp.c to read psdrgb rather than psdbgr.

toolbin/bmpcmp.c


2019-08-21 15:33:27 +0100
Chris Liddell <chris.liddell@artifex.com>
9ba1827e220cd49a6732c04fcf3e55a268014377

Fix commit ec0b35fed3de: "Handle directory separators..."

The logic in the above fix was wrong.

base/gpmisc.c


2019-08-21 14:28:20 +0100
Robin Watts <Robin.Watts@artifex.com>
7d0206d2b118b26f6d87ba8f09d077eba417e4c9

Bug 701451: Fix clist color_usage calculations for shadings.

Or rather, don't attempt to calculate them badly, and just
use the safe "all colors" value.

base/gxclrect.c


2019-08-21 10:10:51 +0100
Ken Sharp <ken.sharp@artifex.com>
320ec9672b987a765324f89450de08b70aafbcd3

PDF interpreter - review .forceput security

Bug #701450 "Safer Mode Bypass by .forceput Exposure in .pdfexectoken"

By abusing the error handler it was possible to get the PDFDEBUG portion
of .pdfexectoken, which uses .forceput left readable.

Add an executeonly appropriately to make sure that clause isn't readable
no mstter what.

Review all the uses of .forceput searching for similar cases, add
executeonly as required to secure those. All cases in the PostScript
support files seem to be covered already.

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


2019-08-21 10:56:02 +0100
Chris Liddell <chris.liddell@artifex.com>
e5660f15f5fd4615254acec7ed403b4a7984cb09

Handle directory separators in access control matching

On Windows, we end up dealing with a mishmash of "/" and "\" as directory
separators, so a simple equality check isn't sufficient.

Since there is already (platform specific) function for checking whether a
string (or part thereof) is a directory separation, use it.

base/gpmisc.c


2019-08-20 21:50:18 -0700
Michael Vrhel <michael.vrhel@artifex.com>
596e9baa1b24b0a9dac4d8bad1ea80cd23dcab79

Disable use of alternate tint transform ICC profile

A prior commit introduced the use of color management
if the DeviceN or Separation device had an ICC profile
associated with the colorants. While there is an argument
for doing this, it is not the standard behavior seen in
AR. Disabling for now and will likely turn this into a
command line option.

base/gxcmap.c


2019-08-20 18:48:49 +0100
Robin Watts <Robin.Watts@artifex.com>
7547a2fc593e3a0bb8ea72f661389cd908c382f7

Fix crashes in RAW_DUMP debug code.

Dump the buffer before freeing the device, or the pointer will no
longer be valid.

Also, don't access through ppatdev14 when we know it's NULL.

base/gdevp14.c


2019-08-20 18:47:09 +0100
Robin Watts <Robin.Watts@artifex.com>
421727ed068b3f41fdbd9657d759397610fe8821

Fix deep color transparency pattern copying problem.

The following test:

tests/pdf/pattrans_solid_nonrect.pdf.psdcmyk16.300.1..gs

among others, was showing problems, due to us treating the offset
as bytes rather than shorts.

base/gxp1fill.c


2019-08-20 14:29:33 +0100
Robin Watts <Robin.Watts@artifex.com>
f9052f1debff2168d5a2606fa35bcaaf6f6f2ec7

Avoid signed overflow in deep transparency calculations.

base/gxblend.c


2019-08-20 12:24:03 +0100
Robin Watts <Robin.Watts@artifex.com>
898c9e5f06bb44ec3fd262b47eeaa5028e18773f

Fix overflow in deep color blending.

Multiplying a 16bit unsigned value with a 16 bit signed value
in a 32bit int means we lose the sign bit. Sacrifice a bit of
accuracy to avoid that.

base/gxblend.c


2019-08-20 10:10:28 +0100
Ken Sharp <ken.sharp@artifex.com>
85c9d6de80ba57deeee289238aa1c0202f584c3c

make .forceput inaccessible

Bug #701343, #701344, #701345

More defensive programming. We don't want people to access .forecput
even though it is no longer sufficient to bypass SAFER. The exploit
in #701343 didn't work anyway because of earlier work to stop the error
handler being used, but nevertheless, prevent access to .forceput from
.setuserparams2.

Resource/Init/gs_lev2.ps
Resource/Init/gs_pdfwr.ps


2019-08-19 10:03:57 +0100
Chris Liddell <chris.liddell@artifex.com>
3ba6d871c70398cfbd15b619127bf13ddea13282

Handle drag'n'drop file name/paths

Because we now run by default with the file access permission active,
we need to do additional work for Windows drag and drop files, so they don't
throw an invalidaccess error (since we implement drag and drop by sending
characters to the gs console to do '(file) run').

The problem is, we cannot add the file to read list, send the characters to the
console, and remove the file from the read list because, although SendMessage()
blocks until the message is handles, WriteConsoleInput() does not block until
the console buffers are consumed (i.e. it is asynchronous). So, there is no
certainty when the final SendMessage() in WM_DROPFILES case is finished that
Ghostcript will actually have run the file.

So, we create a list of dropped file names, add them to the permit read list,
when the next WM_DROPFILES event happens, or a WM_DESTROY event, we drop
file names from the permit read list before, if necessary, adding the current
ones.

psi/dwimg.c
psi/dwmain.c
psi/dwmainc.c
psi/dwtext.c
psi/dwtext.h


2019-08-16 15:43:32 +0100
Robin Watts <Robin.Watts@artifex.com>
d2e36e8ef01546aaee0cd0531fbc0fa932b23b99

Squash warnings in claptrap.

Thanks to William Bader for highlighting these.

base/claptrap-planar.c


2019-08-16 15:28:49 +0100
Robin Watts <Robin.Watts@artifex.com>
e34d5606835fc587e222b80bf9cac1bc40c4790b

Squash warning in gdevpsd.c

Thanks to William Bader for spotting this.

devices/gdevpsd.c


2019-08-16 13:08:14 +0100
Robin Watts <Robin.Watts@artifex.com>
f416b415e8e3a25446b66bf1a6253f86be0366de

Squash some compiler warnings.

base/gslibctx.c
base/gslibctx.h
devices/gdevpdfimg.c
devices/vector/gdevpdfu.c
pcl/pl/plmain.c


2019-08-15 11:39:51 +0100
Chris Liddell <chris.liddell@artifex.com>
9ead927968ff8104e1a81df1590fced74927639d

Dates and versions for 9.28 RC 1

base/gscdefs.h
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/Internal.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


2019-08-15 11:35:56 +0100
Chris Liddell <chris.liddell@artifex.com>
ae7dea2b9bd068f61b6aef312a7f4cbc9860cac3

Revision date

base/version.mak


2019-08-15 17:06:02 +0100
Chris Liddell <chris.liddell@artifex.com>
2f8e2423c860e89b325675dc1311819179740c76

Add -dNOSAFER for Windows installer cidfmap creation

psi/nsisinst.nsi


2019-08-15 14:36:55 +0100
Ken Sharp <ken.sharp@artifex.com>
226fb24dbe4f844b8c7531be3eccc2bfae1a103d

ps2write - don't password encrypt PostScript output!

Noticed while testing the args commit; if we set -sOwnerPassword (to
create a password-protected PDF file), but select (e)ps2write as the
device, then the resulting PostScript file would have all the streams
(in a PDF sense) encrypted with PDF password encryption.

Unsurprisingly, this result in a completely unusable PostScript file.
Lets not permit that....

devices/vector/gdevpdfp.c



Version 9.50 (2019-10-15)

Highlights in this release include:

  • The change to version 9.50 (rather than the intended 9.28) follows recognition of the extent and importance of the file access control redesign/reimplementation outlined below.

  • The file access control capability (enable with -dSAFER) has been completely rewritten, with a ground-up rethink of the design. For more details, see: SAFER.

    It is important to note that -dSAFER now only enables the file access controls, and no longer applies restrictions to standard Postscript functionality (specifically, restrictions on setpagedevice. If your application relies on these Postscript restrictions, see OLDSAFER, and please get in touch, as we do plan to remove those Postscript restrictions unless we have reason not to.

    IMPORTANT: File access controls are now enabled by default. In order to run Ghostscript without these controls, see NOSAFER

  • Important Note for Windows Users: See below under Incompatible Changes

  • 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.

  • Special thanks to Akira Kakuto, Paul Wessel, William Bader, Nelson H. F. Beebe and everyone else who put time and effort into testing this new release.

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

Incompatible changes

  • There are a couple of subtle incompatibilities between the old and new SAFER implementations. Firstly, as mentioned above, SAFER now leaves standard Postcript functionality unchanged (except for the file access limitations). Secondly, the interaction with save/restore operations, see SAFER.

    Important Note for Windows Users:
    The file/path pattern matching is case sensitive, even on Windows. This is a change in behaviour compared to the old code which, on Windows, was case insensitive. This is in recognition of changes in Windows behaviour, in that it now supports (although does not enforce) case sensitivity.

  • The following is not strictly speaking new to 9.50, as not much has changed since 9.27 in this area, but for those who don't upgr