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.51 (2020-03-02)

Highlights in this release include:

  • 9.51 is primarily a maintainance 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 are now maintaining a policy of 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-thred"). 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.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-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,119.50-1..+3 ...

This is equivalent running multiple times with MEMENTO_FAILAT set to 115866,
115867, 11588, 119927, 119.50, 119929.

base/memento.c


2020-02-24 10:38:53 +0000
Julian Smith <jules@op59.net>
39557bd53eee75a8b8f762457ce57a5437e79d6c

Fix for MEMENTO_FAILAT=119.50: 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=119.50 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>
08695f8ccebb0d25eb2a5933ecee9.501eefc1be

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>
ba331d45f8e5be7723ff7bca9450f09.50910464

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>
10d2678613d5a93bedc094a62b1b989.5071f464

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.50 +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>
dd95eb235f00a600f8b8b99b8929e59.503fa96c

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>
98a8b291b135d49ffca23d9.509786971cf33a12

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>
d11a43b64a2e623aebdfa34f8ee9.5087dc5b2b2

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.50 RC 1

Date for 9.50 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.50 rc3

Dates and docs for 9.50 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.50.

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.50-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.50"

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>
ec0b35fed3de9f313c7c9.5044daac5f3f28618d

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.50.

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.50 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>
cd3db03d3e04c9146b59.500d6da76cec23f60a6

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.50 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.50-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.50"

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.50 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.50 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.50) 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 upgrade with every release:

    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

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-27 13:26:01 +0100
Chris Liddell <chris.liddell@artifex.com>
b0574cdb5b427690ac8d95679930c9f6cc1bdffb

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>
cce67ebf4c209ae3cbcc671e944596c64a3d7fc9

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>
24c9f7f4a8d3e85e572094b4aedddbeeb02d5ef1

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>
c40963eb024265ab28f4f897401ad7a050ca9425

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>
7d70bd4338291c99234dd0078b5cdc85178c0540

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>
2f713b99e1a626ba4b7b1be8cc715043bb4e0f0a

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>
31df729a821d1683381493b96c2ecced9da1e5e2

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>
ca553d6d3ec0fa1455cf400629e08db90658aa85

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>
205e2f529e6da569ec764ebb4aeddc41c66a8860

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>
dd19ec5348723a5c70ff728911f856caa518166b

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>
da7486fc4b00eee956200d45fb340dc62c8e3bcb

Slight improvement to "permit-file-***" parameter documentation.

doc/Use.htm


2019-09-20 11:17:53 -0700
Ray Johnston <ray.johnston@artifex.com>
0222263e4fe03b29e9eb4141f7866fa8261d416a

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>
0557d5d6628279fc526e9d87f05433800ce1b025

Dates etc for 9.50 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.50-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.50"

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>
e62f684be3d80bb5599a669ddca3ee1b544100d8

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.50 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.50 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


2019-08-13 14:43:51 +0100
Chris Liddell <chris.liddell@artifex.com>
fd14a8e3701a7f75d758a1e536bcafbddeb70289

Document the new SAFER/file access controls

The documentation for the old SAFER remains in place (noted as deprecated) until
we actually remove it. Document accessing the old SAFER functionality
(-dOLDSAFER).

Generally, tidy up the HTML/formatting of the parameter and operator lists
in Use.htm and Language.htm - mainly making indenting even and consistent.

List .setpdfwrite as deprecated

Include setting the target of the first parameter of gsapi_new_instance() to
NULL before calling it, and fix the examples in API.htm

doc/API.htm
doc/Language.htm
doc/Use.htm
doc/VectorDevices.htm
doc/style.css


2019-08-13 14:40:45 +0100
Chris Liddell <chris.liddell@artifex.com>
79a06b45e784e6839b2b2129cd2620ea606254e1

Enable new 'SAFER' protection by default.

We'll now run by default with file access controls enabled. SAFER (and
.setsafe) now *only* enables file access controls. The old SAFER functionality
is (temporarily) available by specifying "-dSAFER -dOLDSAFER" on the command
line, or "-dOLDSAFER" before the call to .setsafe.

Resource/Init/gs_init.ps


2019-08-13 08:28:06 +0100
Chris Liddell <chris.liddell@artifex.com>
9883f2a931407503778bb94948b47480eff858b2

Add null file to the permit writing list

base/gslibctx.c


2019-08-12 12:21:50 +0100
Chris Liddell <chris.liddell@artifex.com>
7abf720f46dd9ff6018b7f29141ba0573016d59d

Use enum values for shutting down the file access lists

base/gslibctx.c


2019-08-09 14:43:17 +0100
Chris Liddell <chris.liddell@artifex.com>
d86ecec686d77e69f7c4a10df9da8c4cd8336a03

Tweak to better handle undefined transparency ops

examples/transparency_example.ps


2019-08-08 10:46:39 +0100
Chris Liddell <chris.liddell@artifex.com>
7ca1bb5794997e0dba059a5be6f85a9eaefc915d

Fix gs_add_explicit_control_path()

it was always adding to the "read" list, rather than the list requested by the
parameter.

base/gslibctx.c


2019-08-08 10:33:18 +0100
Chris Liddell <chris.liddell@artifex.com>
34dac4d2a1b195536fcb9d796168cd1360c0e500

Don't bind and undefine .copytree

.copytree is a Postscript proc that calls itself recursively, hence we cannot
bind it nor undefine it.

Resource/Init/gs_setpd.ps


2019-08-06 09:32:32 +0100
Chris Liddell <chris.liddell@artifex.com>
4d53f6ee868205c76950027e76a27f0278513a39

Tweak the interaction of file permissions and -I

The new file permissions code differentiates between 'path', 'path/' and
'path/*', whilst the old -I code did not.

This slightly modifies how the -I stuff drives the file permissions stuff so it
works (more) like the previous -I behaviour.

The remaining difference is that the new code always treats '*' as a wildcard,
where the old code would permit '*' as a 'real' character in a path.

Resource/Init/gs_init.ps


2019-08-15 09:52:04 +0100
Ken Sharp <ken.sharp@artifex.com>
00af0eb11b82c4dfddbe91bcb70caed2e61a1cc8

pdfwrite/ps2write/pdfimage - record args used

Following on from commit 813d7e96c8733f85d59a62732171cf7cedfc087d this
adds functionality to the pdfwrite and pdfimage families of devices to
actually write the args that were used to generate the output file into
the final output file, as comments.

Output files are somewhat larger with this commit, but only very small
files are in any way significantly larger. We do have a number of such
files in our test suite which exhibit larger output ( > 5%increase).

devices/gdevpdfimg.c
devices/vector/gdevpdf.c
devices/vector/gdevpdfu.c
devices/vector/gdevpdfx.h


2019-08-12 16:30:46 +0100
Robin Watts <Robin.Watts@artifex.com>
813d7e96c8733f85d59a62732171cf7cedfc087d

Capture args to feed to pdfwrite.

To facilitate debugging, we want a way to pickle the gs invocation
used into device output (for devices that want it).

We therefore amend the argument processing logic to pass arguments
to gs_lib_ctx, where they will are 'sanitized' and stored in a list.
This list can then be accessed by a device.

We are careful to sanitize the args so as not to reveal paths or
secret passwords/code etc. Essentially we never store any filenames
or string values stored (except for certain whitelisted -s options).

It is likely that we'll want to expand the whitelisted values in
future.

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


2019-08-14 16:47:36 +0100
Robin Watts <Robin.Watts@artifex.com>
8ba95fb06387572160fee5e4c1e51d972401566e

Fix gs_lib_ctx memory calls to use the correct memory pointer.

base/gslibctx.c


2019-08-14 08:03:45 -0700
Ray Johnston <ray.johnston@artifex.com>
ddddd71785d058b036775566d36d6848c9817f80

Fix -F____ and -f____ to actually run the file ____.

Commit 7ecbfda9 broke -F completely since it requires the file to run to
immediately follow the switch, and -f____ use to run the file, but since
gs_add_control_path returns 0 as long as there was no error, the code
never called argproc. Also, argproc already does the add_control_path
and remove_control_path, so simplify -f and -F code.

Also gs_add_outputfile_control_path was ignoring the return code when
adding the full pipe string as a path, so fix it.

Note that plmain ignores the return code from gs_remove_control_path,
but that should be OK.

base/gslibctx.c
psi/imainarg.c


2019-08-12 13:53:29 +0100
Robin Watts <Robin.Watts@artifex.com>
3eb2b1337260a17274588d377032e1f9953062fd

Squash double -> int warning message with explicit cast.

base/gxblend.c


2019-08-13 11:54:36 +0100
Robin Watts <Robin.Watts@artifex.com>
8b5af0e2db28be36d96de97eb1a145d5716ffea3

Tweak lcms to optimise the pipeline before consulting plugins.

This allows us to recognise identity transforms before selecting
one of our optimised lookup functions. Firstly, however optimised
our code is, we aren't going to beat the identity code. Secondly,
lcms doesn't calculate the tables for identity transforms, so
our code can fall in a heap here.

lcms2mt/src/cmsxform.c


2019-08-13 16:05:37 +0100
Ken Sharp <ken.sharp@artifex.com>
15d95340389f0f46bd214803ec19685c0a738a0e

Deprecate .setpdfwrite

The .setpdfwrite operator nowadays does nothing more than increase the
VM threshold, which is relatively pointless so we're going to remove it.

In this commit; add a warning message to the .setpdfwrite operator so
that anyone using it will be warned. Remove usage from the various
shell scripts we provide.

Resource/Init/gs_pdfwr.ps
lib/dvipdf
lib/ps2pdfwr
lib/ps2pdfxx.bat


2019-08-12 16:06:21 +0100
Ken Sharp <ken.sharp@artifex.com>
8cc13d54850af14a07e72f73cca20e96ed01fd03

PDF interpreter - ignore visibility of annotations for devices which support them

No bug for this, arose from a Stack Overflow question, but its a FAQ
as well.

It used to be the case that the PDF interpreter would (and should)
render files containing annotations with the Print and NoView flags
differently, depending on whether the destination was to be rendered
or sent to a high level device. This is controlled with the -dPrinted
flag to determine whether annotations should be treated as for a Print
device or a View device.

This doesn't make a lot of sense for pdfwrite though. We really want to
keep the Annotation 'as is' and let the viewer or printer of the output
PDF file deal with it.

In the past we've moved the annotation handling for pdfwrite and,
technically, for any device which directly supports annotations from
'drawannot' to 'preserveannot'. Now that we've done that, it makes some
sense to have the 'preserveannot' code no longer check the annotation's
visibility, but simply preserve it as you would expect. NOTE we do check
the visibility state of annotations that we don't know how to handle.
These will not be preserved as annotations, but will be drawn into the
page contents, so we don't want to render any which should be invisible.
Such annotations are still affected by -dPritned.

Resource/Init/pdf_draw.ps


2019-08-09 15:57:54 +0100
Ken Sharp <ken.sharp@artifex.com>
368bc91bf0bba66f31204e1ee57da7c9b70b32bb

pdfwrite - fix a minor error

I don't think this causes any actual problems, but the correct return
should be 0, not an error, when we can't find a Pattern resource.

devices/vector/gdevpdfi.c


2019-08-09 15:56:45 +0100
Ken Sharp <ken.sharp@artifex.com>
9a871de445eaed295748a3b489e138e87b9e0b65

Transparency compositor - forward unhandled special_ops to target device

Noticed while doing earlier work. The pdf14 device only passed on a few
specific gxdso_ special_op types to the target device, the remainder
were sent to the default handler. This seems wrong and caused problems
for my new gxdso at the time. Instead of it going through the pdf14
device and ending up at pdfwrite (or the default handler for other
devices) it was always going to the default handler and never making
it to pdfwrite when rendering transparency.

The pdf14 device should instead handle any gxdso_ special_ops that vary
depending on rendering. For instance the JPEG passthrough should *not*
be passed to the target device, the pdf14 device needs to have the
uncompressed image data to render it to the compositor buffer.

This commit adds handlers for such gxdso_ special ops, and passes all
the remaining unhandled ones to the target device for processing.

For some reason this causes diffs in halftones, I have no idea why. but
they don't seem like problems.

base/gdevp14.c
base/gxdevsop.h


2019-08-09 17:14:42 +0100
Chris Liddell <chris.liddell@artifex.com>
1ca2c331684ca2912c431771d1aac8bc5cb42e76

Fix line endings (file had some '\r' line endings).

Resource/Init/pdf_draw.ps


2019-08-08 09:07:09 +0100
Ken Sharp <ken.sharp@artifex.com>
e9e253e1dbc87d6ef772936130076e1ba3b81867

pdfwrite - don't permit fallback font substitution with PDF/A

Bug #701373 "PDFA fails to validate by Preflight"

The inptu is a PDF file which is missing two fonts, Helvetica and
Calibri. For both fonts we use /Helvetica as a substitute. For the
missing Helvetica font this is correct, but for the missing Calibri font
this leads to problem when creating PDF/A otuput files.

Firstly, we now have two different fonts, with differing /Widths which
are potentially attempting to reference the same glyphs from a single
font. Secondly, no matter what we do, the /Widths from the Calibri font
are not going to match the actual glyph metrics from Helvetica.

Since there is no possible way to deal with the second problem, because
either the metrics won't match the /Widths, or the text will be misplaced
if we use Widths that are not those from Calibri, there is no point in
trying to tackle the first problem.

So here we introduce a new special_op 'EventInfo' which passes a single
name to the device. The name is the name of the event which occurred. For
now this can only be 'SubstitutedFont'. The only device which handles
this event is pdfwrite, all other devices simply ignore it. The pdfwrite
device checks to see if it is creating a PDF/A otuptu file, and if it is
then it emits a warnign and aborts the production of PDF/A.

Resource/Init/pdf_font.ps
base/gdevdflt.c
base/gdevp14.c
base/gxdevsop.h
devices/vector/gdevpdfi.c
psi/zdevice.c


2019-06-14 16:52:28 -0700
Michael Vrhel <michael.vrhel@artifex.com>
009d44b855dcda9d0d9ecf5ca20944504648eebe

CompatibleOverprint Mode

Ray did the interpreter work on this and Michael did the graphics
library portion.

For the interpreter:
When OP is set, change to CompatibleOverprint mode, but don't push a
transparency group or change opacityalpha when the current blendmode
is Normal or Compatible. This was determined based on the note on page
568 of the PDF 1.7 spec (section 7.6.3 in the area titled "Compatibility
with Opaque Printing"). It states:

Note: It is not necessary to create such an implicit transparency
group if the current blend mode is Normal; simply substituting
the CompatibleOverprint blend mode while painting the object
produces equivalent results. There are some additional cases in
which the implicit transparency group can be optimized out.

After painting, if the group was pushed, pop the group, and restore the
opacityalpha and shapealpha,then restore the blendmode (if it was
CompatibleOverprint).

NB, we don't attempt to optimize any other groups hinted at in
Adobe's comment.

In addition, if we are going to an output device that handles transparency
compositor actions do not do any of the above stuff.

For the graphics library:
When doing blending in non-isolated groups with compatible overprint
the non-drawn colors must be corrected during the fill rectangles to
ensure that the proper amount is maintained with the changing group
alpha values. This is poorly documented in the specification.
In addition, the spec is poorly written in terms of how the blend
computation is performed for overprint compatible.

The spec claims the following:

If the overprint mode is 1 (nonzero overprint mode) and the
current color space and group color space are both DeviceCMYK,
then only process color components with nonzero values replace
the corresponding component values of the backdrop. All other
component values leave the existing backdrop value unchanged.
That is, the value of the blend function B(Cb,Cs) is the source
component cs for any process (DeviceCMYK) color component whose
(subtractive) color value is nonzero; otherwise it is the
backdrop component cb. For spot color components, the value is
always cb.

The equation for compositing is

ar*Cr = (1-as)*Cb + as*[(1-ab)*Cs+ab*B(Cb,Cs)]

Now if I simply set B(cb,cs) to cb for the case when the
DevieCMYK value (with opm true) is zero I get

ar*Cr = (1-as)*Cb + as*[(1-ab)*Cs+ab*Cb]

But what I am seeing with AR is
ar*Cr = (1-as)*Cb + as*[(1-ab)*Cb+ab*Cb] = (1-as)*Cb + as*Cb = Cb
which is what I think we want.

The description in the spec is confusing as it says
"then only process color components with nonzero values replace
the corresponding component values of the backdrop. All other
component values leave the existing backdrop value unchanged"

which makes sense for overprinting,

vs.

"That is, the value of the blend function B(Cb,Cs) is the source
component cs for any process (DeviceCMYK) color component whose
(subtractive) color value is nonzero; otherwise it is the
backdrop component cb."

Which is NOT the same thing as leaving the backdrop unchanged
with the compositing equation
ar*Cr = (1-as)*Cb + as*[(1-ab)*Cs+ab*B(Cb,Cs)]

For this to work, we need to carry out the operation during
the mixing of the source with the blend result. Essentially
replacing that mixing with the color we have here.

Resource/Init/pdf_draw.ps
Resource/Init/pdf_main.ps
Resource/Init/pdf_ops.ps
base/gdevp14.c
base/gdevp14.h
base/gstrans.h
base/gxblend.c
base/gxclpath.c


2019-08-07 10:24:49 -0700
Ray Johnston <ray.johnston@artifex.com>
d8f05309d5e54b6e75c2b78af9c0bcf5f62b493c

Bug 701308: Fix clip transpose logic that resulted in garbled output.

This seems like it should have showed up earlier, but when the clip
rectangle list was transposed, the _t1 and _s1 clip_fill_rectangle_
functions were confused about the coordinates being sent to the target
device fill_rectangle.

Also during debug, I found that if the clip list consisted of more than
a single rectangle, clip_get_clipping_box was only using the first rect,
rather than accumulating the outer_box for the entire list.

base/gxclip.c


2019-08-06 12:44:49 +0100
Ken Sharp <ken.sharp@artifex.com>
ff856d0c44ce7d3f4d204f4a405857a6a6672a80

pdfwrite - handle nested Patterns inside a transparency Group

Bug #701181 "Incorrect output after ghostscript processing of a PDF file"

The PDF file is constructed in a somewhat sub-optimal fashion. Each
background square 'grid' is a Form, each Form draws the content by
filling the area with a solid colour, and then drawing white lines
across it. The white lines (actually rectangles) are drawn using a
Pattern.

So far so good, however the Pattern simply executes a Form, that Form
then fills another rectangle, with another Pattern, its this final
pattern which does the drawing.

This is two levels of indirection more than required.

Normally this isn't a problem because we don't attempt to preserve
Forms from PDF files (and this is one example of why we don't). But....
If the file involves transparency Groups, then we must use a Form
XObject for the Group.

In this case the CTM of the first pattern is the CTM of the 'enclosing
context', ie the Form, but the CTM of the second pattern is also the
CTM of the 'enclosing context', but now that means the first pattern,
not the Group.

To cater for this we track the number of patterns defined since the last
Form definition. If its 0 (ie this is the first pattern since a Form
definition) then we just use the CTM. If its greatre than 0, however,
then we 'undo' the scaling applied by pdfwrite, in order to get back to
the CTM of the enclosing pattern.

Its possible that more extreme examples (patterns inside patterns
inside groups inside patterns inside groups) might still not be entirely
correct, but we have no examples of this (Patterns inside patterns are
relatively rare). If we find any we can revisit this.

devices/vector/gdevpdfb.h
devices/vector/gdevpdfi.c
devices/vector/gdevpdft.c
devices/vector/gdevpdfv.c
devices/vector/gdevpdfx.h


2019-08-05 17:50:04 +0100
Ken Sharp <ken.sharp@artifex.com>
f69b63a3dc3bb7671df956587fe2520f8badab88

PDF interpreter - cope with strangely constructed Pages trees

Bug #700953 "Error: /execstackoverflow in --.systemvar--"

The pre-interpretation scan of the Pages tree looking for loops in the
tree structure uses recursion; if a Pages tree is badly constructed it
is possible to recurse enough times to cause an overflow of the exec
stack.

We can cope with this by aborting the scan and continuing to interpret
and render the PDF file, because the regular processing of PDF file
doesn't use recursion.

Of course, this does mean that we lose the check for loops in the Pages
tree (at least, loops beyond the point where we overflow the exec stack)
but both conditions are rare, so I think its worth doing.

We do still raise a warning.

Resource/Init/pdf_main.ps


2019-08-05 10:05:58 +0100
Ken Sharp <ken.sharp@artifex.com>
fd915a81c605a52f58855bd233c19aaa373b2f69

pdfwrite - improve CIDFont generation

Bug 701010 "Low Printer VM and gswinc32.exe crashing on postscript file with Korean text"

The problem in this case is that the PostScript uses a CIDFont with two
descendant fonts. PDF only permits a single descendant font in a CIDFont
so pdfwrite can't simply copy the font 'as is'.

Instead we create a type 0 font (CIDFont) for each descendant and switch
between them as required.

The problem here is that the code for retrieving an existing Type 0
CIDFont for a given descendant in the PostScript assumed that the name
of the CIDFont would be of the form /FontName-CMapName, and the font
we have here does not match that.

In fact, I'm not at all sure that this is *ever* the case, certainly
none of our test files seem to exercise this (bearing in mind that its
the Type 0 CIDFont generated by pdfwrite that we are checking against
and I can see no code that created a name of that form).

So what was happening was that every time the PostScript CIDFont
switched descendants, we generated a new Yype 0 font, along with all the
attendant structures, such as a ToUnicode CMap (256kB on its own). In
fact the first line of text in the file switches descendants 26 times,
leading to us creating something like 21 MB of extra font information.

We now extend the check so that if the name is not FontName-CMapName we
check the FontName and the CMap Name (which we do also store) separately
and if they match we reuse the existing Type 0 font.

The supplied test file now runs to completion, all 217 pages, with a
peak memory usage of ~22.8MB whereas it previously exhausted memory,
using ~2GB, at page 111. In addition the resulting PDF file is around
95% smaller and the performance is noticeably improved on this file.

devices/vector/gdevpdtt.c


2019-08-02 15:18:26 +0100
Chris Liddell <chris.liddell@artifex.com>
5b85ddd19a8420a1bd2d5529325be35d78e94234

Bug 701394: protect use of .forceput with executeonly

Resource/Init/gs_type1.ps


2019-07-31 13:34:06 +0100
Chris Liddell <chris.liddell@artifex.com>
3ed82a40fd4b49.50c79955319b6d67d1e092006

Add a way to record the selected cmap

(for the pdfi branch)

base/fapi_ft.c
base/gxfapi.h
pcl/pl/plfapi.c
psi/zfapi.c
xps/xpsfapi.c


2019-08-01 08:55:31 +0100
Chris Liddell <chris.liddell@artifex.com>
1eb609f130c397144702097f4d987f3b956770f9

Add 'post' table name lookup to TTF in graphics lib

Make Mac Roman glyph ordering available to 'clients'

(in support of the pdfi branch)

base/gstype42.c
base/gxfont42.h


2019-07-31 15:04:37 +0100
Ken Sharp <ken.sharp@artifex.com>
788958decad94b7b3f7a478cfb57724323041bf5

Fix Separation and DeviceN Alternate colour space generation

Bug #701369 "PB with Pantone color in pdfwrite"

When converting to a specified colour space, if we encounter a DeviceN
or Separation space, we leave the spot inks in place but change the
alternate space to the defined colour conversion space, and generate a
new tint transform which approximates the original colours.

However there was a logical error in the code, which only became
apparent if TransferFunctionInfo was set to something other than 'Apply'

Normally this doesn't happen, but commit
2e68cc460dbe349f68b81082ff7344db48eb4820 changed the behvaiour when
we are doing colour conversion to prevent us trying to apply a transfer
function to a SMask, which we can't do.

This then exposed the fact that we were not copying the concretized
samples to the client_colour structure, but we were reading them *back*
from the client_colour structure to set the low and high values in the
generated tint transform function.

The solution is to copy the components from the concretized colour
outside the if clause testing the TransferFunctionInfo.

This fix continues to work properly with the file from bug #700052

devices/vector/gdevpdfg.c


2019-07-24 12:36:35 -0700
Ray Johnston <ray.johnston@artifex.com>
4367024d102c6363ba7536227790564466ec9ddc

Fix debug PDF14_OPCODE_NAMES -- PDF14_BEGIN_TRANS_PAGE_GROUP was missing.

base/gstrans.h


2019-07-23 14:48:32 +0100
Robin Watts <Robin.Watts@artifex.com>
9a8e9c6f7bd45531a1b01eb0d697a6dc48cde2b0

Add arm option to clusterpush.pl

toolbin/localcluster/clusterpush.pl


2019-07-22 12:18:52 -0600
Henry Stiles <henry.stiles@artifex.com>
4de965abeddf859b91937314bc7e86de25acb729

Bug #701339, fixes total pattern length of 0.

Fallback to the default path code if the total pattern length is 0.
This can happen because PCL XL represents pattern length elements as
integers not floats.

devices/vector/gdevpx.c


2019-07-22 19:33:44 +0100
Robin Watts <Robin.Watts@artifex.com>
a628e509caf40ddec3d016dd9ff6379f12be7cc1

Ensure pdf14_put_image linebuf is long enough to avoid overrun.

The assumption is that we can write in 32byte lumps, so we may
overrun the actual amount we need by 28 bytes. Allow for this.

base/gdevp14.c


2019-07-21 16:26:28 +0100
Robin Watts <Robin.Watts@artifex.com>
4d8b6c57ef7272d41fb389a4dc9546f078ba3b2d

Rework CAL cflags.

Cope with building for machines that have SSE4.2, but not AVX2,
that crash on SSE4.2 code compiled with the -mavx2 flag.

Makefile.in
base/cal.mak
configure.ac


2019-07-22 13:07:59 +0100
Ken Sharp <ken.sharp@artifex.com>
909a87a15b5f8fede1f6bfeac2005327a7ca1601

Permit extra widths on space glyphs (PDF Tw value) even for xyshow

For the benefit of the pdfi interpreter. With the PDF in PostScript
current interpreter, we apply Widths using a cshow procedure. The pdfi
interpreter instead uses the x_widths and y_widths arrays, intended for
use with the PostScript xyshow operator instead.

However, the existing code doesn't add the extra width to space glyphs
if we have TEXT_REPLACE_WIDTHS set (ie an xyshow).

Here we move the code for the additional width out of the 'else'
clause in show_move() so that we always have the value available. We
then apply the dx and/or dy values in both cases.

We also need to relax the 'invalid' checking which is performed at a
higher level in the code (gx_device_text_begin) because this combination
is explicitly barred there and returns an error.

base/gstext.h
base/gxchar.c


2019-07-20 11:34:46 -0700
Robin Watts <Robin.Watts@artifex.com>
239d9035a011c212b015951bb2d75114ba11bee0

Add cal operation to clusterpush.pl

toolbin/localcluster/clusterpush.pl


2019-07-20 19:34:00 +0100
Robin Watts <Robin.Watts@artifex.com>
0d4dcb839b679a01f38aac2156c2bb87a819b0d4

Squash warnings in CAL build.

base/gxblend.c
base/gximono.c


2019-07-18 15:47:54 +0100
Robin Watts <Robin.Watts@artifex.com>
e5faf407dcb7c9679537313cebd55a747098f6f8

Bug 701296: Fix Interpolation in Indexed spaces with UseFastColor

The get_color_handler logic was being called with pcs = Indexed, and
so doing pcs = pcs->base_space. Then it was checking that pcs == the
concrete space, seeing that it was, and deciding it could then use
the device colors direct. The problem is that pcs->base_space is a
greyscale space, so when running to (say) an rgb output, we have the
wrong color data.

We now check for the number of components being as we expect, and
for the space being one of our 'default' ones before choosing to
take the 'fast' route.

base/gsicc_manage.c
base/gsicc_manage.h
base/gxiscale.c


2019-07-17 10:25:45 -0700
Michael Vrhel <michael.vrhel@artifex.com>
c0e588f679fca92d92045049fd60846b57da899c

Fix crash when RAW_PATTERN_DUMP is enabled

RAW_PATTERN_DUMP is used to help debug pattern issues.
Crash introduced when changes were made to file i/o.
Easy to overlook since this is rarely enabled.

base/gxpcmap.c


2018-07-26 14:35:48 -0700
Michael Vrhel <michael.vrhel@artifex.com>
c7499c426c0307880e9a34a577492d99a976c15b

Introduce CAL based transparency accelerations.

Authored by Michael Vrhel.

base/cal.mak
base/gdevp14.c
base/gdevp14.h
base/gstrans.c
base/gxblend.c
base/gxblend.h
base/gxblend1.c
base/lib.mak


2018-07-03 11:36:07 -0700
Michael Vrhel <michael.vrhel@artifex.com>
2533344c1bad749e81c3cef91e770ba4ea5a1a1d

Introduce CAL based SSE4.2 and AVX2 optimisations.

Authored by Michael Vrhel.

base/cal.mak
base/gsicc_lcms2mt.c
base/gxicolor.c
base/lib.mak
psi/msvc.mak


2019-07-17 07:14:21 -0700
Robin Watts <Robin.Watts@artifex.com>
2682485aefb808e5dca7191b980aa83880821dcc

Update configure for CAL to spot AVX2 as well.

configure.ac


2019-07-16 12:04:04 +0100
Robin Watts <Robin.Watts@artifex.com>
58d1db5850d470856f8c83af9a573b9c5c18e519

Move cal_context into gs_lib_ctx core.

This avoids us having to repeatedly init/fin the CAL lib.

base/gdevdrop.c
base/gslibctx.c
base/gslibctx.h
base/gxicolor.c
base/gxidata.c
base/gximage.h
base/gximono.c
base/lib.mak
base/siscale_cal.c


2019-07-17 10:19:47 +0100
Robin Watts <Robin.Watts@artifex.com>
47cd6503f34921c840df7c96faa9d957603521e7

Bug 701323: Skip oversize TIFF checks in BigTIFF mode.

If we have -dUseBigTIFF, then we don't need to check that
we don't exceed 4Gig.

This appears to work, but I don't have any code that will
actually load and show me a >4Gig TIFF!

devices/gdevtsep.c


2019-07-15 18:43:04 +0100
Robin Watts <Robin.Watts@artifex.com>
efce71ac4d500231296d1c84f62077666e0966a1

Fix SEGV seen in saved-pages-test run.

The following job:

membin/gs -Ilib -sOutputFile=out.%04d.psd --saved-pages-test
-dMaxBitmap=10000 -sDEVICE=psdrgb -r300 -Z: -sDEFAULTPAPERSIZE=letter
-dNOPAUSE -dBATCH -K2000000 -dClusterJob -dJOBSERVER
/home/regression/cluster/tests_private/comparefiles/Bug691425.pdf

SEGVs due to a buffer overrun.

We are attempting to copy a list of up to GX_DEVICE_MAX_SEPARATIONS
spot colors for the page into a list that's only GX_SOFT_MAX_SPOTS
long.

We just extend the storage here to cope.

base/gxclist.h


2019-07-15 11:50:27 +0100
Robin Watts <Robin.Watts@artifex.com>
105891fadfa649a7b0e3196cc6b0a9865fbf3cac

Fix SEGV seen in -dUseCIEColor testing.

The following test fails with a SEGV in overnight testing:

tests_private/ps/ps3cet/30-07.PS.psdcmyk.300.1

I can reproduce the problem with this call:

membin/gs -Ilib -sOutputFile=out.%d.psd -dUseCIEColor -dMaxBitmap=10000
-sDEVICE=psdcmyk -r300 -Z: -sDEFAULTPAPERSIZE=letter -dNOPAUSE -dBATCH
-K2000000 -dClusterJob -dJOBSERVER -dCETMODE %rom%Resource/Init/gs_cet.ps
tests_private/ps/ps3cet/30-07.PS

(with a hacked version of Memento so that blocks aren't all put into
their own chunk).

The problem is that when a shading is built it contains a set of
params, one of which is a reference to the cie_joint_caches
structure. This structure is held in a chunk of memory allocated
from pgs->memory. This entire chunk of memory goes away when an
l2restore happens. The built shading, however, is referenced by
a PS object that can (and does) outlive this.

When a gc happens, it follows the pointer as part of the enumeration
and crashes due to it having been freed already.

The fix implemented here, is to add a new graphics lib entrypoint
that returns a reference to a copy of the current caches, allocated
in a given memory space; we use that to get a reference to the
caches in the same memory space (and hence with the same lifespan
as) the shading.

base/gscie.c
base/gscie.h
psi/zshade.c


2019-07-12 16:53:58 +0100
Robin Watts <Robin.Watts@artifex.com>
7e9df44328a8a6796a83331a4ab5f9b31091a02c

Fix SEGV with psdcmykog device and files with > 7 spots.

Example invocation:

membin/gs -Ilib -sOutputFile=out.%d.psd -dMaxBitmap=10000
-sDEVICE=psdcmykog -r600 -Z: -sDEFAULTPAPERSIZE=letter
-dNOPAUSE -dBATCH -K2000000 -dClusterJob -dJOBSERVER
./tests_private/comparefiles/Bug693541.pdf

The PDF14 buffers are set up to have dev->color_info.num_components
planes. When these buffers are written into, components 0 to num_spots-1
inclusive are written. If num_spots > num_components, we overwrite
data.

Devices such as psdcmyk expand num_components to accomodate the
number of spots found on the page. Devices such as psdcmykog
do not; they stick with the number of spots they know about to
start with (i.e. 2).

Accordingly, if we run a file through with (say) 11 spots on the
page, with a psdcmykog device, the pdf14 device is setup with
num_comps = 7 (6+alpha), but the number of spots is taken as
the number of spots on the page (11), and thus we have memory
overwrites.

The fix attempted here is to set the number of spots to be
num_comps - number_of_standard_comps.

base/gdevp14.c
base/gdevp14.h


2019-07-03 20:24:24 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
6b0aab1de02cfc44515ff05f70be066bcac7f504

Bug 697545 : Prevent memory leaks in transfer_raster_row.

Prevent several memory leaks in transfer_raster_row by releasing graphic state.

Error created using :-
MEMENTO_FAILAT=15010 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0670

pcl/pcl/rtraster.c


2019-07-10 14:19:23 +0100
Robin Watts <Robin.Watts@artifex.com>
3bce47c5094c4e200d2200ebd1b081a4dd943215

Fix CAL halftoning crash due to unaligned data buffer.

base/gdevp14.c


2019-07-09 14:00:36 +0100
Robin Watts <Robin.Watts@artifex.com>
0c6f6eb9bd630d594aae0ef7b58aa75253bf52ed

Reference count image colorspaces in XPS.

This avoids leaks.

xps/xpsanalyze.c
xps/xpscolor.c
xps/xpsglyphs.c
xps/xpsgradient.c
xps/xpsimage.c
xps/xpsjpeg.c
xps/xpsjxr.c
xps/xpspath.c
xps/xpspng.c
xps/xpstiff.c
xps/xpstop.c


2019-07-08 19:40:28 +0100
Robin Watts <Robin.Watts@artifex.com>
ab4cea734dca75cde0ad5d39ad2964c9343e8c91

XPS: Avoid leaking scanline buffer on jpeg decompression.

xps/xpsjpeg.c


2019-07-08 11:33:55 +0100
Chris Liddell <chris.liddell@artifex.com>
5c1311ed4dbfb159c9b2304c26b9311834a72bd4

Remove a couple of macros

base/gxchar.c


2019-07-08 19:20:18 +0100
Robin Watts <Robin.Watts@artifex.com>
a116672f813da107719df28057b624ce434e163c

Fix leak of buffer from scaler.

This was being hidden by gc, but shows up in xps.

base/siscale.c


2019-07-08 17:30:01 +0100
Robin Watts <Robin.Watts@artifex.com>
23f28069c8b342cc03de65d8b90029a4b3548010

Really fix CAL makeflags for NEON and SSE.

Makefile.in
base/cal.mak


2019-07-08 17:29:40 +0100
Robin Watts <Robin.Watts@artifex.com>
c0d136b659b6e54017f57877068206bee62e1fa1

Fix typo in PRI definitions.

base/stdint_.h


2019-07-08 16:49:17 +0100
Ken Sharp <ken.sharp@artifex.com>
f0c043ead481dd780c916ddd088baf7abe2a2665

pdfwrite - fix a memory leak

pcs is a local variable and when it goes out of scope if it still holds
a reference to the colour space, it will leak.

devices/vector/gdevpdfb.c


2019-07-08 16:38:09 +0100
Robin Watts <Robin.Watts@artifex.com>
a77d1aef180a2dce12cefc039f7fc3dffd69af98

Fix CAL NEON detection.

configure.ac


2019-07-08 15:46:55 +0100
Robin Watts <Robin.Watts@artifex.com>
c454bf4c1e6eb6d64508234dbdd6f29ceea184c3

Bug 701284: Fix more path leakages, this time in pdf14.

base/gdevp14.c


2019-07-08 14:58:36 +0100
Robin Watts <Robin.Watts@artifex.com>
0ca58b97aa19d25ede275cc6447dc32815205263

Bug 701284: Fix clipping path memory leaks

base/gxclrast.c
base/gxcpath.c


2019-07-06 18:34:47 +0100
Robin Watts <Robin.Watts@artifex.com>
9d410dc41277401d48f4dd94dd50391c4a4c79b0

Fix CAL builds to pass appropriate compiler flags

Makefile.in
configure.ac


2019-07-05 19:36:34 +0100
Robin Watts <Robin.Watts@artifex.com>
c734f19d7780cac16b89ced9924ad18bf1c1b380

Fix memory leak in pdf14_tile_pattern_fill in non-GC languages.

base/gdevp14.c


2019-07-05 19:35:58 +0100
Robin Watts <Robin.Watts@artifex.com>
d181151975f0ee13162cc03865c0cc5f58931823

Fix memory leaks seen in XPS; pattern cache and start_part.

xps/xpstop.c


2019-07-05 19:35:28 +0100
Robin Watts <Robin.Watts@artifex.com>
f19453e0f1ced6eb0273f4eabc4e618553c49925

xps_free_font wasn't freeing font->data causing leaks.

xps/xpsfont.c


2019-07-05 19:34:56 +0100
Robin Watts <Robin.Watts@artifex.com>
e05305f8d8e6222250f18daf9b437b7faee8ebee

Destructors should cope with NULL.

base/gxpcmap.c


2019-07-04 18:52:08 +0100
Robin Watts <Robin.Watts@artifex.com>
dd2bd7b4ca1886a4f3c58afbdacbb93831c57e1b

Bug 701284: Fix leak of pdf14device in xps.

The pdf14device is created and then "retained". This is required
for gs, because postscript can call "currentdevice" and get a
non reference counted pointer to a device. It is cleared up
correctly because of gc.

Other languages have no gc, and so leak. The fix is to enable
those languages to get the pdf14device "unretained". We add an
graphics lib call to allow this to happen.

Transparent Patterns also create pdf14devices, which are again
retained, despite not needing to be. In gs this causes no problems
as they are cleared by the restore, but in other languages they
leak. We make them unretained here, with no ill effects.

base/gstrans.c
base/gstrans.h
base/gxpcmap.c
psi/zpcolor.c
psi/ztrans.c
xps/xpspage.c


2019-07-04 08:47:15 +0100
Chris Liddell <chris.liddell@artifex.com>
47a4fab32690cd2f0aba92f37fc7f03b4069460a

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.

freetype/src/psaux/psintrp.c


2019-07-02 17:15:12 +0100
Robin Watts <Robin.Watts@artifex.com>
491a1637f11c84ad47d83d35eba510ac6d0c47f0

Move to size_t in allocations.

base/gsalloc.c
base/gsalloc.h
base/gsmalloc.c
base/gsmalloc.h
base/gsmchunk.c
base/gsmdebug.h
base/gsmemory.c
base/gsmemory.h
base/gsmemret.c
base/gsnogc.c
base/gsstype.h
base/gxalloc.h
base/gxobj.h
base/mkromfs.c
psi/ilocate.c


2019-07-03 18:16:25 +0100
Robin Watts <Robin.Watts@artifex.com>
25fbeb3e1f4ba5ca7ecafd7a24b7be4079113e7c

Squash warning in compile time assert.

psi/iapi.c


2019-07-03 18:01:01 +0100
Robin Watts <Robin.Watts@artifex.com>
7dfee126567be1859f4ca1637c256b4179a571b8

Fix missing const with fs_file_open_printer.

base/gslibctx.c


2019-07-03 18:00:28 +0100
Robin Watts <Robin.Watts@artifex.com>
378fd9840e957c3a160665483cc537d6f6e860bf

Squash some build warnings with debug prints.

base/gsicc_cache.c
base/gsicc_profilecache.c


2019-07-03 15:39:15 +0100
Robin Watts <Robin.Watts@artifex.com>
e3dd119d53361d09fa30ca13cce4a97869ba0f8d

Add printf format specifier macros for size_t.

Sadly, it is not enough to have definitions that match
the sizes; gcc will give a warning if the types don't match.

base/stdint_.h


2019-07-03 15:23:46 +0100
Robin Watts <Robin.Watts@artifex.com>
761a8b513a28a9c4f4f1e83150556e7407f0d74a

Add size_t definitions to genarch.

arch/windows-arm-msvc.h
arch/windows-x64-msvc.h
arch/windows-x86-msvc.h
base/genarch.c


2019-06-27 16:48:06 +0100
Robin Watts <Robin.Watts@artifex.com>
d306e93d487a6539804c6343986bcbca2ecc37a8

Rework ROP transparency

Rework ROP behaviour with transparency based upon the results
from roptest.pxl seen on an HP printer.

The old style ROP transparency code used to treat white pixels
as special. The new style code does everything in boolean logic
by modifying the ROP that is used when S or T pixels are set to
be transparent.

This enables us to rip out several cases from the ROP
processing loops, as we never need to check for transparent
pixel values anymore.

base/gdevdrop.c
base/gdevmpla.c
base/gdevmr1.c
base/gdevmr2n.c
base/gdevmr8n.c
base/gdevmrop.h
base/gdevplnx.c
base/gsroprun.c
base/gsroprun24.h
base/gsroprun8.h
base/gsropt.h
base/gxdcolor.c
base/gxipixel.c
devices/vector/gdevpdfi.c
devices/vector/gdevpx.c


2019-06-26 18:51:31 +0100
Robin Watts <Robin.Watts@artifex.com>
054f4df9b5f8bb09c252841f0c3256b9adc60f0a

Add another couple of SSE ROP cases.

base/gsroprun.c
base/gsroprun8.h
base/gsropt.h


2018-01-11 17:57:29 +0000
Robin Watts <robin.watts@artifex.com>
82e2843149b32e61cfde7861ac67a51014538f4f

ROP optimisation: Fold 24bpp ROPs down to 8 bit where possible.

This increases line length.

base/gsroprun.c
base/gsroprun8.h
base/gsropt.h


2019-07-02 17:29:54 +0100
Robin Watts <Robin.Watts@artifex.com>
470897e484fb0bfaa8553e0ccd5b9db91eda008b

Avoid warning due to casting int to double.

Use size_t properly, and no call to abs is required.

devices/vector/gdevpdfe.c


2019-07-02 17:14:33 +0100
Robin Watts <Robin.Watts@artifex.com>
6c986cd9f93008992344d2cd5be224af13e1c980

Squish an annoying implicit cast warning.

Do it explicitly.

base/gsicc_cache.c


2019-07-02 17:13:48 +0100
Robin Watts <Robin.Watts@artifex.com>
45e765e59a45b46dcb05e8c729689a7c0574a48c

Fix some warnings caused by the gs FS api commit.

base/gp.h
base/gp_dvx.c
base/gp_msprn.c
base/gp_mswin.c
base/gp_os2.c
base/gp_os2.h
base/gp_os9.c
base/gp_unix.c
base/gp_winfs2.c
base/gslibctx.h


2019-07-01 21:31:03 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f209fb3a0f50cd0a9974d8627a4ac7f358f60c8a

Bug 697545 : Prevent SEGV in check_pattern_rendering.

Prevent SEGV by checking for check_pattern_rendering being called with NULL pattern.

Error created using :-
MEMENTO_FAILAT=16764 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0825

pcl/pcl/pcpatrn.c


2019-07-01 21:08:30 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e6c50c878d622974e7bb2438327e5363b9419875

Bug 697545 : Prevent SEGV due to double freeing.

On error pl_dict_put now consumes the new value so these extra calls
to free memory are no longer needed.

Error created using :-
MEMENTO_FAILAT=1987 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0825

pcl/pcl/pcsymbol.c
pcl/pl/pllfont.c


2019-07-02 15:36:07 +0100
Chris Liddell <chris.liddell@artifex.com>
5ef3a531d00715c2b8bcfd38401515d4f60bfec5

Rejig order of operations from commit 47b1b7f971a76

I'd forgotten that setcolorspace would blow away the current color, so we need
to get two sets of current color values, before setting the fill and stroke
color spaces, and then setting the file and stroke colors.

Resource/Init/pdf_ops.ps


2019-06-24 13:23:34 +0100
Robin Watts <Robin.Watts@artifex.com>
93fc44b3426cd771ee0a9358da805cd2ac93a649

Fix gsapi exposure through the DLL.

Lots of functions that should have been exposed, weren't.

psi/dpmain.c
psi/dwdll.c
psi/dwdll.h
psi/gsdll32.def
psi/gsdll32metro.def
psi/gsdll64.def
psi/gsdll64metro.def
psi/gsdllARM32metro.def


2019-06-19 18:43:33 +0100
Robin Watts <Robin.Watts@artifex.com>
e6966d10ec319a25ad91e4aa53a783edede7b62b

Add gsapi call to introduce new 'Filing Systems' to gs.

Still to do - Example?

base/gdevpipe.c
base/gp.h
base/gp_mshdl.c
base/gp_msprn.c
base/gp_os2pr.c
base/gpmisc.c
base/gsdevice.c
base/gslibctx.c
base/gslibctx.h
base/stdpre.h
doc/API.htm
pcl/pl/plapi.c
pcl/pl/plapi.h
psi/iapi.c
psi/iapi.h


2019-07-02 11:12:04 +0100
Chris Liddell <chris.liddell@artifex.com>
e585a31732e966f1508b64f04cacbaf8ede65c68

Fix an out-of-date comment about devices in gstates

base/gsstate.c


2019-07-02 11:06:03 +0100
Chris Liddell <chris.liddell@artifex.com>
47b1b7f971a760ff311bf3c3d8a02e2a2d53ac7d

PDF interp: use initgraphics for initial color(space)

Previously, the PDF interpreter explicitly set the initial color and color space
for each page ('0 g 0 G') despite initgraphics being called, and also setting
the color(space)s correctly.

Unfortunately, removing that completely causes problems with pdfwrite's
transparency handling, so we reuse the already installed values in place
of explicitly setting absolute values.

This should allow for preview-latex's (slightly hacky) method of custom coloring
'special' PDFs for previewing.

Resource/Init/pdf_ops.ps


2019-06-25 10:43:30 +0100
Chris Liddell <chris.liddell@artifex.com>
94cc50cf64e0899c5d415e6ac1e6ea725fc13502

Fix DELAYBIND

We now undefine a *lot* of non-standard/internal operators (and other things) as
we go, and often we rely on bind to ensure that the names are replaced with the
operator objects rather than names.

This falls over when DELAYBIND is in force, and the call to .bindnow happens
*after* the undefining occurs.

To solve this, all the undefining happens through a procedure: .addtoundeflist.

Under normal operation, that simply undefines as we go, and things work the same
as always.

Under DELAYBIND .addtoundeflist accumulates a list of names to undefine, and the
dictionaries from where they should be removed, and on the .bindnow call, then
.applyundeflist is called which rattles through the lists removing the names
from the dictionaries.

Resource/Init/gs_btokn.ps
Resource/Init/gs_cet.ps
Resource/Init/gs_cidfn.ps
Resource/Init/gs_dps2.ps
Resource/Init/gs_epsf.ps
Resource/Init/gs_fapi.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_img.ps
Resource/Init/gs_init.ps
Resource/Init/gs_lev2.ps
Resource/Init/gs_ll3.ps
Resource/Init/gs_res.ps
Resource/Init/gs_resmp.ps
Resource/Init/gs_setpd.ps
Resource/Init/gs_ttf.ps
Resource/Init/pdf_main.ps


2019-07-02 10:36:18 +0100
Chris Liddell <chris.liddell@artifex.com>
871b8d8d5a26205a7a3c05ea9abf060a272fd6fb

Tweak path access control logic

Correctly handle the difference between permitted paths of the forms:
'path', 'path/' and 'path/*'.

The previous code effectively treated 'path/' and 'path/*' the same.

base/gpmisc.c


2019-06-20 12:24:04 +0100
Chris Liddell <chris.liddell@artifex.com>
1b83ee86dc775a9d7972d94041e226893983b264

File access control: handle non-null terminated paths

Add an access control checking API call that can take a non-null terminated
string (i.e. takes a string and length).

The reason being the strings returned from gp_enumerate_files* are not null
terminated, and we need to filter them by permissions.

base/gp.h
base/gpmisc.c


2019-07-01 15:27:05 +0100
Ken Sharp <ken.sharp@artifex.com>
56158b2c2d8fb9bd5e5bbb9be645fb88231c4898

Fix buffer overrun in mswinpr2 device

Bug #701281 "ACTIONABLE_HEAP_CORRUPTION when try print with -sOutputFile"

The mswinprs2 device uses the very old 16-bit GetProfileStringW() API
call to get the 'Devices' in order to look for a specified printer.

The code however assumes that the buffer length passed is in bytes, and
in fact it should be in wchar_. This means that a sufficiently large
Devices section could overrun the buffer, as it thinks there are more
wchar_t available than there are.

in addition, if the section is very large we could run out of space in
the string altogether, and then would be unable to find the designated
printer.

This commit alters the code so that the length passed to GetProfileStringW
is in wchar_t and also examines the returned length. If the returned
length indicates possible truncation of the return, then we free the
buffer, increase its size by 4Kb and try again. Repeatedly until we
either exhaust memory or get a large enough buffer.

devices/gdevwpr2.c


2019-06-18 21:21:10 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
90ae60d1669ebf01228d05cdb58c248a2f971d07

Bug 697545 : Prevent memory leaks in pcl_define_symbol_set.

Cleanup symbol set for all error returns.

Error created using :-
MEMENTO_FAILAT=15206 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0460

pcl/pcl/pcsymbol.c
pcl/pl/pldict.c


2019-06-25 15:28:48 +0100
Ken Sharp <ken.sharp@artifex.com>
12ffa0f40b6849d97c1e4dc49287bca56f513f7f

pdfwrite - fix an error path

This turned up while working on the PDF interpreter in C. Previously we
had no examples which exercised this error pathway, because it was only
used by PCL and none of our PCL examples threw an error here.

If we've started accumulating a CharProc, then we have started a pdf
substream. If we get an error, then we need to terminate that substream
before returning (the caller can't know that the substream was begun).

devices/vector/gdevpdtt.c


2019-06-11 19:04:21 +0100
Robin Watts <Robin.Watts@artifex.com>
4f59b4dc4f512839fd73718de535da99c6085da3

First steps for using SSE for ROPs.

base/gsroprun.c
base/gsroprun8.h
base/gsropt.h


2018-04-19 12:45:14 +0100
Robin Watts <robin.watts@artifex.com>
140a9359f3cc6739c7caf0796430bc3112cb3cd5

Initial import of CAL.

Makefile.in
base/cal.mak
base/gdevdrop.c
base/gs.mak
base/gxicolor.c
base/gxidata.c
base/gximage.h
base/gximono.c
base/gxiscale.c
base/lib.mak
base/siscale_cal.c
base/sisparam.h
base/unix-gcc.mak
base/winlib.mak
configure.ac
psi/msvc.mak
windows/ghostscript.vcproj


2019-06-24 16:35:31 +0100
Ken Sharp <ken.sharp@artifex.com>
dd75f619d0ae98e21e30ad89d2e7d2cd4277cc2e

Preparatory work for the PDF interpreter in C

Currently the pdfwrite device assumes that a font with FontType 3
(ft_user_defined) *will* require an exit to the interpreter. The
CharProc capture is set up so that this happens in a complicated dance.

When we have the PDF interpreted in C we do not need to exit to the
interpreter, and so we need to capture the CharProc in the same way we
do for PCL 'user defined' fonts (eg the HPGL stick font and PCL bitmap
fonts).

Obviously to be able to do this we need to be able to differentiate
between a PostScript type 3 font (or a type 3 font built by the PostScript
PDF interpreter) and a type 3 font built by the C PDF interpreter. So
the first thing we do is add a new ft_PDF_user_defined font tyep.

Then update the graphics library so that it treats the PDF type 3 font
in exactly the same way as it does a PostScript type 3 font.

In the pdfwrite device, in general we want to treat a PDF type 3 font
as being the same as a PS type 3.

Finally, in pdf_text_process() the bulk of the real work. If we have a
ft_PDF_user_defined font, then set 'early_accumulator' which means we
push the accumulator early, because we won't need to exit to the
interpreter. This means that in the 'early_accumulator' branch we need
to account for the possibility that the text operation won't be a
'TEXT_FROM_CHARS' (it always is for PCL, which is why this didn't need
to be handled before). There was also some bad error handling in here,
we do a gs_gsave() which is undone by a gs_grestore() in comp[ete_charproc()
but if we had an error before that we would not undo the gs_gsave whhich
could lead to ridiculous levels of nested gsaves.

base/gstext.c
base/gxchar.c
base/gxftype.h
base/gxpaint.c
devices/vector/gdevpdtc.c
devices/vector/gdevpdtd.c
devices/vector/gdevpdte.c
devices/vector/gdevpdtf.c
devices/vector/gdevpdti.c
devices/vector/gdevpdts.c
devices/vector/gdevpdtt.c


2019-06-22 10:49:31 +0100
Ken Sharp <ken.sharp@artifex.com>
9055511a9ca3600ee8680ea2b35b2f31f708bd40

Improve -dFILTERIMAGE

Previously if we were supplied too much image data, we could read off
the end of the supplied data and consume input that should have been
interpreted.

This limits the consumption of data so that we don't read more than we
expected.

NB! We still don't support type 3 images, as that requires us to process
2 images at once.

base/gdevoflt.c


2019-06-19 19:11:43 +0100
Robin Watts <Robin.Watts@artifex.com>
4f3f5aeb40be1562f05864705b0a04fbccae6fec

Remove unused gsapi functions.

gsapi_get_device_memory and gsapi_set_device aren't used, so
do away with them.

psi/dwdll.h
psi/dwnodll.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


2019-06-19 18:43:09 +0100
Robin Watts <Robin.Watts@artifex.com>
c1500bb8ed62224e8b372fca76ed8e411cc447d1

More gp_file vs FILE fixes.

base/gp_vms.c
contrib/pcl3/src/pcl3opts.c
contrib/pscolor/test.c


2019-06-20 19:22:24 +0100
Ken Sharp <ken.sharp@artifex.com>
ae73b49631e657b5ed5c3bf7936febf64a3f8b3c

Fix Indexed 'install' procedure

The Install procedure for Indexed spaces was calling the 'install'
procedure for its base space. This is incorrect. Colour spaces are
supposed to be set from the lowest (most 'base') to the highest. So the
Indexed space's base space should already be set, and installed. Trying
to set it again is a bad thing and can cause Seg Faults.

However, the PCL interpreter relies on the Indexed space doing this,
contrary to the expected behaviour it does not set the base space before
setting the Indexed space, and relies on the Indexed space to 'install'
the base space.

Setting the base space caused unexpected (and inexplicable) differences
in halftoned output. I 'suspect' that this is because it sets the three
initial components of pgs->color[0].ccolor, whereas the previous code
only resulted in setting the initial value.

So instead, call the base space's 'install' procedure directly, this
doesn't set the colour values (which gs_setcolorspace does) and results
in no differences.

For me this resolves the crashes that were being seen in the 32-bit
builds of Ghostscript and shows no differences.

base/gscolor2.c
pcl/pcl/pcindxed.c


2019-06-19 15:14:46 +0100
Robin Watts <Robin.Watts@artifex.com>
108dd018b746d33ad06a7ee863fae56cbeb1fd80

"Fix" contrib and test uses of gp_fopen.

Here we fix a lot of contrib devices that had been broken by the
changes to gp_file. I believe they all should work OK now.

One of the routines was calling lib_fopen in an unsupported way; this
can't easily be fixed, so we just call gp_fopen instead now.

We also "fix" some test code that was calling gp_fopen and then doing
things that we can't easily do with a gp_file *. This code has reverted
to using FILE *'s and fopen - this might cause issues on compilation as
this code is untested, but it's better than compiling to give code that
crashes.

base/gp_vms.c
contrib/japanese/dviprlib.c
contrib/japanese/dviprlib.h
contrib/japanese/gdevdmpr.c
contrib/pscolor/test.c
devices/vector/gdevtxtw.c
psi/gserver.c


2019-06-19 12:51:38 +0100
Robin Watts <Robin.Watts@artifex.com>
2c6484de7376ce4e24d87f1eb4c6f76360c9b928

Fix debug code to call gp_fopen correctly.

These were missed during the conversion to gp_file.

base/gdevp14.c
base/gsicc_create.c
base/gsicc_lcms2.c
base/gsicc_lcms2mt.c
base/gsicc_manage.c
base/gsicc_manage.h
base/gsroprun.c
base/gxblend.c
base/gxblend.h
base/gxblend1.c
base/gxpcmap.c


2019-06-19 09:42:10 +0100
Chris Liddell <chris.liddell@artifex.com>
b38aad870c573f7cafe99a95c3b931c1dc6cd132

Remove some debug code

Resource/Init/gs_init.ps


2019-06-18 10:54:47 +0100
Chris Liddell <chris.liddell@artifex.com>
d4d7d6948e41c2573b47645191dbb7e3877f0597

Fix up some coverity issues, and other warnings

CIDs: 341120, 341119, 341118, 341117, 341116, 341115, 341114, 341113, 341112,
341111, 341110, 341109, 341108, 341107, 341106, 341105, 341104, 341103, 341102,
341101.

Mostly examples of gp_fseek and sscanf ignoring return values.

base/gp_unifs.c
base/mkromfs.c
contrib/pcl3/eprn/pagecount.c
contrib/pcl3/src/gdevpcl3.c
contrib/pcl3/src/pclgen.c
contrib/pcl3/src/pclgen.h
devices/gdevdfax.c
devices/gdevpsd.c
devices/vector/gdevpdf.c
devices/vector/gdevxps.c
pcl/pl/pjparse.c
pcl/pl/plmain.c
psi/imainarg.c
psi/iutil.c
xps/xpszip.c


2019-06-14 09:10:45 +0100
Chris Liddell <chris.liddell@artifex.com>
29da5d218dac7e0975c03a81982fdc33b5eba20d

Make sure font Decoding is in the correct VM mode

Resource/Init/gs_fntem.ps


2019-06-14 09:10:04 +0100
Chris Liddell <chris.liddell@artifex.com>
35b8b94e3ac3cced1b415c92b091c6959240755e

Remove stray exec and some pointless immediate evaluations

Resource/Init/gs_fapi.ps


2019-06-14 09:16:53 +0100
Ken Sharp <ken.sharp@artifex.com>
adc94490502a360c3bdf8843888f784d57066c0e

PDF interpreter - improve repair of broken PDF files

If a file had a startxref token which was not followed by any further
actual tokens (eg nothing but % comment lines) then the repair code
failed to account for this, and ended up trying to pop non-existent
objects from the stack.

This is because the code did not test the result of the 'token' operator
to ensure that a token had been read, it assumed one would be. In this
commit we check the result and, if its 'false' (no token read) we don't
attempt to pop the non-existent token from the stack, but instead follow
the existing error path and resort to scanning the PDF file for the
trailer dictionary.

In addition to fixing the customer reported file, this also fixes the
existing test suite file

tests_private/pdf/sumatra/repairing_leaks_object.pdf

Resource/Init/pdf_rbld.ps


2019-06-12 15:35:11 +0100
Chris Liddell <chris.liddell@artifex.com>
8522db03fde6b1b514beed9d66faa839f24ebdc4

Make .pdfexectoken not an operator

In a previously round of security fixes, I made .pdfexectoken an operator. That
turns out to cause problems because we (normally) attempt to recover from errors
in PDF files, so we don't want .pdfexectoken to cleanup the stacks in the event
of an error.

In addition, the original problem this solved is solved in a more robust way
(executeonly on the transient procedures).

Resource/Init/pdf_base.ps


2019-06-11 20:29:53 +0200
Sebastian Rasmussen <sebras@gmail.com>
094b9caade51b718a20b8d326fff9e0f93166cd4

Bug 698777: jbig2dec: Update information in README.

jbig2dec/README


2019-06-10 17:22:04 +0100
Robin Watts <Robin.Watts@artifex.com>
20a6ddad3cd42796c913ab94583fc0f0e5870281

Fix gpdl SAFER operation.

-sOutputFile=foo was having the pass set as "=foo" due to
me forgetting to increment the pointer. This resulted in
many thousands of errors in the weekly SAFER test.

pcl/pl/plmain.c


2019-06-10 16:24:41 +0100
Ken Sharp <ken.sharp@artifex.com>
ee8ab38bab473ff1457e7f966b2733f0c829bcb1

PDF interpreter - don't execute newpath when ending text blocks

Bug 701178 - "PDF missing two bounding boxes on process"

The missing rectangles are defind in the content stream between a
number of BT/ET text blocks, and only finally stroked after all the
text has been emitted.

Because we execute a newpath when ending a text block (to avoid dangling
path elements from text), and prior path elements are lost.

This commit only executes a newpath when the text rendering mode is one
of the 'clip' modes, as that is handled differently, and we need the
newpath.

Its a pretty poor way to output the paths, and I suspect that it would
likely run into trouble with the text clipping modes, but since those
aren't used here its hard to tell.

Resource/Init/pdf_ops.ps


2019-06-07 13:58:25 +0100
Ken Sharp <ken.sharp@artifex.com>
8eaa0856399c9b621db17e96c8f7be1e0241ab8b

Fix AES-256 decryption when using owner key

The code for computing the decryption key for AES-256 encrypted PDF
files was incorrect. When computing the validation check we correctly
used the owner key if it was supplied, but for computing the actual
decryption key we always treated the supplied password as the user
password.

psi/zpdf_r6.c


2019-06-05 09:55:46 +0100
Ken Sharp <ken.sharp@artifex.com>
b31fb3c0cd7ab223d870fa1e0fb231d911b19984

Modify the new gp_file API so that gp_fread etc match fread

The new gp_fread() and gp_fwrite() have a parameter list which (more or
less) matches the list for the C run-time functions fread() and fwrite()

However, the return values do not match the returned values from the
C runtime functions. This is because, internally, the gp_file structure
has function pointers which only take 3 parameters instead of 4. This
is handled by multiplying the size of the record by the number of records
to be read/written, and then reading that many bytes.

Since the underlying functions are (at this time) the C runtime functions
this means that th returned value becomes the number of bytes read
(or written) instead of the number of *records* read/written.

This commit modifies that internal API so that the gp_file member
functions take 4 parameters (thus matching both gp_fread and fread)
and pass them to the underlying functions. The return value is then
the number of records, as expected.

Should we ever encounter an implementation which doesn't match the
C runtime fread() we could implement it by multiplying the size by the
count (as was done prior to this commit) and then, assuming the return
value was the number of bytes read, dividing the return value by the
size, in order to retrieve the number of records read.

base/gp.h
base/gpmisc.c


2019-06-07 12:11:57 +0100
Michael Vrhel <michael.vrhel@artifex.com>
ee8864ae09ff0017e5503bde1f5b52538759babc

Ensure that separation CMYK source colors managed

This is the separation version of the DeviceN commit

http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=0b9c45fa86f7736e7fec170a135efa83636283ba

base/gdevp14.c
base/gscsepr.c
base/gsequivc.c
base/gxcmap.c
base/gxcmap.h


2019-06-01 11:09:05 +0100
Ken Sharp <ken.sharp@artifex.com>
d5e123d42718370c144a62ba10a7b715cc88b81a

Graphics library - match gsaves with grestores

Auditing as part of the pdfi work, when the graphics library executes
a gs_gsave() it should match it with a gs_grestore(), even in the case
of an error.

In addition, if gs_setcolorspace failed in image_PaintProc() it would
leak the pattern enumerator. Because this is only called from PCL
the memory is not garbage collected.

base/gsptype1.c
base/gxchar.c


2019-06-03 18:28:18 +0100
Robin Watts <Robin.Watts@artifex.com>
c9a832653a91ddcdd1220fe9fbbc58839eade4aa

Fix leak in gs_lib_ctx_fin.

When freeing gs_lib_ctx, don't remove the mem->gs_lib_ctx pointers
until after we have finished using them. This avoids a leak.

base/gslibctx.c


2019-06-03 14:19:54 +0100
Robin Watts <Robin.Watts@artifex.com>
7b052ff372bbd325676d2e1a57dfd71c33c9f677

Update gpdl with new file access permissions.

This basically involves duplicating the changes from Chris'
gs commit. Part of this promotes a couple of static functions
to being global ones so both implementations can call them.

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


2019-05-29 15:56:20 -0700
Ray Johnston <ray.johnston@artifex.com>
650c49424529fca922519ee9cdf2086eee5cfb70

Fix broken DEBUG build. Add standalone gs_log_error to mkromfs.c

This function is invoked for DEBUG builds by gs_note_error. We define
an equivalent local version so we don't have to include gsmisc.obj
(as for other utility functions such as outprintf).

base/mkromfs.c


2019-05-29 13:20:39 +0100
Chris Liddell <chris.liddell@artifex.com>
f5c0159d993418a8900a84e5fd946e83bdaeec73

Fix dfaxhigh/low device with new gp_file API.

Arose in the "all devices" cluster test

devices/gdevdfax.c


2019-05-07 11:30:15 +0100
Chris Liddell <chris.liddell@artifex.com>
7ecbfda92b4c8dbf6f6c2bf8fc82020a29219eff

Add use of new file access permissions to PS interp

(this is a squash of several commits from filesec branch)

Use errno to indicate invalidfileaccess

Integrate fontconfig with file access controls

fontconfig API has a call to retrieve all the directories about which fontconfig
knows, so we can get those, and add them to the paths from which we're permitted
to read.

Add (most of) the Postscript "managed" paths....

...to the access controls.

GenericResourceDir, ICCProfilesDir (reading) and temporary file directories for
read/write/control.

Add paths/files from C to the file access controls

The -I paths, environment variables and build time paths.

The command line specified output file, permit writing.

Lastly, the command line specified input file is added to the readable list,
interpreted, and then removed from the list.

Add the FONTPATH path list to permit read access control list.

I opted to do this in Postscript because the list is (normally) a colon
separated list of paths, which we split into an array of paths (in Postscript) -
it seems sensible to do this only once, both for storage and permissions.

Add a non-standard string 'reverse search" operator

The search operator searches for the first occurrence of a character code in a
string (i.e. searches forwards from the start of the string), 'rsearch' finds
the last instance of a character code (i.e. search backwards from the end of
the string).

Fix gp_open_scratch_file_rm for access permissions

i.e. the same as gp_open_scratch_file

Handle clist file 'rewind' failures

'Rewinding' clist files may involved closing and recreating the temporary files,
which conceivably can fail, but the clist procs rewind method was a void
function, so couldn't return an error.

It now can, and does return an error, and we handle the error.

Add file permissions support for piped output.

Paths from Fontmap to PermitReading list

cidfmap paths, add to PermitReading list

Add command line options for path access control addition

--permit-file-read
--permit-file-write
--permit-file-control
--permit-file-all

They all take a separated list of paths (the usual platform specific ':' or ';'
separator), and to the respective access control lists - the final 'all' option
adds the paths to all the control lists.

Add file access control to the 'gp_stat' method.

This is complicated by the need to add the memory allocator context to the
gp_stat parameters. To facilitate this, I've added a gs_memory_t pointer to the
gx_io_device structure, which is set during the io device initialisation at
startup.

mkromfs: Add dummy gp_stat_impl for Windows - saves quite a bit of pointless
build upheaval

Add file access protection to file enumeration.

The low level implementation of Postscript's filenameforall (*_enumerate_files)
needs to also honour file access protection.

This is has been complicated by requiring a gs_memory_t to be available where
it wasn't previously (in order to access the gs_lib_ctx and the file permissions
lists therein).

Temp

Resource/Init/gs_cidfm.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps
base/gdevpipe.c
base/gp.h
base/gp_dosfe.c
base/gp_mshdl.c
base/gp_msprn.c
base/gp_mswin.c
base/gp_ntfs.c
base/gp_os2fs.c
base/gp_os2pr.c
base/gp_unifs.c
base/gp_unix.c
base/gp_vms.c
base/gpmisc.c
base/gsiodev.c
base/gsiodevs.c
base/gsiodisk.c
base/gsioram.c
base/gsiorom.c
base/gxclfile.c
base/gxclio.h
base/gxclist.c
base/gxclmem.c
base/gxclread.c
base/gxiodev.h
base/gxp1fill.c
base/lib.mak
base/mkromfs.c
base/stat_.h
pcl/pl/pjparse.c
pcl/pl/pllfont.c
psi/imain.c
psi/imainarg.c
psi/zdevcal.c
psi/zfile.c
psi/ziodev.c
psi/ziodev2.c
psi/ziodevsc.c
psi/zstring.c


2019-03-07 18:03:00 +0000
Robin Watts <Robin.Watts@artifex.com>
9de16a6637b73e35f79d2d622de403b24e6502f2

Move FILE * operations behind new gp_file * API.

(squash of commits from filesec branch)

Most of this commit is donkeywork conversions of calls from
FILE * -> gp_file *, fwrite -> gp_fwrite etc. Pretty much every
device is touched, along with the clist and parsing code.

The more interesting changes are within gp.h (where the actual
new API is defined), gpmisc.c (where the basic implementations
live), and the platform specific levels (gp_mswin.c, gp_unifs.c
etc where the platform specific implementations have been
tweaked/renamed).

File opening path validation

All file opening routines now call a central routine for
path validation.

This then consults new entries in gs_lib_ctx to see if validation
is enabled or not. If so, it validates the paths by seeing if
they match.

Simple C level functions for adding/removing/clearing paths, exposed
through the gsapi level.

Add 2 postscript operators for path control.

<name> <string> .addcontrolpath -

Add the given <string> (path) to the list of paths for
controlset <name>, where <name> can be:
/PermitFileReading
/PermitFileWriting
/PermitFileControl
(Anything else -> rangecheck)

- .activatepathcontrol -

Enable path control. At this point PS cannot make any
more changes, and all file access is checked.

base/gdebug.h
base/gdevdevn.c
base/gdevp14.c
base/gdevpccm.c
base/gdevpccm.h
base/gdevpipe.c
base/gdevprn.c
base/gdevprn.h
base/gdevvec.c
base/gdevvec.h
base/gp.h
base/gp_dosfs.c
base/gp_dvx.c
base/gp_mshdl.c
base/gp_msprn.c
base/gp_mswin.c
base/gp_ntfs.c
base/gp_os2.c
base/gp_os2fs.c
base/gp_os2pr.c
base/gp_os9.c
base/gp_unifs.c
base/gp_unix.c
base/gp_vms.c
base/gp_win32.c
base/gp_winfs.c
base/gp_winfs2.c
base/gpmisc.c
base/gpmisc.h
base/gsargs.c
base/gsargs.h
base/gsdevice.c
base/gsicc_create.c
base/gsicc_lcms2.c
base/gsicc_lcms2mt.c
base/gsicc_manage.c
base/gsinit.c
base/gsiodev.c
base/gsiodevs.c
base/gsiodisk.c
base/gsioram.c
base/gsiorom.c
base/gslib.h
base/gslibctx.c
base/gslibctx.h
base/gsmemory.h
base/gsmisc.c
base/gsroprun.c
base/gstiffio.c
base/gstiffio.h
base/gxblend.c
base/gxblend1.c
base/gxclfile.c
base/gxdevice.h
base/gxiodev.h
base/gxpcmap.c
base/lib.mak
base/msvctail.mak
base/sfxcommon.c
base/sfxfd.c
base/sfxstdio.c
base/stdpre.h
base/stream.h
base/tiff.mak
base/winlib.mak
contrib/contrib.mak
contrib/eplaser/gdevescv.c
contrib/gdevbjc_.c
contrib/gdevbjc_.h
contrib/gdevbjca.c
contrib/gdevcd8.c
contrib/gdevdj9.c
contrib/gdevgdi.c
contrib/gdevhl12.c
contrib/gdevln03.c
contrib/gdevlx32.c
contrib/gdevlx7.c
contrib/gdevmd2k.c
contrib/gdevop4w.c
contrib/gdevxes.c
contrib/japanese/dviprlib.c
contrib/japanese/gdev10v.c
contrib/japanese/gdevalps.c
contrib/japanese/gdevdmpr.c
contrib/japanese/gdevespg.c
contrib/japanese/gdevfmlbp.c
contrib/japanese/gdevfmpr.c
contrib/japanese/gdevj100.c
contrib/japanese/gdevlbp3.c
contrib/japanese/gdevmjc.c
contrib/japanese/gdevml6.c
contrib/japanese/gdevnpdl.c
contrib/japanese/gdevp201.c
contrib/japanese/gdevrpdl.c
contrib/lips4/gdevl4r.c
contrib/lips4/gdevl4v.c
contrib/lips4/gdevlprn.c
contrib/lips4/gdevlprn.h
contrib/opvp/gdevopvp.c
contrib/pcl3/eprn/eprnparm.c
contrib/pcl3/eprn/gdeveprn.c
contrib/pcl3/eprn/pagecount.c
contrib/pcl3/eprn/pagecount.h
contrib/pcl3/src/gdevpcl3.c
contrib/pcl3/src/pcl3opts.c
contrib/pcl3/src/pclgen.c
contrib/pcl3/src/pclgen.h
contrib/pcl3/src/pclscan.c
cups/gdevcups.c
devices/contrib.mak
devices/devs.mak
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/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/gdevepsc.c
devices/gdevepsn.c
devices/gdevescp.c
devices/gdevfax.c
devices/gdevfax.h
devices/gdevfpng.c
devices/gdevgprf.c
devices/gdevhl7x.c
devices/gdevicov.c
devices/gdevifno.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/gdevmgr.c
devices/gdevmiff.c
devices/gdevn533.c
devices/gdevo182.c
devices/gdevokii.c
devices/gdevpbm.c
devices/gdevpcx.c
devices/gdevpdfimg.c
devices/gdevperm.c
devices/gdevphex.c
devices/gdevpjet.c
devices/gdevplan.c
devices/gdevplib.c
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/gdevstc.c
devices/gdevtfax.c
devices/gdevtfax.h
devices/gdevtfnx.c
devices/gdevtifs.c
devices/gdevtifs.h
devices/gdevtknk.c
devices/gdevtsep.c
devices/gdevupd.c
devices/gdevwpr2.c
devices/gdevxcf.c
devices/rinkj/rinkj-byte-stream.c
devices/rinkj/rinkj-byte-stream.h
devices/vector/gdevpdf.c
devices/vector/gdevpdfo.c
devices/vector/gdevpdfp.c
devices/vector/gdevpdfu.c
devices/vector/gdevpdfx.h
devices/vector/gdevpsu.c
devices/vector/gdevpsu.h
devices/vector/gdevpx.c
devices/vector/gdevtxtw.c
devices/vector/gdevxps.c
pcl/pl/pjparse.c
pcl/pl/pl.mak
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/plmain.h
pcl/pl/plparams.c
pcl/pl/pltop.h
psi/files.h
psi/iapi.c
psi/iapi.h
psi/imain.c
psi/imain.h
psi/imainarg.c
psi/imainarg.h
psi/iminst.h
psi/int.mak
psi/psapi.c
psi/zfile.c
windows/ghostscript.vcproj
xps/ghostxps.h
xps/xpsjxr.c
xps/xpstop.c
xps/xpszip.c


2019-05-28 16:08:26 +0100
Chris Lidell <chris.liddell@artifex.com>
808021913baf763e07cc9eabc3716bfa507380ff

Bug 701083(2): Write the new key/value to DecodeParms

There was a lengthy block of code that handled PDFs with buggy DCTDecode
dictionaries with a missing, or incorrect Height entry. Since we now have a
second key/value needing added to the DecodeParms and in two places, I've
split that into a more general procedure, so we can add multiple new keys in
one step.

This is used to add/patch the Height key, and add the new ErrsAsEOD key
(telling the CCITT fax decode filter to treat an error as a EOD).

Resource/Init/pdf_draw.ps


2019-05-27 19:00:06 +0100
Robin Watts <Robin.Watts@artifex.com>
1a344ed8506e46e77a0c58aed57de69ce8f54a20

Bug 701083: Add key to treat errors as end of data when decoding images.

This specifically only applies to the CCITT decode filter at the
moment, but the key will be in place for all image decoders to look
at if required.

A following commit will cause the PDF interpreter to set this key
in the DecodeParms.

base/scfd.c
base/scfparam.c
base/scfx.h


2019-05-27 15:33:27 +0100
Chris Liddell <chris.liddell@artifex.com>
c1739dcc6a8ceda1a5091c1b7dc8bb4870c6c76b

Fix a couple more compiler warnings.

psi/imain.c


2019-05-24 14:32:59 +0100
Chris Liddell <chris.liddell@artifex.com>
e2e83fb18feeae8786c16c0c309f9c1efdea2614

Bug 700956: don't free text enumerator in error condition

Some errors mean the graphics library will decrement the reference count,
potentially freeing, the text enumerator. So, on return to the interpreter
don't try to free it.

In these cases we can safely rely on the garbager to clean up the memory if the
graphics library didn't.

psi/zchar.c


2019-05-24 09:50:49 +0100
Chris Liddell <chris.liddell@artifex.com>
f8b9b5d02f2ba59256c92f6015eda02cb5d16c9e

Fix a trivial (probably benign) compiler warning

psi/imain.c


2019-05-23 11:09:50 +0100
Chris Liddell <chris.liddell@artifex.com>
c1844f1adbd7e1b215dde46d6211a84af5cea8a4

Fix FONTPATH font file enumeration

As part of improving security, we had replaced the reference using the name
.scanfontheaders to find the array of headers for file types to scan with
the immediatetly evaluated //.scanfontheaders in gs_fonts.ps

That doesn't work correctly because the array is redefined multiple times
as we add support for various font types during initialisation.

Fix it by replacing the immediate evaluation with explicitly using the name key
/.scanfontheaders to pull the array from systemdict.

Resource/Init/gs_cff.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_ttf.ps


2019-05-23 11:18:06 +0100
Chris Liddell <chris.liddell@artifex.com>
e42161d209e220aa84615b0af7efc7507f0f5397

Fix crash when the default font can't be found.

Making .loadfontloop into an operator messes up the error condition recovery
when we've had to fall back to the default font, and even that is not
available (i.e. when GenericResourceDir is set to somewhere that isn't actually
a viable resource directory).

Resource/Init/gs_fonts.ps


2019-05-22 19:07:07 -0600
Henry Stiles <henry.stiles@artifex.com>
c2d78d6fd563bb3137991ce9f74ec2379e0de9aa

Remove unnecessary but harmless conditional from the last commit.

pcl/pcl/pctop.c


2019-05-22 13:36:31 -0600
Henry Stiles <henry.stiles@artifex.com>
690adf6efb53e61e965e6f37cd78b060b2fdb233

Fix bug 701045 - infinite loop in pcl parser.

The recent work to remove the specialized PL cursor code and replace
it with streams removed end of data detection PCL depended on. End of
data is now detected by the PCL parser by requiring a minimum number
of bytes on the next call to the parser. If the required number of
bytes are not provided the parser signals end of data by advancing the
read pointer to the end of the buffer.

The change precipitated some reorganization in how RTL is initialized,
as well.

pcl/pcl/pcl.mak
pcl/pcl/pcmacros.c
pcl/pcl/pcparse.c
pcl/pcl/pcparse.h
pcl/pcl/pcsfont.c
pcl/pcl/pctop.c
pcl/pxl/pxpthr.c


2019-03-28 17:21:02 -0600
Henry Stiles <henry.stiles@artifex.com>
1058e51507f4dfb483c104dd83e77375e62181b4

Fix bug #700844, crash with very long font path.

A long font path, specified by setting the environment variable
PCLFONTSOURCE, resulted in buffer overflows in both PJL and PCL. Also,
simplify the logic to load fonts in PCL because it is not
necessary to parse a path list, a single path has been already been
parsed in PJL.

Related coverity id's addressed with this change are: 102193, 102206,
102208, and 102210.

pcl/pl/pjparse.c
pcl/pl/pllfont.c


2019-03-11 11:18:23 -0600
Henry Stiles <henry.stiles@artifex.com>
7a5637d2248501998ca9bb16bc51c93dd15a2d0d

Remove unnecessary include file left from a test.

pcl/pl/plfont.c


2019-05-22 18:04:52 +0100
Robin Watts <Robin.Watts@artifex.com>
3a9bb467fa9ff18ca398081c32edddc6732ce75e

Add gpdl to default products for clusterpush.pl

toolbin/localcluster/clusterpush.pl


2019-05-22 17:58:25 +0100
Robin Watts <Robin.Watts@artifex.com>
979f09479916c799d5df30df85c6caa30f86bffc

Add nopdfwrite to clusterpush.pl

toolbin/localcluster/clusterpush.pl


2019-05-21 07:39:49 -0700
Nancy Durgin <nancy.durgin@artifex.com>
dd4be3eb2b28ff67dc3ee6e636bf7024bf9d1003

Add check for gs_error_handled for pattern handling

Some clients (specifically gpdfi) can now return gs_error_handled if
they already took care of everything in the PaintProc call. In this
case, just do all the cleanup as for any other error, but it's not
really an error, so return error code 0.

This wll be needed for pdfi when merged in, should have no affect on current
code.

base/gxpcmap.c


2019-05-20 12:32:13 +0100
Robin Watts <Robin.Watts@artifex.com>
2b925a84a9cbbeabba391d50f08b7064688298c2

Add gsapi_set_param to iapi.h as well.

This keeps the gs and gpdl implementations of gsapi in sync.

psi/iapi.c
psi/iapi.h


2019-05-20 13:07:13 +0100
Robin Watts <Robin.Watts@artifex.com>
8aa6f8ce98e19ddc1a30b924169abf091748c1a9

Fix warnings in pjparse.c

pcl/pl/pjparse.c
pcl/pl/pl.mak


2019-05-17 18:51:13 +0100
Robin Watts <Robin.Watts@artifex.com>
b932ec31114e4e7a7ace0089cb87ddb70dc7732f

Add gsapi_set_param to gpdl gsapi.

This takes an enumerated type and values, to allow programmatic
setting equivalent to -d and -s on the command line.

These should only be called between jobs, and then with care.

Values are set in the device parameters and then passed to each
language implementation in turn.

pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/plmain.h
pcl/pl/pltop.h


2019-05-16 19:59:58 +0100
Robin Watts <Robin.Watts@artifex.com>
dc9c23ed944f653e384fd12fbaf6328e8bab8a33

PJL GSSET and GSSETSTRING

Add GSSET and GSSETSTRING PCL commands for setting device
parameters/language parameters from PJL.

pcl/pl/pjparse.c
pcl/pl/plmain.c
pcl/pl/plmain.h


2019-05-18 13:52:25 +0100
Ken Sharp <ken.sharp@artifex.com>
85c99aa093d4e26b9f40c0a4eb686a7f5b2b2d64

pdfwrite - fix ColorConversionStrategy

No bug number, this arose from a question asked on Stack Overflow.

At some point I removed the enumerated value ccs_UseDeviceDependentColor
but I failed to remove the name "UseDeviceDependentColor" from the
list of strategy names. This meant that setting ColorConversionStrategy
to anything except LeaveColorUnchanged was 'out by 1' in the enumerated
data type.

This led (for example) to Gray being treated as RGB for the purposes
of the output colour space.

devices/vector/gdevpsdf.h


2019-05-08 08:19:55 -0700
Michael Vrhel <michael.vrhel@artifex.com>
95f7befcec1b30fd5014c8ad616485d32901ce33

Make sure transparency page group is isolated

Per the spec, the page group should be treated as an isolated
group. This allows the page group to specify a blending color space.
This resulted in over 90 pages of bmpcmp diffs. I went over all
of them. They are progressions. Most are very minor color differences
as we end up doing the blending and drawings in different color spaces
compared to prior to the commit

base/gstrans.c


2019-05-17 14:37:30 -0700
Michael Vrhel <michael.vrhel@artifex.com>
ebe7cd2b5a7a000c5ebf0bfa061f872faaf098e3

Handle trans group knockouts properly if page group is isolated

Page groups by definition have to be isolated. A fix for this to
ensure that the proper group color space is used for the page group
revealed a problem when the source PDF actually indicated the page
group was isolated. This led to an incorrect selection of subsequent
backdrops for any knockout groups contained.

base/gdevp14.c
base/gdevp14.h


2019-05-17 11:20:45 +0100
Ken Sharp <ken.sharp@artifex.com>
ee8a1c574198351d3ec1b181428d3d0159b4f80a

PDF interpreter - ignore errors in some faulty FreeText annotations

Bug #701058 "Can not convert pdf to tiff"

The PDF file has a FreeText annotation with no appearance stream and
faults in the Annotation dictionary.

Firstly (not perhaps strictly a fault) the /Contents key has a string
value with nothing in it. This isn't exactly an error, but it makes the
annotation pointless.

More seriously the /DA key contains:

(//Helvetica 12 Tf 0 g)

The double // on the font name means we end up with an empty name
on the stack, which causes errors.

In this commit:

Execute the DA processing in a stopped context, so that if it fails we
don't throw an error.

Surround the DA processing with a mark so that we can clear the stack if
it leaves anything behind.

Surround all of that with a 'gstate...setgstate' or 'gstate...pop'. If
we get an error this allows us to restore the graphics state to the
point before we did the DA processing. If we didn't get an error then
we can just discard the saved gstate.

Finally, check the length of the Contents string. If its 0, don't even
try to draw it. If its more than 0, but less than 4, then don't attempt
to check for UTF16 (2 byte BOM + 2 bytes for character means a minimum
of 4 bytes).

This results in slightly different output from pdfwrite with one file,
tests_private/pdf/sumatra/1331_-_prints_garbled.pdf, which results in
very small (single pixel) differences at 72 dpi.

Resource/Init/pdf_draw.ps


2019-05-17 09:15:48 +0100
Chris Liddell <chris.liddell@artifex.com>
2b4f54e13d9a5346e1c4c0a3a577d27065e67313

Remove the redundant -E and -A command line params

The functionality for both are now (and have been for a *long* time!) accessed
via -Z# and -Z@ respectively.

This solves a clash for -E with the other language implementations.

doc/Use.htm
psi/imainarg.c


2019-05-11 09:24:38 +0100
Ken Sharp <ken.sharp@artifex.com>
29fc52982904f7b24349f7fe369f614b3081ce90

DeviceN - handle out of memory errors

When altering the DeviceN colour space handling in the PostScript
interpreter to use C strings instead of name indices, I neglected to
consider the possibility of a failure to allocate memory for the string.

This commit just catches the fault and returns a VM error to the
interpreter.

psi/zcolor.c


2019-05-10 14:49:29 +0100
i3v <i3v@mail.ru>
55d04ff91a70a2cba1a1c15407c94f936c5f91f4

Documentation - fix various typos in VectorDevices.htm

Bug #701021 "Typos in VectorDevices.htm"

Fixes supplied by 'i3v'.

doc/VectorDevices.htm


2019-05-10 09:32:26 +0100
Chris Liddell <chris.liddell@artifex.com>
3db10c55b3ef621770bf6e93dfc1605e766adef2

Improve test for PS resources in romfs

Previously, although we always built a romfs, building gs with COMPILE_INITS=0
meant we included a romfs which was devoid of content, and an attempt to find
the status of the device would return 'gs_error_unregistered'. We used this
to determine whether to automatically add '%rom%Resource/Init' to the default
search path.

In the gpdl case (for the sake of PCL and XPS), we always have a usable romfs
(even with COMPILE_INITS=0) for the ICC profiles, so the above test gave a
false positive: gs would add the romfs to the search path, despite there being
no usable Postscript resources in it.

So, revise the test to explicitly check for Resource/Init/gs_init.ps on the
romfs. If the romfs is, indeed, empty, it will still return
'gs_error_unregistered', but in the gpdl case, it will return
'gs_error_undefinedfilename', and we correctly skip adding the romfs path to
the search paths for Postscript resources

psi/imain.c


2019-05-08 13:23:26 +0100
Chris Liddell <chris.liddell@artifex.com>
d2809b15153eedbbe1bfb43fc259bf674e353f42

Add an (interim) --enable-gpdl configure option

This adds gpdl to the default target list for make.

Mainly to get the .so build usable without having edit the makefiles.

This will be deprecated when gpdl is always in the default target list.

Makefile.in
configure.ac


2019-05-09 09:49:56 +0100
Ken Sharp <ken.sharp@artifex.com>
d0d7b8d3866aecafac3601ebd9b4b5d83f4fbe91

Fix some compiler warnings

and remove some #if directives accidentally included in a commit

base/gscdevn.c
devices/vector/gdevpdfc.c
psi/zcolor.c


2019-05-08 14:28:41 +0100
Ken Sharp <ken.sharp@artifex.com>
86a81b823950c712ac03e0139449045a81672d01

pdfwrite - extend DeviceN attributes dictionary generation

Now that we cater for the /Process dictionary in a DeviceN attributes
dictionary (and the Subtype) we need to emit those from pdfwrite too.

devices/vector/gdevpdfc.c


2019-05-08 14:27:23 +0100
Ken Sharp <ken.sharp@artifex.com>
2019db2e552653bd0c27377d500de1041c9fd0bc

PostScript colour space handling

We were not catering for a /Subtype in a DeviceN attributes dictionary
having a value which is a string type not a name type. I can't quite
see how we are ending up with a string type here, since the PDF file
has it as a name, but it does. Dealing with both resolves many errors.

The second change is more far-reaching; when processing an attributes
dictionary for a DeviceN colour space we may need to create colour
spaces for the Process dictionary /ColorSpace and for any of the entries
in the Colorants dictionary. We were doing that by calling
zsetcolorspace() which mostly works well, however there is one
optimisation which can cause a problem; if the target space is the same
as the current *interpreter* colour space, then zsetcolorspace()
simply returns.

The problem is that if we are halfway through processing a DeviceN
space then we haven't set the interpreter space to the new colour space
array yet which can mean that we incorrectly detect one of the target
spaces as being the same as the current space. This leads to us trying
to use the current space in the graphics state (the DeviceN space) as
the target space, with unfortunate consequences.

So create a new version of zsetcolorspace which doesn't do that
optimisation and use that when processing the various target spaces in
the DeviceN attributes dictionary.

psi/zcolor.c


2019-05-07 12:52:25 +0100
Ken Sharp <ken.sharp@artifex.com>
0d75869134c69963406500b536fb1bb1c97c8621

Separation - change ink name to be a C string instead of name index

As indicated in previous commits, change the stored ink name in the
colour space structure params.separation from a numeric value
(gs_separation_name) into a C string.

We never have to pass these back to the interpreter, so we allocate the
storage using the non-GC allocater.

base/gscdevn.c
base/gscsepr.c
base/gscspace.h
base/gsequivc.c
base/gsicc_cache.c
base/gxcmap.c
devices/vector/gdevpdfc.c
devices/vector/gdevpdfg.c
psi/zcolor.c


2019-05-06 16:51:26 +0100
Ken Sharp <ken.sharp@artifex.com>
97253bf54a701d5e433378df953e066d009afde0

DeviceN - change ink names to be C strings instead of name indices

As indicated in previous commits, change the stored ink names in the
colour space structure params.device_n from numeric values
(gs_separation_name) into C strings.

We never have to pass these back to the interpreter, so we allocate the
storage using the non-GC allocater, which simplifies things for the
array which used to store the indices and now stores the pointers to the
C strings.

base/gscdevn.c
base/gscspace.h
base/gsequivc.c
base/gsicc_cache.c
base/gsicc_manage.c
base/gxcmap.c
devices/vector/gdevpdfc.c
devices/vector/gdevpdfg.c
psi/zcolor.c


2019-04-07 19:54:57 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
880a700f691f444c483053f48b3c0b0f3a920883

Bug 697545 : Prevent SEGV caused by double freeing.

Prevent running finalize for devices with a custom finalize.

Error created using :-
MEMENTO_FAILAT=1767 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0270

base/gdevdflt.c
base/gspaint.c


2019-05-02 08:00:46 -0700
Michael Vrhel <michael.vrhel@artifex.com>
284ba1a6491088ab8ea9985f5df882c43bd3ca12

Use deviceN attributes process color color space

If the DeviceN color space includes an attributes entry and
it has a process color space, and the color space is of the proper
type use that as the source color for the process components. If
instead the alternate tint transform color space is the correct type
use that as a hint. If neither work then set to the defined default_cmyk
source color space. If all fail due to issues with ICC profiles then
the CMYK source process colorants will pass through to the output device.

base/gdevp14.c
base/gscdevn.c
base/gsequivc.c
base/gsicc.c
base/gxcmap.c
base/gxcmap.h


2019-05-06 13:46:42 +0100
Ken Sharp <ken.sharp@artifex.com>
754b4eb77d24ff0273b530aa748bbf925b715d9c

Ensure correct memory allocation of Colorant strings

I'm not happy with using ref_to_string() as it doesn't seem to behave
entirely as I would expect, so modify the code to explicitly allocate
the memory used to store the Colorant name.

Also fix a compiler warning.

psi/zcolor.c


2019-05-06 09:10:22 +0100
Ken Sharp <ken.sharp@artifex.com>
76022c9c27a0f4031553cf3a5eb2c009b26b19be

DeviceN - store C strings for Colorant names, not name indices

For DeviceN spaces with an attributes dictionary containing a
Colorants dictionary we were storing the Colorant names as a name index
(index into the interpreter name table). Additionally we store a
procedure callback to recover the C string from the name index.

This is problematic for several reasons; firstly it requires all the
interpreters to either have a name table or some close equivalent so
that a C string can be recovered from a numeric value.

Secondly the lifetime of the string is divorced from the lifetime of the
C structure using it. Because there's no easy way for the interpreter to
know when the graphics library has freed the colour space structure
the interpreter is forced to retain the relationship between the name
index and the C string until the job is completed.

Both of these will be problems for the new PDF interpreter, so this is
step 1 in altering this. After this we will still need to change the
storage of the DeviceN and Separation ink names, which are handled the
same way.

base/gscdevn.c
base/gscdevn.h
base/gxcdevn.h
devices/vector/gdevpdfc.c
devices/vector/gdevpdfg.c
psi/zcolor.c


2019-05-03 17:35:49 +0100
Ken Sharp <ken.sharp@artifex.com>
8b407511d2fad0108a76c6b46dc54a1770ea3ade

fix commit c2d50885614481ebf542578e69ce4bcbbfea6532

don't retest code, and fix some compiler warnings

base/gscdevn.h
psi/zcolor.c


2019-05-03 13:27:22 +0100
Ken Sharp <ken.sharp@artifex.com>
c2d50885614481ebf542578e69ce4bcbbfea6532

DeviceN - handle attributes Subtype and cleaning up

Previously we were ignoring the /Subtype in the attributes dictionary
of a DeviceN colour space (if attributes were present). We may need to
be able to tell the difference (now that we handle /Process) because
the values associated with the process components must be stored in
their natural form (eg subtractive for CMYK, additive for RGB) when
the Subtype is NChannel.

The remainder of the commit tidies up naming; previously we had a
structure called gs_devicen_attributes, which was used to store the
Colorants entry form an attributes dictionary. Since we now handle
other aspects of the attributes dictionary as well, this was misleading
so the structure has been renamed throughout as gs_devicen_colorant
(since each structure defines only one colorant, the plural name was
also misleading). Apparently pdfwrite is the only client for this
currently anyway.

Finally, moved the 'devn_process_space' from the general graphics
state colour space structure into the DeviceN params structure, as its
only relevant to DeviceN (and indeed only a DeviceN with an attributes
dictionary which contains a /Process entry)

base/gscdevn.c
base/gscdevn.h
base/gscspace.c
base/gscspace.h
base/gxcdevn.h
devices/vector/gdevpdfc.c
devices/vector/gdevpdfg.c
psi/zcolor.c


2019-05-02 16:40:18 +0100
Ken Sharp <ken.sharp@artifex.com>
22d88ad48409a130007976ae26536cc9d99c16d9

Fix an oversight in DeviceN attributes processing

If we have no Colorants entry we still want to check for a Process
entry, but to do so we need to signal to setcolorspace_cont(), the
routine which calls this one, that we do want to keep processing the
colour space.

psi/zcolor.c


2019-05-02 13:12:28 +0100
Ken Sharp <ken.sharp@artifex.com>
7c70031f8be95585bcf439d12e552d386e4e2125

Capture the /Components from a DeviceN /Process dictionary

Following on from commit 5e84879db91fdc8569a85a394def391695152720 and
Michael's commit c6ac30d231946062b41c56df375b240583e75b35 this adds
code to check for the existence of a /Process dictionary in the
attributes dictionary (if present) of a DeviceN colour space.

Also fixed/added a few comments to the existing code and did some
tidying up of error return handling.

psi/zcolor.c


2019-05-01 10:06:41 -0700
Michael Vrhel <michael.vrhel@artifex.com>
c6ac30d231946062b41c56df375b240583e75b35

Add holder for process color names in DeviceN color space parameters

As part of the work to use the DeviceN attributes process dictionary
we need to have a place to store the colorant names. They will
be stored as an array of C strings in the pcs->params.device_n structure.
This commit adds them to the structure and frees them during the color
space finalization.

base/gscdevn.c
base/gscspace.h


2019-05-01 17:49:03 +0100
Ken Sharp <ken.sharp@artifex.com>
5e84879db91fdc8569a85a394def391695152720

Process DeviceN attributes dictionary, /Process dictionary, /ColorSpace

PostScript PDF interpreter changes; retrieve the Process dictionary
from the DeviceN attributes dictionary (if present). Extract the
ColorSpace, resolve the ColorSpace (turns any references into actual
objects), and store the result back in the Process dictionary. Finally
store the Process dictionary in the attributes dictionary which we
pass to setcolorspace.

PostScript interpreter, C changes; add a new 'stage' for DeviceN
colour space handling. In stage 3, check for the existence of an
attributes dictionary, then a /Process dictionary, and a /ColorSpace
entry. Retrieve the entry. Set up a new continuation procedure
'devicenprocess_cont'. The continuation procedure calls zsetcolorspace()
to set the /ColorSpace as the current space. On returning, retrieve
the current color space, attach it to the DeviceN graphics state colour
space and finish.

Still to do; process /Components, add the equivalent code to pdfi,
check pdfwrite to see if we can handle this. Tidy up comments.
Committing now so Michael can carry on with the CMS work.

Resource/Init/pdf_draw.ps
psi/zcolor.c


2019-05-01 13:17:25 +0100
Robin Watts <Robin.Watts@artifex.com>
6742ad7d26dc7bb8cc33aef9f96f86d892d4a424

Valgrind: image_render_interpolate_landscape_icc.

Don't color convert the unprocessed margins of the buffer.
These areas are never inited, so a warning is given. No
harm is done as they are never actually rendered, but it's
faster and cleaner to skip them too.

base/gxiscale.c


2019-04-30 15:13:25 -0700
Michael Vrhel <michael.vrhel@artifex.com>
04db6ace1fb97dcef79d9bdbb01a1c8a63c55d88

Add a devn_process_space to color gs_color_space_s

This is in preparation for having the process color
space as defined in the DeviceN (NChannel) Process
dictionary.

base/gscspace.c
base/gscspace.h


2019-04-30 11:49:07 -0700
Michael Vrhel <michael.vrhel@artifex.com>
e1f9edfcafc3f73f43b85afacb8d788f7e573cf6

Add methods to detect pure process colors in Sep and DeviceN color spaces

When the colors in the separation or Devicen color space consist all of
one particular process color model, we would like to consider the use
of the alternate tint transform color space as an indication of the intent
for these color spaces (assuming the attributes information was not there).
For example, if we had a DeviceN color space
of [Cyan Magenta] and the alternate tint transform color space was a
CMYK ICC color space, that would be a hint that we should treat the color
as being in that space. This commit provides us with the information as
to the colorants all being in one particular process space which is
a requirement.

base/gscdevn.c
base/gscsepr.c
base/gscspace.h


2019-04-30 15:26:11 +0100
Robin Watts <Robin.Watts@artifex.com>
b380b655b64a37a77b98dab881ff0aad0c62586e

Nobble pdfwrite genrated /ID entries in cluster tests.

Avoid having the /ID values depend on the output filename
in cluster testing. This should allow us to compare the
results of pdfwriting between gs and gpdl. It also removes
one more thing to get right when trying to manually reproduce
cluster results.

devices/vector/gdevpdf.c


2019-04-30 10:40:20 +0100
Robin Watts <Robin.Watts@artifex.com>
fd5758e4d55c510fa4ad0047c10b13cf928cfb74

Make pdfwrite fileID calculations consistent on cluster.

Nobble the timing calculations under CLUSTER builds, so
we get consistent results.

Also, move to using realtime, rather than usertime (as the goal
is to have something different each time).

devices/gdevpdfimg.c
devices/vector/gdevpdf.c


2019-04-29 17:58:42 -0700
Michael Vrhel <michael.vrhel@artifex.com>
35c40cdaa2f79432f01733d3f69f95947db5d60b

Change implementation of gsicc_support_named_color

gsicc_support_named_color now will have available all the names
in the DeviceN color space. If there are no spot names
in the list, it will return false ensuring that the process colors
will be color managed.

base/gscdevn.c
base/gscsepr.c
base/gsicc_cache.c
base/gsicc_cache.h


2019-04-29 18:39:23 +0100
Robin Watts <Robin.Watts@artifex.com>
8026e11e50306a51dc3bb6f2bdc57f34986acd62

Fix undefined behaviour in rops.

We were indexing off the end of a static table. Annyoingly,
valgrind has failed to pick this up for years.

base/gsroprun.c


2019-04-29 11:14:06 +0100
Ken Sharp <ken.sharp@artifex.com>
0bafbd9c1273fab0dc79fd20db0ffc4443683f96

PDF interpreter - Decode ToUnicode entries of the form /Identity-H/V

Bug #701003 "Text searchability broken due to omission of /ToUnicode /Identity-H"

The PDF references from 1.2 too 2.0 all state that the value associated
with a ToUnicode key in a FontDescriptor must be a stream object. However
this file (and one case seen previously, bug 687351) have FontDescriptor
dictionaries where the value associated with a /ToUnicode key is a
name object, in both cases /Identity-H.

Although this is clearly not legal, Acrobat not only tolerates it, it
actually uses it for search/copy/paste (see bug 701003 for details).
Without the key Acrobat is unable to successfully search the output file.

We can't simply preserve the name object as a ToUnicode value; when
handling ToUnicode we actually decode the CMap and build a
GlyphNames2Unicode map (an internal representation of the G2U data
produced by the Microsoft PostScript printer driver). When writing the
output file we use that information to get a Unicode value for each
character we write, and build a new ToUnicode CMap using that.

This commit tackles the problem by pre-scanning for a name object and
then checking to see if its Identity-H or Identity-V (although we have
not seen an Identity-V, there seems no reason why it wouldn't be
equally valid). If we find either of these then we construct a
GlyphNames2Unicode table for all possible values (0 - 65535) and store
that with the font as normal. When we write the output file we only
write the required entries for the subset font, so we write a now
completely legal ToUnicode CMap, and Acrobat is equally happy with that
as the original name.

If the ToUnicode value isn't a name object, or isn't one of the
identities then we proceed as before. This means we will print a
warning for non conforming ToUnicode entries and ignore them.

Resource/Init/pdf_font.ps


2019-04-28 19:59:12 -0700
Michael Vrhel <michael.vrhel@artifex.com>
0b9c45fa86f7736e7fec170a135efa83636283ba

Have CMYK colors in DeviceN color spaces color managed when going to CMYK devices

The current code was only doing color management of DeviceN CMYK when going to
the separation device (e.g. tiffsep and psdcmyk). It should also be doing this
for pure CMYK devices like tiff32nc etc. With RGB devices we will be going through
the alternate tint transform. The would only pertain to DeviceN color spaces composed
of only process colors (e.g. [Cyan Magenta]). If a spot color was included we would
be going through the alternate tint transform for a device like tiff32nc.

So with this commit if you have a command line like

-sDEVICE=tiff32nc -sDefaultCMYKProfile=src_cmyk.icc -o output.tif -f input.pdf

it will treat the CMYK values in the DeviceN color space the same as a DeviceCMYK
source color and make use of the src_cmyk.icc profile to handle those. As mentioned
this worked with psdcmyk and tiffsep but not standard CMYK devices.

base/gxcmap.c


2019-04-01 20:30:23 +0100
Robin Watts <Robin.Watts@artifex.com>
68511243fb4817e8170023d1d6922956325a139d

Move transfer functions to 16 bits.

This means that in 'deep' modes, we sample them in 257 places
(0000,0100,....ff00,ffff) rather than 256 (00,01,...ff), and
in 16 bits rather than 8. We also interpolate them on reading.

This in turn increases the size of the data put into the clist.

base/gdevp14.c
base/gstparam.h
base/gstrans.c
base/gstrans.h
base/gxblend.c


2019-04-26 21:24:28 -0700
Michael Vrhel <michael.vrhel@artifex.com>
e2507c443fcd1456ff65695901339fc96f4bbf73

Fix improper logic in named color support

base/gscdevn.c


2019-04-26 16:47:29 -0700
Michael Vrhel <michael.vrhel@artifex.com>
fb9f948ec79d18c2574a9a0bdaf9ab1aeee21e58

And one more fix to the named color blending.

Fixing issues introduced in previous commit.

base/gsicc_cache.c


2019-04-26 11:25:19 -0700
Michael Vrhel <michael.vrhel@artifex.com>
e1a534e843743230019de57a36a04129347a505e

Fix named color blending

Named color blending was not working the way intended. This was clearly visible
when pushing a gradient through. This now does a reasonable result blending
the first colorant with white and then subsequent colorants with the current
colorant.

base/gsicc_cache.c


2019-04-26 14:40:22 +0100
Chris Liddell <chris.liddell@artifex.com>
6fcd76043a6fe69ca2b8ecac498f9ca79829931f

Bug 700973: CIDFont substitution: avoid multiply applying metrics

findCIDFont: we make various efforts to produce a synthetic font style
(bold, light, italic etc) if the actual type face style is not available.

In these cases, we have to avoid reusing an existing CIDFont substitute because
the CDevProc will have been 'hooked' to apply the width metrics drawn from the
PDF file. We want to, if at all possible, use the CIDFont as originally loaded.

Resource/Init/pdf_font.ps


2019-04-25 17:20:12 +0100
Ken Sharp <ken.sharp@artifex.com>
cb1414723d95c6813e8e44a8c0529f0063998378

pdfwrite - handle user-defined PCL fonts with character codes > 256

Bug #700996 "PCL Files Processing failure"

The problem is that we cannot handle a character code in excess of 256
in a PDF Font (we would have to create a CIDFont, which is too much
work). This was causing us to fail to attach a PDF font to the current
(user-defined PCL) font. When we later tried to retrieve the font
that caused a seg fault.

If we simply return an error when there is no attached font then the
fallback machinery will take us through generating an image instead.

This, however, caused the original file not to work properly, text was
going missing. Forcing 'early accumulator' to be 0 so that we created a
new font resolved the problem. Its better, however to remove that entire
section of code, since it now has no purpose.

This commit results in a PDF file with the correct appearance. A number
of out test suite files exhibit small differences, particularly at
low (75 dpi) resolution, but nothing is actually incorrect.

devices/vector/gdevpdti.c
devices/vector/gdevpdtt.c


2019-04-24 12:27:16 -0700
Michael Vrhel <michael.vrhel@artifex.com>
7b1d3a9fcc40d0dd2dc779830abe21da83183c11

Fix two issues in replace color management.

Always do replacement for this demo implementation and
use get_color_mapping_procs_subclass to get the device
color mapping procs. The old method had an issue with
overprint compositor and psdcmyk device.

base/gsicc_replacecm.c


2019-04-24 11:20:57 -0700
Michael Vrhel <michael.vrhel@artifex.com>
29d227c79fa8554e65eb1e081a81cbcb13b76b8a

Avoid double free in replace color management code

base/gsicc_replacecm.c


2019-04-24 10:27:25 -0700
Michael Vrhel <michael.vrhel@artifex.com>
2f947ad5c32968cb113cb3ba4958e239dcf730a5

Use space in calls to gs_strtok

base/gsicc_manage.c


2019-04-23 21:32:00 -0700
Michael Vrhel <michael.vrhel@artifex.com>
8881a51d55df7df70f4e0083be8569e09213dfba

Fix several warnings and issues from last commit.

base/gscsepr.c
base/gsicc_cache.c
base/gxcmap.c


2019-04-24 10:48:07 +0100
Robin Watts <Robin.Watts@artifex.com>
7f34ef8c946be47d5a5dcc412b3da608a0066c44

Fix typo in 16bit code in gxblend.c

src_shape needs to be 16bits, not a byte now.

base/gxblend.c


2019-04-23 20:11:24 -0700
Michael Vrhel <michael.vrhel@artifex.com>
fea343608ce813156ae8ffc2ea6d42fc5f198e64

Add support for named color when going to separation devicen_icc_cmyk

When going through named color processing with the target device either
tiffsep or psdcmyk, cmap_devicen_direct and cmap_devicen_halftoned were
doing an additional cmyk icc mapping. This mapping was needed to ensure
that CMYK values matched DeviceN mapping values of CMYK+Spot where the Spot
value was 0 percent. With the use of named color mapping, we want to avoid this
icc mapping. Fixing this issue involved adding a boolean value to the DeviceN and Separation
color space params to indicate if the spot colorant(s) are supported by the
named color profile. This determination is made during the install of the
device so that it need only be done once. To do that, we needed to add a
method, gsicc_support_named_color, in gsicc_cache.c, which goes with
gsicc_transform_named_color, to indicate if the spot colorant is defined in
the data that we are using. Tested with tiff24, tiff32 and psdcmyk to ensure
named color mapping is occurring and that no additional mapping occurs after
that.

base/gscdevn.c
base/gscsepr.c
base/gscspace.h
base/gsicc_cache.c
base/gsicc_cache.h
base/gxcmap.c


2019-02-19 16:38:26 +0000
Robin Watts <Robin.Watts@artifex.com>
f0f2fa2a084758bcf99409ce19c2c1f93dc04d32

Deep color transparency

Previously, all transparency blending has been done using the
pdf14 compisitor working in 8 bits. Here, we extend it to be
capable of working in 16 bits.

When the compositor is created, it looks at the underlying device;
if that device uses more than 8 bits per component (plus 8 bits
for tags, if tags are in use), then we use 'deep' (i.e. 16 bit
per component) pdf14 buffers.

base/gdevdflt.c
base/gdevmem.c
base/gdevp14.c
base/gdevp14.h
base/gdevprn.c
base/gsptype1.c
base/gstrans.h
base/gxblend.c
base/gxblend.h
base/gxblend1.c
base/gxclrect.c
base/gxclthrd.c
base/gxcolor2.h
base/gxp1fill.c
base/gxpcolor.h


2019-04-22 15:33:02 +0100
Robin Watts <Robin.Watts@artifex.com>
ba8ff34e302ec3e65bd47b14796dcfaef157527f

Hack bmpcmp to accept 16bpc PSD files.

We ignore the bottom bytes of the pixel data.

toolbin/bmpcmp.c


2019-04-19 08:16:57 +0100
Chris Liddell <chris.liddell@artifex.com>
d8db95fb00af2fb543439242d3ac122aead88c94

Fix some structure element name confusion in base/sjbig2_luratech.c

A previous commit slightly modified some of memory management for jbig2 global
data. In mirroring those changes to the Luratech version of the code, a couple
of places were left with the structure element names from the jbig2dec version.

base/sjbig2_luratech.c


2019-04-16 19:30:02 +0100
Robin Watts <Robin.Watts@artifex.com>
b399f849ce1aa391da1abeb23fd32e376b56e522

Bug 700624: Fix "full" pattern fills with gaps between cells.

GS has an optimisation in it, whereby if an uncolored pattern fill
is completely full (the mask is full of 1's), it doesn't bother to
store the mask. When such a pattern is filled, the code knows just
to fill the whole thing.

Sadly, this optimisation breaks down when the cells have an X or Y
step that means there should be gaps between the instances. GS
currently fills the whole thing, gaps and all.

To fix this, we either need to fix all the different fill routines
to cope with this case, or (as I have done here), disable the
optimisation in the case when the X and Y step is larger than the
'size' of the pattern cell.

base/gxpcmap.c


2019-04-18 16:58:41 +0100
Chris Liddell <chris.liddell@artifex.com>
d86210973df93ccca0befd56afba2132da925ebc

Bug 700986: Remove the crazy md5 file copying nonsense

To preserve building as a standalone test exe, we avoided using Ghostscript
includes in the md5 source and header files, but dynamically add them to
copies of the files during the build. Since we no longer need/care for the
stand alone exe, remove the build complication, and just include the header
file normally.

base/gsmd5.h
base/lib.mak
base/md5main.c
doc/Develop.htm
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2019-04-18 14:24:04 +0100
Alexander Grahn <a.grahn@fzd.de>
a3be0c9d86981313d8724f6c29f2feaa07152976

Bug #700984 "BMC pdfmark: BMC keyword missing from content stream (patch included)"

Not sure how this has gone unnoticed for so long. The 'BMC' keyword was
missing from the emission of the content of the pdfmark. The EMC and
BDC pdfmarks seem to be OK.

Thanks to Alexander Grahn for identifying the problem and supplying a
patch to resolve it.

devices/vector/gdevpdfm.c


2019-04-18 11:18:35 +0100
Ken Sharp <ken.sharp@artifex.com>
a7cccaac16e6fc252496ab630f7423262e05756d

Fix commit d89bae568d5015144e5d68fea8221543111e119e

Commit d89bae568d5015144e5d68fea8221543111e119e contained an oversight
which unfortunately was missed due to the testing cluster being in a
state of flux.

Its possible for fonts to have a Subtype of Type1C as well as the
noted CIDFontType0C and CIDFontType1C, and we need to cater for that
as well.

This mostly affected some of the Ghent Working Group test files, and
not much else, so I've chosen just to push an addditional commit.

Resource/Init/pdf_font.ps


2019-04-17 15:53:14 +0100
Ken Sharp <ken.sharp@artifex.com>
d89bae568d5015144e5d68fea8221543111e119e

PDF interpreter - change detection of CFF CIDFont types

Bug #700982 "Error: unrecognized font file starts with <01000D02>"

The code in pdf_font.ps to detect font types, and call an appropriate
font loader works (in part) by reading the first 4 bytes from the font
stream, and then using that as the key for a dictionary where the
values are the font loading procedures.

Most font types have a 'magic number' or similar at the start of the
font data, but CFF fonts do not. In fact the header of a CFF font is
highly variable, the only thing we can rely on being the font version
byte (0x01), the remaining 3 bytes are variable.

We've tackled this previously by simply adding more different varieties
of string values, but this seems nonsensical. There are too many
possible values for this to work reliably.

Ideally I'd recode this to use the CIDFont Subtype to select the
correct font loader, but that would mean recoding all of this, which is
more work than I want to tackle in this code. Instead I've chosen to
only have one single 'tag' in the dictionary, and I've extended the code
handling the case where we don't find a tag in the dictionary.

Previously this checked to see if the first two bytes of the string
were <8001> and otherwise failed. I've modified this so that if the
bytes are not <8001> then we check the dictionary /Subtype key. If its
not present or isn't either CIDFontType0C or 1C then we still throw
an error. Otherwise we discard the string we read, replace it with the
one and only string we have stored in the font_tag_dict dictionary and
proceed.

If there is ever a version 2 of the CFF specification this will fail,
but we can add a check for the version number if that ever happens
(seems highly unlikely).

Resource/Init/pdf_font.ps


2019-04-16 09:20:44 +0100
Ken Sharp <ken.sharp@artifex.com>
cf58dd08435d89e5f205127c518595c0d7441535

Documentation - describe the ink_cov device

Following up from a question on Stack Overflow, the ink_cov device isn't
actually described anywhere. Add a description of the device and how its
output differs from the inkcov device.

At the same time, add the inkcov device(s) to the table of contents in
devices.htm and also add the bit and bbox devices which were not listed
in the TOC.

doc/Devices.htm


2019-04-15 08:25:08 +0100
Ken Sharp <ken.sharp@artifex.com>
5fa1928af0eb110115d34eb4c43bb529dda6f697

PDF interpreter - synthesise appearance for text Widget comb fields

Bug #700967 "Warning Combed form fields are not yet implemented"

Comb fields draw a string into a series of 'combs' or boxes, one
character per box. As usual there are no guidelines in the specification
as to how to draw the individual characters.

I've chosen to centre each character in the box it is draw in, because
drawing it from the origin of the box tends to cause collisions with the
vertical/horizontal lines delineating the box itself (in the one example
file I have). This may cause slightly odd appearance if a field uses
mixed upper/lower case, as the text will jump up and down vertically.

The example file supplied has a fault, one of the comb fields has a
value (/V) string which is longer than the /MaxLen value for the field.
This indicates to me a fault with the form filling application which
should not permit this. Acrobat truncates the string, I've chosen to
not render the string at all, and emit a warning on the back channel.

None of our test suite files show any differences at all; either we
don't have an examples of this kind of field already, or they all have
appearance streams.

Resource/Init/pdf_ops.ps


2019-04-12 09:53:44 +0100
Chris Liddell <chris.liddell@artifex.com>
6d8e1957175ec98443a6bc0d8c3cda6bfdced801

Bug 700968: Fix TTF Format 4 (segmented) cmap parsing

The format 4 parsing was incorrect, but in a manner only exposed by reading
an out of spec cmap.

The spec implies that the character codes in the cmap segments should be non-
overlapping, and the segments should be in order of lowest-to-highest codes.

We were imposing (*not* enforcing) that condition, but forcing the start code
of the current segment to be greater than size of the range of codes we've
already read. This, basically, has no effect on fonts that adhere correctly
to the spec.

The fonts embedded in the files for Bug 700968 do not conform to the spec. For
example, the 'Z_C00002.tmp' font has the first 92 segments in the cmap with
start code and end code both set to 33. The above imposing of the no-overlap
and order of segments meant that when we got past those first 92 segments, we
were forcibly using character codes 92 and upwards.

Removing the code imposing those conditions causes these files to render
correctly, and shows no regressions in our existing test suite.

Resource/Init/gs_ttf.ps


2019-04-11 12:16:57 -0700
Nancy Durgin <nancy.durgin@artifex.com>
adc75668cc254ead4929748fdb5ca988353f91eb

Change s_jbig2decode_release() to free the global context in some cases

Basically, if state->global_struct is NULL, it means the library should
free the global_ctx when it's done with it. This is the case when used in
gpdf (C implementation of PDF).

If the state->global_struct is non-NULL, then it is a memory-managed
value that the interpreter will eventually clean up. This is the case
when used in gs (PS implementation of PDF).

base/sjbig2.c
base/sjbig2_luratech.c


2019-04-11 08:49:14 -0700
Nancy Durgin <nancy.durgin@artifex.com>
fd3730fa8429f1ea58b2f5a5bfc1eecd3f835247

Change s_jbig2decode_set_global_data to take a separate pointer for global_ctx

This is so gpdf can pass NULL for the 'gd' pointer, since it doesn't care
about garbage collection.

base/sjbig2.c
base/sjbig2.h
base/sjbig2_luratech.c
base/sjbig2_luratech.h
psi/zfjbig2.c


2019-04-10 14:23:39 +0100
Chris Liddell <chris.liddell@artifex.com>
06c920713e11bce9bd541bbf9bf294b2ba16aee8

Bug 700952: re-introduce over/underflow workaround

Commit 355434f4b1bbe8c4f98cafad5a6868aa2f0eaae1 reverted a workaround that
compensated for over/underflow in Freetype's TTF hinting (related to freedom
and projection vector calculations). That problem no longer exists in recent
Freetype releases, and the workaround actually caused other issues to occur
with hinting.

What wasn't obvious was that the workaround also protected over/underflow
issues relating to the unitsPerEm value.

So this re-instates the workaround, but bases the decision on how the final
scale is distributing between the Freetype "size" and the Freetype matrix on
the unitsPerEm value (this is relevant for all font types as, for non-TTF,
font types, Freetype derives the unitsPerEm from the FontMatrix (for PS type
fonts).

Also fixes Bug 700875

base/fapi_ft.c


2019-04-10 14:51:12 +0100
Chris Liddell <chris.liddell@artifex.com>
35d9fc4d2a9dd85fc8497cb68389ec6eded73fcb

Update the copyright string.

base/gscdefs.h


2019-04-10 13:54:57 +0800
Sebastian Rasmussen <sebras@gmail.com>
08b91a2141df36d2f733e1822601ad06941674f2

Detect system jbig2dec library using pkg-config if available.

Otherwise fall back to traditional presence checking.

configure.ac


2019-04-10 20:06:04 +0800
Sebastian Rasmussen <sebras@gmail.com>
9f111ddc1cdb3cee329fb71e6ce4fd31c150f039

jbig2dec: Improve jbig2dec-specific gitignore.

jbig2dec/.gitignore


2019-04-10 13:48:05 +0800
Sebastian Rasmussen <sebras@gmail.com>
d72c6cdcd686a7dd0836f8a3afc4e23b5bb45144

jbig2dec: Add pkg-config file and allow for it to be installed.

jbig2dec/Makefile.am
jbig2dec/configure.ac.in
jbig2dec/jbig2dec.pc.in


2019-04-10 18:23:26 +0800
Sebastian Rasmussen <sebras@gmail.com>
300dd807b47d48b7b8368ca7b6db3db0312fa19b

jbig2dec: Check that header version matches library version.

jbig2dec/jbig2.c
jbig2dec/jbig2.h


2019-04-10 18:00:35 +0800
Sebastian Rasmussen <sebras@gmail.com>
a2f646ac8a07e7d019ddcb9e0ca2bdff1f5c740f

jbig2dec: Expose version number in header.

Since the version number should only be specified in one location,
the public jbig2dec header, autogen.sh will not regenrate the
autoconf input file configure.ac.

jbig2dec/autogen.sh
jbig2dec/config_win32.h
jbig2dec/configure.ac.in
jbig2dec/jbig2.h
jbig2dec/jbig2dec.c


2019-04-10 13:44:23 +0800
Sebastian Rasmussen <sebras@gmail.com>
90e56e3d9195f1aa19977629f2d3d3b4ec4d72cf

jbig2dec: Add empty m4 directory to silence libtool warning.

jbig2dec/Makefile.am


2019-04-10 13:40:08 +0800
Sebastian Rasmussen <sebras@gmail.com>
cb4d8dee4974e85b8c54f553520bded6fabd7b74

jbig2dec: Silence automake warning about setting CFLAGS directly.

Setting AM_CFLAGS is added to CFLAGS, adding the wanted XCFLAGS.

jbig2dec/Makefile.am


2019-04-10 13:39:05 +0800
Sebastian Rasmussen <sebras@gmail.com>
f25171c4fc2a5e7cd6bd9ab0b96a5133c038425d

jbig2dec: Silence automake warning about ar use.

jbig2dec/configure.ac


2019-03-05 18:09:20 +0800
Sebastian Rasmussen <sebras@gmail.com>
9f1959fb44a4da0506c8ef7a8cbb0ccbef4cceea

jbig2dec: Fix bug where realloc returns NULL.

jbig2dec/jbig2_image.c


2019-04-10 05:11:16 +0800
Sebastian Rasmussen <sebras@gmail.com>
67c9175c4a601a447b22e84251ec8c33ac827277

jbig2: Avoid integer overflow in custom allocator.

base/sjbig2.c


2019-04-10 05:10:29 +0800
Sebastian Rasmussen <sebras@gmail.com>
a69dd377c6f07e08ea4f895eabb974c92adccab4

jbig2: Print messages from jbig2dec, do not just count them.

base/sjbig2.c


2019-04-03 11:01:18 -0700
Ray Johnston <ray.johnston@artifex.com>
1fb3a69df53754f6a000152606f52b2f4a658b97

Fix crash reported by customer #531 with multi-threaded rendering.

This was a race condition where threads were continuing to be started
while we were tearing threads down. This doesn't occur with most usages
because we render the entire page, but with the customer's device, it
stops reading before the last line, but the multi-threading rendering
logic tried to keep starting threads (up to NumRenderingThreads) to
have later bands available.

The solution is to wait for all threads to be in the "THREAD_DONE"
state before freeing the threads.

Also, since the color_usage_array of the main thread is shared by the
rendering threads, wait until the threads are shut down before freeing
that.

base/gxclist.c
base/gxclthrd.c


2019-03-19 13:49:49 +0000
Chris Liddell <chris.liddell@artifex.com>
d9055d0a350ca7681fb8f4854ed4f1c3bf7ed570

Bring master up to date with 9.27 release branch

Product string, dates etc for 9.27 release candidate

News and changelog for 9.27 release candidate

Update product string, dates etc for 9.27 release

News/History9.htm revisions also.

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-04-04 10:44:50 +0100
Chris Liddell <chris.liddell@artifex.com>
12e31a72ffe1d2da30bf2c1976795b72ccd320b2

Update jbig2dec stuff for 0.16 release

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


2019-04-03 03:28:01 -0700
Robin Watts <Robin.Watts@artifex.com>
76c6de5428936c8fdb7269d7fcc31d4bdc83d745

Fix problems with "typedef struct foo_s foo;" redefinitions.

In the header revamp, I'd left various places where we
use the above formulation in more than one location. This
is fine with all the C compilers I tested it on, but seems
to update gcc 4.1.2.

This effect can be seen on later gcc's by using
"-std=gnu89 -pedantic".

This commit tweaks the code to avoid redefinitions of this
kind.

base/gsfont.h
base/gsgdata.h
base/gspath.h
base/gspenum.h
base/gxchar.h
base/gxdevcli.h
base/gxfont.h
base/gxiodev.h
base/gxpath.h
base/gxtext.h
base/lib.mak
psi/imemory.h


2019-04-03 08:37:41 +0100
Ken Sharp <ken.sharp@artifex.com>
7146b7292e27acc54d23b48472f6851ae9b51d8c

Fix PDFX_def.ps

Bug #700942

For some reason Git did a merge with this file when I made the change,
and it messed it up. Since we don't test these files, it didn't get
noticed.

lib/PDFX_def.ps


2019-04-02 10:55:27 +0100
Ken Sharp <ken.sharp@artifex.com>
2c97be9f328babb7b544ab3610e6fce05e30cdc8

pdfwrite - change the example PDF/A and PDF/X scripts

From Bug #700930 "Typo in example command for PDF/X-3 in VectorDevices.htm"

The reporter claimed that the (mis-spelled) command didn't work, which
was not surprising, since it contained a typo. After fixing the
documentation the reporter claimed that the command didn't work. This
is true and was missed because of the misleading title.

The PDFX_def.ps file was mistakenly pulling the ProcessColorModel from
systemdict, which would only be set if this was set on the command line.
The real problem is the fact that our setpagedevice/currentpagedevice
code doesn't truly reflect the device setup, so changes to the
ProcessColorModel caused by setting ColorConversionStrategy are not
reflected in the values returned by currentpagedevice.

This commit updates PDFX_def.ps to chaeck the ColorConversionStrategy
instead, which is more reliable, and then use the ProcessColorModel
from the currentpagedevice as a fallback if ColorConversionStrategy
is not set. (actually this should not be possible)

Update PDFA_def.ps similarly; although it was using the currentpagedvice
this is not a reliable method.

Finally; reformat the files, add some extra comments describing what the
code is doing, make it clearer that these files *should* be customised
and add additional some basic instruction on customising them.

lib/PDFA_def.ps
lib/PDFX_def.ps


2019-04-02 08:26:09 +0100
Ken Sharp <ken.sharp@artifex.com>
978b03b453245c2a48abaee5addea3b7e025a2ed

Fix another typo.

HTML is annoyingly impossible to spell-check :-(

doc/VectorDevices.htm


2019-04-01 16:15:21 +0100
Ken Sharp <ken.sharp@artifex.com>
2983be3f871e480b6567f5ce5c16206a026851fe

PS interpreter - prevent user code overriding some commad line switches

Bug #700935 "defining BATCH causes typecheck in ifelse"

A (surprisingly large) number of command line switches are checked at
various points in gs_init.ps, but use the 'current' definition of the
key, rather than explicitly checking systemdict, which is where the
command line controls are stored.

This meant that user code could (deliberately or accidentally) override
the system definition and cause errors or unexpected behaviour.

Resource/Init/gs_init.ps


2019-04-01 16:12:33 +0100
Ken Sharp <ken.sharp@artifex.com>
34a94a5d72f8a339cad4c2e2140519c33b58de79

tiffsep devices - add TIFFDateTime to get_params

We need to add this parameter to both put_params and get_params, or it
will not work properly.

devices/gdevtsep.c


2019-04-01 13:30:57 +0100
Ken Sharp <ken.sharp@artifex.com>
87e4b35c9fc15434d710f86aa265501cad61c34f

Tiff devices - Honour the TIFFDateTime parameter

The TIFFDateTime switch can be used to disable writing the date and
time into the tags of TIFF files. However, the tiffg3, tiffg4, tiffsep
and tiffsep1 devices weren't honouring the parameter.

I believe this also affected the tiff32 and tiff8 devices, all the
tiffscaled devices and teh tiffcrle device.

Although gdevtfax.c read the parameter, it didn't transfer it to the
devcie structure. The tiffsep and tiffsep1 devices didn't even read it.

I can't help thinking that having our tiff support spread over 19
different devices and 3 source files

devices/gdevtfax.c
devices/gdevtsep.c


2019-04-01 10:58:11 +0100
Ken Sharp <ken.sharp@artifex.com>
b987c511229ba0b70e6a7691366d530fa8db7444

pdfwrite - completely remove the old colour management

Also remove all references (I hope) from the documentation.

While we're changing the docs, remove references to ps2pdf where we are
really referring to pdfwrite, rewrite the information on LZW Encoding,
update the 'Opitimize' distiller param note, add some covering words
about the faxt that pdfwrite doesn't permit the full range of options
in the LCMS2 implementation that rendering devices do, note that the
example PDFX_def.ps needs to be modified (cribbed from PDF/A).

devices/vector/gdevpdfg.c
devices/vector/gdevpdfi.c
devices/vector/gdevpdfp.c
devices/vector/gdevpsdf.h
doc/VectorDevices.htm


2019-04-01 08:20:52 +0100
Ken Sharp <ken.sharp@artifex.com>
f5bd9757cffeb8b173cdde161b39abd381e325c3

Documentation changes

Bug #700930 "Ghostscript - Typo in example command for PDF/X-3 in VectorDevices.htm"

doc/VectorDevices.htm
lib/PDFX_def.ps


2019-03-29 15:43:14 +0000
Robin Watts <Robin.Watts@artifex.com>
086390943b223cd726d7f63ad076b48e57ceae0f

Fix Downscaler ETS brokenness.

We are only supposed to use ETS if requested. We pass in a flag to
say whether to use it - probably best, on balance, not to ignore it.

base/gxdownscale.c


2019-03-28 10:36:53 +0000
Chris Liddell <chris.liddell@artifex.com>
3929dbaed570ba58cccbf600ba58158ab4fafd8a

Revise gs.c to use the gsapi API.

It's probably better if our own code reflects the way we recommend others to
code.

psi/gs.c


2019-03-28 09:21:37 +0000
Chris Liddell <chris.liddell@artifex.com>
a87c116174ef574465ab12493ef6d0c575bda60d

Fix sefault with 'so' build.

The loaders were passing an unitialise pointer into gsapi_new_instance()
meaning we might try to dereference the pointer to get to the shared portion
of the library context.

Initialise the pointer to NULL.

Apply the same fix to everywhere that uses gsapi_new_instance.

pcl/pl/plwmainc.c
pcl/pl/realmain.c
psi/apitest.c
psi/dmmain.c
psi/dpmain.c
psi/dwmain.c
psi/dwmainc.c
psi/dxmain.c
psi/dxmainc.c
toolbin/halftone/gen_stochastic/gen_stochastic.c


2019-03-27 14:41:13 +0000
Chris Liddell <chris.liddell@artifex.com>
9723b898561c3cd7b9f207c9976994671940df56

Update thirdparty.htm: Freetype and jbig2dec versions

doc/thirdparty.htm


2019-03-27 08:08:04 +0000
Chris Liddell <chris.liddell@artifex.com>
a21912a4c7c2a0cbc79c1a86df77b63bcae850fb

Add license file for cups/libcups

cups/LICENSE.txt


2019-03-26 16:26:11 +0000
Ken Sharp <ken.sharp@artifex.com>
cdd481e5406b8fd07f0cc9b771adfd6877028d96

Fix valgrind error with PXL patterns and high level devices

Bug #700573 " Uninitialised colors used in path plotting"

When the current colour space is a pattern, and the saved high level
colour space is also a pattern, we were checking every possible
component of ccolor.paint.values in both spaces against each other.

The problem is that in gx_hld_save_color we set almost all the values to
0, but then copy a single uninitialised value into the 0th index.

This leads to a valgrind error. Henry points out that the PostScript
interpreter has a hack specifically to work around this in zcolor.c,
zsetcolor() at around line 313.

This is wasteful, its far better (IMO) to rearrange the logic in
gx_hld_saved_color_equal(), we already bail out early if the colour
spaces are not equal. If the spaces are patterns, then there's no point
in comparing the device components, instead compare the pattern IDs
*before* we compare the device components, if they are the same then
return true, if they are different return false.

This avoids us having to check 2 sets of 64 values, and also avoids us
having to set 64 values every time we create a pattern.

base/gxhldevc.c
psi/zcolor.c


2019-03-26 15:14:49 +0000
Chris Liddell <chris.liddell@artifex.com>
519326a98c1d2172da280305fef0a3a52ddc65bc

Tweak the pcl/LICENSE to make a little more sense

It hadn't been revised really for the "new" directory structure.

It will probably benefit from a more substantial revisit, but for now, this
makes it less confusing.

pcl/LICENSE


2019-03-26 09:23:56 +0000
Chris Liddell <chris.liddell@artifex.com>
db96dc02a83e45d2997315e52e77cb4c283c09ce

Reword the 'greeting' to reflect the open source license.

Resource/Init/gs_init.ps


2019-03-26 09:13:42 +0000
Chris Liddell <chris.liddell@artifex.com>
0371b3cef0e28fa603437faf983c7be8f2160214

Fix 'greeting' and include COPYING in install

The greeting message still referenced the obsolete 'PUBLIC' file. And
doc/COPYING was missing from the list of files for install.

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


2019-03-26 10:51:36 +0000
Chris Liddell <chris.liddell@artifex.com>
686204e73479a5fde722ca00a851cfb7f0d4186a

Bug 700897: fix validation of -M and -N parameters.

psi/imainarg.c


2019-03-25 19:35:07 -0700
Michael Vrhel <michael.vrhel@artifex.com>
81d801a07450227eee573aac5fc9259862b4a568

Fix tiffsep_cmyk_cs_to_cm in tiffsep device

When we were doing just a single or a couple spot colorants using something like
-c "<< /SeparationColorNames [(Pantone 137 CVU)] /SeparationOrder [(Pantone 137 CVU)]>>
setpagedevice" the colorants mappings were not getting properly cleared by
tiffsep_cmyk_cs_to_cm causing fillpage to not clear out the page.

devices/gdevtsep.c


2019-03-25 09:01:51 +0000
Ken Sharp <ken.sharp@artifex.com>
c70dc7911aaf559eeec0ced48f8504e24ba39b8a

Coverity ID 337243 - remove dead code

devices/vector/gdevpdfp.c


2019-03-23 10:29:59 +0000
Ken Sharp <ken.sharp@artifex.com>
4dc1cb5197292f3fa7548353c4208f507ca3b310

Another trailing white space fix

base/gdevp14.c


2019-03-23 10:26:29 +0000
Ken Sharp <ken.sharp@artifex.com>
8946e4418257a99ea029283405bc23b75a02e0a5

PDF Interpreter - fix leading and trailing white spaces in pdf_draw.ps

Commit 09c656e066777bd69bbd1902e6163fe3a8a39406 included some
leading and trailing white spaces.

Resource/Init/pdf_draw.ps


2019-03-20 13:55:54 +0000
Chris Liddell <chris.liddell@artifex.com>
f1fccd62b5d1010ecec2817b1b67f3b74b145d02

tiffscaled: correctly select the downscaler when using ETS

When tiffscaled uses ETS for the halftoning, and it's downscaling, we have to
select the downscaling "core" based on the factor.

base/gxdownscale.c


2019-03-19 17:49:14 +0100
Knut Petersen <knut_petersen@t-online.de>
eec855c9baeaa73c0208ed439fbbf1a0d48a447e

Fix e005c87e09f67f37ce4ae2f80f24cf9182e86d8d

Signed-off-by: Knut Petersen <knut_petersen@t-online.de>

Resource/Init/pdf_font.ps


2019-03-19 10:06:38 -0700
Michael Vrhel <michael.vrhel@artifex.com>
2d67148ab19d5e278ec4dbe9929839a37f9961b7

Bug 700744 Documentation typo.

doc/GS9_Color_Management.pdf
doc/GS9_Color_Management.tex


2019-03-19 08:32:46 -0700
Michael Vrhel <michael.vrhel@artifex.com>
09c656e066777bd69bbd1902e6163fe3a8a39406

Bug 700686 Matte premultiplied images

The undoing of the matte pre-blend must occur in the image color space. As such
the group that the interpreter pushes must be that color space and we must make sure
that we undo the pre-blend before any conversions for the group color space.

Resource/Init/pdf_draw.ps
base/gdevp14.c
base/gxblend.c
base/gxblend.h


2019-03-19 09:25:48 -0700
Ray Johnston <ray.johnston@artifex.com>
db24f253409d5d085c2760c814c3e1d3fa2dac59

Fix lib/pdf2dsc.ps to use documented Ghostscript pdf procedures.

We eliminated GS_PDF_ProcSet and pdfdict, but runpdfbegin, dopdfpages,
and runpdfend are still available.

lib/pdf2dsc.ps


2019-03-19 08:34:05 -0700
Ray Johnston <ray.johnston@artifex.com>
332c74c6ffe84acfc0fa80a99f6590a4be9f561b

Fix bug 700719: SEGV with very large XStep/YStep and transparent patterns.

At high resolutions, the bonkers XStep/YStep for the pattern could confuse
the tile_by_steps_trans logic, and could overflow a 32-bit signed int causing
a sign flip. Protect from this by checking to make sure we only fill within
the fill_trans_buffer->rect.

base/gxp1fill.c


2019-03-19 14:35:43 +0000
Ken Sharp <ken.sharp@artifex.com>
c5b92cc2dc9a20c8b6ba204f1e5a5e292bc53846

Fix FillOrder tag for the TiffG3 and TiffG4 devices

Bug #700255 "Option FillOrder doesn't work anymore"

Commit 0ef309305417776a9f8b8cd143fbf3c5e89456b2 added the FillOrder
switch to the 'tiff' class of devices, but the fax Tiff devices already
processed that switch, and the commit did not remove the processing
from those devices.

This led to us trying to us ending up with the parameter in the params
list twice when we executed get_params (once from the tiff device
processing and once from the tiff fax device processing).

When we then next execute a 'put_param', the list has a duplicate
entry for FillOrder. We stop processing when we find the first entry,
which means the second entry never gets processed, leading to an
unused entry in the list, and that throws an error.

The simplest way to fix this is to remove the duplicate 'get_param()'
processing from the tiff fax devices, leaving it up to the generic
Tiff device.

devices/gdevtfax.c


2019-03-19 13:12:25 +0000
Chris Liddell <chris.liddell@artifex.com>
5eebbe1be2b097e541b14fecbd5a154c2cba1519

Bump version number for release

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



Version 9.27 (2019-04-03)

IMPORTANT: It is our intention, within the next 12 months (ideally sooner, in time for the next release) to make SAFER the default mode of operation. For many users this will have no effect, since they use SAFER explicitly, but some niche uses which rely on SAFER being disabled may need to start explicitly adding the "-dNOSAFER" option.

Highlights in this release include:

  • We have extensively cleaned up the Postscript name space: removing access to internal and/or undocumented Postscript operators, procedures and data. This has benefits for security and maintainability.

  • We have added a new "product": "gpdl". This is a rethink/redesign of the old "language_switch" product (pspcl6), and includes all the interpreters we develop based on the Ghostscript graphics library: Postscript, PDF, PCL6, PXL and XPS. This is experimental, and should be considered of beta testing quality, and thus is not built by default: it can be built by using the "experimental" target.

    gpdl uses a heuristic to judge the file type being passed to it. In general, it supports most of the widely used command line options for each interpreter, but compatibility is not complete (the practicalities of swapping interpreters means it is unlikely that full parity of command line options will be possible).

  • Fontmap can now reference invidual fonts in a TrueType Collection for font subsitution. Previously, a Fontmap entry could only reference a TrueType collection and use the default (first) font. Now, the Fontmap syntax allows for specifying a specific index in a TTC. See the comments at the top of (the default) Fontmap.GS for details.

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

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

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

Incompatible changes

  • 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.

    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

2019-04-03 09:27:46 +0100

2019-04-03 09:27:46 +0100
Chris Liddell <chris.liddell@artifex.com>
ef23f2457ff6c215d99189a0f78bf28f42d5f98c

Update product string, dates etc for 9.27 release

News/History9.htm revisions also.

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-03-19 14:53:24 +0000
Chris Liddell <chris.liddell@artifex.com>
5c3344f40f95c4c8fd806265e4e6191d98e06be5

News and changelog for 9.27 release candidate

doc/History9.htm
doc/News.htm


2019-03-19 13:49:49 +0000
Chris Liddell <chris.liddell@artifex.com>
0e3084881a3f2b40ed17a9f71713304bcbf5c976

Product string, dates etc for 9.27 release candidate

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-04-03 03:28:01 -0700
Robin Watts <Robin.Watts@artifex.com>
d832f46edd65968e795f5f419107eb33a7a3e09f

Fix problems with "typedef struct foo_s foo;" redefinitions.

In the header revamp, I'd left various places where we
use the above formulation in more than one location. This
is fine with all the C compilers I tested it on, but seems
to update gcc 4.1.2.

This effect can be seen on later gcc's by using
"-std=gnu89 -pedantic".

This commit tweaks the code to avoid redefinitions of this
kind.

base/gsfont.h
base/gsgdata.h
base/gspath.h
base/gspenum.h
base/gxchar.h
base/gxdevcli.h
base/gxfont.h
base/gxiodev.h
base/gxpath.h
base/gxtext.h
base/lib.mak
psi/imemory.h


2019-03-29 15:43:14 +0000
Robin Watts <Robin.Watts@artifex.com>
0750e5fa1e3c988f07d3fb5adedfb0896e7b400c

Fix Downscaler ETS brokenness.

We are only supposed to use ETS if requested. We pass in a flag to
say whether to use it - probably best, on balance, not to ignore it.

base/gxdownscale.c


2019-03-28 09:21:37 +0000
Chris Liddell <chris.liddell@artifex.com>
1f602898555e969542760ac86b4e250c411e9f8c

Fix sefault with 'so' build.

The loaders were passing an unitialise pointer into gsapi_new_instance()
meaning we might try to dereference the pointer to get to the shared portion
of the library context.

Initialise the pointer to NULL.

Apply the same fix to everywhere that uses gsapi_new_instance.

pcl/pl/plwmainc.c
pcl/pl/realmain.c
psi/apitest.c
psi/dmmain.c
psi/dpmain.c
psi/dwmain.c
psi/dwmainc.c
psi/dxmain.c
psi/dxmainc.c
toolbin/halftone/gen_stochastic/gen_stochastic.c


2019-03-27 14:41:13 +0000
Chris Liddell <chris.liddell@artifex.com>
4be4e4195c88d195502e3e093f0177534af0439c

Update thirdparty.htm: Freetype and jbig2dec versions

doc/thirdparty.htm


2019-03-27 08:08:04 +0000
Chris Liddell <chris.liddell@artifex.com>
6d6a868110e7b1258f6586593f4e6405a1b0dcc3

Add license file for cups/libcups

cups/LICENSE.txt


2019-03-26 15:14:49 +0000
Chris Liddell <chris.liddell@artifex.com>
10eddb8d2b327bfb78c23863577a80b40860f920

Tweak the pcl/LICENSE to make a little more sense

It hadn't been revised really for the "new" directory structure.

It will probably benefit from a more substantial revisit, but for now, this
makes it less confusing.

pcl/LICENSE


2019-03-26 09:23:56 +0000
Chris Liddell <chris.liddell@artifex.com>
bb161b7be76b71a99cb1761bcea7b9c13cf987fb

Reword the 'greeting' to reflect the open source license.

Resource/Init/gs_init.ps


2019-03-26 09:13:42 +0000
Chris Liddell <chris.liddell@artifex.com>
076c127d2a1d697d9d02cf6bce70f5a692e11846

Fix 'greeting' and include COPYING in install

The greeting message still referenced the obsolete 'PUBLIC' file. And
doc/COPYING was missing from the list of files for install.

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


2019-03-26 10:51:36 +0000
Chris Liddell <chris.liddell@artifex.com>
6cc71a794e784887fc7d41ebd87473e7a065e87d

Bug 700897: fix validation of -M and -N parameters.

psi/imainarg.c


2019-03-25 19:35:07 -0700
Michael Vrhel <michael.vrhel@artifex.com>
f53e124de64baf9306ee55e5fda46d77091ad176

Fix tiffsep_cmyk_cs_to_cm in tiffsep device

When we were doing just a single or a couple spot colorants using something like
-c "<< /SeparationColorNames [(Pantone 137 CVU)] /SeparationOrder [(Pantone 137 CVU)]>>
setpagedevice" the colorants mappings were not getting properly cleared by
tiffsep_cmyk_cs_to_cm causing fillpage to not clear out the page.

devices/gdevtsep.c


2019-03-25 09:01:51 +0000
Ken Sharp <ken.sharp@artifex.com>
76ada9e73edaf0cf661f5af85d58580caae9f882

Coverity ID 337243 - remove dead code

devices/vector/gdevpdfp.c


2019-03-23 10:29:59 +0000
Ken Sharp <ken.sharp@artifex.com>
06ed92ab4efddaea02069b2411aef401f8c7e5ce

Another trailing white space fix

base/gdevp14.c


2019-03-23 10:26:29 +0000
Ken Sharp <ken.sharp@artifex.com>
c7de4cdfeda7916359303ad0731752918835a876

PDF Interpreter - fix leading and trailing white spaces in pdf_draw.ps

Commit 09c656e066777bd69bbd1902e6163fe3a8a39406 included some
leading and trailing white spaces.

Resource/Init/pdf_draw.ps


2019-03-21 16:42:06 +0000
Chris Liddell <chris.liddell@artifex.com>
7e0a16411957a2809d61be966af6c08c9a735d84

Revert "Update psd devices to only do one pass while rendering."

This reverts commit d2d32bcee1cb1b28494ba9b572afa53ef84391af.

Experiment for release testing.

devices/gdevpsd.c


2019-03-20 13:55:54 +0000
Chris Liddell <chris.liddell@artifex.com>
3c981b6987fb6a30c1911aaa3aeb6535ce92882c

tiffscaled: correctly select the downscaler when using ETS

When tiffscaled uses ETS for the halftoning, and it's downscaling, we have to
select the downscaling "core" based on the factor.

base/gxdownscale.c


2019-03-19 17:49:14 +0100
Knut Petersen <knut_petersen@t-online.de>
2e866aca0186d8847512686b80b2eca12988ba3f

Fix e005c87e09f67f37ce4ae2f80f24cf9182e86d8d

Signed-off-by: Knut Petersen <knut_petersen@t-online.de>

Resource/Init/pdf_font.ps


2019-03-19 10:06:38 -0700
Michael Vrhel <michael.vrhel@artifex.com>
d66449d30e13b4a5d71559d373ab00985b0bd3c1

Bug 700744 Documentation typo.

doc/GS9_Color_Management.pdf
doc/GS9_Color_Management.tex


2019-03-19 08:32:46 -0700
Michael Vrhel <michael.vrhel@artifex.com>
20de9c4570bc556505069ff91c121cfb3d2f5984

Bug 700686 Matte premultiplied images

The undoing of the matte pre-blend must occur in the image color space. As such
the group that the interpreter pushes must be that color space and we must make sure
that we undo the pre-blend before any conversions for the group color space.

Resource/Init/pdf_draw.ps
base/gdevp14.c
base/gxblend.c
base/gxblend.h


2019-03-19 09:25:48 -0700
Ray Johnston <ray.johnston@artifex.com>
ebbb3ec7d20b5f4c444eb11fc9835e07229ccbd9

Fix lib/pdf2dsc.ps to use documented Ghostscript pdf procedures.

We eliminated GS_PDF_ProcSet and pdfdict, but runpdfbegin, dopdfpages,
and runpdfend are still available.

lib/pdf2dsc.ps


2019-03-19 08:34:05 -0700
Ray Johnston <ray.johnston@artifex.com>
52b4d7918e5792e1fb040f1ba72bd71b9f9ec0a9

Fix bug 700719: SEGV with very large XStep/YStep and transparent patterns.

At high resolutions, the bonkers XStep/YStep for the pattern could confuse
the tile_by_steps_trans logic, and could overflow a 32-bit signed int causing
a sign flip. Protect from this by checking to make sure we only fill within
the fill_trans_buffer->rect.

base/gxp1fill.c


2019-03-19 14:35:43 +0000
Ken Sharp <ken.sharp@artifex.com>
e0e9e32357debd5610bca37a804f1bde62f77844

Fix FillOrder tag for the TiffG3 and TiffG4 devices

Bug #700255 "Option FillOrder doesn't work anymore"

Commit 0ef309305417776a9f8b8cd143fbf3c5e89456b2 added the FillOrder
switch to the 'tiff' class of devices, but the fax Tiff devices already
processed that switch, and the commit did not remove the processing
from those devices.

This led to us trying to us ending up with the parameter in the params
list twice when we executed get_params (once from the tiff device
processing and once from the tiff fax device processing).

When we then next execute a 'put_param', the list has a duplicate
entry for FillOrder. We stop processing when we find the first entry,
which means the second entry never gets processed, leading to an
unused entry in the list, and that throws an error.

The simplest way to fix this is to remove the duplicate 'get_param()'
processing from the tiff fax devices, leaving it up to the generic
Tiff device.

devices/gdevtfax.c



Chris Liddell <chris.liddell@artifex.com>
2e843b2dd9a6ae935c9e00ba127302123cb9121e

Bug 700815(2): Fix the end-of-data condition.

The end-of-data condition in the charstring interpreter that checks for SEACs
was allowing an extra byte to read off the end of the string.

In addition, we also want to handle the out-of-data condition for a (g)subr
gracefully.

base/gxtype1.c


2019-03-19 08:53:10 +0000
Chris Liddell <chris.liddell@artifex.com>
b66ebe07ae5c1fb4ef94f9051e537d69eb789896

Bug 700815(1): Init gsubrNumberBias in Type 1 fonts and eexec decoder

The gsubrNumberBias is only used for Type 2 fonts, but the structure and
charstring interpreter are shared between Type 1 and 2 fonts, so we still need
to set gsubrNumberBias for Type 1 fonts (always 0 for Type 1).

Secondly, full initialise the eexec decoder state, along with some stack
variables during eexec decode setup.

This fixes most of the valgrind errors in Bug 700815, but not all.

psi/zfont1.c
psi/zmisc1.c


2019-03-18 10:45:12 +0000
Chris Liddell <chris.liddell@artifex.com>
e005c87e09f67f37ce4ae2f80f24cf9182e86d8d

Bug 700678: Check for embedded font when substituting

When we apply a font name mapping, make sure that the ultimate font we load
comes from disk, and is not embedded in the job.

To aid differentiating between a substitute CIDfont (cidfmap), a "real" CIDFont
resource, and an embedded CIDFont, add a /ResourcePath key to CIDFont resource
dictionaries (susbsitute CIDFonts contain /Path key).

Resource/Init/gs_cidfn.ps
Resource/Init/pdf_font.ps


2015-11-29 08:10:37 -0600
Chris Liddell <chris.liddell@artifex.com>
5edf847476e7a3e342422013283f984e38b52cd9

Bug 695903: Augment fontmap syntax to allow TTCs to work 'properly'.

Support dictionary entries in Fontmap, so a fontmap file can contain a map to
specific fonts in a TTC.

The romfs inlines the fontmap definitions, and ends up parsing them before
we've bootstrapped the Level 2 world properly so the '<<...>>' dictionary
syntax not only is not defined but also cannot even be parsed.

So, temporarily enable Level 2 parsing, and include local definitions of the
names '<<' and '>>' to work as you'd expect.

Resource/Init/Fontmap.GS
Resource/Init/gs_fonts.ps
Resource/Init/gs_res.ps
Resource/Init/gs_ttf.ps


2019-03-19 09:18:09 +0000
Ken Sharp <ken.sharp@artifex.com>
6a49a201c82106e97148553a8394b74e6c656858

PDF interpreter - fix commit 33414cb5930ee715a23b75eb37e919b6f15f96c0

There was a logical error in the prior commit which caused all PDF files
with a /Info dictionary to signal an error.

This rearranges the code to have the correct logic flow, properly
producing an error only for the broken specimen file.

Resource/Init/pdf_main.ps


2019-03-18 19:30:43 +0000
Ken Sharp <ken.sharp@artifex.com>
33414cb5930ee715a23b75eb37e919b6f15f96c0

PDF interpreter - check the type of the Info dictionary before use


Bug #700820 " GPL Ghostscript 9.26: Unrecoverable error, exit code 1"

The problem here is that the trailer dictionary has an entry for the
/Info dictionary, but the object it poitns to is not a dictionary.

For most purposes this doesn't matter, but when the devce is pdfwrite
we try to maintain the information in that dictionary.

This commit tests the type of the object referenced by the key in the
trailer dictionary and if the object isn't a dictionary we don't try to
use it. We do flag an error though.

Resource/Init/pdf_main.ps


2019-03-18 11:54:40 +0000
Ken Sharp <ken.sharp@artifex.com>
b4e343d201e337478973824995c0bbc25955b36e

Silence a compiler warning

This is actually a false positive, the code is:

if ((code = glyph_show_setup(i_ctx_p, &glyph)) != 0)
return code;
if ((code = gs_glyphshow_begin(igs, glyph, imemory_local, &penum)) < 0)
return code;

and the warning is against gs_glyphshow_begin. However glyph is actually
initalised in the line above by glyph_show_setup. There are paths to
exit that routine without setting glyph, but they all return non-zero
exit codes.

I suspect the return macros in glyph_show_setup and co are confusing
the compiler.

To silence the compiler warning, simply initialise the variable.

psi/zcharx.c


2019-03-18 11:13:51 +0000
Ken Sharp <ken.sharp@artifex.com>
9b11ad14c36103f3446680efa71d25a216177ccd

Initialise another variabel to silence valgrind

Following on from 086d30c38cb351e95941a950ddadd300e23cd8a4

The last.count member gets tested in pdfmark_adjust_parent_count, even
when last.id is 0, so we need to initialise that too.

devices/vector/gdevpdfm.c


2019-03-18 10:14:48 +0000
Ken Sharp <ken.sharp@artifex.com>
086d30c38cb351e95941a950ddadd300e23cd8a4

pdfwrite - don't write an incomplete Outline entry

Bug #700816 "Valgrind shows problems with pdfmarks"

The file in question has a recursive Outline entry, which eventually
leads to an execstackoverflow. This causes the pdfwrite device to be
closed, which leads to it closing and writing the Outkine tree as part
of the cleanup. Because of the way the /OUT pdfmark works, this means
there is a dangling reference (because the last /OUT pdfmark had a
child, but we haven't yet received the child data).


There was in fact already code to deal with this, and not write out
the final outline entry. However it relied upon an uninitialised value
being 0, which of course it usually isn't.

Fixed by initialising the value to 0, which should avoid the valgrind
warning, and prevents us writing an invalid Outline tree entry as well.

devices/vector/gdevpdfm.c


2019-03-18 09:47:35 +0000
Ken Sharp <ken.sharp@artifex.com>
1f30baee070ea9da1de1cb479e3a5c49c0514267

Check error codes for configuration errors with the pdfwrite family

Bug #800819 "Incorrect parameter value for sColorConversionStrategy is silently ignored."

The low level parameter checking for the pdfwrite family wasn't
honouring error returns from certain kinds of parameters, most notably
those involving lists of permitted values (eg ColorConversionStrategy)

This commit throws an error for those cases.

This causes one file in the regression test suite 'pt.ps' to throw an
error with the ps2write device. This is because the PostScript program
contains an invocation of setdistillerparams which sets the
ColorImageFilter (and GrayImageFilter) to Flate instead of DCT. Level 2
PostScript doesn't include the Flate filter, that is a level 3 addition
so we now throw an error on that file.

devices/vector/gdevpdfp.c
devices/vector/gdevpsdp.c


2019-03-14 15:21:40 -0700
Nancy Durgin <nancy.durgin@artifex.com>
03019418e745d215beeea1c5b141524eec8346eb

Alternate way to process that whitelist at end of scanner.

This version doesn't assume there is a --oper-- form on the list, so
it works with "functions" (procedures) that as well as with operators.

toolbin/scan_ps_dicts.ps


2019-03-14 14:17:41 -0700
Nancy Durgin <nancy.durgin@artifex.com>
4163949fa861188f647b7106e181a8121522012f

Make sure all references to .sort are executeonly so it can be undef'd

.findfontvalue and .loadttfonttables still had some references

Note: .sort is currently only undef'd in SAFER mode

Resource/Init/gs_ttf.ps


2019-03-14 14:13:15 -0700
Nancy Durgin <nancy.durgin@artifex.com>
d2f3830b364788a88ea6233f8255cc507f483048

Add a bunch of extensions to whitelist

Also, the logic for "functions", which don't have the --oper-- form
on the whitelist, is currently broken, so just put everything
on the operator list until that's sorted (if ever).

toolbin/scan_ps_dicts.ps


2019-03-14 09:40:18 -0700
Nancy Durgin <nancy.durgin@artifex.com>
40c5fae8604fb6f7916beed8b5c5081e29da8cef

Remove some code that was checking for .setglobal to be defined

.setglobal, .currentglobal and .gsheck are all defined in psi/zvmem2.c
This code seems to be leftover from a time when that might not have been
the case, but it's unnecessary and confusing now. The comment in the
C code indicates they are always defined even for language level 1.

Resource/Init/gs_init.ps


2019-03-14 08:57:11 -0700
Nancy Durgin <nancy.durgin@artifex.com>
5503e225ade2de26fd9e41e63cd3d26b14c3878b

Whitelist some more operators that are in the PLRM

Not sure why the Ray's automated extraction didn't pick these up?

toolbin/scan_ps_dicts.ps


2019-03-13 14:53:41 -0700
Nancy Durgin <nancy.durgin@artifex.com>
fbcda19eb6c8cdba96a6315dfb6f8d241c667259

Remove UserObjects from whitelist

This is in the PLRM, but it's not an operator and it's not going to
show up in the scan unless 'defineuserobject' has previously been run.

toolbin/scan_ps_dicts.ps


2019-03-13 08:51:06 -0700
Nancy Durgin <nancy.durgin@artifex.com>
ad63987d8d4395423513e55008f6ecdcd31f9f26

Move .makeoperator docs from Language.htm to Internal.htm.
It is now an internal operator

Remove it from whitelist in scan_ps_dicts.ps

This has already been undef'd (after initialization), just fixing the
documentation.

This commit also adds a new "Internal.htm" documentation file, and
hopefully fixes up the links to it in Readme.htm

doc/Internal.htm
doc/Language.htm
doc/Readme.htm
toolbin/scan_ps_dicts.ps


2019-03-13 15:18:57 +0000
Ken Sharp <ken.sharp@artifex.com>
c633d492cef7de24dafcecceb6efca982b1ad8be

Coverity IDs 279970 and 279971

Add some casts to prevent implicit casting promoting unsigned values to
signed values.

Moost places had already been handled, but three had been missed.

devices/gdevdsp.c


2019-03-13 14:25:47 +0000
Ken Sharp <ken.sharp@artifex.com>
58e490fec4909b18151e25bd55c9e9f91512a007

Fix (non-PostScript) processing of -d switch with radix

The -d switch can take a radix as part of the value assigned to a
named switch. For example -dDisplayFormat=16#20808 is described in the
display device documentation as selecting CMYK rendering.

The implementation in plmain.c was completely broken and returned the
error "Malformed base value for radix" for any switch using '#'.

The first problem is that we increment the pointer 'v' after checking
'c' to see if its a number. That means when its not a number (ie #) we
have moved v on past the # character. So the test for *v being '#'
fails.

Later we use 'val' which has been initialised to the '#' symbol in the
string. We check to see its a number or A->F or a->f and if its not
then we throw an error. Of course its initially pointing at '#' so
it fails immediately.

pcl/pl/plmain.c


2019-03-08 11:51:31 -0800
Ray Johnston <ray.johnston@artifex.com>
9da9391c8f0a1414be45201c79e5cc649a125341

Add "print" operator to whitelist in scan_ps_dicts.ps

toolbin/scan_ps_dicts.ps


2019-03-08 11:40:28 -0800
Ray Johnston <ray.johnston@artifex.com>
805ca20a78cd837b5d6a30ad7d0df0828aa5de38

Add final section that reports any whitelisted operators that are not seen.

By setting the whitelist entry to //false initially, and the //true when
the operator is encountered in the scan, we can report elements that are in
the whitelist that probably don't need to be there (they've already been
undef'ed).

Also for operators, since they may be encountered in a dict in "bare" form,
or may be seen in packedarray procedures with "--" in front and back, we
check for either having been encountered by pulling out the "bare" form
and checking if that whitelist entry has been seen.

toolbin/scan_ps_dicts.ps


2019-03-11 08:16:47 -0600
Henry Stiles <henry.stiles@artifex.com>
8bc9b0e335b0b69d5b174835a92270903c1dd830

Fix Bug #700575 valgrind problem with decode_char.

Previously PCL stored the character code when encoding and returned it
upon decode. This was only implemented properly for TrueType fonts,
ie. Intellifont or bitmap fonts did not set the character which
resulted in an unitialized read. Ostensibly (for PCL/XL) high level
devices pass the character back upon decode, so it is only necessary
to return the passed in value and we can dispense with storing the
last character.

pcl/pl/plchar.c
pcl/pl/plfont.c
pcl/pl/plfont.h


2019-03-11 08:32:15 +0000
Ken Sharp <ken.sharp@artifex.com>
b881341b3d9993d88a1b395b552f28e62d0abc20

Fix a typo in an error message

Reported by Michael Witten via email. There was a typo in the error
message when the number of entries in an xref table didn't match the
value associated with the /Size key in the trailer dictionary.

Resource/Init/pdf_main.ps


2019-03-08 11:55:27 +0000
Ken Sharp <ken.sharp@artifex.com>
6deec5bffda4b7b3e2f7daa4801150e469b4be95

reformat a conditional to avoid a compiler warning

gcc was giving a false warning on 'glyph' being used uninitialised,
which is not (I believe) the case. I could fix it by initialising the
variable, but instead lets remove the annoying multiple calls in an if
clause.

I'm not certain this will silence the warning.

psi/zcharx.c


2019-03-07 16:51:04 +0000
Chris Liddell <chris.liddell@artifex.com>
3c8bc1663619afa6dcf74c287801408508c504b1

Bug 700701: stack cleanup for all 'show' operator family.

The exec stack cleanup done in 'show' needs applied to all the other similar
operators.

psi/zchar.c


2019-03-07 13:39:58 -0800
Nancy Durgin <nancy.durgin@artifex.com>
32258b5f0fe0db14142a6487c46121afa65c2538

Add 'min' and 'max' back in

These are harmless and redundant, but they have been around a long
time and are documented in Language.htm, so it seems better to keep
them than to break stuff.

Internal code all uses .min and .max instead, so yes there are two
versions of the same thing...

Resource/Init/gs_init.ps


2019-03-07 13:28:29 -0800
Nancy Durgin <nancy.durgin@artifex.com>
9f811276ed9eb29a1dc8284159a2995e9be4dabf

Fix the test for which whitelisted operators were found, to check boolean

toolbin/scan_ps_dicts.ps


2019-03-07 11:07:30 -0800
Ray Johnston <ray.johnston@artifex.com>
3d3e0f2788fd3403bf5ac8d31b732f1404cca4aa

Add a check to scan_ps_dicts.ps to report whitelist entries that aren't found.

toolbin/scan_ps_dicts.ps


2019-03-07 12:38:33 -0800
Nancy Durgin <nancy.durgin@artifex.com>
9a835217e1f61272f8830eac643f689ba041902e

Change to use a list of operator/function names and add to dict later

- can break out the lists by category (standard vs extensions)
- adds the "--" around operators dynamically
- can put non-operators (functions) in a separate list if desired
- changed the value in the dict to //false

toolbin/scan_ps_dicts.ps


2019-03-07 10:29:17 -0800
Nancy Durgin <nancy.durgin@artifex.com>
9302928bf518f3ce3e739f1ea428e5f82729d7d9

Undef .pdfcharkeys in gs_ttf.ps

Change references to immediate evaluation and undef at end of file

Resource/Init/gs_ttf.ps


2019-03-07 10:29:01 -0800
Nancy Durgin <nancy.durgin@artifex.com>
36e629576399a596b930878dad0438f9c9a19dd6

Add some ghostscript extensions to whitelist

toolbin/scan_ps_dicts.ps


2019-03-07 08:30:38 -0800
Nancy Durgin <nancy.durgin@artifex.com>
ccf0be61013372c4c449f0b760fa00ac0b20245f

Change shellarguments to .shellarguments and document it.

Resource/Init/gs_init.ps
doc/Language.htm
lib/gslp.ps
lib/pf2afm.ps
lib/pfbtopfa.ps
lib/pphs.ps
lib/printafm.ps
lib/rollconv.ps
lib/viewcmyk.ps
lib/viewpbm.ps
lib/viewpcx.ps
lib/viewraw.ps
lib/viewrgb.ps
toolbin/pdf_info.ps


2019-03-06 13:57:56 -0800
Nancy Durgin <nancy.durgin@artifex.com>
b5a3721b36da0a1a28cb6d132d2c6ae11e1592c0

Undef .confirm, .confirmread

There was a reference in doc/SavedPages.htm to .confirmread which has
been changed in 314c6b9026efbcada4e48b11c9a173a5e91d779c
to use standard postscript.

1) Rearranged code so things are defined before use.
2) Change all references to immediate evaluation.
3) undef

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


2019-03-06 16:11:43 -0700
Henry Stiles <henry.stiles@artifex.com>
f6ddc968966327f3bc24d1edc6a25c0f7ef82cd4

Remove the ownership document.

This hasn't been kept up to date, most of the information can be found
in Bugzilla by looking at default assignee per component.

doc/who_owns_what.txt


2019-03-06 16:08:56 -0700
Henry Stiles <henry.stiles@artifex.com>
2b100b794af3da27c127212af96bf4668fbda89b

Bug #700671 - error code not propagated back.

In attempt to clean up after an error PCL was stepping on the original
error code resulting in the interpreter continuing without fonts.

pcl/pcl/pctop.c


2019-03-06 15:30:14 -0700
Henry Stiles <henry.stiles@artifex.com>
b731a0d961516bd42b510e1ae036cca109b0ccdb

Bug #700671 fix file mode.

The file mode was incorrectly specified to include 'b' with the
sfopen(), the stream code adds another 'b' because it is always
binary. This can cause a crash on Windows 10 (see bug #696101).
Further gp_file_rb should only be used with gp_fopen().

pcl/pl/plfont.c


2019-03-06 13:41:07 -0800
Ray Johnston <ray.johnston@artifex.com>
314c6b9026efbcada4e48b11c9a173a5e91d779c

Rework a saved-pages example to use standard PostScript (not .confirmread)

doc/SavedPages.htm


2019-03-06 13:38:08 -0800
Nancy Durgin <nancy.durgin@artifex.com>
b9947ecde3bb1cd265ab24e5fd5086ae9f09bdc4

Tweak whitelist of scan_ps_dicts.ps, add some color ops

- remove statusdict
- add some standard operators that aren't in the PLRM (related to color)

toolbin/scan_ps_dicts.ps


2019-03-06 10:28:52 -0800
Nancy Durgin <nancy.durgin@artifex.com>
882aec138f3b734182f7494c69cf8c67d72aba77

Undef deprecated min,max,unread and clean up undef of .unread

min, max and unread have been deprecated since like 2001. Deleted
their definitions. This broke vasaley.ps test file, but I edited it
to define its own "min".

Changed existing uses of 'unread' to '.unread', 'min' to '.min', 'max'
to '.max'.

Made sure all uses of .unread are executeonly.

Resource/Init/gs_fonts.ps
Resource/Init/gs_img.ps
Resource/Init/gs_init.ps
Resource/Init/gs_type1.ps


2019-03-06 10:22:25 -0800
Ray Johnston <ray.johnston@artifex.com>
ee9e9.503c82eed181d5a11c7bea3735090fd680

Add whitelist to scan_ps_dicts.ps

Note that unfortunately, we have to have operators both in the 'bare'
form and the display form e.g. (exit) (--exit--).

toolbin/scan_ps_dicts.ps


2019-03-05 13:18:10 -0800
Nancy Durgin <nancy.durgin@artifex.com>
f5e8f8118bdca7ecae547a1d33d10ae1ec97d646

Don't define SAFERUndefinePostScriptOperators unless in SAFER

Previously if SAFER not true, then this would be defined and never undefined.

Resource/Init/gs_init.ps


2019-03-05 15:47:16 -0800
Ray Johnston <ray.johnston@artifex.com>
77152d4b71cf542f3c4cb610ad97c3a4d4efa65b

Initial version of utility to scan dictionaries for operators

toolbin/scan_ps_dicts.ps


2019-02-28 14:57:55 -0800
Nancy Durgin <nancy.durgin@artifex.com>
a45e3a9bf7b878c6f4e4a840ade4e64b5c56cd80

Cleaned up dead code related to .savelocalstate

.savelocalstate was part of display postscript (gs_dps.ps), so it is
no longer defined. Cleaned up conditional code that is now dead code.

Resource/Init/gs_init.ps


2019-02-28 14:22:32 -0800
Nancy Durgin <nancy.durgin@artifex.com>
097bb257147f45e5d1c15278cb95b7d19a147ac8

Undef .makeinternaldict in gs_init.ps

This used to be used more in gs_dps.ps, when multiple contexts were supported.
Downgraded it from an operator to a function. It's now only used in one
place, so undef right after use.

Resource/Init/gs_init.ps


2019-02-28 12:50:34 -0800
Nancy Durgin <nancy.durgin@artifex.com>
def941fa84d55e9ffdd76dec5009440904cf792b

Undef .getpath in gs_init.ps

This was another case where the operator is defined in C and was put
into the level2dict for no apparent reason. The code that uses it (in
pdf_ops.ps and pdf_draw.ps) didn't have level2dict available on the
dictstack when it defined the operators, so it wasn't getting bound.

Solution is to take .getpath out of level2dict. Added zupath_op_defs
for it and fixed makefile. Then can easily undef it.

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


2019-02-28 10:41:44 -0800
Nancy Durgin <nancy.durgin@artifex.com>
f26771b927e154c63101a08c9ca6ecef564e80a3

Undef .useloresscreen in gs_init.ps

Change to immediate evaluation and undef after use.

Resource/Init/gs_init.ps


2019-02-28 09:10:29 -0800
Nancy Durgin <nancy.durgin@artifex.com>
15e29a6e26dca230b9f35ec9bfa92de37a6f7c8c

Undef .setdefaultbgucr in gs_init.ps

This is just used locally. Change to immediate evaluation and undef after use.

Resource/Init/gs_init.ps


2019-02-27 15:21:57 -0800
Nancy Durgin <nancy.durgin@artifex.com>
b8a02cc76747e78e86ad5a127d1aec832b1b7566

Undef .beginpage, .endpage in gs_init.ps

Make sure all uses are executeonly.
After all the other cleanups, these are now easily undefined.

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


2019-02-27 14:25:08 -0800
Nancy Durgin <nancy.durgin@artifex.com>
c7b85fa9d84d5c9304c783461d5c8b91d580bfbb

Undef .mergespecial,.requiredattrs dictionaries in gs_setpd.ps

These are only used locally, but contain some functions (such as
InputAttributes) which were exposed.

Change to immediate evaluation and undef at end of file.

Resource/Init/gs_setpd.ps


2019-02-27 13:58:55 -0800
Nancy Durgin <nancy.durgin@artifex.com>
c2ad80deefb2b5af6b432cf4aa9942303fff17b3

Undef .clearerror in gs_init.ps

Move definition above use, make all uses immediate evaluation and undef.

Resource/Init/gs_init.ps
Resource/Init/gs_res.ps


2019-02-27 13:28:49 -0800
Nancy Durgin <nancy.durgin@artifex.com>
359306748b1aee2497d650b82a5222df2d99e702

Undef .type11mapcid, .type9mapcid

Made sure all uses were bind and executeonly, then can undef.

Note that the "CIDWProc" in pdf_font.ps wasn't bound. I didn't see
any reason for that, so I bound it.

Resource/Init/gs_cidfn.ps
Resource/Init/gs_init.ps
Resource/Init/pdf_font.ps


2019-02-27 12:42:11 -0800
Nancy Durgin <nancy.durgin@artifex.com>
af2c7b51e110d831e1c133e2635b2bad8e2e7dc8

Undef EPSBoundingBoxInit in gs_init.ps

This is only referenced during initialization. Undef after use.

Resource/Init/gs_init.ps


2019-02-27 11:40:03 -0800
Nancy Durgin <nancy.durgin@artifex.com>
34c34b9d9cc51bb90bf1e7c761bb917fcd094734

Undef .unstoppederrorhandler in gs_init.ps

Change to immediate evaluation and undef right after use.

Resource/Init/gs_init.ps


2019-03-04 07:14:31 +0000
Ken Sharp <ken.sharp@artifex.com>
7cb19e8362925329feed688db308aa3e5b935d0a

Coverity ID 33608

We weren't acting on a return value. If we get an error, which I believe
should actually be impossible in this case, we might potentially have
an invalid object being pointed to by an array.

Just in case, if we get an error here, discard the array we just
allocated and propagate the error.

psi/istack.c


2019-03-04 07:05:21 +0000
Ken Sharp <ken.sharp@artifex.com>
c38992507901fb8a3991ae61f5301f28719230b7

Coverity ID 333611

The error handling code in the run length encode filter confuses
Coverity because it relies on a series of 'got' operations that jump
into a block of otherwise unreachable code.

The code is (IMO) ugly and confusing, so refactor it to avoid the
'if (0)' blocks. This results in many fewer goto labels, and simpler
code.

base/srle.c


2019-03-04 07:02:31 +0000
Ken Sharp <ken.sharp@artifex.com>
ff41c469b656224fb90083e8f622af21952266d9

Coverity ID 333614 sign extension

An intermediate calculation results in a cast to 'int' which is then
promoted (on 64-bit systems) to an unsigned long long. If the top bit
of the intermediate value is set, then all the top bits of the final
value will be set.

Do an explicit cast to an unsigned to avoid this.

devices/gdevxalt.c


2019-03-04 06:09:15 +0000
Ken Sharp <ken.sharp@artifex.com>
00909869edf9f38af985086495e310ed2ea6b916

Coverity IDs 333615, 333613, 333610, 333606

Recent changes ot the code (extra chacking of the return value from
gs_matrix_invert are causing Coverity to regard unchecked return codes
from this routine as a problem.

Add return code checks (or cast to void) to pacify.

contrib/eplaser/gdevescv.c
contrib/lips4/gdevl4v.c
contrib/opvp/gdevopvp.c
devices/vector/gdevpdtt.c


2019-03-04 05:54:56 +0000
Ken Sharp <ken.sharp@artifex.com>
a7ab9861741f1aad06f4932c92b1a27fc13e230e

Coverity ID #333616

Add a comment to the default case so that Coverity can tell that we
fall through to the next case deliberately.

base/srle.c


2019-03-02 15:04:33 -0800
Michael Vrhel <michael.vrhel@artifex.com>
d5bc9bd2a548e6c12dd8224b6d18615d050a5731

Only use plug-in clone if transform is not identity

lcms will if it finds the table is essentially the identity set
the transform to a copy operation. If this is the case, then
just use that operation as it will be as fast as things can get.

lcms2mt/src/cmsxform.c


2019-02-26 17:22:21 +0000
Robin Watts <Robin.Watts@artifex.com>
79ce761f39aac21c270d8fb19142f5f8146440d2

Bug 700606: Fix problem with interpolated indexed >8bit images.

In the initial decode of the line, all but the first pixel of the
line is getting a value 0.

We look to be wrongly applying the nth map function to the nth
pixel, when the nth map function is intended for the nth component
of the pixel. Given we are only processing indexed images at this
point, we therefore always want the 0th map function.

base/gxiscale.c


2019-02-26 19:38:12 -0800
Nancy Durgin <nancy.durgin@artifex.com>
6931f9b2fe9aa8d6ffcdbfece50ffde0ac8d00e8

Undef /.generate_dir_list_templates, /.generate_dir_list_templates_with_length

Made these operators due to length. Made sure all uses are executeonly.
Undef in gs_init.ps

Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps
Resource/Init/gs_res.ps


2019-02-26 15:46:24 -0800
Nancy Durgin <nancy.durgin@artifex.com>
ebea5737da47a55e0838b9472bc05d209717d670

Undef .internalstopped in gs_init.ps

This is used all over the place, tons of edits. Making it an operator
didn't work (something to do with the stack during an error I think --
fails on tests_private/ps/ps3fts/141-01.ps).

So I made all the references be immediate evaluation, then can undef
in gs_init.ps.

Resource/Init/gs_btokn.ps
Resource/Init/gs_cidfm.ps
Resource/Init/gs_cidfn.ps
Resource/Init/gs_cidtt.ps
Resource/Init/gs_cmap.ps
Resource/Init/gs_diskn.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_frsd.ps
Resource/Init/gs_init.ps
Resource/Init/gs_lev2.ps
Resource/Init/gs_res.ps
Resource/Init/gs_setpd.ps
Resource/Init/gs_type1.ps
Resource/Init/pdf_base.ps
Resource/Init/pdf_main.ps
Resource/Init/pdf_ops.ps
Resource/Init/pdf_rbld.ps


2019-02-26 14:34:08 -0800
Nancy Durgin <nancy.durgin@artifex.com>
239d82b8b382afd435f3b48025954715633da9a9

Fixed previous undef of .stopped

The .stopped operator had been previously undef'd, but all the usages
weren't executeonly so it still shows up in the operator scan. Made usages
executeonly so .stopped is more thoroughly gone.

Resource/Init/gs_init.ps


2019-02-26 13:13:21 -0800
Nancy Durgin <nancy.durgin@artifex.com>
a4dbb260b6525e65d9bbe894591a79830afe191e

Undef .numicc_components and .set_outputintent in gs_init.ps

These are defined as C operators and used in pdf_main.ps. For some
reason they were defined in ll3dict, and during their use in
pdf_main.ps, ll3dict wasn't on the dictstack, so they didn't get
bound, meaning they couldn't easily be undef'd.

The solution I picked was to take them out of ll3dict, as I see no
reason for them to be there. That's a change to the C code (zicc.c).
I also renamed the structure to be zicc_op_defs instead of
zicc_ll3_op_defs, to eliminate any confusion. That required a
makefile change (int.mak).

After those changes, undef'ing in gs_init.ps is easy.

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


2019-02-26 09:58:03 -0800
Nancy Durgin <nancy.durgin@artifex.com>
94a78ca611ccc59383e5c4ea4beba4a13f4d4afd

Undef .runresource in gs_init.ps

Change to immediate evaluation (used in gs_res.ps) and undef.

Resource/Init/gs_init.ps
Resource/Init/gs_res.ps


2019-02-26 09:53:37 -0800
Nancy Durgin <nancy.durgin@artifex.com>
81c820ac5154751b248bdc91d0416d1eec354be2

Undef .PurgeDict in gs_init.ps

This was already used with immediate evaluation, so just undef it.

Resource/Init/gs_init.ps


2019-02-21 15:13:50 -0800
Nancy Durgin <nancy.durgin@artifex.com>
2aa1452450845649105c752c246a7a9c9b93b479

Undef .registererror and .registererror2 in gs_init.ps

.registererror2 is only used locally. Move code so it's defined before use.
Change to immediate evaluation and undef right afterwards.

.registererror is only used during initialization (not used in any
procedure definitions), though it's also used in gs_dps2.ps in the same way.
Undef after the uses.

Resource/Init/gs_init.ps


2019-02-21 13:22:20 -0800
Nancy Durgin <nancy.durgin@artifex.com>
23f68c46dd32cc955aec10bfc1c13438bb89a166

Undef .execute in gs_init.ps

Used locally, had to rearrange some code.
Change to immediate evaluation and undef after use.

Resource/Init/gs_init.ps


2019-02-21 10:40:58 -0800
Nancy Durgin <nancy.durgin@artifex.com>
d17c277a2e847990fccab18de357afea87024065

Undef .printerror_long in gs_init.ps

Some whitespace changes and moved code around.
This is only used locally.
Change to immediate evaluation and undef after use.

Resource/Init/gs_init.ps


2019-02-21 09:07:51 -0800
Nancy Durgin <nancy.durgin@artifex.com>
be56100b1ecf53092c9d678e4783b5660eb3e47e

Clean up and rearrange some code related to SAFER

Add some comments about which ones are extensions and to separate the code.
Make the temporary stuff not be operators (no need).

Resource/Init/gs_init.ps


2019-02-21 08:53:51 -0800
Nancy Durgin <nancy.durgin@artifex.com>
bdd92585f4a0aaa734053a5755e556ed61c8545d

Undef .locksafeglobal, .locksafe_userparams in gs_init.ps

Both of these are only used locally in gs_init.ps. Undef right after use.

Resource/Init/gs_init.ps


2019-02-25 14:55:40 +0000
Chris Liddell <chris.liddell@artifex.com>
a3b526cafb940890aff47dd9933777b88321b3ce

Bug 700678: Check for embedded font when substituting

When we apply a font name mapping, make sure that the ultimate font we load
comes from disk, and is not embedded in the job.

Resource/Init/gs_fonts.ps


2019-02-25 19:16:03 +0000
Robin Watts <Robin.Watts@artifex.com>
d2d32bcee1cb1b28494ba9b572afa53ef84391af

Update psd devices to only do one pass while rendering.

Previously, PSD devices would loop over each component in the file
and then over each line in the file. For non-page mode rendering
therefore, we would render each page as many times as there were
components.

Change the logic here to loop over each component, then over each
line.

This means we seek within the file as we write, but we already
impose restrictions on the output for this device to ensure that
we don't write multiple pages to the same file, so this is no
great loss.

devices/gdevpsd.c


2019-02-25 19:51:16 -0800
Michael Vrhel <michael.vrhel@artifex.com>
4c741f6ff9b1ab8a0fb433af9db8d7b0db335318

Have lcms2mt clone method check for transform plug-ins

When cloning a transform, it is necessary to see if there
are any plugins that should be used with the new data types.

lcms2mt/src/cmsxform.c


2019-02-24 22:01:04 -0800
Ray Johnston <ray.johnston@artifex.com>
d683d1e6450d74619e6277efeebfc222d9a5cb91

Bug 700585: Obliterate "superexec". We don't need it, nor do any known apps.

We were under the impression that the Windows driver 'PScript5.dll' used
superexec, but after testing with our extensive suite of PostScript file,
and analysis of the PScript5 "Adobe CoolType ProcSet, it does not appear
that this operator is needed anymore. Get rid of superexec and all of the
references to it, since it is a potential security hole.

Resource/Init/gs_init.ps
psi/icontext.c
psi/icstate.h
psi/zcontrol.c
psi/zdict.c
psi/zgeneric.c


2019-02-22 13:43:15 -0800
Michael Vrhel <michael.vrhel@artifex.com>
1bc4205dca71ca075af6ca95aa53a33f5a724586

Bug 700584 Cups device

The RGBW color space needs to have the white value mapped properly during the encode process.

cups/gdevcups.c


2019-02-21 13:01:24 -0800
Michael Vrhel <michael.vrhel@artifex.com>
f89824ec77691e80b954fd0e783fc41cf6246599

Bug 692405 X11 device

The X11 device copy_color proc was accessing indices outside its 16 value cache
causing improper color drawing for the cmyk2 device. For the cmyk4 device, the
bit manipulations mapping to rgb were incorrect.

devices/gdevxalt.c


2019-02-21 19:12:18 +0000
Robin Watts <Robin.Watts@artifex.com>
dd60ff8ba5030f078eccabe26a617374c1c2961f

Improve bounding box return for clip list accumulator.

This should hopefully reduce the amount of work the scan converter
has to do every time it writes to the clip list accumulator; in
particular the clist should set this up so that we don't needlessly
scan convert lines outside the current band.

base/gxacpath.c


2019-02-21 14:20:40 +0000
Robin Watts <Robin.Watts@artifex.com>
02b6572798cfa75f1b77cfa666748add0ae7db31

Bug 700643: Rejig scan converter - back off in high memory cases.

Group scan converter calling logic together, and call it through
a single gx_scan_convert_and_fill function.

Have the scan converter bale if the required memory is larger than
an arbitrary size (currently 1Meg). We subdivide the path into
bands and retry.

base/gxfill.c
base/gxscanc.c
base/gxscanc.h


2019-02-19 16:37:53 +0000
Robin Watts <Robin.Watts@artifex.com>
ed1d07fb8c324dea9988359bbcc400979155ffa8

Avoid buffer overflow in transparency buffer dump debug.

base/gdevp14.c


2019-02-18 17:48:32 +0000
Robin Watts <Robin.Watts@artifex.com>
f5a93cd8ca658ce80234319e7355335086c71872

Tweak "device_encodes_tags" to avoid const warnings.

base/gxdevcli.h


2019-02-22 12:28:23 +0000
Chris Liddell <chris.liddell@artifex.com>
a82601e8f95a2f2147f3b3b9e44ec2b8f3a6be8b

Bug 700576(redux): an extra transient proc needs executeonly'ed.

Resource/Init/gs_res.ps


2019-02-21 07:35:41 -0800
Nancy Durgin <nancy.durgin@artifex.com>
70e04b6d103193dd1eb1e7748cb6fb231c0482cf

Undef .setsafeglobal

Only used in gs_init.ps, undef right after use.

Resource/Init/gs_init.ps


2019-02-19 15:03:16 -0800
Nancy Durgin <nancy.durgin@artifex.com>
04e71e429c83dead2c5e69bf126b5c8cf1c18167

Undef .vmreclaim in gs_init.ps

This was tricky because it can be used in showpage, which wasn't bound.
Previous commit makes it possible to bind showpage.

It's used for debugging in the memento build, but this is useful so I
needed to maintain that functionality.

Also used in gs_lev2.ps, so make sure that is bound.

Since this operator is defined in C in the level2dict, it needs to
be undef'd from both systemdict and level2dict.

Resource/Init/gs_init.ps
Resource/Init/gs_lev2.ps


2019-02-19 14:56:31 -0800
Nancy Durgin <nancy.durgin@artifex.com>
9a6d754d60409d4ff3832d83801b1d3f96303932

Make it possible to .bind showpage and copypage

A bunch of operators were being redefined later in other code, so that
binding showpage and copypage picked up the wrong versions. I think
historically this was due to the way level2/level3 support was
implemented. Since we no longer support level1 postscript, we can
clean some of this up.

The cleanup involves moving some operators from other files into
gs_init.ps and also removing duplicate (level1) definitions when applicable.

- Move 'initgraphics' operator definition from gs_cspace.ps
- Move .currentnumcopies, .beginpage, .endpage from gs_setpd.ps
- Move 'copypage' definition down near showpage, so code is in right places

There are no changes to the code within the moved functions, other than to
make them .bind executeonly.

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


2019-02-19 08:38:08 -0800
Nancy Durgin <nancy.durgin@artifex.com>
214fdd5625c81afa4e2c206eb3e54f1f0435580f

Undef .getdefaulthalftone in gs_init.ps

Used in gs_init.ps and gs_ll3.ps. Change to immediate evaluation and undef.

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


2019-02-19 09:29:48 -0800
Nancy Durgin <nancy.durgin@artifex.com>
eb5b4c273d42584d560d5d923565fcb4a07ff02d

Undef .bindoperators in gs_init.ps

We undef in different places depending on whether BINDNOW is true or not.

Resource/Init/gs_init.ps


2019-02-18 12:11:45 -0800
Ray Johnston <ray.johnston@artifex.com>
be86d2ff2f0f0ea0e365707f3be0fa0c9e7315ee

Bug 700599: Issue an error message if an ExtGstate is not found.

Previously, this was silently ignored. Only issue a single warning,
and respect PDFSTOPONERROR to prevent continuing with potentially
incorrect output.

Note that tests_private/pdf/uploads/bug696410.pdf also now gets this
error message (ExtGState" instead of ExtGState in object 10).

Resource/Init/pdf_draw.ps


2019-02-20 09:54:28 +0000
Chris Liddell <chris.liddell@artifex.com>
ed9fcd95bb01f0768bf273b2526732e381202319

Bug 700576: Make a transient proc executeonly (in DefineResource).

This prevents access to .forceput

Solution originally suggested by cbuissar@redhat.com.

Resource/Init/gs_res.ps


2019-02-20 09:50:13 +0000
Chris Liddell <chris.liddell@artifex.com>
73d1a911f4c8b19c19d37a963c39b01a181b46e1

Update to iclude TOC overflow solution

Also, remove the RS/6000 reference, and just reference IBM AIX

doc/Make.htm


2019-02-19 19:34:59 -0800
Michael Vrhel <michael.vrhel@artifex.com>
e1d09836703104ca5ac8cb94a47f2ce27bee28cd

Macro removal

Get rid of two macros in the halftone tile creation code.
One was replaced with an inline function. The other was simple
enough and used only in two spots to just use directly.

base/gxcht.c


2019-02-13 12:01:54 -0800
Michael Vrhel <michael.vrhel@artifex.com>
ba2043a548559d184cbfe90ca9884734dba6efdc

Bug 700584: cups device

The cups device has a pile of different color spaces. It is up to the cups device to
ensure that the color is handled properly for these. RGBA should certainly be treated
as a 32 3 component color similar to our pngalpha device. RGBW will be treated the same way.

Note that I looked at the output using Mike Sweet's rasterview program. I suspect there
probably is some work that needs to be done on that viewer to ensure proper viewing of
this type of data. With this patch gs is doing all it can.

cups/gdevcups.c


2019-02-14 15:14:50 -0800
Nancy Durgin <nancy.durgin@artifex.com>
1521304bd0da395fd11a950ab82a40deebc1f8c4

Undef .makepathtemplate in gs_init.ps

Only used locally. Change to immediate evaluation and undef.

Resource/Init/gs_init.ps


2019-02-14 15:10:28 -0800
Nancy Durgin <nancy.durgin@artifex.com>
8512e98984c6d1be2bcefd0493fc5c4dd26f118e

Undef .uservar in gs_init.ps

It was already an operator. Make sure all uses are executeonly and undef.

Resource/Init/gs_init.ps
Resource/Init/gs_statd.ps
Resource/Init/gs_trap.ps


2019-02-14 14:23:46 -0800
Nancy Durgin <nancy.durgin@artifex.com>
53a8955c422713ef6794f39de823a03d2f056790

Undef .userdict in gs_init.ps

It was already an operator. Make sure all uses are executeonly and undef.

Resource/Init/gs_dps2.ps
Resource/Init/gs_init.ps
Resource/Init/gs_lev2.ps
Resource/Init/gs_trap.ps


2019-02-14 13:40:08 -0800
Nancy Durgin <nancy.durgin@artifex.com>
7cd5f3cb820f75bc6ad636f09504918d96c9ba63

Undef .growdict and .growdictlength in gs_init.ps

Changed uses to immediate evaluation, undef with the others.

Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps


2019-02-14 13:12:17 -0800
Nancy Durgin <nancy.durgin@artifex.com>
4ae191913f5c3260d780108217c63d161f49272a

Undef .putdeviceprops in gs_init.ps

This is only used by /putdeviceprops, but I don't understand what's
going on with error handling and the comment about backward compatibility.
Both .putdeviceprops and putdeviceprops were already operators.

Just undef .putdeviceprops with the other operators, after making sure
everything is executeonly.

Resource/Init/gs_init.ps


2019-02-14 11:58:00 -0800
Nancy Durgin <nancy.durgin@artifex.com>
9a4acb441374641ba820648e5ae098ce9e5ae9d6

Undef .promptmsg in gs_init.ps

There used to be some code related to readline in lib/gs_rdlin.ps
that would redfine the .promptmsg, but that code is now gone.
There doesn't seem to be any reason to keep .promptmsg any more.
If somebody wants to redefine /prompt, that is still fine and is
documented in the PLRM.

Change to use immediate evaluation and then undef it.

Resource/Init/gs_init.ps


2019-02-14 11:39:08 -0800
Nancy Durgin <nancy.durgin@artifex.com>
e187134ce58a398d46cb0065929ecbe9b40b6d7c

Undef .packtomark in gs_init.ps

This is used in a bunch of other files. Changed all those to
immediate evaluation.

Resource/Init/gs_btokn.ps
Resource/Init/gs_init.ps
Resource/Init/gs_res.ps
Resource/Init/gs_ttf.ps
Resource/Init/pdf_base.ps
Resource/Init/pdf_sec.ps


2019-02-16 15:27:43 +0000
Ken Sharp <ken.sharp@artifex.com>
3ba38b60a2380a8fbac7d315da5dfeaaf3d4cf21

Fix some compiler warnings

Noticed in a regression run where warnings were not swallowed. When
using 'C' Keys we should use the function which searches dictionaries
using a 'C' string instead of a byte string (which may not be null
terminated).

devices/vector/gdevpdfj.c


2019-02-16 11:14:57 +0000
Ken Sharp <ken.sharp@artifex.com>
6c4ef58b66dadf546cbc7370ebbabe5505acc7ed

PS interpreter - properly restore exec stack after error in zshow

Bug #700618 "Ghostscript - Invalid read in op_show_finish_setup()"

The problem occurs some time before the actual seg fault. The test file
is overly complex (not uncommon for fuzzed files), a simpler file would
be:

/S 80 string def
108 480 moveto
{ 1 S show
} loop

This runs in a loop, showing an empty string. But each iteration of the
loop leaves an object on the exec stack. Eventually we reach the stack
limit. The internals of 'show' require us to be able to push an object
(actually, 2 objects) on to the operand stack, so this results in a
stack overflow.

Although zshow() checks the return code properly, it does not reset the
exec stack pointer in the case of an error (it adds up to 11 objects
to the exec stack itself). For a fatal error this isn't a problem, but
stack overflow is non-fatal; the interpreter can increase the stack size
and retry.

This is where the problem exhibits. When we retry zshow() we have left
entries on the exec stack, in particular a 'mark', because we didn't
rewind the exec stack on error. We then try to use that to locate an
enumerator stored on the exec stack, but because we didn't complete the
setup, what we find is garbage.

The solution is simply to restore the exec stack pointer on error,
before we return. We should also free the enumerator to prevent a
(saved by garbage collection) memory leak. So also initialise the
pointer to NULL, so we can safely free it, even if we didn't get round
to allocating it.

There are 2 error conditions in this code, we need to update both.

psi/zchar.c


2019-02-14 10:20:03 -0800
Ray Johnston <ray.johnston@artifex.com>
205591753126802da850ada6511a0ff8411aa287

Fix bug 700585: Restrict superexec and remove it from internals and gs_cet.ps

Also while changing things, restructure the CETMODE so that it will
work with -dSAFER. The gs_cet.ps is now run when we are still at save
level 0 with systemdict writeable. Allows us to undefine .makeoperator
and .setCPSImode internal operators after CETMODE is handled.

Change previous uses of superexec to using .forceput (with the usual
.bind executeonly to hide it).

Resource/Init/gs_cet.ps
Resource/Init/gs_dps1.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps
Resource/Init/gs_ttf.ps
Resource/Init/gs_type1.ps


2019-02-14 10:16:18 -0800
Nancy Durgin <nancy.durgin@artifex.com>
4250323f0c5e85f43bd82255c846f98869a46354

Remove undef of /odef from the SAFER list.

Oops, this change crept in on an earlier commit. No need to include in
the SAFER list since it's being undef'ed in the main list.

Resource/Init/gs_init.ps


2019-02-14 10:09:00 -0800
Nancy Durgin <nancy.durgin@artifex.com>
e8acf6d1aa1fc92f453175509bfdad6f2b12dc73

Undef /odef in gs_init.ps

Made a new temporary utility function in gs_cet.ps (.odef) to use instead
of /odef. This makes it fine to undef odef with all the other operators in
gs_init.ps

This punts the bigger question of what to do with .makeoperator, but it
doesn't make the situation any worse than it already was.

Resource/Init/gs_cet.ps
Resource/Init/gs_init.ps


2019-02-13 14:03:29 -0800
Nancy Durgin <nancy.durgin@artifex.com>
3e6e57c0a80948f322b9842add4a7ab86915cdc6

Undef /obind from gs_init.ps

This is only used in gs_typ32.ps, just undef with all the other things in
gs_init.ps

Resource/Init/gs_init.ps


2019-02-13 13:54:25 -0800
Nancy Durgin <nancy.durgin@artifex.com>
533f78554f194524abb55183d370e64354caa329

Deleted definition of /execute, which wasn't used anywhere.

As far as I can tell... It's extremely challenging to try to grep for uses of
this word.

Resource/Init/gs_init.ps


2019-02-13 09:36:29 -0800
Nancy Durgin <nancy.durgin@artifex.com>
c5ed6a1f8583068484b4c138fb1e0e1ef1ad2a3f

Undef /runlibfile0 in gs_init.ps

This is just used temporarily.
Change to immediate evaluation and undef right after use.

Resource/Init/gs_init.ps


2019-02-13 08:43:00 -0800
Nancy Durgin <nancy.durgin@artifex.com>
e0b0c12518bc58020efda5ca3d1e4888b33060b2

Delete /ppstack, which is defined in gs_init.ps and not used anywhere

Resource/Init/gs_init.ps


2019-02-13 08:29:39 -0800
Nancy Durgin <nancy.durgin@artifex.com>
b26b5ec2be0a924981a47c8a66b1cfe936170129

Remove 'copystring', which was only used in one place

Just put the code in-line.

Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps


2019-02-12 14:00:29 -0800
Nancy Durgin <nancy.durgin@artifex.com>
25c744f8a7761676d7790f513ca138eaaed2c366

Undef .set/.currentfilladjust, re-def .set/.currentfilladjust2

The .setfilladjust, .currentfilladjust were just wrappers around the
'2' versions. They were used in only a couple places, and were just
dupping/popping the extra args, so I replaced these with equivalent
uses of the underlying operators.

These were "compatibility" operators for .setfilladjust2 and
.currentfilladjust2, which do the same basic thing but take two values
(x,y) instead of 1.

Robin wants these to be official extensions because they are useful
for testing, so I have taken out the code that undef's .setfilladjust2
and .currentfilladjust2. We need to add documentation for these.

Resource/Init/gs_init.ps
Resource/Init/pdf_ops.ps


2019-02-12 10:41:34 -0800
Nancy Durgin <nancy.durgin@artifex.com>
509cb1f2103a2b35efe463271a94b2c33ed6b838

Undef /printgreeting in gs_init.ps

Only used locally. Undef right after use.

Resource/Init/gs_init.ps


2019-02-13 15:15:33 +0000
Robin Watts <robin.watts@artifex.com>
0e0981f84562bff97f45e401c704289544d4f523

Avoid buffer overread in pcl ccittfax decompression.

If you:

make gpcl6debugvg
valgrind --track-origins=yes debugbin/gpcl6 -sOutputFile=test.pdf
-dMaxBitmap=400000000 -sDEVICE=pdfwrite -r75 -Z: -dNOPAUSE
-dBATCH -K2000000 -dClusterJob
tests_private/customer_tests/bug693269.prn

Then we get valgrind errors in cf_decode_eol.

The cause is that process_ccitt_compress is making the read buffer
4 bytes too long, due to forgetting to remove the allowance for the
4 bytes used for the header word.

The fix is simply to adjust the buffer size.

pcl/pcl/rtraster.c


2019-02-09 13:34:17 +0100
Sebastian Rasmussen <sebras@gmail.com>
660eaabf87a143b5217dc875550968883d8e4fc0

Bug 700554: jbig2: Use custom allocator for jbig2dec/luratech decoders.

base/sjbig2.c
base/sjbig2.h
base/sjbig2_luratech.c
base/sjbig2_luratech.h
psi/zfjbig2.c


2019-02-09 13:34:38 +0100
Sebastian Rasmussen <sebras@gmail.com>
0d942b34ae4a5385f5cd3cfa9b2c708f56c65860

jbig2dec: Return allocator once it is retired.

jbig2dec/CHANGES
jbig2dec/jbig2.c
jbig2dec/jbig2.h


2019-02-12 17:27:56 +0000
Chris Liddell <chris.liddell@artifex.com>
0fb8c19f9b848fb691dc067a0feebbfee539672b

Bug 700564: Tweak to fix shared libjpeg

A custom header include wasn't protected by proprocessor directives.

And remove one not required inclusion.

base/sjpegc.c
devices/gdevpdfimg.c


2019-02-12 08:04:39 -0800
Nancy Durgin <nancy.durgin@artifex.com>
ecf45905a555386c157967aefc986c94002b3c6d

Undef .pdfcharkeys from gs_ttf.ps

Used locally. Change to immediate evaluation and undef.

Resource/Init/gs_ttf.ps


2019-02-07 14:22:14 -0800
Nancy Durgin <nancy.durgin@artifex.com>
05dddc4d150b372eecd28817b8441694843b64d8

Move code around to prepare for more undef'ing

Moved code so things are declared before referenced.
No changes to the code, just moved it around in the file.

Resource/Init/gs_ttf.ps


2019-02-07 14:02:49 -0800
Nancy Durgin <nancy.durgin@artifex.com>
e7faf522a5f5a770659cf4d1c9cd7f3362eb9b4d

Undef .findcmap, .pdfmapsymbolic in gs_ttf.ps

Used locally. Change to immediate evaluation and undef.

Resource/Init/gs_ttf.ps


2019-02-07 13:53:00 -0800
Nancy Durgin <nancy.durgin@artifex.com>
9a0db357352e338fe8432ec1e18aa901aed61fdd

Undef .loadttcidfont, .loadpdfttfont in gs_ttf.ps

These are used in pdf_font.ps. Need to rearrange the order of things
in the Makefiles so that gs_ttf.ps is included before pdf_font.ps in
obj/iconfig.h. This also meant moving gs_mgl_e.ps, though I wonder if
it could be moved up with the other encodings (gs_mex_e.ps,
gs_mro_e.ps, etc). I didn't look into right now -- it would be a lot
of Makefile hacking.

After makefile change: change .loadttcidfont and .loadpdfttfont to
operators, make sure their usage is executeonly, and undef in
gs_init.ps.

Resource/Init/gs_init.ps
Resource/Init/gs_ttf.ps
psi/int.mak


2019-02-12 09:15:54 +0000
Chris Liddell <chris.liddell@artifex.com>
355434f4b1bbe8c4f98cafad5a6868aa2f0eaae1

Bug 700533: Undo FT over/underflow workaround

Older versions of Freetype had a problem with overflow (and underflow) in the
Truetype hinting code. That was resolved some time ago with the addition of
(or handling of) the F_dot_P value.

In the file associaited with this issue, the glyph offset is caused by this
workaround.

Thus the workaround is no longer required, and as it actually causes a problem,
it is hereby removed.

base/fapi_ft.c


2019-02-11 07:40:02 -0800
Robin Watts <Robin.Watts@artifex.com>
fd643f053ea4a311a9e61a10069cfe8747aa950c

Bug 700577: Follow on fix.

If the matrix inversion fails, set values for tmat as well as smat.

devices/vector/gdevpdtt.c


2019-02-11 09:31:04 +0000
Chris Liddell <chris.liddell@artifex.com>
0038d98e024edb55a844f8371e62eacbbeb6f6a6

Bug 700582: Handle disabled streams in s_file_available()

and s_file_read_seek()

base/sfxstdio.c


2019-02-06 17:30:00 +0000
Chris Liddell <chris.liddell@artifex.com>
52196a78714e632c2c4001edffc65285346ac998

Ensure uses of true/false/null are immiediately evaluated

Resource/Init/gs_cet.ps
Resource/Init/gs_epsf.ps
Resource/Init/gs_init.ps
Resource/Init/gs_lev2.ps
Resource/Init/gs_pdfwr.ps
Resource/Init/gs_setpd.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


2019-02-10 17:56:23 -0800
Michael Vrhel <michael.vrhel@artifex.com>
08ffa461bbf0914757c11be28c99829dcdae5a38

Bug 696318 psdcmykog issues

The psdcmykog device has to ignore certain postscript color settings since
it does not support any colorants other than the cmykog ones.
I tested with a file that had Artifex Green and Artifex Orange to
ensure that rendered properly still after this fix.

devices/gdevpsd.c


2019-02-10 19:10:26 -0700
Henry Stiles <henry.stiles@artifex.com>
aaf522721db34addf48ae1cc64d559bddbcc1c02

Improve function naming and simplify initialization and destructor.

No expected differences.

pcl/pxl/pximage.c


2019-02-08 04:08:08 +0100
Sebastian Rasmussen <sebras@gmail.com>
d9edb5a256b00e787d72462320112ef39bfa27b3

Without enough prefix codes, a Huffman table cannot be generated.

Previously this was treated as a warning, possibly allowing access
to uninitialized prefix code entries.

jbig2dec/jbig2_text.c


2019-02-08 04:03:40 +0100
Sebastian Rasmussen <sebras@gmail.com>
e4a0d6264627ece2a2c09da9d81d21b6b2158481

Make sure to indicate error upon unexpected OOB.

jbig2dec/jbig2_text.c


2018-12-07 18:12:48 +0100
Sebastian Rasmussen <sebras@gmail.com>
a89d75c1a059093aab4218046a9f258e86a5ab5f

Clarify the element size of GR_stats when memsetting.

In case Jbig2ArithCx ever changes, but it is unlikely.

jbig2dec/jbig2_symbol_dict.c


2019-02-08 04:15:41 +0100
Sebastian Rasmussen <sebras@gmail.com>
f2cadf483f44518ddae68c3146ae77f205f7e11b

Use common pattern for error detection.

Previously the code used a non-standard variant, but it is better
to do error detection the same way everywhere.

jbig2dec/jbig2_halftone.c


2018-12-07 18:12:23 +0100
Sebastian Rasmussen <sebras@gmail.com>
6238141c4564df091515fac92e3c35275d5ce26f

Bug 700384: Indicate error upon error, do not just warn.

Building a Huffman table failed, this was correctly detected,
but success was indicated to the caller causing a reference
template to be left uninitialized, which later on caused the
generic refinement region decoder attempt to use this
uninitialized data. This was reported by MSAN.

Thanks to oss-fuzz for reporting.

jbig2dec/jbig2_text.c


2019-01-24 03:55:57 +0100
Sebastian Rasmussen <sebras@gmail.com>
a0421f035fd418d27fd2df80b896d97d3d6e87ea

Bug 694247: Do not confuse openjpeg input buffer usage with size.

Previously s_opjd_accumulate_input() populated the openjpeg input data
buffer and adjusted the buffer size and usage fields accordingly. The
openjpeg callbacks for reading, skipping and seeking confused these two
fields and used the buffer size instead of the buffer usage. This meant
that there was a risk of reading uninitialized data.

base/sjpx_openjpeg.c


2019-01-25 15:49:56 +0100
Sebastian Rasmussen <sebras@gmail.com>
9a317d2ddfb82ad584a91540fca80db36c6440c7

Add sanitize variant of gpdl target.

base/unix-end.mak


2019-02-07 18:18:59 +0000
Robin Watts <robin.watts@artifex.com>
38c864f6300ccb2664c3d8707ef41564645742e4

Fix Memento_find when running under valgrind.

base/memento.c


2019-02-07 20:00:55 +0000
Robin Watts <robin.watts@artifex.com>
046cd2e7fc5c6a11a5e59835b06a70f3b65f9eb1

Ensure that gs_matrix_invert always has its return checked.

If you do:

make gsdebugvg
valgrind --track-origins=yes debugbin/gs -sOutputFile=test.ps
-dMaxBitmap=400000000 -sDEVICE=ps2write -r300 -Z: -dNOPAUSE
-dBATCH -K2000000 -dClusterJob comparefiles/Bug694772.pdf

then you get:

Conditional jump or move depends on uninitialised value(s)
at 0x945795: gs_matrix_multiply (gsmatrix.c:88)
by 0x7E568B: pdf_calculate_text_size (gdevpdtt.c:2352)
by 0x7E58DD: pdf_update_text_state (gdevpdtt.c:2386)
by 0x7D2E28: pdf_process_string (gdevpdte.c:679)
by 0x7D079E: pdf_process_string_aux (gdevpdte.c:79)
by 0x7D68D1: process_plain_text (gdevpdte.c:1582)
by 0x7E902C: pdf_text_process (gdevpdtt.c:3566)
by 0x956BEC: gs_text_process (gstext.c:595)
by 0xB445A0: op_show_continue_pop (zchar.c:583)
by 0xB42B95: zshow (zchar.c:71)
by 0xB11AD6: do_call_operator (interp.c:86)
by 0xB14B0D: interp (interp.c:1300)
Uninitialised value was created by a stack allocation
at 0x7E57EA: pdf_update_text_state (gdevpdtt.c:2373)

This is because a matrix inversion fails and is uncaught.

base/gshtscr.c
devices/vector/gdevpdfi.c
devices/vector/gdevpdtc.c
devices/vector/gdevpdtt.c
devices/vector/gdevpx.c
devices/vector/gdevtxtw.c
devices/vector/gdevxps.c
pcl/pxl/pximage.c


2019-02-07 17:30:48 +0000
Robin Watts <robin.watts@artifex.com>
1c247504269f70d07ce95104440a36f34f1a68a0

Bug 700577: Ensure text enum initialisation sets reqired flags

The default begin_text function initialises various things like
charpath_flag and is_pure_color. The PCL interpreter then calls
directly into the graphics lib for string measurement etc, and
this depends on these flag.

Sadly, not all text enumerator initialisations set these flags;
in particular if we have the flp device in effect, the subclass
begin_text function is used and that does not init those values.

The simplest solution appears to be to amend
gs_text_enum_init_dynamic to always set these flags as required.

base/gstext.c
base/gxchar.c


2019-01-31 16:34:30 -0800
Michael Vrhel <michael.vrhel@artifex.com>
f10f2900633674746f6a8155200f24db51449523

Bug 696318: psdrgb device

With certain postscript files, the psdrgb device was getting its process
color model changed causing significant confusion for the device.

devices/gdevpsd.c


2019-02-06 21:36:54 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
5daf81e0edb5dee2911bf419fa2423b2588449ab

Bug 697545 : Prevent numerous memory leaks.

Cleanup font for all error returns.

Error created using :-
MEMENTO_FAILAT=21465 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0282

pcl/pcl/pcsfont.c


2019-02-06 09:51:49 -0800
Ray Johnston <ray.johnston@artifex.com>
8da995af1f586f2f90cac274aa738cd8dad3759f

Undef check_r6_password and PDFexecform

Immediate binding and undef for check_r6_password.

Move PDFexecform from gs_lev2.ps to pdf_draw.ps (the only place it was
used), and put it and .PDFexecform in pdfdict. PDFexecform and
.PDFexecform don't need odef -- just make them executeonly (even though
they will be hidden in pdfdict).

Also change the initial size of pdfdict to just over the actual size
(it was growing to > 400 maxlength).

Resource/Init/gs_lev2.ps
Resource/Init/pdf_draw.ps
Resource/Init/pdf_main.ps
Resource/Init/pdf_ops.ps
Resource/Init/pdf_sec.ps


2019-02-07 08:48:53 -0800
Nancy Durgin <nancy.durgin@artifex.com>
060c83126ad016a691f6ef1b43d5232956ddc128

Undef /.loadttfont, /.loadwofffont, /.loadwofftables from gs_ttf.ps

Used locally, so change to immediate evaluation and undef.

Resource/Init/gs_ttf.ps


2019-02-06 15:35:05 -0800
Nancy Durgin <nancy.durgin@artifex.com>
bdc3e6b7201c2a73eeae60cf4cfffb843f5034ea

Reorder code to prep for future cleanup

Resource/Init/gs_ttf.ps


2019-02-06 14:36:01 -0800
Nancy Durgin <nancy.durgin@artifex.com>
dd3b403b72931b9ef52630665fc418ad96075197

Undef .readttdata,.nname in gs_ttf.ps

Used locally. Use immediate evaluation and undef.

Resource/Init/gs_ttf.ps


2019-02-06 14:34:01 -0800
Nancy Durgin <nancy.durgin@artifex.com>
46ec997913d63b6c7d3ac666484c1a04551a082b

Undef .printtab in gs_ttf.ps

Used locally, so change to immediate evaluation and undef.

Resource/Init/gs_ttf.ps


2019-02-06 14:28:17 -0800
Nancy Durgin <nancy.durgin@artifex.com>
91bf6eef15c30efd90c4e98cc4b95e9e7f85a763

Undef .pickcmap, .pickcmap_with_xlatmap, .pickcmap_with_no_xlatmap in gs_ttf.ps

.pickcmap uses immediate evaluation on the other two, so just undef them.

Make .pickcmap an operator because it's a big function. Make sure all uses
are executeonly. Undef in gs_init.ps.

Resource/Init/gs_init.ps
Resource/Init/gs_ttf.ps


2019-02-06 13:01:26 -0800
Nancy Durgin <nancy.durgin@artifex.com>
715541a5c7390508d923d48e2eda4417b82a2710

Undef .makesfnts in gs_ttf.ps

Large procedure, so made it an operator. Make sure all references are
executeonly. Undef in gs_init.ps.

Resource/Init/gs_init.ps
Resource/Init/gs_ttf.ps


2019-02-06 11:47:15 -0800
Nancy Durgin <nancy.durgin@artifex.com>
ce52f184357a8043c0b314f2e8319237b75c29ae

Undef .ttkeys in gs_ttf.ps

Used locally -- change to immediate evaluation and undef at end of file.

Resource/Init/gs_ttf.ps


2019-02-06 10:12:34 -0800
Nancy Durgin <nancy.durgin@artifex.com>
c58684b54be4190a8f1ce3d92200f420aefba9dd

Undef .is_ttf_or_otf, .is_woff from gs_ttf.ps

Only used locally, changed to immediate evaluation.

Also moved some of the related things that were already undef'd, to be
handled together.

Resource/Init/gs_ttf.ps


2019-02-07 07:12:36 -0800
Michael Vrhel <michael.vrhel@artifex.com>
7cc8aeb7bf93deab5d86aeeca6c5b22a3890345d

Bug 700571 SoftMask Matte rendering

Fix for multiple issues with the removal of the preblended transparency
that can exist with the softmask

base/gdevp14.c
base/gdevp14.h
base/gxblend.c


2019-02-04 11:36:19 -0800
Robin Watts <Robin.Watts@artifex.com>
28f825c642a9af53136a7e661c6026db53604b76

Workaround Shading/clist valgrind issues with trans_device.

When shading into the clist the code has to cope with 2 devices;
the target device, and the 'trans_device', which is updated to
use the source colorspace for the shading.

The number of components can vary between the two, meaning that
the shading code has to be passing (say) 1 component around,
but the call into the clist will attempt to write (say) 3 components.

The clist appears to cope with this mismatch on reading (and I
haven't found a case where we write too few components), so for
now, just add a hacky PACIFY_VALGRIND section to clear the
spare color components.

base/gxshade6.c


2019-02-05 15:22:15 -0800
Nancy Durgin <nancy.durgin@artifex.com>
6c8a539b2a2c199bcde37acc652b882239407c47

Undef .is_hex_digit, .pop3ex, .popfex from gs_ttf.ps

These were already used with immediate evaluation, so just need to undef.

Resource/Init/gs_ttf.ps


2019-02-05 14:06:06 -0800
Nancy Durgin <nancy.durgin@artifex.com>
ebfacf80bf673dbaa7e742687f4d319cd1b8dd11

Undef .loadttfontdict, which undefs a bunch of internal procedures

Changed to immediate evaluation of the dict. Undef dict at end of file.
Eliminates a bunch of internal procedures.

Resource/Init/gs_ttf.ps


2019-02-05 12:19:00 -0800
Nancy Durgin <nancy.durgin@artifex.com>
402c16dec171424700639d8aa41009dbc57b66a7

Remove undef of /postalias that was supposed to be removed after v9.09

There are no remaining references to "postalias", so this appears to be
dead/unneeded code, as indicated by the comment.

Resource/Init/gs_ttf.ps


2019-02-05 12:12:42 -0800
Nancy Durgin <nancy.durgin@artifex.com>
3575fc86cfcffcec935023238a2d6d0ae62875ca

Undef .findttfontname and .findwoffname from gs_ttf.ps

Move code so defined before use. Use immediate evaluation. Undef locally.

Resource/Init/gs_ttf.ps


2019-02-05 12:07:36 -0800
Nancy Durgin <nancy.durgin@artifex.com>
4e051acc94b70a952ba2f2baa7209df3a2924bb6

Undef .findseg from gs_ttf.ps

Used locally. Immediate ref and undef in file.

Resource/Init/gs_ttf.ps


2019-02-05 11:54:12 -0800
Nancy Durgin <nancy.durgin@artifex.com>
1bebd7f9f299026de62868e72f70979460080a27

Undef .fill_identity_cmap, .definettcidfont in gs_ttf.ps

Local definition -- use immediate evaluation and then undef.

Resource/Init/gs_ttf.ps


2019-02-05 09.50:48 -0800
Nancy Durgin <nancy.durgin@artifex.com>
9876fb74118b91ec87a34673735bcd89900ad66a

Undef .charkeys from gs_ttf.ps

- This is a huge procedure, so I made it an operator rather than using
immediate evaulation
- Make sure all uses are executeonly
- Undef in gs_init.ps

Resource/Init/gs_init.ps
Resource/Init/gs_ttf.ps


2019-02-05 09:25:17 -0800
Nancy Durgin <nancy.durgin@artifex.com>
3c12cbfa2585c4af7173e6045c2339f051574b3c

Undef .addglyph from gs_ttf.ps

- this already only had immediate references
- undef at end of gs_ttf.ps

Resource/Init/gs_ttf.ps


2019-02-06 11:17:27 +0000
Robin Watts <robin.watts@artifex.com>
1ca42001f0ae456aa3ec080e88719e2d4b4f8131

Tweak cff_write_Encoding to avoid writing badly formed table.

The following:

make gsdebugvg
valgrind --track-origins=yes debugbin/gs -sOutputFile=/dev/null
-dMaxBitmap=400000000 -sDEVICE=pdfwrite -r72 -Z: -dNOPAUSE
-dBATCH -K2000000 -dClusterJob Bug691693.pdf

results in valgrind warnings:

Use of uninitialised value of size 8
at 0x53F0B6: deflate_slow (in ghostpdl/bin/gs)
by 0x53CDA5: deflate (in ghostpdl/bin/gs)
by 0x6CB1B7: s_zlibE_process (in ghostpdl/bin/gs)
by 0x6B35F0: swritebuf (in ghostpdl/bin/gs)
by 0x6B31EB: s_process_write_buf (in ghostpdl/bin/gs)
by 0x6B28E5: spputc (in ghostpdl/bin/gs)
by 0x6B2CE1: sputs (in ghostpdl/bin/gs)
by 0x7E3A43: type2_put_hintmask (in ghostpdl/bin/gs)
by 0x7E4704: psf_convert_type1_to_type2 (in ghostpdl/bin/gs)
by 0x7D9770: cff_put_CharString (in ghostpdl/bin/gs)
by 0x7DAB9B: cff_write_CharStrings (in ghostpdl/bin/gs)
by 0x7DC58B: psf_write_type2_font (in ghostpdl/bin/gs)
Uninitialised value was created by a stack allocation
at 0x7DAF8E: cff_write_Encoding (in ghostpdl/bin/gs)

Investigation shows that cff_write_Encoding is outputting a table
with uninitialised bytes in that. Not only that, in such cases
it can clearly omit some valid data.

Conceptually, the routine starts with an empty index table, with
uninitialised values. For each of the possible 256 entries within
the font, it attempts to encode the char to get the glyph index.
If this fails, then the glyph is not encoded, so not mentioned in
the table.

Assuming it is encoded, it finds the index for that glyph within
the subset. If there is no index, then it is not in the subset, so
no entry in the table.

If there is an index, we look up the glyph name. If there is no
glyph name, we choose not to encode the glyph in the table. This
is the (first) case which is causing us problems.

Finally, we check to see if the encoded index fits into the simple
(0..255) table without clashing with a previously encoded glyph;
if so, we insert it into the index table (incrementing the number
of entries we have inserted), if not, we have to resort to using a
supplement entry.

The code then assumes that the first 'actual_enc' bytes of index
make up the table. This is sadly not the case.

In the test given above, this routine is called several times, one
of which demonstrates that this assumption is false.

While the entries do yield a set of index values that form a prefix
within the table (from 0 to 20), number 14 has no glyph name. This
results in byte 14 of the table having a garbage value in, and
(more worryingly), because actual_enc is only incremented to 20,
we don't write the final entry of the table at all, effectively
dropping a glyph.

It is possible that something has gone wrong earlier in the process
and that this should be a fatal error, but observation of the code
shows that if we use a supplement, because a j maps to a previously
used i, we'll similarly miscount the length of the table.

A better solution, seems to me, to be to keep track of the maximum
encoded value that has gone into the index table, and to ensure
that every value within that table has a defined value.

The table is initialised with 0's, as Chris informs me that the CIF
SID for .notdef is 0.

We make matching changes to cff_Encoding_size.

devices/vector/gdevpsf2.c


2019-02-06 09:54:22 +0000
Ken Sharp <ken.sharp@artifex.com>
0cf2aa5cdb1d7392cd4a6b11a30625be91ef9be0

PDF interpreter - reset colour space after starting a Group

Bug #700572 "PDF to TIFF - only borders left after conversion - no errors"

The problem is that the PDF file does not set a fill (or indeed stroke)
colour space or colour before beginning to draw on the canvas. Thus it
relies upon the default colour values.

Because the page has a transparency Group, and the Group has a Colour
space, we set the colour space before we begin rendering. The defined
colour space of the group is an ICCBased space with four components.
The PDF Reference is clear that the default colour for an ICCBased space
is that all the components should be 0. This results in us drawing all
the filled elements in 0 0 0 0, or white.

We need to set the colour space before we define the group for the
transparency compositor, because the code relies upon the colour space
of the group being current at the time the group is 'defined'.

Grabbing the current colour space, before setting the group space, and
then setting it back again afterwards, effectively a gsave/grestore but
only for the colour space fixes this problem. This causes differences in
7 test files, which I believe are progressions.

Resource/Init/pdf_draw.ps


2019-02-05 07:31:05 -0800
Nancy Durgin <nancy.durgin@artifex.com>
8d0253fdeb73bdb021f665e7c5478d6e1f41898e

Delete .makemodifiedfont

This goes with .definemodifiedfont, which was previously deleted.
Neither of these functions are referenced anywhere, so removing completely.

Resource/Init/gs_fonts.ps


2019-01-31 15:06:54 -0800
Nancy Durgin <nancy.durgin@artifex.com>
d0883434eb7fd7239048b404dab884803a42f52d

Undef .FontDirectory

- It was already an operator. Make it executeonly.
- Make sure all uses are executeonly.
- Undef in gs_init.ps

Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps


2019-01-31 12:10:48 -0800
Nancy Durgin <nancy.durgin@artifex.com>
cea599bca413609.508a43c7b1d765b53f200083

Undef .substitutefont and .substitutefontname

Used in gs_fonts.ps and pdf_font.ps

- make it an operator
- make sure all procedures that use it are executeonly
- undef in gs_init.ps

Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps


2019-01-31 11:58:21 -0800
Nancy Durgin <nancy.durgin@artifex.com>
c52e82d2eeae0eb498eef80c1a86d788fe0b117d

Undef .loadinitialfonts

Defined in gs_fonts.ps and used in gs_init.ps. Undef right after use in
gs_init.ps.

Resource/Init/gs_init.ps


2019-02-04 16:56:51 +0000
Robin Watts <robin.watts@artifex.com>
c5fd7dc0f3c706eddd59488a33fc334a2860da49

Ensure return code of gs_bbox_transform_inverse always checked.

Spotted this while debugging something else.

base/gdevbbox.c
base/gdevbbox.h
base/gsdevmem.c
base/gslib.c
base/gsshade.c
base/gxp1fill.c
base/gxshade1.c
base/gxshade6.c
xps/xpsopacity.c


2019-02-01 10:48:31 +0000
Robin Watts <robin.watts@artifex.com>
2d5b86f0acf37fcb6176817580c2d3bb745e27d2

Avoid valgrind error in gs_shading_A_fill_rectangle_aux

The following sequence:

make gsdebugvg
debugbin/gs -sOutputFile=test.pdf -dMaxBitmap=400000000
-sDEVICE=pdfwrite -r72 -Z: -dNOPAUSE -dBATCH -K2000000 -dClusterJob
/home/marcos/cluster/tests_private/comparefiles/Bug695746.pdf
valgrind --track-origins=yes debugbin/gs -sOutputFile=/dev/null
-dMaxBitmap=400000000 -sDEVICE=ppmraw -r72 -Z: -dNOPAUSE -dBATCH
-K2000000 -dClusterJob test.pdf

produces valgrind errors:

==31466== Conditional jump or move depends on uninitialised value(s)
==31466== at 0x47873B: gs_shading_A_fill_rectangle_aux (gxshade1.c:256)
==31466== by 0x478B6A: gs_shading_A_fill_rectangle (gxshade1.c:301)
==31466== by 0x476374: gs_shading_do_fill_rectangle (gsshade.c:477)
==31466== by 0x4748DB: gx_dc_pattern2_fill_rectangle (gsptype2.c:243)
==31466== by 0xA442ED: gx_default_fill_path (gxfill.c:707)
==31466== by 0xA75F9C: gx_fill_path (gxpaint.c:52)
==31466== by 0x94D38A: do_fill (gspaint.c:318)
==31466== by 0x94D488: fill_with_rule (gspaint.c:352)
==31466== by 0x94D4D7: gs_fill (gspaint.c:363)
==31466== by 0xB64A36: zfill (zpaint.c:27)
==31466== by 0xB10E74: do_call_operator (interp.c:86)
==31466== by 0xB143DA: interp (interp.c:1410)
==31466== Uninitialised value was created by a stack allocation
==31466== at 0x4784DC: gs_shading_A_fill_rectangle_aux (gxshade1.c:216)

These are due to the inversion of a matrix failing, and the error
being ignored.

Fix the error handling in the function; if the inversion fails, just
don't render anything and exit. Returning an error causes content to
be lost from cluster test files.

As a side effect of this, fix gsicc_release_link to follow the
general rule for destructors that they should accept NULL without
error.

base/gsicc_cache.c
base/gsmatrix.c
base/gxshade1.c


2019-02-03 12:09:52 +0000
Chris Liddell <chris.liddell@artifex.com>
556bb1c7110ee65af5c38a32610c8dfdd9aedc43

Add non-packed capability to packps

For creating opdfread.h we normally strip comments and whitespace from the
Postscript, but that makes reading debugging the opdfread Postscript even more
unpleasant than it has to be.

This adds a "-d" option ("don't pack") to pack_ps.c.

Also adds a subtarget for opdfread.h that means invoking make thus:
make DEBUG_OPDFREAD=1

will create opdfread.h without stripping whitespace and comments, so the output
from ps2write is only baroque and less wilfully horrific.

base/pack_ps.c
devices/devs.mak


2019-02-03 12:09:04 +0000
Chris Liddell <chris.liddell@artifex.com>
7f86b6a5add79b7a32d216f5095e93112ff58506

Add copyright notice to source file

devices/gdevpdfimg.c


2019-02-04 17:01:42 +0000
Ken Sharp <ken.sharp@artifex.com>
dc685b7525c9ccea3ee59bacd6d6f25ab22d174a

pdfwrite - use the correct enumerator when handling PCL bitmap fonts

Bug #700562 "Valgrind reveals use of unitialised value in text code"

This is a follow-on from commit c47512e5e638d903d69925f7ebab4de2aa3f481f
again what we have is confusion over *which* of the two enumerators we
should be using, when we are converting fonts which we can't preserve
into type 3 fonts.

For non-PCL cases we don't need the text enumerator for the 'default'
show functions, so we specifically set pdev->pte to NULL (at around line
3477 in gdevpdtt.c). However for PCL bitmap fonts, or the GL/2 stick
font, we do need the 'default' enumerator which we create in order to
process the 'BuildGlyph' for the character.

So we need to make sure we are using the correct enumerator when we try
to read back the 'returned_glyph'.

devices/vector/gdevpdtt.c


2019-02-03 14:44:02 -0700
Henry Stiles <henry.stiles@artifex.com>
0495abb3605831147f39691701030405b44cd5d0

Fix 700565 - SetHalftoneMethod parsing is wrong.

The parameter numbering was off by one and the check for object type
should not have exited the command.

Also change the operator to not report missing attributes. This
results in changes to error test files in the Quality Logic suite,
however, we did not match the HP error report previously and don't
plan to do so. Oddly, HP reports a C file and line number in the
report, we suspect this is a bug.

pcl/pxl/pxink.c


2019-02-04 10:39:19 +0000
Ken Sharp <ken.sharp@artifex.com>
cfc80a96f5ba682d86ce2ee1375cfca5b5941fea

type 3 masked image - pacify valgrind with pdfwrite

Bug #693814 "Valgrind reports uninitialised value(s) in pdf written image streams"

The valgrind warnings are real, but essentially benign. If the wisth of
the mask data for a type 3 masked image is not a multiple of 8, then we
do not completely write to each bit of the final byte of mask data.

When writing the mask data to a PDF file, we obviously write the entire
last byte, which causes valgrind to (correctly) complain about using
uninitialised data. Of course the uninitialised bits are never actually
used, even by the PDF consumer.

We could put a PACIFY_VALGRIND around this line, but writing
uninitialised bytes means we could run the same input twice and get two
slight different PDF files, which would flag as a diff in our testing.
It would also annoy the 'reproducible builds' people, potentially.

Since its only a single byte, just clear it for reproducibility, even
when we aren't running valgrind.

base/gximage3.c


2019-02-02 16:21:48 +0000
Ken Sharp <ken.sharp@artifex.com>
ca8246f639c73127fd05b674679864a9bf2eb0d2

XPS interpreter - address a valgrind problem

Bug #700557 "valgrind error pdfwriting text from an xps file"

The fault is not in pdfwrite, its the XPS interpreter. The pdfwrite
device copies a font, which involves calling gs_c_name_glyph() to
retrieve the name of a given glyph. The expectation (because this is
making a copy of a font) is that the returned string will be persistent
and not managed by the font or pdfwrite.

In the PostScript interpreter this is managed by adding the glyph name
to the PostScript name table, which is persistent to the end of job and
then freed.

Now, the XPS interpreter supplies a routine xps_true_callback_glyph_name
which is called to retrieve the glyph name. If there is a POST table in
the font, and it has names, and we can read it, we allocate some memory
and copy the name there before returning a pointer to that memory.

If there is a POST table, but its a format which has no names, or which
we cannot deal with, then the code simply made a buffer, printed a
dummy name into it, and returned that. The problem is that as soon as
we return, the buffer we created on the stack goes out of scope leading
to the valgrind error.

It appears that in XPS (and PCL where this code originated) there is no
mechanism like ht name table, and so even when we can find a name in the
POST table, we allocate memory for it, and allow it to leak!!

See the comment at around line 263 of xpsttf.c, and note that this is
the same code as in pl_glyph_name() in plfont.c

Since this memory leak already happens for the case where the POST
table can be read, I've (reluctantly) chosen to do the same in the case
where we simply invent a glyph (PCL doesn't do this). I'm not happy
about it, and the owners of the relevant interpreters really ought to
fix this properly IMO, or we should rewrite the 'copy_glyph' method
from the fonts so that it owns the memory for the name, but this would
be a huge undertaking.

xps/xpsttf.c


2019-02-01 13:07:29 -0800
Michael Vrhel <michael.vrhel@artifex.com>
11338176d31567a5d63e49d6f91ccac7db706716

Rename pdf14 parent_color_info_procs to parent_color_info

As Ray pointed out, this structure has more than just procs in it.

base/gdevp14.c
base/gdevp14.h


2019-01-31 11:31:30 -0800
Ray Johnston <ray.johnston@artifex.com>
4ec9ca74bed49f2a82acb4bf430eae0d8b3b75c9

Hide pdfdict and GS_PDF_ProcSet (internal stuff for the PDF interp).

We now keep GS_PDF_ProcSet in pdfdict, and immediately bind pdfdict
where needed so we can undef it after the last PDF interp file has
run (pdf_sec.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_sec.ps


2019-02-01 14:45:18 +0000
Ken Sharp <ken.sharp@artifex.com>
78b321cdcbc22df928f3af2772473435e4d0695a

txtwrite - fix use of incorrect index for recording Widths

When scanning multi-byte CIDFont text, we were using the text enumerator
'index' to store the widths of glyphs. However this is incorrect when
the CIDFont uses multiple bytes; the index is the byte count into the
input string, not the numebr of characters processed.

Use TextBufferIndex instead, which is correctly updated to track the
character index in the string, not the byte index.

devices/vector/gdevtxtw.c


2019-01-31 19:14:49 +0000
Robin Watts <robin.watts@artifex.com>
52cbdabc0627bbeb918ffeb5f0fe15a6922a8322

Bug 700306: Fix values returned by bbox device.

The "any part of a pixel" code in the new scan converter holds a
"cursor" position that determines where edges intersect with
the scanlines. The leftmost and rightmost positions of intersection
are held in this as values of type fixed.

The "null" cursor position is represented by using maximal/minimal
values. Unfortunately, I used {max,min}_int_in_fixed, rather than
{max,min}_fixed, which meant they weren't nearly as maximal/minimal
as they ought to have been.

This meant that the logic for inserting the real left/right hand
edges went wrong, and we output spurious positions into the
edgebuffer table. This in turn caused larger spans to be filled
to the underlying device than expected, hence upsetting the bbox.

For all other devices, there was no problem because overly large
or small values are clipped away.

base/gxscanc.c


2019-01-30 15:09:45 -0800
Nancy Durgin <nancy.durgin@artifex.com>
e1f3eb6e848498a085fbec7333cbe2a22d7be318

Undef .growfontdict

- make it an operator
- make sure all procedures that use it are executeonly
- undef in gs_init.ps

Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps
Resource/Init/gs_type1.ps


2019-01-30 14:49:10 -0800
Nancy Durgin <nancy.durgin@artifex.com>
052d8d2afc14b14efa46632f355ee24b273760f1

Undef .fontnameproperties

Used in a gs_fonts.ps and pdf_font.ps. Immediate evaluation and undef in
gs_init.ps.

Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps
Resource/Init/pdf_font.ps


2019-01-30 13:54:06 -0800
Nancy Durgin <nancy.durgin@artifex.com>
7b5031745ae7f00f9d6c653bf647330e1e1f5a9b

Undef .findfontname

Only used locally, so use immediate evaluation.

Resource/Init/gs_fonts.ps


2019-01-30 13:40:45 -0800
Nancy Durgin <nancy.durgin@artifex.com>
64cc22e15f680418c539f0f1d286168bc6d1cf75

Undef .definenativefontmap

Only used locally, so use immediate evaluation.

Resource/Init/gs_fonts.ps


2019-01-30 13:38:02 -0800
Nancy Durgin <nancy.durgin@artifex.com>
829a8c85112193116f39.50568e8bf56138b7410

Undef .definemodifiedfont

This was a random procedure not actually used anywhere...

Resource/Init/gs_fonts.ps


2019-01-30 12:14:52 -0800
Nancy Durgin <nancy.durgin@artifex.com>
865e68569b194992ab097006f2884c1dc1e83d05

Undef .definefakefonts

All the comments seem to say not to bind this one, but immediate evaluation
should be fine.

Undef in gs_init.ps after all uses.

Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps


2019-01-30 12:09:43 -0800
Nancy Durgin <nancy.durgin@artifex.com>
430e219ea17a2650577d70021399c4ead05869e0

Undef .completefont

- make it an operator
- make sure all procedures that use it are executeonly
- undef in gs_init.ps

Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps
Resource/Init/gs_ttf.ps


2019-01-30 09:51:54 -0800
Nancy Durgin <nancy.durgin@artifex.com>
cdcb56ed5af686ab2e368587506f12ba071ff41e

Undef .buildnativefontmap

- make it an operator
- make sure all procedures that use it are executeonly
- undef in gs_init.ps

Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps
Resource/Init/gs_res.ps


2019-01-30 09:40:25 -0800
Nancy Durgin <nancy.durgin@artifex.com>
fe316c21cb1c9a192da58158155a56f46f1f753a

Undef .origdefinefont, .origundefinefont, .origfindfont

I don't understand why these need to be defined (in gs_res.ps) but things
break if they are not. So just undef them in gs_init.ps after all the
initialization is complete.

Resource/Init/gs_init.ps
Resource/Init/gs_res.ps


2019-01-30 09:05:55 -0800
Nancy Durgin <nancy.durgin@artifex.com>
d68c6d816d5d584ce340f9d4c827279cc4321125

Remove .glyphwidth implementation, since it isn't used anywhere

Deleted C implementation.
Made finish_stringwidth() static since it no longer needs to be exported
to zglyphwidth().

psi/ichar.h
psi/zchar.c
psi/zcharx.c


2019-01-30 08:14:58 -0800
Nancy Durgin <nancy.durgin@artifex.com>
d74962183f1929ebfab7db119d97ca0b82eb3816

Undef .findfontop

This needs to stay an operator (based on the comments), so have to undef it
in gs_init.ps.

Resource/Init/gs_init.ps


2019-01-29 21:05:41 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
412a279721c0f17d496147f3b87de873123a530e

Bug 697545 : Prevent numerous memory leaks.

Saving the desired_implmentation ensures that the correct cleanup routines are called.

Error created using :-
MEMENTO_FAILAT=1846 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0270

pcl/pl/plmain.c


2019-01-30 09:30:37 -0800
Michael Vrhel <michael.vrhel@artifex.com>
9bf4dddd99987b45375972ee95d061cc7d3d393f

Bug 696600: psdcmykog device_procs

My earlier fix caused massive problems with any transparency files.
This should fix all the issues.

devices/gdevcmykog.c


2019-01-29 11:50:21 -0800
Ray Johnston <ray.johnston@artifex.com>
f075b380de5c2826055d092f2e4616ed6da89e87

Fix debug message 'v' output num_components_new with spot colors.

The debug message was before the new_num_components was adjusted for
num_spots.

base/gdevp14.c


2019-01-28 09:58:51 -0800
Ray Johnston <ray.johnston@artifex.com>
0dcbfa4a999fcfe154c313e1a63855b7c0355a8e

Bug 700493: Search parent Resources, if not found in Local or Page

The spec mentions that the Page Resources are inherited by a Form
Xobject (not recommended), but Adobe and mupdf find, and use, the
Resource definition in a parent (ancestor) Xobject. Recursively
search the parent Resources ONLY if it isn't found in the Form's
Resources or the Page Resources (which may include Resources of
ancestors of the Page).

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


2019-01-28 10:09:10 -0800
Ray Johnston <ray.johnston@artifex.com>
647992061fc815d29982ecbc1ad76e3e86cc714f

Fix Bug 694190 for cmykspot and custom put_image functions (fix SEGV)

When we get an error in the PDF interpreter, we can end up in the put_image
function. This check belongs in the two other pdf14 put_image functions.

base/gdevp14.c


2019-01-18 09:33:45 -0800
Ray Johnston <ray.johnston@artifex.com>
0530328c8d16e69557f8bdeafcd40d8a75f5e994

Fix SEGV found with broken PDF interpreter and Bug690770.pdf

Found accidentally when I was working on a PDF interpreter change, when
closing the pdf14 device, the smaskcolor->ref_count was decremented, but
that object had already been freed (stale pointer). The free was by a
"restore", so the smaskcolor needs to be in stable_memory so that it
will be protected from the restore. Similarly for the "profiles" of that
structure (and free both with stable_memory).

base/gdevp14.c


2019-01-29 08:31:06 -0800
Nancy Durgin <nancy.durgin@artifex.com>
13faebdf8817a99e1476736687ca2d75c002fb25

Fixed some issues with htmldiff.pl

1) I am using pngize=0. My version of bmpcmp automatically outputs in
png format. I think this reveals a bug related to file suffixes?
Anyway, I added an "outsuffix" variable and at least for my situation,
it now works. I don't know if this is a general fix or not.

2) The metafile string was built with $imstr, which isn't a defined
variable? Changed this to be $imstr1. How did this ever work?

toolbin/htmldiff.pl


2019-01-29 14:31:03 +0000
Robin Watts <robin.watts@artifex.com>
7c8f63f6765254367cb85e3bd0f3b9b1388237c7

Bug 693814: Fix valgrind error in pdf_image_plane_data_alt.

Valgrind is not smart enough to realise that <undefined_value> * 0 =
defined 0.

Thus, initialise raster to 0.

This makes the following command run without warnings:

valgrind --track-origins=yes bin/gs -sOutputFile=out.pdf
-dMaxBitmap=400000000 -sDEVICE=pdfwrite -r300 -Z:
-dNOPAUSE -dBATCH -K2000000 -dClusterJob
/home/marcos/cluster/tests_private/comparefiles/Bug692226.ps

base/gximage3.c


2019-01-29 12:51:09 +0000
Robin Watts <robin.watts@artifex.com>
14ccdd48a3ba6f546e024a21c3837dc258d1f79d

Bug 700512: Fix error from image_render_icc16.

If we render a skewed image using image_render_icc16, and the first
two pixels on the line have identical source values, the current
code would forget to do the color mapping. This would result in
a "Fatal" error coming back from the underlying pixel plot routine
which causes the whole program to exit.

The fix is simply to insist that the first pixel on a row must
always be mapped.

base/gxi12bit.c


2019-01-28 15:07:07 -0800
Robin Watts <Robin.Watts@artifex.com>
7eff21255ed7b053bb78e7654793c63943b10a01

Avoid valgrind problems with copy_landscape.

The copy_landscape routine uses memflip8x8 to transpose 8 lines
of data to be 8 columns of data.

At the end of the line, unless the width is a multiple of 8, we
therefore end up accessing uninitialised data. This trips
valgrind.

We therefore introduce a special case variant for the end of the
line, where we mask off the undefined bits.

This can be seen by doing:

make vg
bin/gs -sOutputFile=test.ps -dMaxBitmap=400000000 -sDEVICE=ps2write
-r300 -Z: -dNOPAUSE -dBATCH -K2000000 -dClusterJob
/home/marcos/cluster/tests_private/comparefiles/Bug691740.pdf
valgrind --track-origins=yes bin/gs -sOutputFile=/dev/null
-dMaxBitmap=400000000 -sDEVICE=pkmraw -r300 -Z: -dNOPAUSE
-dBATCH -K2000000 -dClusterJob test.ps

base/gsutil.c
base/gsutil.h
base/gxifast.c


2019-01-28 09:43:17 -0800
Robin Watts <Robin.Watts@artifex.com>
c79f5245d24398b6f024e5e8611882a10b2799b0

Fix strange valgrind problem; compiler error?

On peeves, the following commands produce valgrind warnings:

make vg
bin/gs -sOutputFile=out.ps -dMaxBitmap=400000000 -sDEVICE=ps2write
-r300 -Z: -dNOPAUSE -dBATCH -K2000000 -dClusterJob
/home/marcos/cluster/tests_private/comparefiles/Bug691112.pdf
valgrind --track-origins=yes bin/gs -sOutputFile=/dev/null
-dMaxBitmap=400000000 -sDEVICE=ppmraw -r300 -Z: -dNOPAUSE
-dBATCH -K2000000 -dClusterJob out.ps

Debugging shows that the "run_len" member of the RLE stream state
is not being initialised. As far as I can tell, it really out to
be.

Changing the code to use the (neater, IMHO) mechanism of initing
the stream state by calling the template init function seems to
solve this. I cannot for the life of me see why this should make
a difference, but this is a better way to work in any case.

base/gxclutil.c


2019-01-28 20:21:24 -0800
Michael Vrhel <michael.vrhel@artifex.com>
659cb78748c9f4bb4e5f45a1c07872176fba7e57

Bug 696600: psdcmykog device issues

The psdcmykog device is a DeviceN color based device but unlike psdcmyk and
tiffsep it can't change its color characteristics. It remains as
a 6 color cmykog device. Postsript files can change the maxseparations
(example 29-07E.PS) The gdevdevn code will, if it
detects a change occured, close the device and reopen (see
devn_printer_put_params) possibly resetting the color info. tiffsep
and psdcmyk, when reopened, will reset their color characteristics based upon
the content of the page, avoiding any issues upon the reopen. Here we
will need to make sure to set the color information to avoid problems.

devices/gdevcmykog.c


2019-01-27 17:40:25 -0700
Henry Stiles <henry.stiles@artifex.com>
7c3c69932c9b12526a54830cca745ceb21aebdec

Bug 700492 - xl readImage IllegalAttributeValue.

Support switching compression schemes within a single image. We now
allow switching between lossless modes (uncompressed, rle and
delta-row) but do not allow changing to jpeg compression.
Interleaving lossy and lossless compression within a single image is
not expected in practice.

pcl/pxl/pximage.c


2019-01-28 10:45:58 -0800
Michael Vrhel <michael.vrhel@artifex.com>
6476023744d256b12ea11bff3e121104df99f426

Bug 695046: icc profile not found

When the code is compiled without compile inits the icc profiles
associated with enumerated color spaces in jpx images could not
be found.

base/gsicc_manage.c
base/gsicc_manage.h


2019-01-28 14:16:35 +0000
Robin Watts <robin.watts@artifex.com>
c52f058c6d5c912d9d9da609929b4cd306e2760e

pdfwrite: Avoid valgrind errors when comparing image lines.

Within pdf_dump_converted_image we compare scanlines of image data
to the next one. Unfortunately, if scanlines aren't an exact number
of bytes wide, we have uninitialised bits at the end, which can a)
cause spurious mismatches, and b) cause valgrind errors, such as
seen with the following:

make vg
valgrind --track-origins=yes bin/gs -sOutputFile=out.ps
-dMaxBitmap=400000000 -sDEVICE=ps2write -r300 -Z: -dNOPAUSE
-dBATCH -K2000000 -dClusterJob
/home/marcos/cluster/tests_private/comparefiles/Bug690237.pdf

Here we simply use a modified line comparison routine to test
the exact set of bits required.

devices/vector/gdevpdfd.c


2019-01-22 09:37:43 +0000
Robin Watts <robin.watts@artifex.com>
b092266152f2c43f7f5bb195bf9ef37afa46996b

Fix buffer overread in cmd_compress_bitmap.

The following commands:

make debugvg
debugbin/gs -sOutputFile=/dev/null -dMaxBitmap=400000000 -sDEVICE=ppmraw
-r300 -Z: -dNOPAUSE -dBATCH -K2000000 -dClusterJob out2.ps

cause a read of uninitialised data in cmd_compress_bitmap.

Painstaking debugging shows that the problem is due to an overread
at the end of a bitmap line.

cmd_put_bits is called with 408 bits of bitmap data. This passes the
details into clist_bitmap_bytes, and is told that uncompressed_raster
should be 448 bits.

It then passes this side into cmd_compress_bitmap, which causes the
buffer overread.

The interesting point is that this call is:

status = cmd_compress_bitmap((stream_state *) & sstate, data,
uncompressed_raster << 3 /*width_bits */ ,
raster, height, &w);

which suggests that at some point in the past we were passing the
correct value of width_bits in, and we then changed to passing
the wrong width in.

Sadly, there is no hint in the commit record as to WHY this changed.
This line dates back to the earliest commit we have in source control
in 1998, so it looks like it hasn't changed for a while.

This is only the first part of the problem, though; once in
cmd_compress_bitmap, the value is fed into bitmap_raster() which again
rounds it up so it reads off the end of the defined data.

We therefore rework cmd_compress_bitmap. We specifically only compress
the actual bits of data that we have, and ensure that any padding bits
(or bytes) are correctly sent as constant zeros.

As well as assugaging valgrind, and preventing potential genuine
(if unlikely) buffer overreads, this ensures that we should get
repeatable results on each successive run.

base/gxclbits.c


2019-01-23 16:13:17 +0000
Robin Watts <robin.watts@artifex.com>
f78601f3d8df7ed16550d834cbf2c440804a6f41

Rework RunLengthEncoder.

The existing RunLengthEncoder relies on being able to read ahead
a few bytes, and then decide that it wants to ask the caller for
more data.

Unfortunately, this means that the clist cmd_compress_bitmap routine
can only call it in the "here is all the data in a solid block" case,
not in the "here is the data a line at a time" case.

This will become even more of a limitation when I rework
cmd_compress_bitmap to avoid overrun reads in a future commit.

The primary difference here is that we never backtrack on our reads
within the compression routine. We keep the last 1, 2 or 3 bytes
read in the state as n0, n1 and n2, and we insert literal bytes into a
array within the state for copying out later.

Because we now allow cmd_compress_bitmap to run in cases when it
didn't before, we trip over a bug in there. If height > 0 and
raster < width_bytes (for instance when raster = 0, so we can repeat
the same line several times), on 64bit builds the pointer
arithmetic goes wrong, and we end up accessing illegal memory.
Fix with a simple cast to int.

base/gxclbits.c
base/srle.c
base/srlx.h


2019-01-28 09:37:36 +0000
Ken Sharp <ken.sharp@artifex.com>
290ad1e4321ee46d34e7f6fdc6936e909092f7d5

txtwrite - forcibly disable interpolation

Bug #700525 "/unknownerror in --imagemask-- on txtwrite device"

If we have interpolation on, and we get an imagemask, then the rendering
code tries to use get_bits() to perform the interpolation. This
obviously doesn't work with a non-rendering device.

The simplest solution is to disable interpolation, which isn't in any
even useful on a non-rendering device.

devices/vector/gdevtxtw.c


2019-01-17 15:11:56 -0800
Nancy Durgin <nancy.durgin@artifex.com>
946025aa4219d2a386ff0ca5b48e7be71d86b81f

Undef/hide internal operators in gs_typ42.ps

Undef internal .type42build, only used locally.

Make %Type42BuildChar and %Type42BuidlGlyph executeonly to properly hide
.type42execchar.

Resource/Init/gs_typ42.ps


2019-01-17 14:28:28 -0800
Nancy Durgin <nancy.durgin@artifex.com>
9be4230804851ee1cba0aebc97e98f12bc885593

Undef/hide internal operators from gs_type1.ps

/.loadfont1 -- used locally, rearranged code so def is before use
/.type1build -- end of file has some optional code (it may skip to EOF),
so I just undef'd it in gs_init.ps

Made %Type1BuildChar, %Type1BuildGlyph, %Type2BuildChar, %Type2BuildGlyph
executeonly to properly hide .type1execchar and .type2execchar.

Resource/Init/gs_init.ps
Resource/Init/gs_type1.ps


2019-01-17 12:18:26 -0800
Nancy Durgin <nancy.durgin@artifex.com>
e6feb75ec94d7102440a2b86ce16841b3e3023af

Undef/hide internal operators in gs_cidfn.ps

/.checkfonttype
/.loadcidfontresource
/.readglyphdata

Make %Type9BuildGlyph and %Type11BuildGlyph funcs executeonly to
properly hide the '.type*execchar' operators that they call.

Resource/Init/gs_cidfn.ps


2019-01-17 09:31:17 -0800
Nancy Durgin <nancy.durgin@artifex.com>
95ac05d50f5af5f81f0ab2e0e0731a65ad59085e

undef .composefontdict from gs_cmap.ps

Resource/Init/gs_cmap.ps
Resource/Init/gs_init.ps


2019-01-16 12:55:22 -0800
Nancy Durgin <nancy.durgin@artifex.com>
2905c901244a3c105560a48ae3047196961920d7

Undef internal operators from gs_cff.ps

- rearranged some code in gs_cff.ps to have things defined before used
- /.init_wOFF_otto_font_file is only used locally, undef right after use
- /.init_otto_font_file is used by pdf_fonts.ps, undef in gs_init.ps

/.init_otto_font_file was being defined after it was used, because
gs_cff.ps was run after pdf_fonts.ps. Need to define before using, in
order to be able to undef, so had to change psi/int.mak to load
gs_cff.ps before pdf_fonts.ps. Also moved around the cff.dev dependencies
accordingly.

NOTE: To see what order the files will be loaded, you can look at
obj/iconfig.h which is generated by the makefile magic. You can also
look at the INITFILES array in gs_init.ps, which the stuff in
iconfig.h eventually generates.

Resource/Init/gs_cff.ps
Resource/Init/gs_init.ps
psi/int.mak


2019-01-23 12:00:30 -0800
Nancy Durgin <nancy.durgin@artifex.com>
e7ff64cf9b756278f19c87d295ee0fd95c955c05

Fixed bug caused by the way .checksetparams was undef'd

Previously, had undef'd it by making it an operator.
Now just use an immediate reference and undef it in the gs_lev2.ps file.

This fixes bug introduced in commit fe4c47d8e25d6366ecbb5ff487348148b908a89e.

Undef'ing .checksetparams by making it an operator doesn't work right because
errors report .checksetparams as the offending function instead of
the operator that uses it (setsystemparams in this case).

This caused an error in file /tests_private/ps/ps3cet/27-09.PS on page 3,
where it reports the offending function of some error-handling tests.
Reporting function should be 'setsystemparams', not '.checksetparams' on
this page.

Resource/Init/gs_init.ps
Resource/Init/gs_lev2.ps


2019-01-24 15:33:37 +0000
Ken Sharp <ken.sharp@artifex.com>
e51c447b690c233b6299e68f9c031a32c61cc263

pdfwrite - detecting duplicate images, check for pending masks

Bug #700495 "gs/gpdl difference with pdfwrite"

This exhibits with gpdl but not gs because, for some unknown reason, the
MD5 sums from gpdl differ in a few cases from those returned by GS,
I have no idea why.

But that's not the problem, so I'm ignoring it for now.

The real problem is that when we have an image which has an associated
Mask or SMask, when checking to see if it is a duplicate of a prior
image, we were not checking to see if the prior image also had a Mask
or SMask (as appropriate) which could lead to us emitting an image
with a missing mask.

We cater for that now in smask_image_check. Also not strictly part of
this problem, when we did add a Mask or SMask to a stream cos object, we
didn't invalidate its MD5, which could mean it would match a later image
when it should not. So set the md5_valid flag to 0 when we add a mask
entry to the cos object.

On the cluster this show progressions with two files, image-qa.ps and
692217.pdf (drop shadows were previously missing)

Note that the previous output for image-qa.ps was incorrect with both
gs *and* gpdl.

devices/vector/gdevpdfi.c
devices/vector/gdevpdfj.c


2019-01-24 08:45:51 +0000
Chris Liddell <chris.liddell@artifex.com>
3c952a9bde27766af4832435e62fcb659df1ee1f

Bug 700500: Check Type 3 fonts for transparency

The transparency checking code didn't check Type 3 font resources for
transparency settings, thus we could miss those, and fail to push the
compositor device.

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


2019-01-23 18:59:19 -0800
Michael Vrhel <michael.vrhel@artifex.com>
f5cb0ef75fc11bb65a63a1af35ee2edc94656bb4

Bug 693787 Valgrind issue

An error code was not returned when it was encountered
leading to the use of uninitialized values.

base/gxshade4.c


2019-01-23 11:52:19 -0800
Michael Vrhel <michael.vrhel@artifex.com>
aad16609bbc3476c56fa8ab8b52b64c1653594d4

Bug 693816 Valgrind issue

During CMYK color space install unset the device color
to ensure that any of the overprint checking is not
invoked with unknown values.

psi/zcolor.c


2019-01-22 13:34:32 -0800
Michael Vrhel <michael.vrhel@artifex.com>
4cf03307489c9c27da77607821598ded1aa14e73

Bug 694243 Valgrind issue

During the creation of the transparency buffer information we were
exiting if the width or height were zero. We needed to fill in
a few more items (like the width and the height) before doing so
as they are tested elsewhere.

base/gdevp14.c


2019-01-11 13:36:36 +0000
Chris Liddell <chris.liddell@artifex.com>
49c8092da88ef6bb0aa281fe294ae0925a44b5b9

Remove .forcedef, and harden .force* ops more

Remove .forcedef and replace all uses with a direct call to .forceput instead.

Ensure every procedure (named and trasient) that calls .forceput is
executeonly.

Resource/Init/gs_dps1.ps
Resource/Init/gs_init.ps
Resource/Init/gs_lev2.ps
Resource/Init/gs_ll3.ps
Resource/Init/gs_res.ps
Resource/Init/gs_statd.ps


2019-01-09 14:24:07 +0000
Chris Liddell <chris.liddell@artifex.com>
2768d1a6dddb83f5c061207a7ed2813999c1b5c9

Undefine a bunch of gs_fonts.ps specific procs

Also reorder and add some immediate evaluation, so it still works with the
undefining.

Resource/Init/gs_dps1.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_res.ps


2018-12-18 10:42:10 +0000
Chris Liddell <chris.liddell@artifex.com>
59d8f4deef90c1598ff50616519d5576756b4495

Harden some uses of .force* operators

by adding a few immediate evalutions

Resource/Init/gs_dps1.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps


2018-12-15 09:08:32 +0000
Chris Liddell <chris.liddell@artifex.com>
99f13091a3f309bdc95d275ea9fec10bb9f42d9a

Bug700317: Fix logic for an older change

Unlike almost every other function in gs, dict_find_string() returns 1 on
success 0 or <0 on failure. The logic for this case was wrong.

psi/interp.c


2018-12-13 15:28:34 +0000
Chris Liddell <chris.liddell@artifex.com>
2db98f9c66135601efb103d8db7d020a672308db

Any transient procedures that call .force* operators

(i.e. for conditionals or loops) make them executeonly.

Resource/Init/gs_diskn.ps
Resource/Init/gs_dps1.ps
Resource/Init/gs_fntem.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps
Resource/Init/gs_lev2.ps
Resource/Init/gs_pdfwr.ps
Resource/Init/gs_res.ps
Resource/Init/gs_setpd.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


2018-12-05 12:22:13 +0000
Chris Liddell <chris.liddell@artifex.com>
13b0a36f8181db66a91bcc8cea139998b53a8996

Sanitize op stack for error conditions

We save the stacks to an array and store the array for the error handler to
access.

For SAFER, we traverse the array, and deep copy any op arrays (procedures). As
we make these copies, we check for operators that do *not* exist in systemdict,
when we find one, we replace the operator with a name object (of the form
"/--opname--").

psi/int.mak
psi/interp.c
psi/istack.c
psi/istack.h


2019-01-23 11:45:16 +0000
Ken Sharp <ken.sharp@artifex.com>
c47512e5e638d903d69925f7ebab4de2aa3f481f

pdfwrite - sort out a type confusion

Bug #700490 "gs_text_enum_t used as pdf_text_enum_t"

There seems to have been 2 sources of confusion here; this falls into
the 'how did this ever work' category.

The problem only occurs when we are forced to go to a bitmap font, which
for PostScript and PDF input is very rare, but for PCL there are several
font types we cannot support and so we must make bitmapped fonts for
them.

We use a pointer in the pdfwrite device structure to store a pointer to
the text enumerator, but we store the *wrong* enumerator. We store
pte_default, which is the enumerator we just created for the standard
test processing. We don't need to store that one, its available as the
argument to all the procedures. What we need access to is the original
text enumerator, the pdfwrite one, and its that one we should be storing
in the device structure.

There was similar confusion in pdf_text_set_cache, which set penum to
'pte' casting it to a pdf_text_enum * in the process. This is clearly
wrong in the case of making a bitmap font, because we made a standard
text enumerator and passed that in, so 'pte' won't be a pdf text
enumerator.

Now it is possible to exercise a different code path and arrive at
pdf_text_set_cache with a pdf_text_enumerator. There is no other way
to arrive here.

So we check pdev->pte (where we would have stored the original pdf
text enumerator) and if its not NULL we use it as a pdf text enumerator.
If it is NULL, then we believe the enumerator pte should he a pdf
text enumerator and cast it as such. Also add a check to ensure that
the enumerator from the arguments *is* a pdf_text enumerator to avoid
this confusion in future.

Finally, clean up a couple of minor compiler warnings in passing.

devices/vector/gdevpdtt.c


2019-01-22 17:31:33 +0000
Robin Watts <robin.watts@artifex.com>
79589242c72d432f06c7a5f545989362564ab57e

Add a couple of helpful perl scripts for valgrind testing.

vdb.pl automates the running of valgrind jobs under gdb, and
multiplexes the output from valgrind and gdb together.

vgbatch.pl automates the running of a list of "cluster like"
tests under valgrind.

toolbin/vdb.pl
toolbin/vgbatch.pl


2019-01-21 16:57:10 +0000
Robin Watts <robin.watts@artifex.com>
882343089e6c9ec2a4ce574cd719.501706b2f21

Fix valgrind problem in pdfwrite.

The following command:

gs -sOutputFile=out2.ps -dMaxBitmap=400000000 -sDEVICE=ps2write -r72
-Z: -dNOPAUSE -dBATCH -K2000000 -dClusterJob
/home/marcos/cluster/tests_private/comparefiles/Bug690837.pdf

shows problems where we call dash_pattern_eq on uninitialised data.

It looks very much to me like pdf_load_viewer_state fails to copy
the dash data, despite allocating space for it. We fix that here.

Also, we never check whether the allocation fails or not. Add some
error checking.

devices/vector/gdevpdfg.c


2019-01-19 12:45:45 +0000
Robin Watts <robin.watts@artifex.com>
f612df16597bbae73707d0dc9a90235b3de26c6e

Preemptively fix more potential valgrind problems.

Again, while we know that a+b = a|b when (a&b)==0 (ignoring
overflow), valgrind is not that smart, and can hence incorrectly
get undefinedness calculations wrong.

Fix cases in gdevm2 that look wrong, in the same way as the
previous commit fixed gdevm1.

base/gdevm2.c


2019-01-19 04:32:18 -0800
Robin Watts <Robin.Watts@artifex.com>
d1a355ecf8adfce6758638aa79bc9f5338fc1e64

Bug 693784: Tweak copy_mono code for valgrind.

We are smart enough to know that doing a+b is the same as
doing a|b when (a&b)=0 (ignoring overflow). Valgrind is not.

Accordingly our "bit fetching and skewing" code, when run
under valgrind can introduce spurious "undefined" status
to bits when it should not.

The fix is just to use | when we really mean |.

This makes:

debugbin/gs -sOutputFile=out.pkm -dMaxBitmap=400000000
-sDEVICE=pkmraw -r300 -sDEFAULTPAPERSIZE=letter
-dNOPAUSE -dBATCH -K1000000 -dClusterJob -dJOBSERVER
tests/Ghent_V3.0/010_CMYK_OP_x3.pdf

run to completion with no valgrind warnings.

base/gdevm1.c


2019-01-17 14:27:07 +0000
Robin Watts <robin.watts@artifex.com>
8176af6bdcf8c9d3e80862965d02ed4e71b02236

Bug 693747: Fix valgrind problem.

In the image scaling code, we use interpolate_scaled_expanded_height
to calculate a value that will only be used if abs_interp_limit > 1.

The setup code only bothers to initialise the values used for this
calculation if abs_interp_limit > 1, hence valgrind complains that
this is using undefined values.

The simple fix is to only calculate the values if they might be
used.

base/gxiscale.c


2019-01-16 17:56:39 +0000
Robin Watts <robin.watts@artifex.com>
1d0582d65fcb8760628c80a25cd0ff6a0d2db65b

GPDL: Tweak PS device init for subclassing.

Subclassing doesn't work with gpdl. For example:

gpdl -sDEVICE=pdfwrite -o out.pdf -dFirstPage=3 lib/image-qa.ps

The device is correctly subclassed on an open, but then we use
zcurrentoutputdevice to find the device for us to setdevice it.
This finds the childmost (i.e. pdfwrite) device, rather than
first_lastpage.

Here, we use zcurrentdevice instead.

psi/imain.c


2019-01-16 15:34:53 +0000
Robin Watts <robin.watts@artifex.com>
6cee9657ff63ed555e6092f7eded544189d078d5

Valgrind: tweak sample_unpack functions to avoid false positive UMRs.

The "sample_unpack" template functions rely on unpacking whole
bytes at a time. Sometimes, the ends of these buffers of bytes
may have bits that are (intentionally, and permissibly) undefined.

Update the code so that in PACIFY_VALGRIND builds we cope with
these undefined bits, and carry the undefinedness over into the
output.

base/gxsamplp.h


2019-01-16 15:10:56 +0000
Chris Liddell <chris.liddell@artifex.com>
4cf2ad7ad15bd52472a342c979bdd48315c43155

Update source/header file copyright notice to 2019

Makefile.in
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/claptrap-impl.h
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_wpapr.c
base/gp_wsync.c
base/gp_wutf8.c
base/gp_wxpsprn.cpp
base/gpcheck.h
base/gpgetenv.h
base/gpmisc.c
base/gpmisc.h
base/gpsync.h
base/gs.mak
base/gs_dll_call.h
base/gs_mgl_e.h
base/gs_mro_e.h
base/gsalloc.c
base/gsalloc.h
base/gsalpha.c
base/gsalpha.h
base/gsalphac.c
base/gsalphac.h
base/gsargs.c
base/gsargs.h
base/gsbitcom.c
base/gsbitmap.h
base/gsbitops.c
base/gsbitops.h
base/gsbittab.c
base/gsbittab.h
base/gsccode.h
base/gsccolor.h
base/gscdef.c
base/gscdefs.h
base/gscdevn.c
base/gscdevn.h
base/gscedata.c
base/gscedata.h
base/gscencs.c
base/gscencs.h
base/gschar.c
base/gschar.h
base/gschar0.c
base/gscicach.c
base/gscicach.h
base/gscie.c
base/gscie.h
base/gsciemap.c
base/gscindex.h
base/gsclipsr.c
base/gsclipsr.h
base/gscms.h
base/gscolor.c
base/gscolor.h
base/gscolor1.c
base/gscolor1.h
base/gscolor2.c
base/gscolor2.h
base/gscolor3.c
base/gscolor3.h
base/gscompt.h
base/gscoord.c
base/gscoord.h
base/gscparam.c
base/gscpixel.c
base/gscpixel.h
base/gscpm.h
base/gscrd.c
base/gscrd.h
base/gscrdp.c
base/gscrdp.h
base/gscrypt1.c
base/gscrypt1.h
base/gscscie.c
base/gscsel.h
base/gscsepr.c
base/gscsepr.h
base/gscspace.c
base/gscspace.h
base/gscssub.c
base/gscssub.h
base/gsdcolor.h
base/gsdevice.c
base/gsdevice.h
base/gsdevmem.c
base/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/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/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