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

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:28: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>
cea599bca413609c288a43c7b1d765b53f200083

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>
829a8c85112193116f39928568e8bf56138b7410

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>
882343089e6c9ec2a4ce574cd7198281706b2f21

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
base/gxdhtres.h
base/gxdhtserial.c
base/gxdhtserial.h
base/gxdither.h
base/gxdownscale.c
base/gxdownscale.h
base/gxdtfill.h
base/gxfapi.c
base/gxfapi.h
base/gxfapiu.c
base/gxfapiu.h
base/gxfarith.h
base/gxfcache.h
base/gxfcid.h
base/gxfcmap.h
base/gxfcmap1.h
base/gxfill.c
base/gxfill.h
base/gxfillsl.h
base/gxfilltr.h
base/gxfillts.h
base/gxfixed.h
base/gxfmap.h
base/gxfont.h
base/gxfont0.h
base/gxfont0c.h
base/gxfont1.h
base/gxfont42.h
base/gxfrac.h
base/gxftype.h
base/gxfunc.h
base/gxgetbit.h
base/gxgstate.h
base/gxhintn.c
base/gxhintn.h
base/gxhintn1.c
base/gxhldevc.c
base/gxhldevc.h
base/gxht.c
base/gxht.h
base/gxht_thresh.c
base/gxht_thresh.h
base/gxhtbit.c
base/gxhttile.h
base/gxhttype.h
base/gxi12bit.c
base/gxi16bit.c
base/gxiclass.h
base/gxicolor.c
base/gxidata.c
base/gxifast.c
base/gximag3x.c
base/gximag3x.h
base/gximage.c
base/gximage.h
base/gximage1.c
base/gximage3.c
base/gximage3.h
base/gximage4.c
base/gximask.c
base/gximask.h
base/gximono.c
base/gxiodev.h
base/gxiparam.h
base/gxipixel.c
base/gxiscale.c
base/gxline.h
base/gxlum.h
base/gxmatrix.h
base/gxmclip.c
base/gxmclip.h
base/gxobj.h
base/gxoprect.c
base/gxoprect.h
base/gxp1fill.c
base/gxp1impl.h
base/gxpaint.c
base/gxpaint.h
base/gxpath.c
base/gxpath.h
base/gxpath2.c
base/gxpcache.h
base/gxpcmap.c
base/gxpcolor.h
base/gxpcopy.c
base/gxpdash.c
base/gxpflat.c
base/gxrplane.h
base/gxsample.c
base/gxsample.h
base/gxsamplp.h
base/gxscanc.c
base/gxscanc.h
base/gxshade.c
base/gxshade.h
base/gxshade1.c
base/gxshade4.c
base/gxshade4.h
base/gxshade6.c
base/gxstate.h
base/gxstdio.h
base/gxstroke.c
base/gxsync.c
base/gxsync.h
base/gxtext.h
base/gxtmap.h
base/gxttf.h
base/gxttfb.c
base/gxttfb.h
base/gxtype1.c
base/gxtype1.h
base/gxxfont.h
base/gzacpath.h
base/gzcpath.h
base/gzht.h
base/gzline.h
base/gzpath.h
base/gzspotan.c
base/gzspotan.h
base/gzstate.h
base/ijs.mak
base/instcopy
base/jbig2.mak
base/jerror_.h
base/jmemcust.c
base/jmemcust.h
base/jpeg.mak
base/jpegxr.mak
base/lcms2.mak
base/lcms2mt.mak
base/lcups.mak
base/lcupsi.mak
base/ldf_jb2.mak
base/lib.mak
base/locale_.h
base/lwf_jp2.mak
base/malloc_.h
base/math_.h
base/memory_.h
base/mkromfs.c
base/msvccmd.mak
base/msvclib.mak
base/msvctail.mak
base/openjpeg.mak
base/openvms.mak
base/openvms.mmk
base/pack_ps.c
base/pcwin.mak
base/pipe_.h
base/png.mak
base/png_.h
base/ramfs.c
base/ramfs.h
base/sa85d.c
base/sa85d.h
base/sa85x.h
base/saes.c
base/saes.h
base/sarc4.c
base/sarc4.h
base/sbcp.c
base/sbcp.h
base/sbtx.h
base/scanchar.h
base/scantab.c
base/scf.h
base/scfd.c
base/scfdgen.c
base/scfdtab.c
base/scfe.c
base/scfetab.c
base/scfparam.c
base/scfx.h
base/scommon.h
base/sdcparam.c
base/sdcparam.h
base/sdct.h
base/sdctc.c
base/sdctd.c
base/sdcte.c
base/sddparam.c
base/sdeparam.c
base/seexec.c
base/setjmp_.h
base/sfilter.h
base/sfilter1.c
base/sfilter2.c
base/sfxboth.c
base/sfxcommon.c
base/sfxfd.c
base/sfxstdio.c
base/shc.c
base/shc.h
base/sidscale.c
base/sidscale.h
base/siinterp.c
base/siinterp.h
base/simscale.c
base/simscale.h
base/siscale.c
base/siscale.h
base/sisparam.h
base/sjbig2.c
base/sjbig2.h
base/sjbig2_luratech.c
base/sjbig2_luratech.h
base/sjpeg.h
base/sjpegc.c
base/sjpegd.c
base/sjpege.c
base/sjpx_luratech.c
base/sjpx_luratech.h
base/sjpx_none.c
base/sjpx_openjpeg.c
base/sjpx_openjpeg.h
base/slzwc.c
base/slzwd.c
base/slzwe.c
base/slzwx.h
base/smd5.c
base/smd5.h
base/smtf.h
base/spdiff.c
base/spdiffx.h
base/spngp.c
base/spngpx.h
base/spprint.c
base/spprint.h
base/spsdf.c
base/spsdf.h
base/srdline.h
base/srld.c
base/srle.c
base/srlx.h
base/ssha2.c
base/ssha2.h
base/sstring.c
base/sstring.h
base/stat_.h
base/std.h
base/stdint_.h
base/stdio_.h
base/stdpre.h
base/stream.c
base/stream.h
base/strimpl.h
base/string_.h
base/strmio.c
base/strmio.h
base/stub.mak
base/szlibc.c
base/szlibd.c
base/szlibe.c
base/szlibx.h
base/szlibxx.h
base/tiff.mak
base/time_.h
base/ttcalc.c
base/ttcalc.h
base/ttcommon.h
base/ttconf.h
base/ttconfig.h
base/ttfinp.c
base/ttfinp.h
base/ttfmain.c
base/ttfmemd.c
base/ttfmemd.h
base/ttfoutl.h
base/ttfsfnt.h
base/ttinterp.c
base/ttinterp.h
base/ttload.c
base/ttload.h
base/ttmisc.h
base/ttobjs.c
base/ttobjs.h
base/tttables.h
base/tttype.h
base/tttypes.h
base/ugcclib.mak
base/unistd_.h
base/unix-aux.mak
base/unix-dll.mak
base/unix-end.mak
base/unix-gcc.mak
base/unixansi.mak
base/unixhead.mak
base/unixinst.mak
base/unixlink.mak
base/valgrind.h
base/version.mak
base/vms_x_fix.h
base/vmsmath.h
base/windows_.h
base/winlib.mak
base/winplat.mak
base/winrtsup.cpp
base/winrtsup.h
base/wrfont.c
base/wrfont.h
base/write_t1.c
base/write_t1.h
base/write_t2.c
base/write_t2.h
base/x_.h
base/zlib.mak
configure.ac
devices/contrib.mak
devices/devs.mak
devices/gdev3852.c
devices/gdev4081.c
devices/gdev8510.c
devices/gdev8bcm.c
devices/gdev8bcm.h
devices/gdevatx.c
devices/gdevbit.c
devices/gdevbj10.c
devices/gdevbjc.h
devices/gdevbjcl.c
devices/gdevbjcl.h
devices/gdevbmp.c
devices/gdevbmp.h
devices/gdevbmpc.c
devices/gdevccr.c
devices/gdevcdj.c
devices/gdevcfax.c
devices/gdevchameleon.c
devices/gdevcif.c
devices/gdevclj.c
devices/gdevcljc.c
devices/gdevcmykog.c
devices/gdevcslw.c
devices/gdevdfax.c
devices/gdevdjet.c
devices/gdevdjtc.c
devices/gdevdljm.c
devices/gdevdljm.h
devices/gdevdm24.c
devices/gdevdsp.c
devices/gdevdsp.h
devices/gdevdsp2.h
devices/gdevepsc.c
devices/gdevepsn.c
devices/gdevescp.c
devices/gdevfax.c
devices/gdevfax.h
devices/gdevfpng.c
devices/gdevgprf.c
devices/gdevhl7x.c
devices/gdevicov.c
devices/gdevijs.c
devices/gdevimgn.c
devices/gdevjbig2.c
devices/gdevjpeg.c
devices/gdevjpx.c
devices/gdevl31s.c
devices/gdevlbp8.c
devices/gdevlj56.c
devices/gdevlp8k.c
devices/gdevlxm.c
devices/gdevmeds.c
devices/gdevmeds.h
devices/gdevmgr.c
devices/gdevmgr.h
devices/gdevmiff.c
devices/gdevn533.c
devices/gdevo182.c
devices/gdevokii.c
devices/gdevpbm.c
devices/gdevpcl.c
devices/gdevpcl.h
devices/gdevpcx.c
devices/gdevpe.c
devices/gdevperm.c
devices/gdevphex.c
devices/gdevpjet.c
devices/gdevplan.c
devices/gdevplib.c
devices/gdevplib.h
devices/gdevpm.h
devices/gdevpng.c
devices/gdevpsd.c
devices/gdevpsd.h
devices/gdevpsim.c
devices/gdevpxut.c
devices/gdevpxut.h
devices/gdevrinkj.c
devices/gdevsj48.c
devices/gdevsnfb.c
devices/gdevsppr.c
devices/gdevstc.c
devices/gdevstc.h
devices/gdevstc1.c
devices/gdevstc2.c
devices/gdevstc3.c
devices/gdevstc4.c
devices/gdevtfax.c
devices/gdevtfax.h
devices/gdevtfnx.c
devices/gdevtifs.c
devices/gdevtifs.h
devices/gdevtknk.c
devices/gdevtrac.c
devices/gdevtsep.c
devices/gdevupd.c
devices/gdevwpr2.c
devices/gdevx.c
devices/gdevx.h
devices/gdevxalt.c
devices/gdevxcf.c
devices/gdevxcmp.c
devices/gdevxcmp.h
devices/gdevxini.c
devices/gdevxres.c
devices/gxfcopy.c
devices/gxfcopy.h
devices/minftrsz.c
devices/minftrsz.h
devices/rinkj/evenbetter-rll.c
devices/rinkj/evenbetter-rll.h
devices/rinkj/rinkj-byte-stream.c
devices/rinkj/rinkj-byte-stream.h
devices/rinkj/rinkj-config.c
devices/rinkj/rinkj-config.h
devices/rinkj/rinkj-device.c
devices/rinkj/rinkj-device.h
devices/rinkj/rinkj-dither.c
devices/rinkj/rinkj-dither.h
devices/rinkj/rinkj-epson870.c
devices/rinkj/rinkj-epson870.h
devices/rinkj/rinkj-screen-eb.c
devices/rinkj/rinkj-screen-eb.h
devices/vector/gdevagl.c
devices/vector/gdevagl.h
devices/vector/gdevpdf.c
devices/vector/gdevpdfb.c
devices/vector/gdevpdfb.h
devices/vector/gdevpdfc.c
devices/vector/gdevpdfc.h
devices/vector/gdevpdfd.c
devices/vector/gdevpdfe.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfg.h
devices/vector/gdevpdfi.c
devices/vector/gdevpdfj.c
devices/vector/gdevpdfk.c
devices/vector/gdevpdfm.c
devices/vector/gdevpdfo.c
devices/vector/gdevpdfo.h
devices/vector/gdevpdfp.c
devices/vector/gdevpdfr.c
devices/vector/gdevpdft.c
devices/vector/gdevpdfu.c
devices/vector/gdevpdfv.c
devices/vector/gdevpdfx.h
devices/vector/gdevpdt.c
devices/vector/gdevpdt.h
devices/vector/gdevpdtb.c
devices/vector/gdevpdtb.h
devices/vector/gdevpdtc.c
devices/vector/gdevpdtd.c
devices/vector/gdevpdtd.h
devices/vector/gdevpdte.c
devices/vector/gdevpdtf.c
devices/vector/gdevpdtf.h
devices/vector/gdevpdti.c
devices/vector/gdevpdti.h
devices/vector/gdevpdts.c
devices/vector/gdevpdts.h
devices/vector/gdevpdtt.c
devices/vector/gdevpdtt.h
devices/vector/gdevpdtv.c
devices/vector/gdevpdtv.h
devices/vector/gdevpdtw.c
devices/vector/gdevpdtw.h
devices/vector/gdevpdtx.h
devices/vector/gdevpsdf.h
devices/vector/gdevpsdi.c
devices/vector/gdevpsdp.c
devices/vector/gdevpsds.c
devices/vector/gdevpsds.h
devices/vector/gdevpsdu.c
devices/vector/gdevpsf.h
devices/vector/gdevpsf1.c
devices/vector/gdevpsf2.c
devices/vector/gdevpsfm.c
devices/vector/gdevpsft.c
devices/vector/gdevpsfu.c
devices/vector/gdevpsfx.c
devices/vector/gdevpsu.c
devices/vector/gdevpsu.h
devices/vector/gdevpx.c
devices/vector/gdevtxtw.c
devices/vector/gdevxps.c
devices/vector/opdfread.ps
devices/vector/whitelst.c
devices/vector/whitelst.h
gpdl/gpdl.mak
gpdl/psi/gpdlpsi.mak
gpdl/psi/psitop.c
gpdl/pspcl6_gcc.mak
gpdl/pspcl6_msvc.mak
ijs/Makefile.am
ijs/configure.ac
ijs/ijs.c
ijs/ijs.h
ijs/ijs_client.c
ijs/ijs_client.h
ijs/ijs_client_example.c
ijs/ijs_exec_unix.c
ijs/ijs_exec_win.c
ijs/ijs_server.c
ijs/ijs_server_example.c
ijs/unistd_.h
ios/ios_arch-arm.h
ios/ios_arch-x86.h
jbig2dec/config_win32.h
jbig2dec/jbig2.c
jbig2dec/jbig2.h
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith.h
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_arith_iaid.h
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_arith_int.h
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_generic.h
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_halftone.h
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_huffman.h
jbig2dec/jbig2_hufftab.h
jbig2dec/jbig2_image.c
jbig2dec/jbig2_image.h
jbig2dec/jbig2_image_pbm.c
jbig2dec/jbig2_image_png.c
jbig2dec/jbig2_image_rw.h
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_mmr.h
jbig2dec/jbig2_page.c
jbig2dec/jbig2_page.h
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_refinement.h
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_segment.h
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_symbol_dict.h
jbig2dec/jbig2_text.c
jbig2dec/jbig2_text.h
jbig2dec/jbig2dec.c
jbig2dec/memcmp.c
jbig2dec/os_types.h
jbig2dec/pbm2png.c
lib/FCOfontmap-PCLPS3
lib/FCOfontmap-PS3
lib/Fontmap.ATB
lib/Fontmap.ATM
lib/Fontmap.OS2
lib/Fontmap.SGI
lib/Fontmap.Sol
lib/Fontmap.URW-136.T1
lib/Fontmap.URW-136.TT
lib/Fontmap.Ult
lib/Fontmap.VMS
lib/align.ps
lib/caption.ps
lib/cat.ps
lib/cid2code.ps
lib/docie.ps
lib/font2pcl.ps
lib/gs_ce_e.ps
lib/gs_il2_e.ps
lib/gs_kanji.ps
lib/gs_ksb_e.ps
lib/gs_lgo_e.ps
lib/gs_lgx_e.ps
lib/gs_wl1_e.ps
lib/gs_wl2_e.ps
lib/gs_wl5_e.ps
lib/gslp.ps
lib/gsnup.ps
lib/image-qa.ps
lib/jispaper.ps
lib/lines.ps
lib/mkcidfm.ps
lib/pdf2dsc.ps
lib/pfbtopfa.ps
lib/ppath.ps
lib/pphs.ps
lib/prfont.ps
lib/ps2ai.ps
lib/ps2epsi.ps
lib/rollconv.ps
lib/stcinfo.ps
lib/stcolor.ps
lib/stocht.ps
lib/traceimg.ps
lib/traceop.ps
lib/uninfo.ps
lib/viewcmyk.ps
lib/viewgif.ps
lib/viewmiff.ps
lib/viewpbm.ps
lib/viewpcx.ps
lib/viewps2a.ps
lib/viewraw.ps
lib/viewrgb.ps
lib/winmaps.ps
lib/zeroline.ps
pcl/pcl/pcbiptrn.c
pcl/pcl/pcbiptrn.h
pcl/pcl/pccid.c
pcl/pcl/pccid.h
pcl/pcl/pccolor.c
pcl/pcl/pccoord.h
pcl/pcl/pccprint.c
pcl/pcl/pccsbase.c
pcl/pcl/pccsbase.h
pcl/pcl/pcdict.h
pcl/pcl/pcdither.c
pcl/pcl/pcdither.h
pcl/pcl/pcdraw.c
pcl/pcl/pcdraw.h
pcl/pcl/pcfont.c
pcl/pcl/pcfont.h
pcl/pcl/pcfontpg.c
pcl/pcl/pcfontst.h
pcl/pcl/pcfrgrnd.c
pcl/pcl/pcfrgrnd.h
pcl/pcl/pcfsel.c
pcl/pcl/pcfsel.h
pcl/pcl/pcht.c
pcl/pcl/pcht.h
pcl/pcl/pcident.c
pcl/pcl/pcident.h
pcl/pcl/pcimpl.c
pcl/pcl/pcindxed.c
pcl/pcl/pcindxed.h
pcl/pcl/pcjob.c
pcl/pcl/pcl.mak
pcl/pcl/pcl_top.mak
pcl/pcl/pclookup.c
pcl/pcl/pclookup.h
pcl/pcl/pcmacros.c
pcl/pcl/pcmisc.c
pcl/pcl/pcmtx3.c
pcl/pcl/pcmtx3.h
pcl/pcl/pcommand.c
pcl/pcl/pcommand.h
pcl/pcl/pcpage.c
pcl/pcl/pcpage.h
pcl/pcl/pcpalet.c
pcl/pcl/pcpalet.h
pcl/pcl/pcparam.h
pcl/pcl/pcparse.c
pcl/pcl/pcparse.h
pcl/pcl/pcpatrn.c
pcl/pcl/pcpatrn.h
pcl/pcl/pcpattyp.h
pcl/pcl/pcpatxfm.c
pcl/pcl/pcpatxfm.h
pcl/pcl/pcrect.c
pcl/pcl/pcsfont.c
pcl/pcl/pcstate.h
pcl/pcl/pcstatus.c
pcl/pcl/pcsymbol.c
pcl/pcl/pcsymbol.h
pcl/pcl/pctext.c
pcl/pcl/pctop.c
pcl/pcl/pctop.h
pcl/pcl/pctpm.h
pcl/pcl/pcuptrn.c
pcl/pcl/pcuptrn.h
pcl/pcl/pcursor.c
pcl/pcl/pcursor.h
pcl/pcl/pcwhtidx.c
pcl/pcl/pcwhtidx.h
pcl/pcl/pcxfmst.h
pcl/pcl/pgchar.c
pcl/pcl/pgcolor.c
pcl/pcl/pgconfig.c
pcl/pcl/pgdraw.c
pcl/pcl/pgdraw.h
pcl/pcl/pgfdata.c
pcl/pcl/pgfdata.h
pcl/pcl/pgfont.c
pcl/pcl/pgfont.h
pcl/pcl/pgframe.c
pcl/pcl/pggeom.c
pcl/pcl/pggeom.h
pcl/pcl/pginit.c
pcl/pcl/pginit.h
pcl/pcl/pglabel.c
pcl/pcl/pglfill.c
pcl/pcl/pgmand.h
pcl/pcl/pgmisc.c
pcl/pcl/pgmisc.h
pcl/pcl/pgparse.c
pcl/pcl/pgpoly.c
pcl/pcl/pgstate.h
pcl/pcl/pgvector.c
pcl/pcl/rtgmode.c
pcl/pcl/rtgmode.h
pcl/pcl/rtmisc.c
pcl/pcl/rtmisc.h
pcl/pcl/rtraster.c
pcl/pcl/rtraster.h
pcl/pcl/rtrstcmp.c
pcl/pcl/rtrstcmp.h
pcl/pcl/rtrstst.h
pcl/pl/pjparse.c
pcl/pl/pjparse.h
pcl/pl/pjparsei.c
pcl/pl/pjtop.c
pcl/pl/pjtop.h
pcl/pl/pl.mak
pcl/pl/plalloc.c
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plchar.c
pcl/pl/plchar.h
pcl/pl/pldebug.h
pcl/pl/pldict.c
pcl/pl/pldict.h
pcl/pl/pldraw.c
pcl/pl/pldraw.h
pcl/pl/plfapi.c
pcl/pl/plfapi.h
pcl/pl/plfont.c
pcl/pl/plfont.h
pcl/pl/plftable.c
pcl/pl/plftable.h
pcl/pl/plht.c
pcl/pl/plht.h
pcl/pl/plimpl.c
pcl/pl/pllfont.c
pcl/pl/pllfont.h
pcl/pl/plmain.c
pcl/pl/plmain.h
pcl/pl/plparams.c
pcl/pl/plparams.h
pcl/pl/plparse.h
pcl/pl/plromfs.mak
pcl/pl/plsymbol.c
pcl/pl/plsymbol.h
pcl/pl/pltop.c
pcl/pl/pltop.h
pcl/pl/pluchar.c
pcl/pl/plufont.c
pcl/pl/plufstlp.c
pcl/pl/plufstlp.h
pcl/pl/plufstlp1.c
pcl/pl/plulfont.c
pcl/pl/plvalue.c
pcl/pl/plvalue.h
pcl/pl/plvocab.c
pcl/pl/plvocab.h
pcl/pl/plwimg.c
pcl/pl/plwimg.h
pcl/pl/plwmainc.c
pcl/pl/plwreg.c
pcl/pl/plwreg.h
pcl/pl/plwres.h
pcl/pl/realmain.c
pcl/pxl/pxasm.ps
pcl/pxl/pxattr.h
pcl/pxl/pxbfont.c
pcl/pxl/pxbfont.h
pcl/pxl/pxbfont.ps
pcl/pxl/pxcet.txt
pcl/pxl/pxdict.h
pcl/pxl/pxdiff.txt
pcl/pxl/pxenum.h
pcl/pxl/pxerrors.c
pcl/pxl/pxerrors.h
pcl/pxl/pxffont.c
pcl/pxl/pxfont.c
pcl/pxl/pxfont.h
pcl/pxl/pxfts.txt
pcl/pxl/pxgstate.c
pcl/pxl/pxgstate.h
pcl/pxl/pximage.c
pcl/pxl/pximpl.c
pcl/pxl/pxink.c
pcl/pxl/pxl.mak
pcl/pxl/pxlib.txt
pcl/pxl/pxoper.h
pcl/pxl/pxpaint.c
pcl/pxl/pxparse.c
pcl/pxl/pxparse.h
pcl/pxl/pxptable.c
pcl/pxl/pxptable.h
pcl/pxl/pxpthr.c
pcl/pxl/pxpthr.h
pcl/pxl/pxsessio.c
pcl/pxl/pxspec.txt
pcl/pxl/pxstate.c
pcl/pxl/pxstate.h
pcl/pxl/pxstream.c
pcl/pxl/pxsymbol.ps
pcl/pxl/pxsymbol.psc
pcl/pxl/pxsymbol.psh
pcl/pxl/pxtag.h
pcl/pxl/pxtop.c
pcl/pxl/pxvalue.c
pcl/pxl/pxvalue.h
pcl/tools/pxlasm.py
pcl/tools/pxldis.py
pcl/tools/suite.tcl
psi/bfont.h
psi/btoken.h
psi/dmmain.c
psi/dmmain.r
psi/dpmain.c
psi/dscparse.c
psi/dscparse.h
psi/dstack.h
psi/dwdll.c
psi/dwdll.h
psi/dwimg.c
psi/dwimg.h
psi/dwmain.c
psi/dwmain.rc
psi/dwmainc.c
psi/dwnodll.c
psi/dwreg.c
psi/dwreg.h
psi/dwres.h
psi/dwtext.c
psi/dwtext.h
psi/dwtrace.c
psi/dwtrace.h
psi/dxmain.c
psi/dxmainc.c
psi/estack.h
psi/files.h
psi/ghost.h
psi/gs.c
psi/gsdll.c
psi/gsdll2.rc
psi/gsdll32.rc
psi/gserver.c
psi/gsos2.rc
psi/ialloc.c
psi/ialloc.h
psi/iapi.c
psi/iapi.h
psi/iastate.h
psi/iastruct.h
psi/ibnum.c
psi/ibnum.h
psi/ichar.h
psi/ichar1.h
psi/icharout.h
psi/icid.h
psi/icie.h
psi/icolor.h
psi/iconf.c
psi/iconf.h
psi/icontext.c
psi/icontext.h
psi/icremap.h
psi/icsmap.h
psi/icstate.h
psi/iddict.h
psi/iddstack.h
psi/idebug.c
psi/idebug.h
psi/idict.c
psi/idict.h
psi/idictdef.h
psi/idicttpl.h
psi/idisp.c
psi/idisp.h
psi/idosave.h
psi/idparam.c
psi/idparam.h
psi/idsdata.h
psi/idstack.c
psi/idstack.h
psi/ierrors.h
psi/iesdata.h
psi/iestack.h
psi/ifapi.h
psi/ifcid.h
psi/ifilter.h
psi/ifilter2.h
psi/ifont.h
psi/ifont1.h
psi/ifont2.h
psi/ifont42.h
psi/ifrpred.h
psi/ifunc.h
psi/ifwpred.h
psi/igc.c
psi/igc.h
psi/igcref.c
psi/igcstr.c
psi/igcstr.h
psi/igstate.h
psi/iht.h
psi/iimage.h
psi/iinit.c
psi/iinit.h
psi/ilevel.h
psi/ilocate.c
psi/imain.c
psi/imain.h
psi/imainarg.c
psi/imainarg.h
psi/imemory.h
psi/iminst.h
psi/iname.c
psi/iname.h
psi/inamedef.h
psi/inameidx.h
psi/inames.h
psi/inamestr.h
psi/inobtokn.c
psi/inouparm.c
psi/int.mak
psi/interp.c
psi/interp.h
psi/iosdata.h
psi/iostack.h
psi/ipacked.h
psi/iparam.c
psi/iparam.h
psi/iparray.h
psi/ipcolor.h
psi/iplugin.c
psi/iplugin.h
psi/ireclaim.c
psi/iref.h
psi/isave.c
psi/isave.h
psi/iscan.c
psi/iscan.h
psi/iscanbin.c
psi/iscanbin.h
psi/iscannum.c
psi/iscannum.h
psi/isdata.h
psi/isstate.h
psi/istack.c
psi/istack.h
psi/istkparm.h
psi/istream.h
psi/istruct.h
psi/itoken.h
psi/iutil.c
psi/iutil.h
psi/iutil2.c
psi/iutil2.h
psi/ivmem2.h
psi/ivmspace.h
psi/main.h
psi/mkfilelt.cpp
psi/msvc.mak
psi/msvc32.mak
psi/msvc64.mak
psi/nsisinst.nsi
psi/oparc.h
psi/opcheck.h
psi/opdef.h
psi/oper.h
psi/opextern.h
psi/os2.mak
psi/ostack.h
psi/psapi.c
psi/psapi.h
psi/psromfs.mak
psi/store.h
psi/winint.mak
psi/zalg.c
psi/zarith.c
psi/zarray.c
psi/zbfont.c
psi/zbseq.c
psi/zcfont.c
psi/zchar.c
psi/zchar1.c
psi/zchar2.c
psi/zchar32.c
psi/zchar42.c
psi/zchar42.h
psi/zcharout.c
psi/zcharx.c
psi/zcid.c
psi/zcie.c
psi/zcie.h
psi/zcolor.c
psi/zcolor.h
psi/zcolor1.c
psi/zcolor2.c
psi/zcolor3.c
psi/zcontrol.c
psi/zcrd.c
psi/zcsindex.c
psi/zcspixel.c
psi/zcssepr.c
psi/zdevcal.c
psi/zdevice.c
psi/zdevice2.c
psi/zdfilter.c
psi/zdict.c
psi/zdouble.c
psi/zdps1.c
psi/zdscpars.c
psi/zfaes.c
psi/zfapi.c
psi/zfarc4.c
psi/zfbcp.c
psi/zfcid.c
psi/zfcid0.c
psi/zfcid1.c
psi/zfcmap.c
psi/zfdctd.c
psi/zfdcte.c
psi/zfdecode.c
psi/zfile.c
psi/zfile.h
psi/zfile1.c
psi/zfileio.c
psi/zfilter.c
psi/zfilter2.c
psi/zfimscale.c
psi/zfjbig2.c
psi/zfjpx.c
psi/zfmd5.c
psi/zfont.c
psi/zfont0.c
psi/zfont1.c
psi/zfont2.c
psi/zfont32.c
psi/zfont42.c
psi/zfontenum.c
psi/zform.c
psi/zfproc.c
psi/zfrsd.c
psi/zfrsd.h
psi/zfsample.c
psi/zfsha2.c
psi/zfunc.c
psi/zfunc.h
psi/zfunc0.c
psi/zfunc3.c
psi/zfunc4.c
psi/zfzlib.c
psi/zgeneric.c
psi/zgstate.c
psi/zht.c
psi/zht1.c
psi/zht2.c
psi/zht2.h
psi/zicc.c
psi/zicc.h
psi/zimage.c
psi/zimage3.c
psi/ziodev.c
psi/ziodev2.c
psi/ziodevsc.c
psi/zmath.c
psi/zmatrix.c
psi/zmedia2.c
psi/zmisc.c
psi/zmisc1.c
psi/zmisc2.c
psi/zmisc3.c
psi/zncdummy.c
psi/zpacked.c
psi/zpaint.c
psi/zpath.c
psi/zpath1.c
psi/zpcolor.c
psi/zpdf_r6.c
psi/zpdfops.c
psi/zrelbit.c
psi/zshade.c
psi/zstack.c
psi/zstring.c
psi/zsysvm.c
psi/ztoken.c
psi/ztrans.c
psi/ztrap.c
psi/ztype.c
psi/zupath.c
psi/zusparam.c
psi/zutf8.c
psi/zvmem.c
psi/zvmem2.c
psi/zwinutf8.c
toolbin/GenSubstCID.ps
toolbin/afmutil.py
toolbin/color/icc_creator/ICC_Creator/CIELAB.h
toolbin/color/icc_creator/ICC_Creator/ICC_Creator.cpp
toolbin/color/icc_creator/ICC_Creator/ICC_Creator.h
toolbin/color/icc_creator/ICC_Creator/ICC_CreatorDlg.cpp
toolbin/color/icc_creator/ICC_Creator/ICC_CreatorDlg.h
toolbin/color/icc_creator/ICC_Creator/icc_create.cpp
toolbin/color/icc_creator/ICC_Creator/icc_create.h
toolbin/color/icc_creator/README.txt
toolbin/encs2c.ps
toolbin/errlist.tcl
toolbin/extractFonts.ps
toolbin/extractICCprofiles.ps
toolbin/gen_ldf_jb2.py
toolbin/genfontmap.ps
toolbin/gitlog2changelog.py
toolbin/gsmake.tcl
toolbin/halftone/gen_ordered/gen_ordered_main.c
toolbin/halftone/gen_stochastic/gen_stochastic.c
toolbin/headers.tcl
toolbin/jpxtopdf.c
toolbin/leaks.tcl
toolbin/makehist.tcl
toolbin/memory.py
toolbin/ocheck.py
toolbin/pdf_info.ps
toolbin/pre.tcl
toolbin/precheck.tcl
toolbin/split_changelog.py
toolbin/suite.tcl
toolbin/tests/build_revision.py
toolbin/tests/check_all.py
toolbin/tests/check_comments.py
toolbin/tests/check_dirs.py
toolbin/tests/check_docrefs.py
toolbin/tests/cmpi.py
toolbin/tests/compare_checksumdb.py
toolbin/tests/compare_checksums.py
toolbin/tests/dump_checksum.py
toolbin/tests/dump_checksum_plus.py
toolbin/tests/dump_checksum_raw.py
toolbin/tests/get_baseline_log.py
toolbin/tests/get_baselines.py
toolbin/tests/gscheck_all.py
toolbin/tests/gscheck_fuzzypdf.py
toolbin/tests/gscheck_pdfwrite.py
toolbin/tests/gscheck_raster.py
toolbin/tests/gscheck_testfiles.py
toolbin/tests/gsconf.py
toolbin/tests/gsparamsets.py
toolbin/tests/gssum.py
toolbin/tests/gstestgs.py
toolbin/tests/gstestutils.py
toolbin/tests/gsutil.py
toolbin/tests/make_baselinedb.py
toolbin/tests/make_testdb.py
toolbin/tests/make_two_pdfversions
toolbin/tests/make_two_versions
toolbin/tests/myoptparse.py
toolbin/tests/rasterdb.py
toolbin/tests/revert_baseline
toolbin/tests/revert_pdfbaseline
toolbin/tests/run_nightly.py
toolbin/tests/run_parallel
toolbin/tests/run_regression.py
toolbin/tests/testdiff.py
toolbin/tests/update_baseline.py
toolbin/tests/update_specific
toolbin/tmake.tcl
xps/ghostxps.h
xps/xps.mak
xps/xpsanalyze.c
xps/xpscff.c
xps/xpscolor.c
xps/xpscommon.c
xps/xpscrc.c
xps/xpsdoc.c
xps/xpsfapi.c
xps/xpsfapi.h
xps/xpsfont.c
xps/xpsglyphs.c
xps/xpsgradient.c
xps/xpshash.c
xps/xpsimage.c
xps/xpsjpeg.c
xps/xpsjxr.c
xps/xpsmem.c
xps/xpsopacity.c
xps/xpspage.c
xps/xpspath.c
xps/xpspng.c
xps/xpsresource.c
xps/xpsromfs.mak
xps/xpstiff.c
xps/xpstile.c
xps/xpstop.c
xps/xpsttf.c
xps/xpsutf.c
xps/xpsvisual.c
xps/xpsxml.c
xps/xpszip.c


2019-01-16 08:08:28 -0800
Nancy Durgin <nancy.durgin@artifex.com>
373d83836619fe8b675b3db7235e4fee19b699fd

Fixed typo and cleaned up usage of //systemdict vs systemdict

Typo was misspelling of /.PDF_UNDEF_OPLIST

Cleaned this up to just use //systemdict and .forceundef because the
mix of uses was confusing.

Took out 'executeonly' because it's not needed (though harmless). This
procedure will have already been undef'd by the time the user gets access
to the interpreter.

Resource/Init/gs_init.ps


2019-01-15 15:30:46 -0800
Nancy Durgin <nancy.durgin@artifex.com>
9cae141e4654124379dc4738bbea4b5b6e13d37b

Added array .PDF_UNDEF_OPLIST to pdf_main.ps instead of maintaining twice

Used to maintain two different lists of operators in gs_init.ps and pdf_main.ps
for undef'ing operators that are used by pdf, in two cases of DELAYBIND or
not DELAYBIND.

This change defines the array in pdf_main.ps and just references it in
gs_init.ps.

Also added a couple operators to the pdf_main.ps list that had gotten
out of sync with the gs_init.ps one (which is why we really need just one
list...)

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


2019-01-16 14:10:01 +0000
Chris Liddell <chris.liddell@artifex.com>
5fac4ab4815b3bd86d471389357cdc7cc184f65c

Update the copyright year (2019) in the documentation

doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gdevds32.c
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm


2019-01-16 05:12:54 -0800
Robin Watts <Robin.Watts@artifex.com>
03a1e5eaf83896053fa32f68d328ff48f86d906f

Valgrind fixes.

Firstly, move entirely to HAVE_VALGRIND rather than ENABLE_VALGRIND.
My fault for having introduced 2 schemes to do the same thing in
the past.

Accordingly, move direct inclusions of memcheck/valgrind.h over to
calling our local valgrind.h header.

And finally, fix the problem that prompted all of this; in
image_simple_expand, we take 1 bit data in. The last bytes in this
data can frequently be only semi-filled, resulting in some
undefined bits. While our code to quickly skip complete bytes is
safe by construction, valgrind cannot recognise it as such, and so
signals false positive UMRs.

Work around that here by tweaking valgrinds ideas of what bits
are defined.

base/gsinit.c
base/gxclfile.c
base/gxclist.c
base/gxclmem.c
base/gxclutil.c
base/gxifast.c
base/valgrind.h
psi/imain.c


2019-01-14 12:41:25 +0000
Robin Watts <robin.watts@artifex.com>
b5ecd380a5af595f5e843352df88a6957b1accda

New valgrind makefile targets and clist tweak.

We introduce 2 new families of targets to the makefile.

1) vg, gsvg, gpcl6vg, gxpsvg, gpdlvg
2) debugvg, gsdebugvg, gpcl6debugvg, gxpsdebugvg, gpdldebugvg

Those build release and debug versions of the executables, tweaked
to work better with valgrind. These mirror the existing *mementovg
targets that were introduced a while ago.

2 extra tweaks are introduced here too.

Firstly, *for these targets*, we default to using memory for
bandlist storage. This should cut down on the number of false
positives we get when using the clist as uninitialised padding
bytes will not be flagged up as they are written to the clist
file. (Instead, they will only be flagged up if they are actually
used during clist playback).

Secondly, whenever we write out a clist block and reset the buffer,
we reset the buffer to "undefined" state so that valgrind can give
us useful information again.

base/gxclutil.c
base/unix-end.mak


2017-11-17 00:22:03 +0000
Robin Watts <Robin.Watts@artifex.com>
53faf466e769bd380a14370aa38562b942e783c2

Add clist valgrind helper call.

base/gxcldev.h
base/gxclimag.c
base/gxclpath.c
base/gxclutil.c


2019-01-14 11:34:09 +0000
Robin Watts <robin.watts@artifex.com>
1f5d4a1ce74ea841102a7c77e29c68e9b7a032c2

Improve -Z: output messages at startup.

The "Init done" messages given by -Z: were misleading.

Here, we simplify the process a bit. We move the init messages
(other than the dumping of the args used) out of -Z: and into
--debug=init-details.

The 3 different init messages are now explicitly done around
each of the 3 phases, rather than in the code that calls
those 3 phases. This makes it far clearer, as the phases can
be called from many different places depending on the exact
command line in use.

The only downside to this is that only the final phase shows up
in normal use, as the parsing of --debug=init_details doesn't
happen until after after the first 2 phases of init have taken
place. This is no worse than the current code, so we'll take this
for now, and update it later (maybe by prescanning the arg list)
if it's ever an issue later on.

base/gdbflags.h
psi/imain.c
psi/imainarg.c


2019-01-11 19:24:47 -0800
Ray Johnston <ray.johnston@artifex.com>
41810035925a2dd419354e8ca918f425603e5cb4

Bug 700482: Binary Object scanner could write past allocated ref array

The object length (osize) was used to compute the max_array_index, but
this exceeded the number of refs allocated based on the overall length
given in the BOS header. We only allocated overall_length/8 but the bad
object length value (in this case for a dict, but could be an array)
was larger so we ended up with a max_array_index that was too large.

psi/iscanbin.c


2019-01-10 13:48:37 +0000
Robin Watts <robin.watts@artifex.com>
deaae0d435112e2fdd9f3f7d1e8eee6e207758f1

Squash a warning in XPS interpreter.

xps/ghostxps.h
xps/xpszip.c


2019-01-10 13:44:13 +0000
Robin Watts <robin.watts@artifex.com>
6236f942b0601772221a910e006c9fa865b4568e

gpdl: Tweak stdin operation to respect gsapi set stdio functions.

Now that gpdl lives entirely under the gsapi API, it should
respect all that API. That means that as people can define
callbacks to be used for stdin/stdout/stderr, we should use
those callbacks if they are set and the program is told to
read from stdin.

Sadly, the only stdin stream implementation we have that supports
this mechanism is the one in the postscript interpreter rather
than the one in the general library, so we can't rely on it being
there (and even if we could, it assumes the presence of an
active PS interpreter instance).

We therefore lift this code out and simplify it to give us a
"callback capable" stdin stream that will be present in all our
builds. This is NOT available using the standard iodev mechanism
so no changes in behaviour can happen for existing programs.

base/lib.mak
base/strmio.c
base/strmio.h
pcl/pl/plmain.c


2019-01-10 21:18:08 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
4e71598a97bce38f3ba384c055d6ffb852f045fd

Bug 697545 : Prevent SEGV when no graphic state is saved.

Prevent SEGV if memory allocation fails leading to pgs->saved being NULL.

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

base/gsdevice.c


2019-01-10 12:19:10 -0500
Steve Phillips <steve.phillips@artifex.com>
2ae1181b33be65478db844e3a330cf31f8dee273

Fix for bug 700042 -- Sanitize out-of-bounds read with fuzzed PDF file.

The test file for this bug was fuzzed in such a way as to generate
Lattice-Form Gouraud shadings with extremely large X coordinates.
This exposed a bug in the code which performs recursive triangle
subdivision. A color cache entry is not the same size as a
patch_color_t so can't be copied directly.

base/gxshade6.c


2019-01-11 14:25:29 +0100
Tor Andersson <tor.andersson@artifex.com>
24281b198d446da47441b132aba2aa09a5c27ba5

Bug 697630: Check ZIP entry sizes for integer overflow.

xps/xpszip.c


2019-01-09 17:55:17 +0000
Robin Watts <robin.watts@artifex.com>
1698937968690ca1ff99e50ae8c1c044718505b8

Fix stdin operation for gpdl/gpcl etc.

pcl/pl/plmain.c


2019-01-09 17:14:13 +0000
Robin Watts <robin.watts@artifex.com>
5b41d5347c1cde4847d8d631aa20e00a6cdb5728

Rename xps language implementation points.

use _impl_ instead of _imp_ to be consistent with the others.

xps/xpstop.c


2019-01-08 18:49:38 +0000
Robin Watts <robin.watts@artifex.com>
0b89bbaf583441e84804201d2e74169b9c7be5de

gpdl: Add -c operation to gpdl.

We gather up all the commands specified by -c and pass them into
the language as a 'prefix' command, to be run just after we have
inited the job. This means they run inside the encapsulation.

The only language that supports prefix commands is postscript,
hence only postscript commands can be used. This is what we want.

gpdl/psi/psitop.c
pcl/pcl/pctop.c
pcl/pl/pjparsei.c
pcl/pl/plmain.c
pcl/pl/pltop.c
pcl/pl/pltop.h
pcl/pxl/pxtop.c
xps/xpstop.c


2019-01-09 17:19:22 +0000
Robin Watts <robin.watts@artifex.com>
51196c3b88bf5a865e03907c90ac891ab857f021

Squash a type warning.

psi/imainarg.c


2019-01-08 16:35:51 +0000
Chris Liddell <chris.liddell@artifex.com>
cb07f9786acc2faa85b1f3cce89339b65f99c310

Bug 700460: Fix Freetype Type1 path segment closepath

* src/psaux/psintrp.c: correctly close a contour

All of the Type 1 path building is done with code common to the revised
CFF engine, with the exception of closepath, which was still calling
ps_builder_close_contour(), thus previously cached segments were not
always written to the path, and glyph corruption, or even invalid outlines
were possible.

Switch to calling cf2_glyphpath_closeOpenPath()

Committed upstream:
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=b75abeb5e6561024d182ccdc0eb36a7d2630310e

freetype/src/psaux/psintrp.c


2019-01-08 14:03:28 -0800
Nancy Durgin <nancy.durgin@artifex.com>
fc8c8630f929cbbe1df01fdc3186f25193b31f75

Undefine internal .presentspecial dictionary

This dictionary contains a bunch of procedures that will no longer be exposed.

Resource/Init/gs_setpd.ps


2019-01-08 11:53:33 -0800
Nancy Durgin <nancy.durgin@artifex.com>
71af04a00d1970be001d043480c07bd336453a73

Rearrange code in gs_setpd.ps so things are defined before used.

This is in preparation for undef'ing .presentspecial dictionary.
I tried to keep the related code together, and I hope I moved the
right comments with the code...

Resource/Init/gs_setpd.ps


2019-01-08 20:05:11 +0000
Robin Watts <robin.watts@artifex.com>
06e9bde4dce776a3afa365bc65b1a1278462c865

Fix Memento squeezing - gs_lib_ctx was using a monitor.

Monitors don't play nice with memento squeezing, so nobble the
code.

base/gslibctx.c


2019-01-08 08:37:55 -0800
Nancy Durgin <nancy.durgin@artifex.com>
cae9c43ecc8eb804022d947f65d60358a7e6094a

Rewrite some code to be able to undef internal .setpagesize

/.setpagesize is used internally by gs_statd.ps, but it was written
to pull the current implementation out of statusdict, so it could use
either a level 2-compatible version that called setpagedevice, or a level 1
version that didn't call setpagedevice.

Since we don't support level 1 postscript anymore, we should always have
setpagedevice, so this can be cleaned up.

Now /.setpagesize is just an internal convenience function that we undef
within gs_statd.ps.

Resource/Init/gs_lev2.ps
Resource/Init/gs_statd.ps


2019-01-07 20:03:02 -0800
Michael Vrhel <michael.vrhel@artifex.com>
6b9a0722a5e4c8083a59fd3ba22b1b572ec7fcd6

Bug 691732 Add support for e-sRGB and ROMMRGB color spaces

JPX images can have an enumerated color space that indicates
e-sRGB or ROMMRGB.

Resource/Init/gs_lev2.ps
Resource/Init/gs_res.ps
Resource/Init/pdf_draw.ps
base/gsicc_manage.h
iccprofiles/esrgb.icc
iccprofiles/rommrgb.icc


2018-12-19 15:03:27 -0800
Ray Johnston <ray.johnston@artifex.com>
c75bd64e30d8ff890cd6495e748b30a4b0dacd32

Bug 699180: Transparency BBox for stroke needs the expanded path.

The simplified test case has an unusually wide line, but since the path
is pure horizontal, pathbbox returns the same coordinate for Ymin and Ymax.
Instead, when painting strokes, use "strokepath pathbbox" to get the actual
area painted (taking width and miter extensions into account).

Resource/Init/pdf_ops.ps


2018-12-23 13:02:22 -0800
Ray Johnston <ray.johnston@artifex.com>
10a630656fadb160ec3e01b934adac3e1ca600f9

Bug 700359: Uniprint device did not set color_info.polarity needed by pdf14

The pdf14 device assumes that if the polarity is ADDITIVE, the colorspace
must be Gray or RGB. The uniprint device did not set the polarity when the
colorspace was changed to CMYK, so the number of components set in the pdf14
compositor was 3, even though the ICC profile for the device expects 4 as
num_components in. This caused a mismatch when reading the clist because
it expected 4 components and only 3 were written. Note that the RGBW, RGBOV,
and RGBNOV modes will probably still fail, but unti we see a case for a device
needing these unusual modes, just leave it as it has been for many years.

Note that other devices with strange colorspaces, such as RGBA may also
trip over this.

devices/gdevupd.c


2018-12-26 13:12:39 -0800
Ray Johnston <ray.johnston@artifex.com>
905d1bf02db12aca93a732dbe5956993e19d2443

Bug 699688: Saving pointer into arg_list string invalid (next arg overwrites)

The 'saved_pages_inital_arg' cannot be a pointer into the argument buffer
(arg_list.cstr) since later long arguments can overwrite past the pointer
saved (12 characters into the buffer). Instead allocate a buffer for the
argument and copy the argument into it.

Thanks to Peter Cherepanov for the analysis and part of the fix.

psi/imain.c
psi/imainarg.c


2018-10-09 23:04:42 -0700
Ray Johnston <ray.johnston@artifex.com>
02fd67bce5cd981282594b1458c4459613559d1b

Remove overprint_mode_alt (overprint mode is the same for stroke and fill)

Also remove effective_overprint_mode_alt.

base/gsstate.c
base/gxgstate.h


2018-07-09 12:05:56 -0700
Ray Johnston <ray.johnston@artifex.com>
0c89f7d14ffdaa3080d996d7502a77f3db949381

Fix for bug 692652: Prevent derefence of NULL if parsed.iodev == NULL

Robin's suggestion seems reasonable to me.

base/gsdevice.c


2018-12-17 11:18:07 +0000
Robin Watts <robin.watts@artifex.com>
e91b67894a28c518b34e0daf75d79715c4aa16e4

Remove some blah_DEFINED cruft.

Now we properly "include what we use" let's sanitise the horrid
blah_DEFINED ifdeffery (i.e. kill it where possible).

Also, we update the .c dependencies in the base/psi makefiles to
be correct.

Unfortunately, this new correct set of dependencies causes nmake
to soil itself and die with an out of memory error. After much
experimentation, I've come to the conclusion that this is because
it copes poorly with given the same file as a dependency multiple
times.

Sadly, our style of declaring dependencies in the following style:

foo_h=$(BLAH)/foo.h $(std_h)
bar_h=$(BLAH)/bar.h $(foo_h) $(std_h)
baz_h=$(BLAH)/baz.h $(foo_h) $(std_h)

means that a .obj file that depends on $(foo_h) $(bar_h) and $(baz_h)
ends up depending on foo.h twice, and std.h three times.

I have therefore changed the style of dependencies used to be more
standard.

We still define:

foo_h=$(BLAH)/foo.h

so each .obj file rule can depend on $(foo_h) etc as required, but the
dependencies between each .h file are expressed in normal rules at the
end of the file in a dedicated "# Dependencies" section that we can now
autogenerate.

base/gdevdevn.c
base/gdevdevn.h
base/gdevmrop.h
base/gdevp14.h
base/gdevprn.h
base/gp.h
base/gsalloc.h
base/gsccolor.h
base/gscdevn.h
base/gschar.h
base/gscicach.h
base/gscie.h
base/gscms.h
base/gscolor2.h
base/gscolor3.h
base/gscrdp.h
base/gscsepr.h
base/gscspace.h
base/gsdcolor.h
base/gsdevice.h
base/gsdsrc.h
base/gsfcmap.h
base/gsfname.h
base/gsfont.h
base/gsfunc.h
base/gsgc.h
base/gsgcache.h
base/gsgdata.h
base/gsgstate.h
base/gsht1.h
base/gsicc_cache.h
base/gsicc_cms.h
base/gsimage.h
base/gsiparam.h
base/gslibctx.h
base/gsmatrix.h
base/gsmemory.h
base/gsmemraw.h
base/gsnamecl.h
base/gsovrc.h
base/gsparam.h
base/gspath.h
base/gspcolor.h
base/gsptype1.h
base/gsptype2.h
base/gsshade.h
base/gsstate.h
base/gsstruct.h
base/gstext.h
base/gstparam.h
base/gstrans.h
base/gstrap.h
base/gstype1.h
base/gsuid.h
base/gxalloc.h
base/gxblend.h
base/gxcdevn.h
base/gxchar.h
base/gxcid.h
base/gxclfile.c
base/gxclipsr.h
base/gxclist.h
base/gxclmem.h
base/gxclthrd.h
base/gxcmap.h
base/gxcolor2.h
base/gxcomp.h
base/gxcpath.h
base/gxcspace.h
base/gxdcolor.h
base/gxdevbuf.h
base/gxdevcli.h
base/gxdevmem.h
base/gxdht.h
base/gxdhtres.h
base/gxdhtserial.h
base/gxdither.h
base/gxfapi.h
base/gxfcache.h
base/gxfcid.h
base/gxfcmap.h
base/gxfill.h
base/gxfont.h
base/gxfont0.h
base/gxfont1.h
base/gxfont42.h
base/gxgetbit.h
base/gxgstate.h
base/gxhintn.h
base/gxhldevc.h
base/gxht.h
base/gxhttile.h
base/gxiclass.h
base/gximage.h
base/gximask.h
base/gxiodev.h
base/gxiparam.h
base/gxmatrix.h
base/gxobj.h
base/gxpaint.h
base/gxpath.h
base/gxpcache.h
base/gxpcolor.h
base/gxrplane.h
base/gxsample.h
base/gxshade.h
base/gxshade4.h
base/gxtext.h
base/gxttfb.h
base/gxtype1.h
base/gzpath.h
base/gzspotan.h
base/lib.mak
base/saes.h
base/sarc4.h
base/scommon.h
base/spprint.h
base/spsdf.h
base/srdline.h
base/std.h
base/strmio.h
base/tiff.mak
base/ttfoutl.h
base/ttobjs.h
base/unixinst.mak
devices/contrib.mak
devices/devs.mak
devices/gdev8bcm.h
devices/gdevbmp.h
devices/gdevdljm.h
devices/gdevdsp2.h
devices/gdevfax.h
devices/gdevmgr.h
devices/gdevpcl.h
devices/gdevplib.h
devices/gdevpsd.c
devices/gdevpsd.h
devices/gdevpxut.h
devices/gdevrinkj.c
devices/gdevtfax.h
devices/gdevxcf.c
devices/gdevxcmp.h
devices/gxfcopy.h
devices/vector/gdevpdfb.h
devices/vector/gdevpdfc.h
devices/vector/gdevpdfg.h
devices/vector/gdevpdfo.h
devices/vector/gdevpdfx.h
devices/vector/gdevpdt.h
devices/vector/gdevpdtb.h
devices/vector/gdevpdtf.h
devices/vector/gdevpdti.h
devices/vector/gdevpdts.h
devices/vector/gdevpdtt.h
devices/vector/gdevpdtw.h
devices/vector/gdevpdtx.h
devices/vector/gdevpsds.h
devices/vector/gdevpsf.h
devices/vector/gdevpsu.h
devices/vector/gdevtxtw.c
gpdl/psi/gpdlpsi.mak
pcl/pcl/pcfontst.h
pcl/pcl/pcl.mak
pcl/pcl/pgstate.h
pcl/pl/pl.mak
pcl/pl/plchar.c
pcl/pl/plfont.h
pcl/pl/pltop.h
pcl/pxl/pxfont.h
pcl/pxl/pxstate.h
psi/files.h
psi/ichar1.h
psi/icid.h
psi/icremap.h
psi/icstate.h
psi/iddstack.h
psi/idebug.h
psi/idict.h
psi/idparam.h
psi/idsdata.h
psi/ifont.h
psi/igc.h
psi/igstate.h
psi/imain.h
psi/imainarg.h
psi/imemory.h
psi/iminst.h
psi/inamedef.h
psi/inames.h
psi/int.mak
psi/interp.h
psi/iplugin.h
psi/iref.h
psi/isave.h
psi/iscan.h
psi/isdata.h
psi/istack.h
psi/itoken.h
psi/iutil.h
toolbin/checkdeps.pl
toolbin/headercompile.pl
windows/ghostpcl.vcproj
windows/ghostscript.vcproj


2019-01-04 17:53:58 +0000
Robin Watts <robin.watts@artifex.com>
763a5f4c3bf94cd7cc3d9fcdcde3d7cac4f38796

Bug 696368: Avoid a garbage collection crash.

The bulk of this analysis and patch is due to Ken.

We can occasionally hit crashes when dealing with patterns. Ken
tracked this down to the 'dirty' pointer in the gx_pattern_trans_t
not being relocated in a garbage collection operation, and hence
ending up pointing to a random address.

His proposed fix was to change the 'dirty' pointer to be a pointer
to the actual pdf14_buf that contained the dirty rectangle, and to
ensure that it was properly enumerated in gc operations. This largely
solved the issues, but left a crash.

This crash was due to pdf14_get_buffer_information returning
a pointer to buf, even when it closed the device and hence freed
buf. This didn't normally affect the caller in as it never accessed
through the pointer, but *did* trip up any garbage collection that
happened while the pointer was extant.

The fix is simply to only have pdf14_get_buffer_information return a
pointer to buf iff buf will actually be around when we return.

base/gdevp14.c
base/gxp1fill.c
base/gxpcmap.c
base/gxpcolor.h


2019-01-07 09:58:36 +0000
Chris Liddell <chris.liddell@artifex.com>
2b0bfd775e43232ec488b8131b8dc014eb09d5aa

Coverity 328396: Correctly handle use cases for register root

There was a logical flaw in the revised iregister_root() implementation that
meant we only handled 2 of the 3 ways of calling it correctly, the third way
would result in a segfault.

Also, add a comment noting those three ways of calling the API.

base/gsalloc.c
base/gsmemory.h


2019-01-03 09:40:01 -0800
Nancy Durgin <nancy.durgin@artifex.com>
4759b642f0f85f61949df18a43179d9cc5c9a91a

Undef internal setpagedevice operators

Had to delay and undef in ps_init.ps:
/.execinstall

Could undefine locally:
/.postinstall
/.copytree
/.defaultdeviceparams
/.makecurrentpagedevice

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


2019-01-01 18:34:45 +0000
Robin Watts <robin.watts@artifex.com>
7fe04b119618b476586e5f5b85c46d72ff05ebfc

Add -I handling to gpdl.

This requires an "add_path" entrypoint be added for each language
(NULL for everything except PS).

This causes the block of memory used for the -I path to be leaked. I
suspect this is the same as in gs. A fix for this is a little involved
so it'll wait for now.

gpdl/psi/psitop.c
pcl/pcl/pctop.c
pcl/pl/pjparsei.c
pcl/pl/plmain.c
pcl/pl/pltop.c
pcl/pl/pltop.h
pcl/pxl/pxtop.c
psi/psapi.c
psi/psapi.h
xps/xpstop.c


2019-01-03 17:07:25 +0000
Robin Watts <robin.watts@artifex.com>
2bc43397c39db60b865ca6afd14c048d9e595359

Avoid leak of lib path blocks.

GS keeps a lib_path postscript array with a list of directories
in. Currently this memory is assumed to be "permanent", and is
never freed by the system. This means that whenever we use -I
we leak a block.

Here, we change the system over so that we copy the different
path components into memory blocks and free them at the end.

This seemingly simple task is made much harder by the way that
gs throws out some of the entries in the libpath at random
points during execution.

Accordingly, I have rejigged the code slightly, and introduced
comments to explain what is going on, in the hopes that the
next person through this code (in another 20 years) will have
an easier time understanding the assumptions baked into it.

psi/imain.c
psi/imainarg.c
psi/iminst.h


2019-01-03 15:14:25 +0000
Robin Watts <robin.watts@artifex.com>
4aadfa18ccc7fd23e3e4e0a262bcda51ef815b3f

Bug 700438: Fix SEGV due to overflowing double->int conversion.

Thanks to Ken for doing most of the investigation on this.

The problem is that we have a double value of 5e9 that won't fit
into an int (and becomes INT_MIN). This huge negative value is then
added to a pointer and we access out of range.

The fix is simply to check for our double values being representable
as ints before we proceed - if not we throw a rangecheck. This is
reasonable as it corresponds to an image being positioned stupidly
far off the page.

The complication with this commit comes in that it collides with
some very suspect old fixes for Bugs 686843 and 687411. The patch
for 686843 makes the same change in 2 places in the code. It looks
like 687411 is reported as the same issue, but the fix for it appears
to be reverting one of the fixes for 686843 - I suspect that the
patch was reversed.

Given that we can't reproduce the original problems that these bugs
were trying to solve any more, I am reverting the code to a saner
form. If the problems recurr, we can reexamine then.

base/gximag3x.c
base/gximage3.c


2019-01-02 14:43:58 -0800
Nancy Durgin <nancy.durgin@artifex.com>
5a1b7b9e67f5b9827338fe65881608c530a89a35

Remove remaining ImageType 2 support, which is now dead code

ImageType 2 was only used for display postscript.

Made make_upath() static, since it is now only used locally by zupath.

base/gsiparm2.h
base/gximage2.c
base/gxiparam.h
base/lib.mak
devices/gdevx.c
psi/zupath.c
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-11-18 14:45:00 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
486f3b4a677180bbef2553114bf13916c76e1884

Bug 697545: Update gx_image_enum_begin to correctly handle error returns.

base/gxi12bit.c
base/gxiclass.h
base/gxicolor.c
base/gxifast.c
base/gximono.c
base/gxipixel.c
base/gxiscale.c


2019-01-02 11:34:52 -0800
Nancy Durgin <nancy.durgin@artifex.com>
0b3e0befdc87323eb518d6233c5fcdf5e006e6dc

Removed has_alpha flag from postscript high-level image functions

The flag was only set to 'true' by the .alphaimage operator, which was
only used by display postscript and has now been removed.

All other callers passed hard-coded 'false', so the argument is now
extraneous.

psi/iimage.h
psi/zimage.c
psi/zimage3.c
psi/ztrans.c


2019-01-02 11:54:21 +0000
Robin Watts <robin.watts@artifex.com>
42646d6c9e264d8f8c34e5e32cde3e02ff83b87d

Pull in fixes from lcms2mt repo.

(This pulls in the latest fixes from mainline lcms2 too).

lcms2mt/README.1ST
lcms2mt/src/cmsopt.c
lcms2mt/src/cmsxform.c
lcms2mt/src/lcms2_internal.h


2019-01-02 10:02:28 +0000
Ken Sharp <ken.sharp@artifex.com>
ef075a44f37f89dcbff03bf0bdcc7e7b6fe17c15

Address compiler warnings

Remove unused variables (x4)

Add include files to fix 'implicit declaration' warnings (x2)

Rewrite a (now) misleading comment.

base/gdevmpla.c
base/gscspace.c
devices/gdevpsd.c
devices/vector/gdevpdft.c
psi/zfont1.c


2019-01-01 13:27:45 +0000
Robin Watts <robin.watts@artifex.com>
11fb2c3140b33f88056d5009b62a98f4ad921109

Fix gpdl --disable-compile-inits build.

Silly typos were preventing chunks 1,2,3 of the romfs being
built.

base/lib.mak


2018-12-29 09:54:09 -0800
Michael Vrhel <michael.vrhel@artifex.com>
416a5ebe1f7435f6dc8894576f40a8f247ed386c

Bug 688210: Add psdcmyk16 and psdrgb16 devices

So the patch that was provided was far from sufficient in making this
work. There was significant work that needed to be done in the
pdf14 device to ensure that the transparency put_image operation
worked correctly. Not sure if the author was paid a bounty but I
question if it was properly tested.

I tested this with some extreme altona files and others and
everything seems to be working well now. Having the psdcmyk16 device
is nice as it is our only device to have full spot color support and
16 bit output precision.

base/gdevmpla.c
base/gdevp14.c
base/gxblend.h
base/gxblend1.c
base/lib.mak
base/unix-gcc.mak
base/unixansi.mak
configure.ac
devices/devs.mak
devices/gdevpsd.c
devices/gdevpsd.h
doc/Devices.htm
psi/msvc.mak


2018-12-28 14:55:14 +0000
Ken Sharp <ken.sharp@artifex.com>
bfecb45e881eee39b2159873b1954f911dcb7fa3

Coverity ID 328395 - check return from ref_stack_push

psi/zdevice.c


2018-12-17 20:16:27 +0000
Robin Watts <robin.watts@artifex.com>
1a61ba8825e80bbd779192950d61474fb7581a26

Remove "device filter stack" as it is long unused.

base/gdevsclass.c
base/gsdfilt.c
base/gsdfilt.h
base/gxgstate.h
windows/ghostscript.vcproj


2018-12-19 09:47:55 -0800
Nancy Durgin <nancy.durgin@artifex.com>
264e3cd12621d8270af08ab645a8aaf2b1b00f7e

Undefine internal functions in gs_dps2.ps

(Note that despite the name, this isn't really display postscript)

.UserObjects
.fixcurrenthalftonescreen
.makehalftoneRGBV
.fixsethalftonescreen
.makestackdict

Resource/Init/gs_dps2.ps


2018-12-20 16:09:26 +0000
Ken Sharp <ken.sharp@artifex.com>
48008d0fbcdb26f1deac44f47eb6b0551e4ea17e

pdfwrite/PDF interpreter/transparency - identify page level groups

Bug #700376 "Color change after reprocessing PDF with Ghostscript"

The problem here lies in identifying the difference between a /Group
entry in the Page dictionary, and a Group encountered as part of an
operation during the course of a Page content stream.

To the rendering code, there is no difference, but pdfwrite needs to
be able to identify Page level groups so that it can attach them to the
Page dictionary when it writes them out.

Previously we've been doing this by detecting the fact that we haven't
started writing anything to the page stream. However, this is simply
not good enough, in the case of this bug report, the first thing that
happens is the file runs a form, which has a Group. Because we haven't
written anything to the page yet, we think its a page level Group and
emit it as such.

The problem is that in the original, we had set a constant alpha of
0.55. When we run the form that is self-contained and uses an alpha of
1, but because its in a form, the result of rendering the form is
composited with the page so far (currently nothing) with teh result that
the form contents are drawn 50% opaque.

When we come to handle this in pdfwrite, the fact that we think the
Group for the Form is at the page level causes us to write the Form
content stream in the page (and the Group for the Form is also put
in the Page dictionary), and we fail to emit a constant alpha, because
the form resets it to 1 before executing any marks. That means we
'optimise out' the change to 0.55 and the form is drawn 100% opaque.

This commit introduces a new transparency compositor operation
'PDF14_BEGIN_TRANS_PAGE_GROUP', the rendering code has been modified
to treat this as exactly equivalent to a 'PDF14_BEGIN_TRANS_GROUP' so
that there are no rendering differences.

The pdfwrite device, however, can use it to identify with certainty
that a given Group is at the Page level and treat it specially.

This results in 5 files in the test suite showing progressions, mostly
subtle, but one quite marked difference. The files are:
Altona_Technical_v20_x4.pdf, Bug691783.pdf, Bug691982.pdf, CATX3146.pdf,
x_-_no_compression_bomb.pdf
*only* when processed through the pdfwrite device.

Resource/Init/pdf_draw.ps
Resource/Init/pdf_main.ps
base/gdevp14.c
base/gstrans.c
base/gstrans.h
devices/vector/gdevpdft.c
psi/ztrans.c
xps/xpsgradient.c
xps/xpsimage.c
xps/xpsopacity.c


2018-12-19 10:09:24 -0800
Nancy Durgin <nancy.durgin@artifex.com>
16b7aba969bc1d607d80ddab5c8d2430bd36b6a0

Remove iimage2.h, zimage2.c (dead code after dps removal)

Remove all the references to these files.

doc/Develop.htm
psi/iimage2.h
psi/int.mak
psi/zimage2.c
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-12-19 10:32:40 -0800
Nancy Durgin <nancy.durgin@artifex.com>
fa1c24756797e43dd63d5318c961baf5f99e2428

Cleanup from no-longer-existing .alphaimage operator

Remove <has_alpha> parameter and handling from .colorimage
Remove references to .alphaimage from comments and stuff

Resource/Init/gs_img.ps


2018-12-19 08:53:32 -0800
Michael Vrhel <michael.vrhel@artifex.com>
0466d01e1677c8a4a8e57a191710842c844e5ad4

Bug 698828: Change of TRC in default_gray.icc

Reviewing this bug revealed that out default_gray.icc profile had a gamma
of 1.8. The proper gamma should be the same as that used by default_rgb.icc
which has the sRGB color space TRC. This commit fixes the issue. Unfortunately
this is going to cause a huge number of changed files.

iccprofiles/default_gray.icc


2018-12-18 14:24:34 -0800
Nancy Durgin <nancy.durgin@artifex.com>
3c58541e2dff52bf9d481f7cd385386716e2bdd5

Remove Display Postscript-related cooperative multitasking code and state

The code this was supporting was in zcontext.c, which has already been
deleted.

psi/icontext.c
psi/icstate.h
psi/interp.c
psi/oper.h


2018-12-13 08:57:50 -0800
Nancy Durgin <nancy.durgin@artifex.com>
cc156631163eb9c156e0863387def7368abe5a8b

Change zmisc.c implementation of usertime to start at 0

The Display Postscript implementation in zcontext.c always returns 0
the first time 'usertime' is called, and counts time from there.

Since that implementation is going away, change the one in zmisc.c to
behave the same way. It used to return a value based on the time since the
process started, which would be variable depending on the implementation.

Both implementations increment based on time spent processing.

This change causes vasarely.ps to run the same with and without dps.

psi/icontext.c
psi/icstate.h
psi/zmisc.c


2018-12-12 07:43:13 -0800
Nancy Durgin <nancy.durgin@artifex.com>
0d04beddf3f2b5f5eac46f2ae9d5ab0452e38ada

Removing display postscript and NeXT dps operators.

This only removes operators that are DPS only. They are marked with
a "DPS" in the PLRM. Also removes related internal operators.

(gs_img.ps) Remove img_utils_dict
Dependency on gs_dps.ps is gone. Can just define the utility funcs for use
and then just undef them at end.

(gs_init.ps)
Don't need to undef dps operators anymore, because they won't be defined

(pdf_draw.ps)
Change PDF implementation to call .setscreenphase directly

This used to call it via the dps operator 'sethalftonephase', but that
is going away, so just make .setscreenphase be part of the pdf
implementation directly.

Also move implementation of .setscreenphase to zpdfops.c

(gs_cet.ps)
No longer need to undef 'deviceinfo' for CET because it won't be defined

(gs_btokn.ps)
Replace the DPS operators in .installsystemnames with placeholders

Keeps the length/values in the array the same, just removing dps operators.

(icontext.c)
Needed to modify the no_reschedule() proc to return 0 instead
of an error. I think we can delete a ton of related code, in future commit,
because the code handling the time_slice_proc and reschedule_proc should
no longer be needed.

(lots of changes)
Delete dps-related source files, update makefiles and other files that
reference the deleted files.

Makefile.in
Resource/Init/gs_cet.ps
Resource/Init/gs_dpnxt.ps
Resource/Init/gs_dps.ps
Resource/Init/gs_img.ps
Resource/Init/gs_init.ps
Resource/Init/pdf_draw.ps
base/gs.mak
base/gsdpnext.h
base/gsdps.c
base/gsdps.h
base/lib.mak
base/openvms.mak
base/openvms.mmk
base/unix-gcc.mak
base/unixansi.mak
gpdl/pspcl6_gcc.mak
gpdl/pspcl6_msvc.mak
psi/icontext.c
psi/int.mak
psi/msvc.mak
psi/os2.mak
psi/psromfs.mak
psi/zcontext.c
psi/zdpnext.c
psi/zdps.c
psi/zpdfops.c
toolbin/pre.chk
toolbin/pre.tcl
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-12-18 11:41:35 -0800
Michael Vrhel <michael.vrhel@artifex.com>
164c0da6464b3c9da4923ca4827616a85f0f95a9

Bug 699152: gen ordered screen generation

Fix typo in output formatting and clean up a few warnings.

base/gen_ordered.c
toolbin/halftone/gen_ordered/gen_ordered_main.c


2018-12-18 09:34:11 -0800
Michael Vrhel <michael.vrhel@artifex.com>
83224c6384cebe4d7463d7b3d7c240c52ca9030b

Bug 700383: Add support for scRGB

XPS files can define RGB colors with things like

Fill="sc#1, 0.0231533665, 0.08021982, 0.226965874"

This implies that the color space is not sRGB (the standard default in XPS)
but rather scRGB which shares the primaries of sRGB but has a gamma of 1.0.

Lots of progressions in the XPS files expected with this commit.

base/gscspace.c
base/gscspace.h
base/gsicc_manage.c
base/gsicc_manage.h
base/lib.mak
iccprofiles/scrgb.icc
xps/xpstop.c


2018-12-18 10:25:59 +0000
Ken Sharp <ken.sharp@artifex.com>
0996199c8607807f423ebf67d576482f8f2bbadb

XPS interpreter - remove special case for artificial bold with pdfwrite

Bug #700382 "Synthetic bold generation too heav"

There was special case code for handling artificially emboldended text
in xps_flush_text_buffer, when the output device could directly handle
text rendering mode 2 (fill and stroke). This was because the pdfwrite
device, the only device capable of handling this mode, did some nasty
trickery with the CTM.

At some point this trickery has been removed, probably as a result of
the ongoing work to handle stroke+fill as a graphics primitive. The
result is that the hackery is no longer required, and in fact causes
the stroke width to be incorrectly calculated, because we are trying to
reverse a later calculation with the CTM, which is no longer applied.

So simply remove the whole section of code. This shows a very few
differences in the test suite, all at low resolution (72 dpi) where
text is slightly bolder, these appear to be (very minor)
progressions.

xps/xpsglyphs.c


2018-12-15 15:19:14 +0000
Ken Sharp <ken.sharp@artifex.com>
2183d4712847901ddf46989e07bdc4dd94a1197f

pdfwrite - improve h/vmtx table generation for embedded TrueType fonts

Bug 700099 " glyph spacing changed after going through pdfwrite"

This is a difficult one to explain. The primary problem is that the
original PostScript contains multiple EPS files, which contain multiple
embedded subsets of the same font, but all with the same name.

Because these subsets are small, they appear to pdfwrite to be the same
font, the checks we use to check the font do not test every possible
characteristic, because that would be slow.

Now this is not a problem, except that for bug #697376 we did an ugly
hack.

The generation of embedded TrueType fonts badly needs rewritten. Currently
we copy some tables, copy and amend other tables, and generate some tables
from scratch. This has led to numerous problems, on and off.

In the case of bug 697376, we were only writing the hmtx table with
exactly as many metrics as the actual glyphs we put in the output file,
and patched the hhea tale so that it had the correct number of
hLongMetrics entries. But the spec says that every glyph (even those
which are empty in the glyf table!) must have a lsb entry. So Acrobat
Distiller threw an error on encountering our font.

This was solved by copying the hmtx table instead of generating it. Fine
as far as it goes, but in this case we have hit the problem where we are
using glyphs from two different fonts. The hmtx table from the first font
has the wrong metrics for the glyphs in the second font, which leads to
spacing errors.

The only possible solution, until we can find time to rewrite all of this
is to 'pad out' the hmtx table with lsb entries for the glyphs which are
present in the glyf table, but not actually used.

I have a sneaky suspicion that this is still incorrect, we should be
writing the metrics at the correct place (GID) in the table, instead
of as a block, but this works well enough for now.

devices/vector/gdevpsft.c


2018-12-14 13:04:04 -0800
Michael Vrhel <michael.vrhel@artifex.com>
6bcf3eb2fd2bca68eef17a8cfcbf272e22d647d1

Bug 698721 Overprint mode getting used during shading pattern

base/gscspace.c
base/gsstate.c


2018-12-14 09:31:45 -0800
Michael Vrhel <michael.vrhel@artifex.com>
7a9359b06801cea8a7a3c4469c1e7f31564a962c

Add missing index update in pdf14 buffer debug

base/gdevp14.c


2018-12-12 12:48:39 +0000
Robin Watts <robin.watts@artifex.com>
085c795835284d2f0d91ebc87faf5b2da1376bca

Fix header inclusions.

Run a release build on a linux machine to make arch.h etc. Then
run toolbin/headercompile.pl to test compiling each headerfile
by itself.

Resolve all the missing #includes, add missing repeated include
guards and copyright statements.

Also, update all the header dependencies in the makefiles.

It is possible that the object dependencies in the makefiles can be
simplified now, but that's a task for another day.

base/ets.h
base/ets_tm.h
base/gdbflags.h
base/gdebug.h
base/gdevbbox.h
base/gdevdcrd.h
base/gdevddrw.h
base/gdevdevn.h
base/gdevdevnprn.h
base/gdevmem.h
base/gdevmpla.h
base/gdevmplt.h
base/gdevmrop.h
base/gdevp14.h
base/gdevpccm.h
base/gdevplnx.h
base/gdevppla.h
base/gdevprn.c
base/gen_ordered.h
base/gp_mswin.h
base/gp_os2.h
base/gpcheck.h
base/gpmisc.h
base/gs.mak
base/gsalloc.h
base/gsalpha.h
base/gsalphac.c
base/gsalphac.h
base/gsargs.h
base/gsbitops.h
base/gsbittab.h
base/gsccode.h
base/gscedata.h
base/gschar.h
base/gscie.h
base/gsclipsr.h
base/gscms.h
base/gscolor.h
base/gscolor1.h
base/gscolor3.h
base/gscompt.h
base/gscoord.h
base/gscpixel.h
base/gscrypt1.h
base/gscspace.h
base/gsdevice.h
base/gsdfilt.h
base/gsdll.h
base/gsdllwin.h
base/gsdps.h
base/gsequivc.h
base/gsexit.h
base/gsflip.h
base/gsfname.h
base/gsfont.h
base/gsform1.h
base/gsfunc.h
base/gsgc.h
base/gsgcache.h
base/gsgstate.h
base/gshsb.h
base/gsht.h
base/gshtx.h
base/gsicc_cache.h
base/gsicc_profilecache.h
base/gsimage.h
base/gsiparm2.h
base/gslib.h
base/gsline.h
base/gsmatrix.h
base/gsmchunk.h
base/gsmemory.h
base/gsnamecl.h
base/gsovrc.h
base/gspaint.h
base/gsparamx.h
base/gspath.h
base/gspath2.h
base/gspcolor.h
base/gsrect.h
base/gsrefct.h
base/gsrop.h
base/gsroprun1.h
base/gsroprun24.h
base/gsroprun8.h
base/gsropt.h
base/gsserial.h
base/gsstate.h
base/gsstrl.h
base/gstext.h
base/gstiffio.h
base/gstype1.h
base/gstypes.h
base/gsuid.h
base/gsutil.h
base/gsxfont.h
base/gx.h
base/gxband.h
base/gxbitfmt.h
base/gxcdevn.h
base/gxchrout.h
base/gxcindex.h
base/gxclip.h
base/gxclpath.h
base/gxclthrd.h
base/gxcmap.h
base/gxcomp.h
base/gxcoord.h
base/gxcpath.h
base/gxctable.h
base/gxdcconv.h
base/gxdcolor.h
base/gxdda.h
base/gxdevbuf.h
base/gxdevcli.h
base/gxdevmem.h
base/gxdevndi.h
base/gxdevrop.h
base/gxdevsop.h
base/gxdht.h
base/gxdhtserial.h
base/gxdither.h
base/gxdtfill.h
base/gxfapi.h
base/gxfarith.h
base/gxfcache.h
base/gxfill.h
base/gxfillsl.h
base/gxfilltr.h
base/gxfillts.h
base/gxfixed.h
base/gxfont0.h
base/gxfont1.h
base/gxfont42.h
base/gxgetbit.h
base/gxgstate.h
base/gxhintn.h
base/gxhldevc.h
base/gxht_thresh.h
base/gxhttile.h
base/gxiclass.h
base/gxiscale.c
base/gxmatrix.h
base/gxmclip.h
base/gxobj.h
base/gxoprect.h
base/gxp1impl.h
base/gxpaint.h
base/gxpath.h
base/gxpcache.h
base/gxsample.h
base/gxsamplp.h
base/gxshade4.h
base/gxstate.h
base/gxttf.h
base/gxttfb.h
base/gxtype1.h
base/gxxfont.h
base/gzht.h
base/gzline.h
base/jmemcust.c
base/jmemcust.h
base/lib.mak
base/pcwin.mak
base/sa85d.h
base/sbcp.h
base/sbtx.h
base/scanchar.h
base/sdcparam.h
base/sdct.h
base/sfilter.h
base/simscale.h
base/sisparam.h
base/sjpeg.h
base/sjpegc.c
base/slzwx.h
base/smd5.h
base/smtf.h
base/spdiffx.h
base/spngpx.h
base/spprint.h
base/spwgx.h
base/srdline.h
base/srlx.h
base/ssha2.h
base/sstring.h
base/strmio.h
base/szlibx.h
base/tiff.mak
base/ttfinp.h
base/ttfsfnt.h
base/ttload.h
base/ttobjs.h
base/tttype.h
devices/devs.mak
devices/gdevxalt.c
pcl/pcl/pcstate.h
pcl/pcl/pgstate.h
pcl/pl/plchar.c
pcl/pl/pldraw.h
pcl/pl/plht.c
pcl/pl/plmain.h
pcl/pxl/pxgstate.h
psi/bfont.h
psi/btoken.h
psi/dscparse.h
psi/dwdll.h
psi/dwimg.h
psi/files.h
psi/ibnum.h
psi/ichar.h
psi/ichar1.h
psi/icharout.h
psi/icid.h
psi/icie.h
psi/icolor.h
psi/iconf.h
psi/icremap.h
psi/icsmap.h
psi/icstate.h
psi/iddstack.h
psi/idebug.h
psi/idicttpl.h
psi/idisp.h
psi/idosave.h
psi/idparam.h
psi/ifcid.h
psi/ifilter2.h
psi/ifont.h
psi/ifont1.h
psi/ifont2.h
psi/ifont42.h
psi/ifrpred.h
psi/ifunc.h
psi/ifwpred.h
psi/igc.h
psi/igcstr.h
psi/iht.h
psi/iimage.h
psi/iimage2.h
psi/iinit.h
psi/ilevel.h
psi/imain.h
psi/imainarg.h
psi/imemory.h
psi/iminst.h
psi/inames.h
psi/inamestr.h
psi/int.mak
psi/interp.h
psi/iparam.h
psi/iparray.h
psi/ipcolor.h
psi/isave.h
psi/iscan.h
psi/iscanbin.h
psi/iscannum.h
psi/isdata.h
psi/isstate.h
psi/istkparm.h
psi/istream.h
psi/istruct.h
psi/itoken.h
psi/iutil.h
psi/iutil2.h
psi/ivmem2.h
psi/ivmspace.h
psi/oparc.h
psi/opcheck.h
psi/opdef.h
psi/opextern.h
psi/winint.mak
psi/zchar42.h
psi/zcie.h
psi/zcolor.h
psi/zfile.h
psi/zfrsd.h
psi/zfunc.h
psi/zicc.h
toolbin/headercompile.pl
windows/ghostscript.vcproj


2018-12-14 10:38:19 +0000
Ken Sharp <ken.sharp@artifex.com>
9d23c4d9a6c02416341992d8b29226273df07af8

PDF interpreter - preserve stroke colour/space round SMask

Bug #699179 " Chart lines rendered as black when converting from pdf to png or jpg"

Michael ran the problem down to the fact that the stroke colour space
is set before an ExtGState with a Group which has an SMask. The colour
space before the SMask is an ICCBased space and afterwards it is
DeviceGray.

The SMask itself has a Group and that group is defined by a Form XObject
which has (yet another) Group. This Group is defined as having a
DeviceGray space. The problem is that when we executed a SMask in the
interpreter, we saved the fill colour space and values and restored
them at the end (we can't simply use gsave/grestore), but we did not
preserve the stroke colour space and colourants.

This commit saves that as well. This results in a progression with
pdfwrite with one file and three other files showing subtle progressions
with all devices (586_-_missing_images_gs_SMask_not_applied.pdf,
fireworks_with_radial_shading.pdf, x_-_recursive_xobjects_cause_crash.pdf)

Resource/Init/pdf_draw.ps


2018-12-14 08:44:36 +0000
Chris Liddell <chris.liddell@artifex.com>
c7b69c7799c32ec3e895f2053bb6c4a5e2ceb340

Fix array index typo for resolution (-r) parameter

psi/imainarg.c


2018-12-13 16:06:46 +0000
Chris Liddell <chris.liddell@artifex.com>
0a6cf27a94f14234b4edad6d8af851a6ba7144c0

Bug 700361: Explicitly setup color fields in txtwrite

Because txtwrite just uses the default implementations for sampled images
and masks, we want to setup various color related data on initialisation.

This just means setting separable_and_linear appropriately and calling
set_linear_color_bits_mask_shift().

Prevents a divide by zero when trying to use the values from
dev->color_info.comp_bits

devices/vector/gdevtxtw.c


2018-12-11 12:26:12 +0000
Chris Liddell <chris.liddell@artifex.com>
3e4d8a0ab793ddd889acbcd2a521cfe5a30e5525

Add product, copyright and version info to Windows binaries

This appears in the Windows Explorer: Properties -> Details dialogue.

base/gscdef.c
base/gscdefs.h
psi/dwmain.rc
psi/gsdll32.rc
psi/winint.mak


2018-12-03 15:06:12 +0000
Chris Liddell <chris.liddell@artifex.com>
218180b6d38a4641807775c032d8774c165a7657

Add checks for multiple master validity

Validate multiple master fonts at definefont time - this saves checking each
item multiple as we pass them into Freetype (or other font scaler library).

psi/zfapi.c
psi/zfont1.c


2018-12-03 14:59:55 +0000
Chris Liddell <chris.liddell@artifex.com>
85bb44261edbf10552a09c839decc669f63a8142

Add an "r_is_number()" macro

By moving the t_integer and t_real enum values to consecutive positions,
starting on a multiple of 2, we can check for a "number" type in a single step.

Useful for values specced as reals, but which may be integer values, and thus
parsed into integer objects. This means validation can be a single check,
rather than checking for real and integer individually.

Also use the macro in various places.

psi/iref.h
psi/zcolor.c
psi/zfunc.c


2018-11-29 14:03:46 -0800
Nancy Durgin <nancy.durgin@artifex.com>
e280984683a5ca0f2d496a93d0333b4a89ab7f42

Undef internal funcs in gs_setpd.ps
Had to rearrange the order of functions, so there are quite a few diffs from that.

/.selectmedia
/.computemediasize
/.prepareparams
/.trysetparams
/.installpagedevice

(couldn't undef .uninstallpagedevice because it is called from C code)

Resource/Init/gs_setpd.ps


2018-12-12 16:01:29 +0000
Robin Watts <robin.watts@artifex.com>
25205fe4aa9d6dc70dd20da8a2ca5e659823bb0c

Update clusterpush.pl

toolbin/localcluster/clusterpush.pl


2018-12-02 15:55:55 +0000
Robin Watts <Robin.Watts@artifex.com>
a44306a2ed48b3cee8e5246e6db0300eb8113c0d

Improve Claptrap headers.

base/claptrap-impl.h
base/claptrap.h


2018-12-11 09:01:26 +0000
Ken Sharp <ken.sharp@artifex.com>
134b38ac7b8587c9b4bb080b34473ea5e67d48d7

remove unused variable to silence compiler warning

base/gsicc_lcms2mt.c


2018-12-11 09:00:02 +0000
Ken Sharp <ken.sharp@artifex.com>
c6451b921ec9f7bab14977552321a12f6f2a87b8

Add parentheses to silence a compiler warning

base/gdevsclass.c


2018-12-08 07:24:43 -0800
Michael Vrhel <michael.vrhel@artifex.com>
3efb86d5d75240b04bed497426cec3dbef36c304

Bug 699305 Softmask with knockout non-isolated group

We were not considering the softmask for the shape when
doing group composition

base/gxblend.c


2018-12-08 14:51:51 +0000
Ken Sharp <ken.sharp@artifex.com>
68b052d0d704037369352eb3692eb9792361fc81

PDF interpreter - Improve T42 CharStrings creation for non-symbolic fonts

Bug #700158 "ghostscript produces incorrect JPG if SubsetFonts=false"

The problem is not in fact a problem with the pdfwrite device, it is
in fact the poorly documented way that Acrobat deals with TrueType
fonts, the symbolic/non-symbolic flags and Encodings.

When the font has a 3,1 CMAP subtable we use a number of sources of data
to try and build a CharStrings dictionary, which we use to map a glyph
name to a glyph ID:

Encoding CharStrings
character code --------> glyph name -----------> glyh ID

However when the font has no 3,1 CMAP subtable the specification says
we should try to use a 1,0 CMAP instead. For 1,0 tables we were not
using the 'prebuilt_encoding' to generate the CharStrins, which meant
that we making less use of information than we might, and some glyphs
were replaced by the /.notdef when rendering.

This commit adds the prebuilt_encoding to the sources of information
we use to generate Charstrings when using a 1,0 CMAP subtable.

This fixes the problem, and shows a progression with one file in our
test suite.

Resource/Init/gs_ttf.ps


2018-12-07 11:33:18 -0800
Michael Vrhel <michael.vrhel@artifex.com>
78af4f91e7a5958acab262f3e90b5ce2a0768562

Add a profile for a particular RGB color space

iccprofiles/a98.icc


2017-11-17 15:17:03 +0000
Chris Liddell <chris.liddell@artifex.com>
abb742af3affbe00da625a1272d682ac5fd4c964

Commit of gpdl-shared-device branch.

This commit is a squashed version of the gpdl-shared-device
branch. Essentially this is a first version of the new
language switching mechanism.

This does not build as part as "all", but rather as "experimental"
or "gpdl".

Resource/Init/gs_cet.ps
Resource/Init/gs_init.ps
base/gp_mspol.c
base/gs.mak
base/gsalloc.c
base/gsdevice.c
base/gsiodev.c
base/gsiodevs.c
base/gslibctx.c
base/gslibctx.h
base/gsmalloc.c
base/gsmalloc.h
base/gsmchunk.c
base/gsmemory.c
base/gsmemory.h
base/gsmemret.c
base/gsstate.c
base/gsutil.c
base/gxdownscale.c
base/gxdownscale.h
configure.ac
devices/devs.mak
devices/gdevchameleon.c
gpdl/psi/psitop.c
pcl/pcl/pctop.c
pcl/pl/pjparsei.c
pcl/pl/pl.mak
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/plmain.h
pcl/pl/pltop.c
pcl/pl/pltop.h
pcl/pl/plwmainc.c
pcl/pl/realmain.c
pcl/pxl/pxtop.c
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/ialloc.c
psi/iapi.c
psi/iapi.h
psi/icstate.h
psi/igc.c
psi/imain.c
psi/imain.h
psi/imainarg.c
psi/imainarg.h
psi/imemory.h
psi/iminst.h
psi/int.mak
psi/interp.c
psi/ireclaim.c
psi/msvc.mak
psi/opextern.h
psi/psapi.c
psi/psapi.h
psi/zdevice.c
psi/zfont.c
psi/ziodevsc.c
windows/ghostscript.vcproj
xps/xpstop.c


2018-12-07 18:53:59 +0000
Ken Sharp <ken.sharp@artifex.com>
eab61428b3fa1e4078e71febefe406dad499814e

txtwrite - allow some slop in zero-width detection

Bug #700322 " Endless loop when converting pdf to text "

While trying to fit text (text format 2 or 3) we do some heuristic
juggling to decide whether or not to use a calculated minimum size.
During this we check to see whether the width is zero, and if it is
we don't try to use it because it would result in an infinite loop.

We actually need to allow a little 'slop' around zero, in case floating
point errors result in a very small, but not quite zero, width.

The loop resuling in the bug isn't endless, but it is very lengthy.

devices/vector/gdevtxtw.c


2018-12-05 10:40:43 -0800
Ray Johnston <ray.johnston@artifex.com>
74723f099067f6b14f61f0cbf816c0b8536931a2

Improve gx_get_bits_copy determination of depth.

For devices that are separable, (GX_CINFO_SEP_LIN), it is better to use
the comp_bits to determine the depth of a plane. Seen with the display
device in spot color mode where dest_depth calculation from the depth
divided by num_components is not correct.

base/gdevdgbr.c


2018-12-04 21:31:31 +0000
Ken Sharp <ken.sharp@artifex.com>
fae21f1668d2b44b18b84cf0923a1d5f3008a696

subclassing devices - fix put_image method

The subclassing devices need to change the 'memory device' parameter to
be the child device, when its the same as the subclassing device.

Otherwise we end up trying to access the child device's memory pointers
in the subclassing device, which may not contain valid copies of
those pointers.

base/gdevsclass.c


2018-12-03 14:40:37 +0000
Ken Sharp <ken.sharp@artifex.com>
2e68cc460dbe349f68b81082ff7344db48eb4820

pdfwrite - don't try and apply transfer functions when converting colours

Bug #700052 "pdfwrite device grayscale conversion looses significant quality on gradients

The problem is that the file contains considerable spurious (ie has no
effect) transparency operatiosns. in this particular case a number of
objects are drawn with an SMask and the SMask uses a transfer function
to invert the single component colour space (The gray objects are in
fact described in a DeviceN [/Black] colour space, presumabkly to
still further pointlessly increase teh complexity).

When converting colour space we were altering the transfer function
from 'Presever' to 'Apply', but we can't actually apply the transfer
function to the SMask in this case.

So leave this as 'preserve for now', note that transfer functions are
deprecated, and not permitted in PDF 2.0.

devices/vector/gdevpdfp.c


2018-12-01 10:04:09 +0000
Ken Sharp <ken.sharp@artifex.com>
86ed59a3b47bc4b57fbd9c76681558c300d1471b

pdfwrite - conform to Acrobat limitations for PDF 1.4 to conform to PDF/A-1

Never noticed before, but PDF/A-1 mandates sticking to the architectural
limits of Acrobat described in the PDF 1.4 specification (Note, these
are not *PDF* Limitations, they are limitations of the Adobe
implementation).

It was possible for us to emit co-ordinate movements which are in real
numbers, but exceed 32767, which is outside the Acrobat limitation.

This commit alters that, and in fact uses the older limitation of
Acrobat 3 and 4, which limits co-ordinates to +/- 16K.

devices/vector/gdevpdts.c


2018-12-01 10:01:18 +0000
Ken Sharp <ken.sharp@artifex.com>
fb9d383dd90bb430e18bd9c039300f0cff589323

pdfwrite - PDF/A-1 must set Compatibility Level of 1.4

Noticed while working on a different bug. Its correct for PDF/A-2 to be
PDF 1.7, but not for PDF/A-1 we must conform to PDF 1.4.

devices/vector/gdevpdfp.c


2018-11-29 12:30:10 -0800
Nancy Durgin <nancy.durgin@artifex.com>
7eaa19df8086579009552162814b34c651f8d0d4

Fix .vmused undef to work properly

Had to both use an immediate reference and make it an operator.
(commit 2ff600a3c4fc169e7c6c1e83874a6bf63a6fb42b made .vmused an operator)

This test was failing and wasn't detected by cluster test:
debugbin/gs -DDELAYBIND -IResource/Init -sDEVICE=ppmraw -dSAFER

If I don't make it an operator, then this fails (cluster test detects):
debugbin/gs -Z: -o out.bin -IResource/Init -sDEVICE=ppmraw -sDEFAULTPAPERSIZE=letter -dNOPAUSE -dBATCH -K2000000 -dClusterJob -dJOBSERVER -dCETMODE %rom%Resource/Init/gs_cet.ps ~/work/samples/tests_private/ps/ps3cet/36-01.PS

Resource/Init/gs_res.ps


2018-11-28 10:09:01 -0800
Nancy Durgin <nancy.durgin@artifex.com>
932f4106a00e99e4ee32dcc02e57d3636f383ea1

Undef internal functions from level2dict

Resource/Init/gs_lev2.ps


2018-11-29 16:07:17 +0000
Robin Watts <robin.watts@artifex.com>
dce2ab5aead0028de39293da8cf835c76b00a7cf

Remove nasty type check in gs_fapi_finish_render.

This is a left over from when show and text enumerators were
significantly different. The only requirement now is that
text enumerators should set penum->cc to be NULL. We update
gs_text_enum_init_dynamic (and hence gs_text_enum_init) to
do this.

base/gstext.c
base/gxfapi.c


2018-11-29 11:48:25 +0000
Robin Watts <robin.watts@artifex.com>
3bd37e9686f93dabb7121406bf36e59941db8e59

Remove unnecessary checks on object types from gxfapi.c

These are no longer required as the enumerators are the same.

base/gxfapi.c


2018-11-29 17:32:30 +0000
Ken Sharp <ken.sharp@artifex.com>
66df699e2d7f19d87542c76e9d96167f2125e654

pdfwrite - add a check to ensure we don't create an invalid PDF file

related to bug #700291 The PDF file in that bug report was created by
Ghostscript and pdfwrite. The xref table is invalid because it has an
entry with an offset of 11 digits, which is illegal (the file exceeds
10GB in size)

Add a check when writing the xref table to see if any offset is greater
that 10 digits, and throw an error if it is. We can't check any earlier
because we don't know the offset of any object in the file until it is
read from its stored temporary file and written to the main output
file.

devices/vector/gdevpdf.c


2018-11-29 16:22:41 +0000
Chris Liddell <chris.liddell@artifex.com>
c0682e5dd674ecfedcb92ba114ce5c43306f270a

Only use FT weight vector API if FT is new enough

So strictly later than 2.9.1 or when using our patched sources (SHARE_FT==0)

Makefile.in
base/fapi_ft.c


2018-11-28 17:12:08 +0000
Chris Liddell <chris.liddell@artifex.com>
2756f0efae1d3966989b15a6526c5d80848b5015

Bug 700290: Fix problems with DELAYBIND and font substitution

Judicious use of immediate evaluation for .setnativefontmapbuilt and
.putgstringcopy to avoid problems with DELAYBIND

Resource/Init/gs_fonts.ps


2018-11-29 11:47:42 +0000
Robin Watts <robin.watts@artifex.com>
680b49775bf27fcfe3bcdbe7049abbba544f3329

Remove unnecessary checks on type of pgs.

No longer required since pgs and pis were merged.

base/gxchar.c
devices/vector/gdevtxtw.c


2018-11-29 11:33:20 +0000
Robin Watts <robin.watts@artifex.com>
6da179927d5aeaf936ebc81eb9d430f7edc0397a

Remove antiquated check in pdf_shift_text_currentpoint.

pdf_shift_text_currentpoint tests to see that the graphics state
it is passed is really a graphics state. We believe this is a
hangover from having graphics states and imager states.

Firstly, the check is wrong, as it uses penum->dev->memory when
it should be using penum->pgs->memory. Fixing this is enough to
solve the problem where this was seen (gpdl pdfwriting files).

Secondly, however the check is no longer needed, so the nicer fix
is to remove it completely.

devices/vector/gdevpdte.c


2018-11-29 10:55:32 +0000
Ken Sharp <ken.sharp@artifex.com>
cb77559a6825f6fa4b23c1d5efb981eadc7f948f

Source fixup, remove trailing whitespace

base/strmio.c


2018-11-14 16:56:43 -0800
Ray Johnston <ray.johnston@artifex.com>
f0ca2c929171a025e846a2eddd51f767e04c8e23

Bug 695813. Reduce memory usage for ICC profiles. Example AIX361DC_Save.pdf

The same ICC profiles and colorspace were used many times (in the example
the cited PDF_1.7_ATS file) which could result in memory usage growth and
performance impact associated with loading the same profile many times.
There was a icc_profile_cache in the gstate, but it was not being used for
ICCBased colorspaces, only for CIEBased* spaces.

Adding logic to cache ICCBased colorspaces and change ICCBased space to
be in stable memory so it can exist in the cache. This results in a
reduction of the RAM needed for the cited file from 1.0Gb down to 44Mb
and reduced the parse time from 29.4s down to 24.4s (overall time from
94.5s to 91.3s) for ppmraw 600 dpi.

Note that this optimization results in many fewer CS/cs operations being
emitted by pdfwrite, but this also can result in text being emitted as
TJ operations (glyphs with positioning) which can result in single pixel
shifts in glyphs. Sometimes this looks better, sometimes not, but the
reduction in size/complexity of the resulting PDF is worth it.

Resource/Init/pdf_draw.ps
base/gsicc_profilecache.c
psi/zicc.c


2018-11-28 14:04:23 +0000
Robin Watts <robin.watts@artifex.com>
34bb42a7bcd649675d618a62c9f8a3a673598787

Ensure that gs_cet.ps is not squashed in romfs.

This causes us to misinterpret it as being PCL, and defeats the
'skip if read more than once' test.

psi/psromfs.mak


2018-11-28 19:13:16 +0000
Robin Watts <robin.watts@artifex.com>
8d462b070127d3541402b4fda670e0b20c6a61a4

LCMS2MT: Planar data fix.

The PrecalculatedXFORMIdentity case was failing to allow for planar
data. Fix that here.

Also, optimise the src = dst case.

lcms2mt/src/cmsxform.c


2018-11-27 13:11:15 -0800
Nancy Durgin <nancy.durgin@artifex.com>
87ec442bc2b0bfa6607c5fb7d085dd85f24e1416

Undefine internal .findcategory

Resource/Init/gs_init.ps
Resource/Init/gs_ll3.ps
Resource/Init/gs_res.ps


2018-11-27 12:36:14 -0800
Nancy Durgin <nancy.durgin@artifex.com>
2ff600a3c4fc169e7c6c1e83874a6bf63a6fb42b

Undef a bunch of internal things in gs_res.ps

Resource/Init/gs_res.ps
Resource/Init/gs_resmp.ps


2018-11-14 22:30:43 +0000
Chris Liddell <chris.liddell@artifex.com>
a6da4c97bb99159269468d95daacdf11ab336187

Use the new Freetype FT_Set/Get_MM_WightVector API

Being able to set the weight vector in an existing FT font object avoids the
need to recreate the font every time the weightvector changes in Postscript.

Creating an FT font is a time consuming operation, so this can save considerable
time in jobs that make heavy use of multiple master fonts

base/fapi_ft.c
base/gxfapi.c


2018-11-14 22:29:24 +0000
Chris Liddell <chris.liddell@artifex.com>
bfddf70400bb1fd4b3f7bfd72f333ad09a0b6cba

Add a setweightvector analogue in Freetype

Avoids the need to recreate the FT font everytime the weightvector changes.

These Freetype changes have been accepted upstream:
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=78a1e69517ca067224d6e33beffd25e2ec8361d2

freetype/include/freetype/ftmm.h
freetype/include/freetype/internal/services/svmm.h
freetype/src/base/ftmm.c
freetype/src/cff/cffdrivr.c
freetype/src/truetype/ttdriver.c
freetype/src/type1/t1driver.c
freetype/src/type1/t1load.c
freetype/src/type1/t1load.h


2018-11-27 19:43:29 +0000
Robin Watts <robin.watts@artifex.com>
3f93e079aa448a202329fd08a350485c3504b9dd

Fix typo in previous commit.

I failed dismally at checking the depth.

base/gdevdflt.c
devices/gdevbit.c


2018-11-27 17:24:38 +0000
Robin Watts <robin.watts@artifex.com>
c80766f966d2801a8608e72a1dea6dcb4bec4248

Bug 700278: Fix inverted colors in jpegcmyk output.

It seems that in the transform pixel region code, I know that
colours are in the right space, and therefore assume that there
will be a 1:1 mapping from the raw bytes into the device memory.

Sadly the jpegcmyk device inverts everything, so my assumption
was wrong.

Accordingly I've added a gxdso to tell me if the encoding is
direct. I've added this to the obvious devices - more may be
required in future.

If this is unimplemented, then we'll take the slower route
and look up colors.

base/gdevdflt.c
base/gdevp14.c
base/gxcmap.c
base/gxdevsop.h
devices/gdevbit.c


2018-11-26 18:01:25 +0000
Chris Liddell <chris.liddell@artifex.com>
779664d79f0dca77dbdd66b753679bfd12dcbbad

Have gs_cet.ps run from gs_init.ps

Previously gs_cet.ps was run on the command line, to set up the interpreter
state so our output more closely matches the example output for the QL CET
tests.

Allow a -dCETMODE command line switch, which will cause gs_init.ps to run the
file directly.

This works better for gpdl as it means the changes are made in the intial
interpreter state, rather than after initialisation is complete.

This also means adding a definition of the default procedure for black
generation and under color removal (rather it being defined in-line in
.setdefaultbgucr

Also, add a check so gs_cet.ps only runs once - if we try to run it a second
time, we'll just skip over the file, flushing through to the end.

Resource/Init/gs_cet.ps
Resource/Init/gs_init.ps


2018-11-21 13:43:50 -0800
Nancy Durgin <nancy.durgin@artifex.com>
5d967e5d2c0b63a3c7d67a08a53ff657d36f0d18

Undef some internal level3 implementation details

Also moved some undef's from gs_init.ps to gs_ll3.ps because they are
for things defined and used only in this file (or some are defined in
the C code, but still only used here).

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


2018-11-20 14:32:20 -0800
Nancy Durgin <nancy.durgin@artifex.com>
f1206fa3834b5a8ff798e08d9cfcbb27bb9bdd41

Remove dead code from gs_cspace.ps

These are dead code, apparently:
/..includecolorspace
/cs_substitute_generic
/cs_substitute_DeviceRGB_for_PDFX_or_PDFA

This one is called from C code (zcolor.c) and can't be undef'd
Added comment about how to trigger it.
/..nosubstdevicetest

Resource/Init/gs_cspace.ps


2018-11-20 12:47:40 -0800
Nancy Durgin <nancy.durgin@artifex.com>
d6630dfe7a2d44aec9193950acc34836a32f97e2

Undef'd things used locally in gs_btokn.ps (binary tokens)

/.objectprinttest
/.bosheader
/.cntobj
/.writeobject
/.writeobjects

Resource/Init/gs_btokn.ps


2018-11-20 12:19:28 -0800
Nancy Durgin <nancy.durgin@artifex.com>
c548ed1dca42cb77572b2a7f8448aad2ce98918c

Fix some previously attempted undef's

/.setdevicecolorrendering1 needs to be undef'd from both systemdict
and level2dict

/.ProcessICCcomment was misspelled

/.setpagesize is actually in statusdict and haven't successfully undef'd yet

Resource/Init/gs_icc.ps
Resource/Init/gs_init.ps


2018-11-27 14:08:33 +0000
Ken Sharp <ken.sharp@artifex.com>
de8b6458abaeb9d0b14f02377f3e617f2854e647

PS interpreter - fix EPSFitPage (again)

Bug #700279 "On square EPS files -dFitPage incorrectly rotates output"

The commit to fix bug #698555 altered the action of EPSFitPage so that
it set the media size form the BoundingBox (using EPSCrop) and then
relied on the usual PostScript page fitting.

However, as noted at the time, this does cause square pages to rotate.
This isn't actually incorrect, there is no specification for this its a
Ghostscript feature, and we're free to implement it any way we like.
However it is a change form the previous behaviour.

This commit reinstates the EPSFitPage code (in EPSBoundingBoxFitPage
in gs_epsf.ps) and fixes the calculations in that code when the content
is rotated onto the media (because it fits better that way) so that it
correctly scales and translates the content onto the new media.

because we are no longer using the PostScript page fitting code, this
no longer rotates square media.

Resource/Init/gs_epsf.ps
Resource/Init/gs_init.ps


2018-11-26 08:20:19 +0000
Ken Sharp <ken.sharp@artifex.com>
96c381cce28c27eac182549441a6c5025b0dcdd6

ps2write - move the page level save/restore wrapper

Bug #700232 "A5 duplex to duplex-capable Postscript printer prints single-sided"

Commit 0f6067d2531298060392d0e25fa759d320e03021 for bug #697245
removed a duplicate definition of pagesave, because it transpires that
Adobe interpreters don't free save objects when they are no longer
referenced. Previously we had defined /pagesave in both the page
content stream, and the code for altering page size.

The problem is that we alter media size as part of processing the
'stream' keyword, which is after we have defined /pagesave. Previously
we would then have redefined it if we needed to alter the media size.

When we got to the end of the page (after the showpage) we would then
restore the save object. Because we had defined the save object after we
had altered the media size the media would remain unchanged. With the
commit above, however, the media size would be restored back to the
original.

When we process page 2, the media size would then need to he altered
again, requiring a setpagedevice to be executed. The action of
setpagedevice, when Duplex is true, is to eject any unpaired pages and
start again with the first side.

Thus Duplex was working entirely correctly, simply not as desired.

This commit moves the pagesave and restore into the 'stream' and
'endstream' processing, so that is taken care of after any media size
changes.

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


2018-11-26 15:19:35 -0800
Michael Vrhel <michael.vrhel@artifex.com>
2ceb01328c4270386299ef55dbdc06d1f26d63c8

Remove unneeded check for planar during color conversion

base/gsicc_lcms2mt.c


2018-11-26 12:14:21 -0800
Michael Vrhel <michael.vrhel@artifex.com>
56b4298a22c3253206615bc6fda34f74aaa72800

Avoid allocations when color transforming planar data

base/gsicc_lcms2mt.c


2018-11-14 14:27:26 -0800
Ray Johnston <ray.johnston@artifex.com>
461cdaa4287edac9bfd0caebf3e8291e0539a0fd

Fix some missing type checking and use check_read_type consistently

Some places checked with code, some places used the check__type
macro (which doesn't check for read access) and some places used
check_read_type. Also add check for CIEdict1 in hashcieaspace.

psi/zcolor.c


2018-11-14 14:19:42 -0800
Ray Johnston <ray.johnston@artifex.com>
e45b35ede042259ff9fbf36fa714e874fc5483db

Change hash key for the icc_profile_cache to uint64_t

This was ulong in some places and int64_t in another, but ulong on a
Windows build is only 32-bits. Make it consistent (and more bytes on
Windows).

base/gscms.h
base/gsicc_profilecache.c
base/gsicc_profilecache.h
psi/zcie.c
psi/zcie.h
psi/zcolor.c


2018-11-09 14:26:27 -0800
Ray Johnston <ray.johnston@artifex.com>
410a192c093c22ca1dbfc1764659faa6a48198a8

Fix infinite loop freeze running all PDF ATS files.

The infinite loop was caused by bumping the ref_count on a cache link
entry too early so that anytime we reached ICC_CACHE_MAXLINKS links in
the cache, we would loop forever.

This simplifies the code, removes a function that was only used once,
and also protects the clist multi-threading from potential lock up due
to more threads than slots in the icc_link_cache.

Add a semaphore when the link_cache is full (no zero ref_count entries)
to let other threads run and finish up with the links that are in the
cache.

No bug opened, but occurred with:
gs -r600 -sDEVICE=ppmraw -o /dev/null PDF_1.7_ATS/*.pdf
NB: This requires skipping AC8ZD1CC_Save.pdf since that needs a password.

base/gpsync.h
base/gscms.h
base/gsicc_cache.c
base/gxclthrd.c


2018-11-26 16:17:51 +0000
Robin Watts <robin.watts@artifex.com>
2501816e229ae98e1c0d9a91f8bf00b380301b55

Fix comment typo.

psi/zdevice.c


2018-11-23 16:24:43 +0000
Robin Watts <robin.watts@artifex.com>
f73fb86fb40d092b4b9a39f43a374bd70eac0d41

Remove more macros from iscan.c

psi/iscan.c


2018-11-26 15:14:12 +0000
Robin Watts <robin.watts@artifex.com>
9a364553aa4d0738ec763aa2c262af6fc82b088d

Make sfclose accept NULL.

All destructors should accept NULL. Anything else is insanity.

base/strmio.c


2018-10-22 18:47:40 +0100
Robin Watts <robin.watts@artifex.com>
40dc5b409c6262b18b4bf5386b5482ead4c511e3

Remove gpdl from the "all" Makefile targets.

Add it to a new "experimental" target that is what "all" used to
be.

Makefile.in
base/gs.mak
psi/msvc.mak


2018-09-14 14:00:40 +0100
Robin Watts <robin.watts@artifex.com>
b43a9362c8614182e77b89a3ff8d8c56a6628260

iscan.c: Remove some scan macros.

psi/iscan.c


2018-09-14 13:56:21 +0100
Robin Watts <robin.watts@artifex.com>
9e99c4ab4135f735091d4b3ffe26851604507db5

iscan.c: Demacro: ssarray

psi/iscan.c


2018-11-22 19:17:28 +0000
Robin Watts <robin.watts@artifex.com>
0718e9a4fdc1c107d772d1aff37566c73d5958f8

Remove ziodevs.c from MSVC project.

windows/ghostscript.vcproj


2018-11-19 17:38:11 +0000
Robin Watts <robin.watts@artifex.com>
edbad08f9c91c994ac8f8df45e0cbf37ca377104

Remove macro bletcherisms from stream code.

base/gsioram.c
base/gsiorom.c
base/sfxfd.c
base/sfxstdio.c
base/stream.c
base/stream.h
psi/zfilter.c
psi/zfrsd.c


2018-11-22 18:18:03 +0000
Robin Watts <robin.watts@artifex.com>
e1eecc89c943d20145a887c64193fb0bfb44c250

Squash warnings.

base/gdevdrop.c
base/gsicc_cache.c
base/gxclist.c
devices/gdevxcmp.c
pcl/pcl/pcfont.c
psi/ilocate.c
psi/zvmem.c


2018-11-22 16:30:49 +0000
Robin Watts <robin.watts@artifex.com>
8fe6187ace91d49c3ca07ab850bc1fe50da3409e

Remove STDIO_IMPLEMENTATION logic from Makefiles.

This has fallen out of usage to the degree where the non-C callbacks
based version hasn't even built for years (since at least 2006, by
my git archaeology). Just strip it out completely.

Makefile.in
base/gs.mak
base/msvclib.mak
base/openvms.mak
base/ugcclib.mak
base/unix-dll.mak
base/unix-gcc.mak
base/unixansi.mak
psi/int.mak
psi/msvc.mak
psi/os2.mak
psi/ziodevs.c
psi/ziodevsc.c


2018-11-07 16:03:59 +0000
Chris Liddell <chris.liddell@artifex.com>
07b4a67404479dfa3ae55835f05b6cc8699c9adc

Bring master up to date with 9.26 release branch

Docs, dates etc

Dates, change log, etc for 9.26 rc1

Dates, changelog, etc for 9.26 release

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


2018-11-14 21:11:43 +0000
Robin Watts <robin.watts@artifex.com>
4b50d93dfe0b539d2cbbf80b3db8c89362abb265

Add gpdlmemento target.

Also add "mementovg" targets for building memento with knowledge of
valgrind. Can't make this the default as then we'd not be able to
build memento on machines without valgrind installed.

base/unix-end.mak


2018-11-20 18:43:20 +0000
Chris Liddell <chris.liddell@artifex.com>
690bc91e0fff4314128becb98e27b8bdd182c194

Tweak gs_cet.ps papersize handling.

This file has always removed all but the default papersizes from
InputAttributes. Here, also ensure that we make that the current
page size to avoid problems with setpagedevice later on.

Resource/Init/gs_cet.ps


2018-11-20 13:44:22 +0000
Robin Watts <robin.watts@artifex.com>
bca00a68a20b4022ce6138d647daa0b6b7989c9a

Remove pl_top_cursor_t and move to using streams.

pcl/pl/pl.mak
pcl/pl/plcursor.c
pcl/pl/plcursor.h
pcl/pl/plmain.c
windows/ghostpcl.vcproj


2018-11-15 15:38:37 -0800
Nancy Durgin <nancy.durgin@artifex.com>
93e0445e2c9980a3e5eb066d61682e84716972bb

Delete gs_l2img.ps, and all references in makefiles and docs.

This is dead code that apparently hasn't been used for years. It was
defining some things in systemdict (.colorspaceimage, .csinextbits)
that are now also gone.

Resource/Init/gs_l2img.ps
doc/Develop.htm
doc/Psfiles.htm
psi/int.mak
psi/psromfs.mak
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-11-15 15:01:48 -0800
Nancy Durgin <nancy.durgin@artifex.com>
9a270eea5080ec418202dcb778c1215839123555

Undef a bunch of image-related things

If we get rid of display postscript, this simplifies to just getting rid of
the img_utils_dict, which contains all the things I have undefined.

Resource/Init/gs_img.ps


2018-11-15 09:23:55 -0800
Nancy Durgin <nancy.durgin@artifex.com>
e06edfb35e09d7e34d4c0c0a31931e28c4cd944d

Undefine a bunch of functions

undef .ProcessICCComment from gs_icc.ps

Undef .rewriteTempMapsNotDef in gs_cmap.ps

These are implemented in C code, so not associated with a particular ps file.

/.currentmatrix /.setmatrix /.setdevicecolorrendering1
/.setlinecap /.setlinejoin /.sizeimagebox /.systemvmcheck

Resource/Init/gs_cmap.ps
Resource/Init/gs_icc.ps
Resource/Init/gs_init.ps


2018-11-20 12:59:06 +0000
Robin Watts <robin.watts@artifex.com>
b7ee393b7afb0d584528173d98fe0509d1ea09ff

Remove needless macros in plmain.c

pcl/pl/plmain.c


2018-11-19 17:23:02 +0000
Ken Sharp <ken.sharp@artifex.com>
c0de6c578f685c03d21c2a5d934734081265d10e

Function cleanup - NULL pointers after free

The PostScript code seems to get away with this, but for the PDF
interpreter we need the object pointed to by the various 'params'
structure members to be NULL after they are freed, so that we don't
try to free memory which has already been freed.

base/gsfunc.c
base/gsfunc0.c
base/gsfunc3.c
base/gsfunc4.c


2018-11-19 09:28:41 +0000
Chris Liddell <chris.liddell@artifex.com>
af39fde7b765ea5550a857290d68f58468086a8c

Coverity CIDs: 326829, 326828 and 326827

Check return values for gdev_prn_open_printer()

contrib/gdevgdi.c
contrib/japanese/gdevrpdl.c
devices/gdevdjet.c


2018-11-19 09:00:54 +0000
Ken Sharp <ken.sharp@artifex.com>
4d98293c72cc5b5fe456065a3252d39e9ab28e4d

Coverity ID 327264 - move pointer NULL check

Due to recent changes in this code, the pointer was being dereferenced
before we checked it to see if it was NULL. Moe the check so that we
check for NULL before dereferencing.

The 'pvalue' of the operand can be NULL, even if the object is a t_device
type, because invalidate_stack_devices traverses the operand stack
looking for devices, and sets their pvalue member to NULL in order to
invalidate them so that they cannot be used.

psi/zdevice.c


2018-11-17 11:20:08 +0000
Ken Sharp <ken.sharp@artifex.com>
867deb44ce59102b3c817b8228d9cbfd9d9b1fde

Check structure types when using the r_ptr macro

Two more places where we were using the r_ptr macro to cast a PostScript
ref object into a structure without thoroughly checking that the object
was in fact a structure of the correct type.

One case did a partial check, but this is more robust.

base/gsfcid2.c
base/gsfcmap.c
psi/zdscpars.c
psi/zfcmap.c


2018-11-17 10:00:32 +0000
Ken Sharp <ken.sharp@artifex.com>
aba438b1835c4c0f4c2b0aee5b7d8430d7e58251

Coverity ID 94865

This had already been tackled, but it turns out there were a couple
more places where tempnames wasn't freed, but Coverity only seems to
flag them one at a time.

psi/imain.c


2018-11-17 09:37:07 +0000
Ken Sharp <ken.sharp@artifex.com>
5cfe86c6f37f4838746d7cc7e9e6125538af6e84

Coverity ID 323322

The new 'transform_pixel_region' method default for forwarding devices
tests the target device to see if its NULL (some forwarding devices are
not always forwarding devices, eg bbox), and if it is NULL then instead
of passing the call to the target device it calls the graphics library
default.

Unfortunately it was passing the target device as an argument, and this
is now certain to be NULL. In gx_default_transform_pixel_region_begin()
we then dereference the pointer which would cause a crash.

So instead, pass the device itself when its not actually a forwarding
device.

Also, some white space changes.

base/gdevnfwd.c


2018-11-16 17:56:46 +0000
Robin Watts <robin.watts@artifex.com>
79a6bb7c5e33e0acf281bf7f34e6c6cc20c2549c

Bug 700205: Bring jbig2dec's copy of memento up to date.

jbig2dec/memento.c
jbig2dec/memento.h


2017-07-03 13:07:29 +0100
Robin Watts <Robin.Watts@artifex.com>
bd6af85222da668b56a1815fefc374b2096029b5

Sync Memento from MuPDF.

* pointer checking functions.

Add some helpful functions for doing quick checks on pointer validity.
Use these in the reference counting functions.

* make ref counting advance events.

* misc sizeof fixes.

base/memento.c
base/memento.h


2018-09-19 17:27:11 +0100
Robin Watts <robin.watts@artifex.com>
7750a48097a387a006577a02e20e2673a77fc82f

Update language recognition mechanism.

Rather than each language implementation offering a single string
to be matched, they now offer a function to match the given
string.

This allows us to have the PJL recognising routine accept a
single <CR><LF> at the top of a PJL block.

Technically, this is against the spec, which very clearly says
that any UEL must be followed instantly by "@PJL" rather than
there being any whitespace there. Sadly, the file from bug 693269
sends UEL<CR><LF>@PJL... and so outputs a page of PJL in the
middle of the job without this fix.

Tests on Henry's HP printer show that his printer at least matches
this behaviour.

It is hard to see that there can be that many real world files out
there that will be adversely affected by this fix.

This means we now behave the same on bug 693269 as we did prior to
making our language switching actually switching languages.

gpdl/psi/psitop.c
pcl/pcl/pctop.c
pcl/pl/pjparse.c
pcl/pl/pjparsei.c
pcl/pl/plmain.c
pcl/pl/pltop.c
pcl/pl/pltop.h
pcl/pxl/pxtop.c
xps/xpstop.c


2018-11-15 15:24:10 +0000
Ken Sharp <ken.sharp@artifex.com>
46d3a9a658f3b92e554cffc3c2ace8c140118155

PS interpreter - check infinite result on exp, where possible

Bug #700181 "using exp with 0 as base" (again)

The reporter for the bug failed to mention this condition in the
original report. Technically we don't always have isinf() available
(I suspect all real compilers do these days) but where we do we can
check the result. Where we don't, we're stuck. This mimics the
behaviour of other math operations in Ghostscript.

psi/zmath.c


2018-11-15 14:18:17 +0000
Ken Sharp <ken.sharp@artifex.com>
1218b59561ba950e212ad4e585bd7b0612eb2102

PDF interpreter - use Appearance streams for highlight annotations

We were previously never using the Appearance stream for a highlight
annotation, which is documented as incorrect in the PDF 2.0 spec.

The reason we were not using it is because a very few PDF files render
differently if we do. This is because Acrobat 'sometimes', and I cannot
figure out the conditions for htis, ignores a perfectly valid Appearance
and generates a new one.

In this case a customer produced a file where the QuadPoints entry is
incorrect. If we use the Appearance stream (as Acrobat does) then the
rendering is correct. If we generate an appearance then, because the
QuadPoints are incorrect, the rendering is incorrect.

Since the PDF 2.0 specification now makes it clear that we should be
using a supplied Appearance stream, I've chosen to change the behaviour
so that we do.

I've also made the text for an appearance stream slightly more robust
and general.

This does produce a few diffs, because of the afore-mentioned files. In
my opinion Acrobat is incorrect in how it treats these files. Our new
rendering is correct.

Resource/Init/pdf_draw.ps


2018-11-14 21:04:46 +0000
Chris Liddell <chris.liddell@artifex.com>
ea1b3ef437f39e45874f821c06bd953196625ac5

Bug 700176: Use the actual output device for both devices in setdevice

Also fixes bug 700189.

The pdf14 compositor device, despite being a forwarding device, does not forward
all spec_ops to it's target, only a select few are special cased for that.
gxdso_current_output_device needs to be included in those special cases.

The original commit (661e8d8fb8248) changed the code to use the spec_op to
retrieve the output device, checking that for LockSafetyParams. If
LockSafetyParams is set, it returns an invalidaccess error if the new device
differs from the current device.

When we do the comparison between the two devices, we need to check the
output device in both cases.

This is complicated by the fact that the new device may not have ever been set
(and thus fully initialised), and may not have a spec_op method available at
that point.

base/gdevp14.c
psi/zdevice.c


2018-11-13 14:23:41 -0800
Nancy Durgin <nancy.durgin@artifex.com>
fe4c47d8e25d6366ecbb5ff487348148b908a89e

Undefine some level2-related operators

These are only a partial set. Undefine them in both the level2dict and
systemdict. They are undef'd in gs_init.ps because they are used outside
the scope of just gs_lev2.ps

/.execform1
/.getdevparams
/.setuserparams2
/.startjob
/.checkFilePermitparams
/.checksetparams
/.copyparam
/.setpagesize

Rename .dict1 to .pair2dict and use immediate reference.

Undef these at end of gs_lev2.ps (should never make it into systemdict):
/.pair2dict
/.checkprocesscomment

Resource/Init/gs_init.ps
Resource/Init/gs_lev2.ps


2018-11-14 17:37:02 +0000
Robin Watts <robin.watts@artifex.com>
66a273de3ca0560bd41a2448b264d78f9316ba6a

Fix PCL handling of slightly malformed PJL.

We parse the PJL lines in, and if we find a terminator character
other than '\n', we ignore the line. What is worse, we eat the
character that we trip over, so that if it (say) happened to be
an ESC, we then don't process the next command correctly.

pcl/pl/pjparse.c


2018-11-14 16:01:51 +0000
Ken Sharp <ken.sharp@artifex.com>
965a557a4cdc8f45ff962616b884c281abd6c72c

PS interpreter - in seticcspace, ensure the ICC dictionary is a dict

From a review of dict_find_string, that function does not check to see
if the object it is passed as an argument is a dictionary, so its
essential to make sure the argument is checked before calling.

This is the only remaining case I could find.

psi/zcolor.c


2018-11-13 04:18:21 +0100
Sebastian Rasmussen <sebras@gmail.com>
f1756124f0f3c542bd6c2a9b325dea6bf860fc61

jbig2dec: Only print repeated error/warning messages once.

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


2018-11-14 14:28:48 +0000
Ken Sharp <ken.sharp@artifex.com>
bcb605e49dbe306ba881818466f8be591510a9ab

PS interpreter - Throw error from exp when base is 0 and -ve exponent

Bug #700181 "using exp with 0 as base"

If base is 0, and exp is negative, then the result of exp is undefined
we should throw an error instead of pushing #INF.0 on the stack.

psi/zmath.c


2018-11-14 13:32:43 +0000
Robin Watts <robin.watts@artifex.com>
9a982079dabc985bbd26d69322f517495158e882

Update .gitattributes file.

Stolen largely from MuPDF's file. This should keep the tabs in
Makefiles from confusing things.

.gitattributes


2018-11-14 13:15:11 +0000
Robin Watts <robin.watts@artifex.com>
fa3ac5d4cfea23ddc4eed64fd6f552013019ad1a

MSVC: Remove #define for fstat from unistd.h

We already define it in stat_.h, which seems like a much more sensible
place.

base/unistd_.h


2018-11-14 09:50:08 +0000
Chris Liddell <chris.liddell@artifex.com>
661e8d8fb8248c38d67958beda32f3a5876d0c3f

Bug 700176: check the *output* device for LockSafetyParams

When calling .setdevice we were checking if LockSafetyParams was set, and if so
throwing an invalidaccess error.

The problem is, if another device, for example the pdf14 compositor is the 'top'
device, that does not (and cannot) honour LockSafetyParams.

To solve this, we'll now use the (relatively new) gxdso_current_output_device
spec_op to retrieve the *actual* output device, and check the LockSafetyParams
flag in that.

psi/zdevice.c


2018-11-14 09:31:10 +0000
Ken Sharp <ken.sharp@artifex.com>
9a1b3ac61761094713f44dedfce56013308a3b1d

PS interpreter - add some type checking

These were 'probably' safe anyway, since they mostly treat the objects
as integers without checking, which at least can't result in a crash.

Nevertheless, we ought to check.

The return from comparedictkeys could be wrong if one of the keys had
a value which was not an array, it could incorrectly decide the two
were in fact the same.

psi/zbfont.c
psi/zcolor.c
psi/zcrd.c
psi/zfjpx.c
psi/zfont.c
psi/zfont0.c
psi/zimage3.c
psi/ztrans.c


2018-11-14 09:27:00 +0000
Ken Sharp <ken.sharp@artifex.com>
606a22e77e7f081781e99e44644cd0119f559e03

Bug #700168 - add a type check

Bug #700168 "Type confusion in JBIG2Decode"

The code was assuming that .jbig2globalctx was a structure allocated
by the graphics library, without checking.

Add a check to see that it is a structure and that its the correct
type of structure.

psi/zfjbig2.c


2018-11-14 09:25:13 +0000
Ken Sharp <ken.sharp@artifex.com>
434753adbe8be5534bfb9b7d91746023e8073d16

Bug #700169 - unchecked type

Bug #700169 "Type confusion in setcolorspace"

In seticc() we extract "Name" from a dictionary, if it succeeds we then
use it as a string, without checking the type to see if it is in fact
a string.

Add a check on the type, and add a couple to check that 'N' is an integer
in a few places too.

psi/zicc.c


2018-11-07 15:03:48 -0800
Nancy Durgin <nancy.durgin@artifex.com>
4f168df2845e15e5f87232317472d09ad1b2f1a3

Move a bunch of existing undef's up to the array with the others.

Resource/Init/gs_init.ps


2018-11-08 15:34:38 -0800
Nancy Durgin <nancy.durgin@artifex.com>
b7e7a76098c33e04e22464b6278c68a02b3d39b0

Undefined a bunch of EPS things

Resource/Init/gs_epsf.ps


2018-11-07 15:00:27 -0800
Nancy Durgin <nancy.durgin@artifex.com>
6f8b9869b38909700dcf906332d8825a6c390765

Remove .endjob, which is not used anywhere

Resource/Init/gs_lev2.ps


2018-11-12 17:21:33 +0000
Chris Liddell <chris.liddell@artifex.com>
aeea342904978c9fe17d85f4906a0f6fcce2d315

Bug 700153: restore: always check available stack

Previously, we were checking there was enough stack space available when the
restore operation required a device change, but since we have to use
Postscript to reset the userparams (ick!), we need the stack check even when
not changing the device.

psi/zdevice2.c


2018-11-07 12:22:59 +0000
Chris Liddell <chris.liddell@artifex.com>
2dceb0400c5a571f23070891b8a8028d04926de1

Contrib devices: Check for error return opening output file

09-59.PS cycles through every available device, attempting to open each one.

For many devices this results in an invalid configuration (mainly a lack of
output file).

These devices, on being shutdown, ignored the lack of output file, and attempted
to write their final bytes out anyway (attempting to write data to a null
FILE * pointer), causing a segfault.

We now check the return value of gdev_prn_open_printer() and only write those
final bytes if gdev_prn_open_printer() completed successfully.

contrib/japanese/gdevespg.c
contrib/japanese/gdevnpdl.c
contrib/lips4/gdevl4r.c


2018-11-08 14:43:32 +0000
Ken Sharp <ken.sharp@artifex.com>
693baf02152119af6e6afd30bb8ec76d14f84bbf

PS interpreter - check the Implementation of a Pattern before use

Bug #700141 "Type confusion in setpattern"

As the bug thread says, we were not checking that the Implementation
of a pattern dictionary was a structure type, leading to a crash when
we tried to treat it as one.

Here we make the st_pattern1_instance and st_pattern2_instance
structures public definitions and in zsetcolor we check the object
stored under the Implementation key in the supplied dictionary to see if
its a t_struct or t_astruct type, and if it is that its a
st_pattern1_instance or st_pattern2_instance structure.

If either check fails we throw a typecheck error.

We need to make the st_pattern1_instance and st_pattern2_instance
definitions public as they are defined in the graphics library and we
need to check in the interpreter.

base/gsptype1.c
base/gsptype2.c
base/gsptype2.h
base/gxcolor2.h
psi/zcolor.c


2018-11-08 12:58:28 +0000
Robin Watts <robin.watts@artifex.com>
81f3d1e7247b9a8e29a388677b01959e612a28c7

Fix missing images due to transform_pixel_region and pattern_accumulator.

The pattern_accumulator was defaulting to the forwarding version
of transform_pixel_region, which was only dealing with the image
plane, not the mask. Accordingly nothing was being plotted.

Instead, use the default, which devolves to copy_color (for the
image data) and fill_rectangle (for the mask).

base/gxpcmap.c


2018-11-07 15:59:32 +0000
Chris Liddell <chris.liddell@artifex.com>
5a4fec2a34af925993192e197ab666fe542b79d3

Bump version number for release

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


2018-11-20 09:51:17 +0000
Chris Liddell <chris.liddell@artifex.com>
8efbedbab72687cb51e3c353d5665d00120eed4a

Dates, changelog, etc for 9.26 release

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


2018-11-19 09:28:41 +0000
Chris Liddell <chris.liddell@artifex.com>
e5978ae6d1e4f3dee0a2838ed580b0373e102613

Coverity CIDs: 326829, 326828 and 326827

Check return values for gdev_prn_open_printer()

contrib/gdevgdi.c
contrib/japanese/gdevrpdl.c
devices/gdevdjet.c


2018-11-19 09:00:54 +0000
Ken Sharp <ken.sharp@artifex.com>
a4228a0d8d657fca3bb3becb93a43fae061beae8

Coverity ID 327264 - move pointer NULL check

Due to recent changes in this code, the pointer was being dereferenced
before we checked it to see if it was NULL. Moe the check so that we
check for NULL before dereferencing.

The 'pvalue' of the operand can be NULL, even if the object is a t_device
type, because invalidate_stack_devices traverses the operand stack
looking for devices, and sets their pvalue member to NULL in order to
invalidate them so that they cannot be used.

psi/zdevice.c


2018-11-17 11:20:08 +0000
Ken Sharp <ken.sharp@artifex.com>
c796ccb512ac581f5ac492fda8807d41769c47e8

Check structure types when using the r_ptr macro

Two more places where we were using the r_ptr macro to cast a PostScript
ref object into a structure without thoroughly checking that the object
was in fact a structure of the correct type.

One case did a partial check, but this is more robust.

base/gsfcid2.c
base/gsfcmap.c
psi/zdscpars.c
psi/zfcmap.c


2018-11-17 10:00:32 +0000
Ken Sharp <ken.sharp@artifex.com>
cb9bb72643e95383bcacd88ab718565f3df9a510

Coverity ID 94865

This had already been tackled, but it turns out there were a couple
more places where tempnames wasn't freed, but Coverity only seems to
flag them one at a time.

psi/imain.c


2018-11-17 09:37:07 +0000
Ken Sharp <ken.sharp@artifex.com>
c69827c308b608719d786fc14c8518af4dd6b335

Coverity ID 323322

The new 'transform_pixel_region' method default for forwarding devices
tests the target device to see if its NULL (some forwarding devices are
not always forwarding devices, eg bbox), and if it is NULL then instead
of passing the call to the target device it calls the graphics library
default.

Unfortunately it was passing the target device as an argument, and this
is now certain to be NULL. In gx_default_transform_pixel_region_begin()
we then dereference the pointer which would cause a crash.

So instead, pass the device itself when its not actually a forwarding
device.

Also, some white space changes.

base/gdevnfwd.c


2018-11-15 15:24:10 +0000
Ken Sharp <ken.sharp@artifex.com>
4548ceaf5ada7f7a4c4da5907e27fec62c1ce63d

PS interpreter - check infinite result on exp, where possible

Bug #700181 "using exp with 0 as base" (again)

The reporter for the bug failed to mention this condition in the
original report. Technically we don't always have isinf() available
(I suspect all real compilers do these days) but where we do we can
check the result. Where we don't, we're stuck. This mimics the
behaviour of other math operations in Ghostscript.

psi/zmath.c


2018-11-15 14:18:17 +0000
Ken Sharp <ken.sharp@artifex.com>
a4e3cb230bfdbf9cb5a0d30763889e58f8215ed1

PDF interpreter - use Appearance streams for highlight annotations

We were previously never using the Appearance stream for a highlight
annotation, which is documented as incorrect in the PDF 2.0 spec.

The reason we were not using it is because a very few PDF files render
differently if we do. This is because Acrobat 'sometimes', and I cannot
figure out the conditions for htis, ignores a perfectly valid Appearance
and generates a new one.

In this case a customer produced a file where the QuadPoints entry is
incorrect. If we use the Appearance stream (as Acrobat does) then the
rendering is correct. If we generate an appearance then, because the
QuadPoints are incorrect, the rendering is incorrect.

Since the PDF 2.0 specification now makes it clear that we should be
using a supplied Appearance stream, I've chosen to change the behaviour
so that we do.

I've also made the text for an appearance stream slightly more robust
and general.

This does produce a few diffs, because of the afore-mentioned files. In
my opinion Acrobat is incorrect in how it treats these files. Our new
rendering is correct.

Resource/Init/pdf_draw.ps


2018-11-14 21:04:46 +0000
Chris Liddell <chris.liddell@artifex.com>
e8be28b49c6a43db1861119288933b5a8fdbef73

Bug 700176: Use the actual output device for both devices in setdevice

Also fixes bug 700189.

The pdf14 compositor device, despite being a forwarding device, does not forward
all spec_ops to it's target, only a select few are special cased for that.
gxdso_current_output_device needs to be included in those special cases.

The original commit (661e8d8fb8248) changed the code to use the spec_op to
retrieve the output device, checking that for LockSafetyParams. If
LockSafetyParams is set, it returns an invalidaccess error if the new device
differs from the current device.

When we do the comparison between the two devices, we need to check the
output device in both cases.

This is complicated by the fact that the new device may not have ever been set
(and thus fully initialised), and may not have a spec_op method available at
that point.

base/gdevp14.c
psi/zdevice.c


2018-11-14 16:01:51 +0000
Ken Sharp <ken.sharp@artifex.com>
5db929cf393fa330bf916da37f5d2a5954a3b0c3

PS interpreter - in seticcspace, ensure the ICC dictionary is a dict

From a review of dict_find_string, that function does not check to see
if the object it is passed as an argument is a dictionary, so its
essential to make sure the argument is checked before calling.

This is the only remaining case I could find.

psi/zcolor.c


2018-11-13 04:18:21 +0100
Sebastian Rasmussen <sebras@gmail.com>
a92e38603902b22c5b20fecefa5da3d2a233516c

jbig2dec: Only print repeated error/warning messages once.

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


2018-11-14 14:28:48 +0000
Ken Sharp <ken.sharp@artifex.com>
3bb28e08002ef4a90bddb05aa6cd06a256153663

PS interpreter - Throw error from exp when base is 0 and -ve exponent

Bug #700181 "using exp with 0 as base"

If base is 0, and exp is negative, then the result of exp is undefined
we should throw an error instead of pushing #INF.0 on the stack.

psi/zmath.c


2018-11-14 09:50:08 +0000
Chris Liddell <chris.liddell@artifex.com>
35766ceb3b28aad95bd63655b1d621a82d3a5b06

Bug 700176: check the *output* device for LockSafetyParams

When calling .setdevice we were checking if LockSafetyParams was set, and if so
throwing an invalidaccess error.

The problem is, if another device, for example the pdf14 compositor is the 'top'
device, that does not (and cannot) honour LockSafetyParams.

To solve this, we'll now use the (relatively new) gxdso_current_output_device
spec_op to retrieve the *actual* output device, and check the LockSafetyParams
flag in that.

psi/zdevice.c


2018-11-14 09:31:10 +0000
Ken Sharp <ken.sharp@artifex.com>
548bb434e81dadcc9f71adf891a3ef5bea8e2b4e

PS interpreter - add some type checking

These were 'probably' safe anyway, since they mostly treat the objects
as integers without checking, which at least can't result in a crash.

Nevertheless, we ought to check.

The return from comparedictkeys could be wrong if one of the keys had
a value which was not an array, it could incorrectly decide the two
were in fact the same.

psi/zbfont.c
psi/zcolor.c
psi/zcrd.c
psi/zfjpx.c
psi/zfont.c
psi/zfont0.c
psi/zimage3.c
psi/ztrans.c


2018-11-14 09:27:00 +0000
Ken Sharp <ken.sharp@artifex.com>
ef252e7dc214bcbd9a2539216aab9202848602bb

Bug #700168 - add a type check

Bug #700168 "Type confusion in JBIG2Decode"

The code was assuming that .jbig2globalctx was a structure allocated
by the graphics library, without checking.

Add a check to see that it is a structure and that its the correct
type of structure.

psi/zfjbig2.c


2018-11-14 09:25:13 +0000
Ken Sharp <ken.sharp@artifex.com>
67d760ab775dae4efe803b5944b0439aa3c0b04a

Bug #700169 - unchecked type

Bug #700169 "Type confusion in setcolorspace"

In seticc() we extract "Name" from a dictionary, if it succeeds we then
use it as a string, without checking the type to see if it is in fact
a string.

Add a check on the type, and add a couple to check that 'N' is an integer
in a few places too.

psi/zicc.c


2018-11-12 17:21:33 +0000
Chris Liddell <chris.liddell@artifex.com>
3005fcb9bb160af199e761e03bc70a9f249a987e

Bug 700153: restore: always check available stack

Previously, we were checking there was enough stack space available when the
restore operation required a device change, but since we have to use
Postscript to reset the userparams (ick!), we need the stack check even when
not changing the device.

psi/zdevice2.c


2018-11-07 12:22:59 +0000
Chris Liddell <chris.liddell@artifex.com>
2f99c138cf60d75621eb03ae924453b968274694

Contrib devices: Check for error return opening output file

09-59.PS cycles through every available device, attempting to open each one.

For many devices this results in an invalid configuration (mainly a lack of
output file).

These devices, on being shutdown, ignored the lack of output file, and attempted
to write their final bytes out anyway (attempting to write data to a null
FILE * pointer), causing a segfault.

We now check the return value of gdev_prn_open_printer() and only write those
final bytes if gdev_prn_open_printer() completed successfully.

contrib/japanese/gdevespg.c
contrib/japanese/gdevnpdl.c
contrib/lips4/gdevl4r.c


2018-11-08 14:43:32 +0000
Ken Sharp <ken.sharp@artifex.com>
7c8f85a23db24031945af3cacb2c0b4740e67072

PS interpreter - check the Implementation of a Pattern before use

Bug #700141 "Type confusion in setpattern"

As the bug thread says, we were not checking that the Implementation
of a pattern dictionary was a structure type, leading to a crash when
we tried to treat it as one.

Here we make the st_pattern1_instance and st_pattern2_instance
structures public definitions and in zsetcolor we check the object
stored under the Implementation key in the supplied dictionary to see if
its a t_struct or t_astruct type, and if it is that its a
st_pattern1_instance or st_pattern2_instance structure.

If either check fails we throw a typecheck error.

We need to make the st_pattern1_instance and st_pattern2_instance
definitions public as they are defined in the graphics library and we
need to check in the interpreter.

base/gsptype1.c
base/gsptype2.c
base/gsptype2.h
base/gxcolor2.h
psi/zcolor.c


2018-11-08 12:58:28 +0000
Robin Watts <robin.watts@artifex.com>
4d6e2125d402033d9073bae3ccde1d95eb3ebc22

Fix missing images due to transform_pixel_region and pattern_accumulator.

The pattern_accumulator was defaulting to the forwarding version
of transform_pixel_region, which was only dealing with the image
plane, not the mask. Accordingly nothing was being plotted.

Instead, use the default, which devolves to copy_color (for the
image data) and fill_rectangle (for the mask).

base/gxpcmap.c


2018-11-07 16:03:59 +0000
Chris Liddell <chris.liddell@artifex.com>
e477875e170d738d7ea1497e1489a6d344c3ef29

Dates, change log, etc for 9.26 rc1

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



Version 9.26 (2018-11-20)

Highlights in this release include:

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

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

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

  • Thanks to Man Yue Mo of Semmle Security Research Team, Jens Müller of Ruhr-Universität Bochum and Tavis Ormandy of Google's Project Zero for their help to identify specific security issues.

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

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

Incompatible changes

  • None

Changelog

2018-11-20 09:51:17 +0000
Chris Liddell <chris.liddell@artifex.com>
d66acfae372e39e8cbc4ce6395b4451cac72516e

Dates etc for 9.26 release

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


2018-11-19 09:28:41 +0000
Chris Liddell <chris.liddell@artifex.com>
e5978ae6d1e4f3dee0a2838ed580b0373e102613

Coverity CIDs: 326829, 326828 and 326827

Check return values for gdev_prn_open_printer()

contrib/gdevgdi.c
contrib/japanese/gdevrpdl.c
devices/gdevdjet.c


2018-11-19 09:00:54 +0000
Ken Sharp <ken.sharp@artifex.com>
a4228a0d8d657fca3bb3becb93a43fae061beae8

Coverity ID 327264 - move pointer NULL check

Due to recent changes in this code, the pointer was being dereferenced
before we checked it to see if it was NULL. Moe the check so that we
check for NULL before dereferencing.

The 'pvalue' of the operand can be NULL, even if the object is a t_device
type, because invalidate_stack_devices traverses the operand stack
looking for devices, and sets their pvalue member to NULL in order to
invalidate them so that they cannot be used.

psi/zdevice.c


2018-11-17 11:20:08 +0000
Ken Sharp <ken.sharp@artifex.com>
c796ccb512ac581f5ac492fda8807d41769c47e8

Check structure types when using the r_ptr macro

Two more places where we were using the r_ptr macro to cast a PostScript
ref object into a structure without thoroughly checking that the object
was in fact a structure of the correct type.

One case did a partial check, but this is more robust.

base/gsfcid2.c
base/gsfcmap.c
psi/zdscpars.c
psi/zfcmap.c


2018-11-17 10:00:32 +0000
Ken Sharp <ken.sharp@artifex.com>
cb9bb72643e95383bcacd88ab718565f3df9a510

Coverity ID 94865

This had already been tackled, but it turns out there were a couple
more places where tempnames wasn't freed, but Coverity only seems to
flag them one at a time.

psi/imain.c


2018-11-17 09:37:07 +0000
Ken Sharp <ken.sharp@artifex.com>
c69827c308b608719d786fc14c8518af4dd6b335

Coverity ID 323322

The new 'transform_pixel_region' method default for forwarding devices
tests the target device to see if its NULL (some forwarding devices are
not always forwarding devices, eg bbox), and if it is NULL then instead
of passing the call to the target device it calls the graphics library
default.

Unfortunately it was passing the target device as an argument, and this
is now certain to be NULL. In gx_default_transform_pixel_region_begin()
we then dereference the pointer which would cause a crash.

So instead, pass the device itself when its not actually a forwarding
device.

Also, some white space changes.

base/gdevnfwd.c


2018-11-15 15:24:10 +0000
Ken Sharp <ken.sharp@artifex.com>
4548ceaf5ada7f7a4c4da5907e27fec62c1ce63d

PS interpreter - check infinite result on exp, where possible

Bug #700181 "using exp with 0 as base" (again)

The reporter for the bug failed to mention this condition in the
original report. Technically we don't always have isinf() available
(I suspect all real compilers do these days) but where we do we can
check the result. Where we don't, we're stuck. This mimics the
behaviour of other math operations in Ghostscript.

psi/zmath.c


2018-11-15 14:18:17 +0000
Ken Sharp <ken.sharp@artifex.com>
a4e3cb230bfdbf9cb5a0d30763889e58f8215ed1

PDF interpreter - use Appearance streams for highlight annotations

We were previously never using the Appearance stream for a highlight
annotation, which is documented as incorrect in the PDF 2.0 spec.

The reason we were not using it is because a very few PDF files render
differently if we do. This is because Acrobat 'sometimes', and I cannot
figure out the conditions for htis, ignores a perfectly valid Appearance
and generates a new one.

In this case a customer produced a file where the QuadPoints entry is
incorrect. If we use the Appearance stream (as Acrobat does) then the
rendering is correct. If we generate an appearance then, because the
QuadPoints are incorrect, the rendering is incorrect.

Since the PDF 2.0 specification now makes it clear that we should be
using a supplied Appearance stream, I've chosen to change the behaviour
so that we do.

I've also made the text for an appearance stream slightly more robust
and general.

This does produce a few diffs, because of the afore-mentioned files. In
my opinion Acrobat is incorrect in how it treats these files. Our new
rendering is correct.

Resource/Init/pdf_draw.ps


2018-11-14 21:04:46 +0000
Chris Liddell <chris.liddell@artifex.com>
e8be28b49c6a43db1861119288933b5a8fdbef73

Bug 700176: Use the actual output device for both devices in setdevice

Also fixes bug 700189.

The pdf14 compositor device, despite being a forwarding device, does not forward
all spec_ops to it's target, only a select few are special cased for that.
gxdso_current_output_device needs to be included in those special cases.

The original commit (661e8d8fb8248) changed the code to use the spec_op to
retrieve the output device, checking that for LockSafetyParams. If
LockSafetyParams is set, it returns an invalidaccess error if the new device
differs from the current device.

When we do the comparison between the two devices, we need to check the
output device in both cases.

This is complicated by the fact that the new device may not have ever been set
(and thus fully initialised), and may not have a spec_op method available at
that point.

base/gdevp14.c
psi/zdevice.c


2018-11-14 16:01:51 +0000
Ken Sharp <ken.sharp@artifex.com>
5db929cf393fa330bf916da37f5d2a5954a3b0c3

PS interpreter - in seticcspace, ensure the ICC dictionary is a dict

From a review of dict_find_string, that function does not check to see
if the object it is passed as an argument is a dictionary, so its
essential to make sure the argument is checked before calling.

This is the only remaining case I could find.

psi/zcolor.c


2018-11-13 04:18:21 +0100
Sebastian Rasmussen <sebras@gmail.com>
a92e38603902b22c5b20fecefa5da3d2a233516c

jbig2dec: Only print repeated error/warning messages once.

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


2018-11-14 14:28:48 +0000
Ken Sharp <ken.sharp@artifex.com>
3bb28e08002ef4a90bddb05aa6cd06a256153663

PS interpreter - Throw error from exp when base is 0 and -ve exponent

Bug #700181 "using exp with 0 as base"

If base is 0, and exp is negative, then the result of exp is undefined
we should throw an error instead of pushing #INF.0 on the stack.

psi/zmath.c


2018-11-14 09:50:08 +0000
Chris Liddell <chris.liddell@artifex.com>
35766ceb3b28aad95bd63655b1d621a82d3a5b06

Bug 700176: check the *output* device for LockSafetyParams

When calling .setdevice we were checking if LockSafetyParams was set, and if so
throwing an invalidaccess error.

The problem is, if another device, for example the pdf14 compositor is the 'top'
device, that does not (and cannot) honour LockSafetyParams.

To solve this, we'll now use the (relatively new) gxdso_current_output_device
spec_op to retrieve the *actual* output device, and check the LockSafetyParams
flag in that.

psi/zdevice.c


2018-11-14 09:31:10 +0000
Ken Sharp <ken.sharp@artifex.com>
548bb434e81dadcc9f71adf891a3ef5bea8e2b4e

PS interpreter - add some type checking

These were 'probably' safe anyway, since they mostly treat the objects
as integers without checking, which at least can't result in a crash.

Nevertheless, we ought to check.

The return from comparedictkeys could be wrong if one of the keys had
a value which was not an array, it could incorrectly decide the two
were in fact the same.

psi/zbfont.c
psi/zcolor.c
psi/zcrd.c
psi/zfjpx.c
psi/zfont.c
psi/zfont0.c
psi/zimage3.c
psi/ztrans.c


2018-11-14 09:27:00 +0000
Ken Sharp <ken.sharp@artifex.com>
ef252e7dc214bcbd9a2539216aab9202848602bb

Bug #700168 - add a type check

Bug #700168 "Type confusion in JBIG2Decode"

The code was assuming that .jbig2globalctx was a structure allocated
by the graphics library, without checking.

Add a check to see that it is a structure and that its the correct
type of structure.

psi/zfjbig2.c


2018-11-14 09:25:13 +0000
Ken Sharp <ken.sharp@artifex.com>
67d760ab775dae4efe803b5944b0439aa3c0b04a

Bug #700169 - unchecked type

Bug #700169 "Type confusion in setcolorspace"

In seticc() we extract "Name" from a dictionary, if it succeeds we then
use it as a string, without checking the type to see if it is in fact
a string.

Add a check on the type, and add a couple to check that 'N' is an integer
in a few places too.

psi/zicc.c


2018-11-12 17:21:33 +0000
Chris Liddell <chris.liddell@artifex.com>
3005fcb9bb160af199e761e03bc70a9f249a987e

Bug 700153: restore: always check available stack

Previously, we were checking there was enough stack space available when the
restore operation required a device change, but since we have to use
Postscript to reset the userparams (ick!), we need the stack check even when
not changing the device.

psi/zdevice2.c


2018-11-07 12:22:59 +0000
Chris Liddell <chris.liddell@artifex.com>
2f99c138cf60d75621eb03ae924453b968274694

Contrib devices: Check for error return opening output file

09-59.PS cycles through every available device, attempting to open each one.

For many devices this results in an invalid configuration (mainly a lack of
output file).

These devices, on being shutdown, ignored the lack of output file, and attempted
to write their final bytes out anyway (attempting to write data to a null
FILE * pointer), causing a segfault.

We now check the return value of gdev_prn_open_printer() and only write those
final bytes if gdev_prn_open_printer() completed successfully.

contrib/japanese/gdevespg.c
contrib/japanese/gdevnpdl.c
contrib/lips4/gdevl4r.c


2018-11-07 16:03:59 +0000
Chris Liddell <chris.liddell@artifex.com>
ba84a01d19a60a8a9a3e834331621bb37cb44a6c

Dates, etc for 9.26 rc1

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


2018-11-07 00:32:29 +0000
Robin Watts <robin.watts@artifex.com>
8747f40646ad2da5c405bab5a1e85fba9b71b85b

Add nasty workaround for PXL stroking.

Filter paths to be filled to remove 1 dimensional sections.

base/gxpath.h
base/gxpcopy.c
pcl/pxl/pxpaint.c


2018-11-06 16:46:02 +0000
Chris Liddell <chris.liddell@artifex.com>
6dd9131bfa9bd2d723e745839e4bc8e5fdc817b7

Ensure stream and string persist as long as required

When we create an ICC based color space from a string source, we create a stream
object, with the stream data coming from that string.

Because the life of the ICC related objects created by the graphics library
is not dictated by the save/restore operations in the Postscript world, we
need to ensure that the stream and the string it references persist as long
as the graphics library needs.

To do this, we move the string data, and the stream object allocation into
"system VM", that is, garbage collected, but *not* save/restore memory.

psi/zcolor.c


2018-11-06 08:48:58 -0800
Ray Johnston <ray.johnston@artifex.com>
30ef5d0b5b14d3f4eaf7929b81aec2279933e1cc

Fix Bug 699806: Incorrect file size from "status" on Windows.

With commit afe8e546, I missed the use of _wstat and _stat in gp_mswin.c
for the "status" operator. Change to use _wstat64 and _stat64 and all
works. Tested with VS 2005 32-bit build and with VS 2015 32 and 64 bit
builds. Note the file size reported is correct for large files even on
a 32-bit build.

base/gp_mswin.c


2018-11-06 12:46:38 +0000
Robin Watts <robin.watts@artifex.com>
9bb753e22cad9e4a20570267cf8bd54e5910f7f2

Fix pattern clist data being freed with wrong memory_t.

gx_pattern_accum_alloc was allocating the pattern clist memory
using storage_memory->non_gc_memory. It was then being freed in
clist_close using cdev->bandlist_memory. The two are not the
same.

Change the allocation to use target->memory->non_gc_memory,
as cdev->bandlist_memory is set to that.

base/gxpcmap.c


2018-11-06 09:51:56 +0000
Chris Liddell <chris.liddell@artifex.com>
0b0825432e04cbb95731aeb22f3db75886a4e6d8

Bug 700133: handle out of range CIDs in CMap parsing

Implementation Limits sections of both PLRM and PDFRM limit the size of a CID
value to unsigned two byte values (max 65535). Acrobat and various other
consumers seem to silently ignore values outside this range in CMaps embedded
in PDF files.

We now limit the CID value to no more than 65535 when parsing a CMap from a
PDF file (and emit a warning), and *only* from a PDF file: CMap files read
from disk, and CMaps embedded in Postscript jobs will still throw an error.

Resource/Init/pdf_font.ps


2018-11-05 20:07:50 +0000
Robin Watts <robin.watts@artifex.com>
2b42541db28423c49cbf47549551a27e9399fd23

Fix dev spec op warning/handling.

My previous fiddling in this area wasn't quite right.

Originally, the code here didn't allow any device to provide
their own dev spec op (and the warning was hence never hit).

In lifting that restriction, the first commit allowed devices to
provide their own one. They then ran into the warning message.

The second commit fixed the warning message in this case, but
sadly left the warning message going off in many 'default' cases
(and what is more, failed to put the prn one in).

This one hopefully gets everything right. As the comments say
this does feel like a hack.

base/gdevprn.c


2018-11-05 15:32:46 +0000
Robin Watts <robin.watts@artifex.com>
d1d59a332b8c560e8949976006424439933c9c64

Scan converter: Fix pngalpha with zero height rectangles.

Because of the banding hack in pngalpha, zero height rectangles
aren't always the lowest scanline in the edgebuffer.

base/gxscanc.c


2018-11-05 14:02:51 +0000
Ken Sharp <ken.sharp@artifex.com>
85e6fd4df9bb51d5c36e7811a2bac4c52898b08c

pdfwrite - add a performance enhancing heuristic for text processing

Bug #700124 "pdfwrite device over 800% performance loss between 9.25 and 9.23"

This is a heuristic attempt to resolve the reduction in performance. The
code originally used the FontBBox to try and determine if a glven
glyph was completely clipped out, or was at least partially drawn.

For efficiency reasons we don't include glyphs which are clipper out
in the pdfwrite output, reducing the PDF size.

However in bug #699454 and bug #699571 we saw EPS files produced from
OneVision EPSExport which include fonts with a wildly inaccurate
FontBBox. Two commits; 6a4202691c4317a698fa23c5309ad8974fe2b003 and
3bf4f3ea45f0022b6cd36415f095f1bfc119fb73 resolved this.

The initial fix considered the advance width in addition to the glyph
width, but this proved to be insufficient with the second file which
drew the same glyph multiple times, with an advance width of 0. The
commit logs note that the only solution is to determine the glyph width
accurately, which means processing the glyph program for each glyph,
which has performance implications (ie its slower).

In order to try and alleviate this where possible, this commit looks at
the number of integer co-ordinates in font space by scaling the
FontBBox by the FontMatrix. If the resulting design space is small (an
arbitrary value of 0.1, 1e 100x100 was chosen as 'small') then we do
not use the FontBBox, but instead use the slower accurate method.

This may need some adjustment, and its entirely possible that it may,
in the long term, prove unreliable and have to be removed.

devices/vector/gdevpdte.c


2018-11-01 12:31:55 +0000
Robin Watts <robin.watts@artifex.com>
b4f29851a33ff04979bb2eb3a32ab62000c6f19c

Avoid misleading warning message.

If a printer device provides its own dev_spec_op parameter, the
system prints a warning. This warning is intended to ensure that
devices remember to call down to the default printer one, but
appears irrespective of whether they do or not. This means it will
confuse most users.

Instead, introduce a debug only dso that we can use to check that
printer devices do indeed forward properly, and use that to print
the warning only when required.

base/gdevprn.c
base/gxdevsop.h


2018-11-01 08:53:01 +0000
Robin Watts <robin.watts@artifex.com>
897dc2afc509fc331e66be43fbae2b20ded142c6

Avoid trampling on dev_spec_op when opening printer device.

base/gdevprn.c


2018-11-01 18:24:58 +0000
Robin Watts <robin.watts@artifex.com>
1303a9a45124fdea7c4f29858ff900d2d3393c76

Scan converter: Zero height rectangles hack.

Spot zero height rectangles, and arrange for them to be rendered.

base/gxscanc.c


2018-11-03 16:54:27 +0000
Robin Watts <robin.watts@artifex.com>
045239d2d00d8febf1804703019c15eb99ac1cfd

Scan converter: Reduce bbox size.

In some cases (specifically, the "centre of pixel" cases) we could
have constructed the bbox to be larger than it should have been.
Fix this here.

This produces diffs (mainly in banded files), because the skipping
calculations for scanlines below/above the edgebuffer can round
very slightly differently. These diffs are all 1 pixel things.

base/gxscanc.c


2018-11-03 14:58:05 +0000
Ken Sharp <ken.sharp@artifex.com>
d03f6e773d0c58c7799ca8f49de6298be59b4e0e

PDF interpreter - work around type 3 fonts with no FirstChar/LastChar

Bug #700130 "Invalid PDF file renders blank pages"

The file (and the customer original file) has a type 3 font with a
/Widths array, but neither of the required FirstChar or LastChar
entries.

With 9.25 and below this was leading to blank pages, where current code
continued. I think because the previous code left garbage on the stack.

This commit sets FirstChar to 0 and LastChar to the length of the
/Widths array if either is missing.

Resource/Init/pdf_font.ps


2018-11-03 10:40:38 +0000
Ken Sharp <ken.sharp@artifex.com>
d850ebc85cd49dd6445f7fd90f504c28c594aa32

Fix commit 71e99

Change dlmprintf to dmlprintf so it'll work.

I blame the reviewer myself.

base/gdebug.h


2018-11-03 09:29:24 +0000
Chris Liddell <chris.liddell@artifex.com>
71e99487758e464a077c6781893ce9c6eb4134df

Add debug only printing macros

Despite what one might think, dmprintf and co are not exclusing to debug builds
but are always present, and functional.

Generally, only the print macros for the -Z style debugging output are exluded
from debug builds.

This adds a dbgprintf and dbgmprintf family of macros which don't rely on a -Z
option to activate them, but are only present when DEBUG is defined.

Additionally, (in line with convention) the dbgprintf variants (rather than
dbgmprintf) are exluded when GS_THREADSAFE is defined, since we don't have
to a context (via a memory pointer) to ensure correct operation of stdout/stderr
in multithreaded environments.

base/gdebug.h


2018-11-02 13:53:55 +0000
Chris Liddell <chris.liddell@artifex.com>
5f1c1cbf68fe1f25b2a325b275992338d4d4e449

Bug 700126: Ensure JPEG passthrough gets shuts down on error

When an ioerror occurs, ensure we wind up the JPEG passthrough state, to
prevent dangling pointer(s) in pdfwrite.

base/sdct.h
base/sdctc.c
base/sdctd.c
base/sjpegd.c


2018-10-23 17:19:31 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
d0abc92713b2e84eb32c67839ddec2d160b3af8d

Bug 697545 : Prevent SEGV by propagating error code in af_loader_load_glyph.

Propagate error by checking for return code.

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

freetype/src/autofit/afloader.c


2018-10-31 15:30:22 +0000
Ken Sharp <ken.sharp@artifex.com>
ece5cbbd9979cd35737b00e68267762d72feb2ea

PDF interpreter - Don't allow page stream fonts to be used for Annotations

Bug #700096 "Poorly constructed PDF file can inappropriately reuse a Font"

The file has a page stream which uses a Helvetica font which is embedded
and subset, but does not have a subset prefix on the name.

A later annotation uses Helvetica, but does not embed it. So we load
the Helvetica from the font cache. Unfortunately, this is the subset
font, and its Encoding is incompatible (as well as missing many glyphs)
so we get a lot of .notdefs.

Here we put a save and restore pair around the page contents, so that
when we come to the annotation rendering, we have restored the font
cache to an 'empty' state, so that we won't try to load any fonts that
were defined in the page stream to satisfy annotation requests.

For some peculiar reason one broken Sumatra file renders slightly
differently with this in place, and another was wrong before, differently
wrong now.

Resource/Init/pdf_main.ps


2018-10-31 15:38:52 -0700
Ray Johnston <ray.johnston@artifex.com>
1ef5f08f2c2e27efa978f0010669ff22355c385f

Fix display device DisplayFormat=16#a0800 (Separation mode) broken by f2cf6829

The ICC profile checking needs to be told that the device supports_devn, so
add a spec_op proc to return true when in separation mode, and add a proc for
fill_rectangle_hl_color so that fillpage will work in Separation mode.

This was fixed for other devices in commit 250b5e83, but the display device
was not fixed then.

devices/gdevdsp.c


2018-10-31 15:30:05 -0700
Ray Johnston <ray.johnston@artifex.com>
ffcfd8d291d0bc4729a4959580befe4faef48b8f

Remove duplicate comment.

base/gxcmap.c


2018-10-30 17:13:57 +0000
Robin Watts <robin.watts@artifex.com>
8718be6504d227b925d1015d289f13209152c286

Scan converter fix.

Fix 'unevenness' seen in the bottom edge of strokes in:

tests/pdf/Bug6901014_CImg_flyer.pdf.ppmraw.300.1

This is part of the bug tail from the "barcode" fixes where
cursor positions at (y&255) == 0 are 'special'.

base/gxscanc.c


2018-10-30 17:13:59 +0100
Sebastian Rasmussen <sebras@gmail.com>
73d4e5d0ac7d697d74bf31ddaed944643f0543a1

Bug 700056: openjpeg allocator must return NULL if size too large.

Previously if an allocation larger than ARCH_MAX_UINT was requested
the size value was truncated and supplied to the gs allocator. Depending
on the values involved an allocation of this truncated value may
actually succeed. This allocation was then passed back to the openjpeg
library as claiming that the larger, initial allocation request was
satisfied, even though the allocation itself was actually smaller.
This resulted in segmentation faults.

base/sjpx_openjpeg.c


2018-09-20 20:24:47 +0800
Sebastian Rasmussen <sebras@gmail.com>
53163da329e2019e27a8876f6b2363628de2ae0f

jbig2dec: Fix signed/unsigned mismatches.

jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c


2018-10-29 11:12:44 -0700
Ray Johnston <ray.johnston@artifex.com>
ecb88d9bd6f6cc1ea8b4dee9f2df50da04429135

Fix debug print in clist code -- index value was incorrect.

base/gxclrast.c


2018-10-26 16:47:23 +0100
Robin Watts <robin.watts@artifex.com>
2be9c4dfc343adafa49c3bbce5f205f771280851

Update mkromfs to allow for splitting data into chunks.

Call this in the pdlromfs builds to keep the chunk size
small enough to avoid out of memory errors during the
build (on plancks especially).

base/lib.mak
base/mkromfs.c
base/unixlink.mak
psi/msvc.mak


2018-10-29 16:17:50 +0000
Robin Watts <robin.watts@artifex.com>
a359d37fa7c1ba7e3910b83e8672ac9a4b110518

Add gs_font_dir_free.

This extracts some code from pdfwrite and makes it available to
other callers.

base/gsfont.c
base/gsfont.h
devices/vector/gdevpdf.c
pcl/pcl/pcfont.c
pcl/pxl/pxstate.c


2018-10-25 19:46:30 +0100
Chris Liddell <chris.liddell@artifex.com>
17262b11330552fb393bbd2907a9672d0d7eee48

Add a security policy link, and remove gsview.com link

The link for the security policy replaces the original 'team' link.

doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm


2018-10-25 14:30:08 +0100
Ken Sharp <ken.sharp@artifex.com>
04333a6f1344df6b5069880cafe7b190d0984601

Fix pngalpha device with device subclassing

Bug #699815 "Segmentation fault for pdf input to pngalpha driver"

The pngalpha device, in pngalpha_create_buf_device() first creates an
in-memory rendering device (image32) and then overrides two of the
device methods with its own versions.

This doesn't work at all when we have subclassing devices loaded, because
the device that gets handed as the 'target' device is the head of the
chain of devices, and the pngalpha device simply pulls the methods
directly from that device. Note that this also wouldn't work if a
forwarding device were present.

We can work around it by descending the chain of devices, and pulling
the methods from the last device in the chain instead of using the
'target' directly. This still feels wrong but it should at least work.

devices/gdevpng.c


2018-10-25 09:22:14 +0100
Ken Sharp <ken.sharp@artifex.com>
ffac21a73b74c8ce01cbae406f7dd3bfd0a7ef65

Include gsstate.h to avoid a compiler warning

Has the definition of gs_currentcpsimode().

psi/ztype.c


2018-10-24 13:46:14 +0100
Ken Sharp <ken.sharp@artifex.com>
be2c93dca70926069df25467a724eb787497c6f7

Allow cvrs to operate on 64-bit integers

Bug #700011 "cvrs may truncate integers"

zcvrs() cast the PostScript intval to an unsigned int internally, which
truncates 64-bit values to 32-bit values. Other similar operators are
capable of handling 64-bit values.

This commit casts the result to a ps_uint (PostScript unsigned int)
which varies in size depending on the platform. If a 64-bit integer
data type is available it will be 64-bit otherwise it will be 32-bit.

Additionally, check CPSI mode and if it is set, cast the ps_int to an
unsigned int in order to explicitly truncate to a 32-bit value. We use
CPSI compatibility mode in our internal testing, and if we don't do this
then two of the Quality Logic CET files throw errors.

Finally add some words to Use.htm regarding the word size of platforms
and some of the implications regarding 64-bit values in PostScript.

doc/Use.htm
psi/ztype.c


2018-10-23 13:40:14 +0100
Chris Liddell <chris.liddell@artifex.com>
73f7c6eb92596087a1e30123ba0cdf701f8d6006

Bug 700023: Fix cups get/put_params LeadingEdge logic

Custom device LeadingEdge logic in complicated as it potentially requires
equivalent changes to changing the page size.

For a device like cups which merely wants the LeadingEdge value stored in its
own place it makes much more sense to allow the Ghostscript 'core' to handle
all the logic (which it has to do anyway to ensure the rendering is correct),
and then just copy the value into the cups specific place.

This saves the problem, as in this case, of unexpectedly ending up with two
LeadingEdge parameters being included in a call to put_params.

cups/gdevcups.c


2018-10-19 13:14:24 +0100
Chris Liddell <chris.liddell@artifex.com>
8e18fcdaa2e2247363c4cc8f851f3096cc5756fa

"Hide" a final use of a .force* operator

There was one use of .forceput remaining that was in a regular procedure
rather than being "hidden" behind an operator.

In this case, it's buried in the resource machinery, and hard to access (I
would not be confident in claiming it was impossible). This ensures it's
not accessible.

Resource/Init/gs_res.ps


2018-09-07 14:23:06 +0100
Chris Liddell <chris.liddell@artifex.com>
f6b11ea745395193f4f1fc8a7b09dda9913dbe72

Bug 699740: Better handle failing to set the nulldevice

When pushing the nulldevice, if gs_setdevice_no_erase() failed, that *could*
mean we end up freeing the device referenced in the graphics state.

If that happens, search back through the saved gstates to find the initial
graphics state, and pull the initial device from there.

This allows us to return a Fatal error code, and exit cleanly.

base/gsdevice.c
psi/zdevice.c


2018-10-18 14:11:45 -0600
Henry Stiles <henry.stiles@artifex.com>
09e6af81cccb5547a18baace0a792f22bc9ea927

Fix bug# 699969 - inverted colors and misplaced graphics.

Our testing of HP printers indicate that monochrome printers clear the
seed row for delta row compression for each each block of adaptive
compression data but color devices leave the row intact.

pcl/pcl/rtraster.c


2018-10-18 13:31:08 -0600
Henry Stiles <henry.stiles@artifex.com>
635dad8721def9da27e13b849ba8e37023703501

Remove unnecessary gs_opendevice() calls

For reasons unknown the target device was being opened prior to the
languages setting and opening the device with gs_setdevice_no_erase().
This is unnecessary and apparently wrong, gs_opendevice() does not
properly fill in the the device procedures (gx_device_fill_in_procs()).

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


2018-10-18 17:26:09 +0100
Robin Watts <robin.watts@artifex.com>
eb473839eed3eeaf9acc7db4d88a3a0a8ca5f432

Tweak htmldiff.pl to ignore empty lines without a confusing error.

toolbin/htmldiff.pl


2018-05-07 14:51:54 +0100
Robin Watts <robin.watts@artifex.com>
e29b99f71c5bdb766e7ee57363ce37cfdcab3621

Update transform_pixel_region with "direct 1:1" methods for memory devs.

base/gdevdrop.c
base/gxcmap.c
base/gxcmap.h


2018-05-07 11:32:44 +0100
Robin Watts <robin.watts@artifex.com>
852295de5b37409b51970cb9329227f1cf573a7b

Attempt transform_pixel_region acceleration for memory devices using templating.

base/gdevdrop.c


2018-05-04 19:37:24 +0100
Robin Watts <robin.watts@artifex.com>
1e926e47d349d0c962c6c64c64804d18c20bf9ba

Update clip device to be smarter about transform_pixel_region.

When the clip device is for a single rectangle (a very common case)
we can avoid resorting to the default transform_pixel_region routine,
and still use the device's (possibly) optimised one.

base/gxclip.c


2018-05-02 17:40:21 +0100
Robin Watts <robin.watts@artifex.com>
eefae1a50eb451584c2e17600933b723dbc68a0e

Implement transform_pixel_region for memory devices.

base/gdevdrop.c
base/gdevmem.h


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

Add "transform_pixel_region" device function.

Use this for handling image type 4 rendering.

The default version of this goes to rectangles. It also knows how to
send portrait images of 8bps to copy_color.

Next step is to write versions of this for the memory mapped devices
to know how to go direct.

Essentially we are copying the guts of the
image_render_color_icc_{portrait,landscape,skew} into a default
device method, and making the code that called those functions
call the device method instead.

base/gdevdflt.c
base/gdevepo.c
base/gdevflp.c
base/gdevmplt.c
base/gdevnfwd.c
base/gdevoflt.c
base/gdevsclass.c
base/gdevsclass.h
base/gxclip.c
base/gxclipm.c
base/gxclist.c
base/gxcmap.c
base/gxcmap.h
base/gxdevcli.h
base/gxdevice.h
base/gxi12bit.c
base/gxicolor.c
base/gxidata.c
base/gximage.h
devices/vector/gdevpdfd.c
devices/vector/gdevpdfx.h
doc/Drivers.htm
windows/ghostscript.vcproj


2018-04-23 16:02:10 +0100
Robin Watts <robin.watts@artifex.com>
29113956bb0599209ca81698ab36736e373f054a

Use copy_color for some image plotting cases.

Avoid dropping to fill_rectangle where possible. We should be
careful, because in some cases copy_color ends up doing
fill_rectangle!

base/gxicolor.c


2018-04-26 15:18:20 +0100
Robin Watts <robin.watts@artifex.com>
3d2e9a3b7b633db23b2b0f7bfdff522c48c1d4be

Add gxdso_copy_color_is_fast.

Default implementation returns 1 if copy_color is not the default
(as the default drops to copy_rects).

Also the lcvd device (as used by pdfwrite and ps2write) returns 0
to stop us calling it in this case. The lcvd device lies about
the width/height, and so clipping goes wrong.

base/gdevdflt.c
base/gxdevsop.h
devices/vector/gdevpdfd.c


2018-10-18 12:50:55 +0100
Robin Watts <robin.watts@artifex.com>
a366c6a1f2dc882e9b3a4baf79bf7ba253bd9165

Update htmldiff.pl

Now properly takes formats from the input test list (though
this can be overridden).

toolbin/htmldiff.pl


2018-10-17 19:32:08 +0100
Robin Watts <robin.watts@artifex.com>
23c3e1dd980ec503f5d1f593557d6ebdb5a2173e

VS solution for bmpcmp.

toolbin/bmpcmp.sln
toolbin/bmpcmp.vcproj


2018-10-16 16:52:25 +0100
Ken Sharp <ken.sharp@artifex.com>
1d2a714c9ac3f5cbca0015dbfbfa2fbcb5620fbe

Remove debug code accidentally left in growPDFobjects

Resource/Init/pdf_base.ps


2018-10-16 11:32:28 +0100
Chris Liddell <chris.liddell@artifex.com>
00f48edb588188dc9f10c4a84abdb336725769bd

Don't push the EPO device in front of the nulldevice

There are no bad effects from this, just pointless.

base/gdevepo.c


2018-10-16 15:10:41 +0100
Ken Sharp <ken.sharp@artifex.com>
0bbf2de242801bdf7001db7f85c5fb3b4016e9e1

PDF interpreter - bug in growPDFobjects when repairing PDF file

Bug #699970 "bug in PDF repair"

The function growPDFobjects is used to increase the size of the Objects,
ObjectStream, Generations and IsGlobal records when the number of
objects being recorded exceeds the size of the current record.

The problem was that the code assumes Generations is a string, which it
normally is. However when we are repairing a PDF file, we turn the
string into an array, and if we need to increase the size of the
record we need to make a larger array, not a larger string.

This commit checks the current type of the Generations record and either
creates a large string or larger array, working from the type of the
existing record.

Resource/Init/pdf_base.ps


2018-10-16 11:21:22 +0100
Chris Liddell <chris.liddell@artifex.com>
3c218c1463b9c2ff39b1ea514824815fde4853a7

Bug 699962: Ensure device survives Postscript "callout"

In shutting down the interpreter, we run Postscript code to remove the 'real'
device from the graphics state (replacing it with the nulldevice). That means
we can shutdown and free the device in the C code, without impacting the
remaining interpreter shutdown.

There is, however, a very small chance that, whilst running the Postcript code,
the interpreter will trigger a garbage collection - if that happens *after*
the device reference has been removed from the graphics state, there is no
'link' to the device object for the garbager to follow. Thus the device can
be freed before control returns from executing the Postscript.

Register the device as a garbage collector 'root': thus it is implicitly marked
and won't be freed before control returns.

psi/imain.c


2018-10-15 13:35:15 +0100
Ken Sharp <ken.sharp@artifex.com>
30cd347f37bfb293ffdc407397d1023628400b81

font parsing - prevent SEGV in .cffparse

Bug #699961 "currentcolortransfer procs crash .parsecff"

zparsecff checked the operand for being an array (and not a packed
array) but the returned procedures from the default currentcolortransfer
are arrays, not packed arrays. This led to the code trying to
dereference a NULL pointer.

Add a specific check for the 'refs' pointer being NULL before we try
to use it.

Additionally, make the StartData procedure in the CFF Font Resource
executeonly to prevent pulling the hidden .parsecff operator out and
using it. Finally, extend this to other resource types.

Resource/Init/gs_cff.ps
Resource/Init/gs_cidcm.ps
Resource/Init/gs_ciddc.ps
Resource/Init/gs_cmap.ps
Resource/Init/gs_res.ps
psi/zfont2.c


2018-10-15 11:28:28 +0100
Ken Sharp <ken.sharp@artifex.com>
8d19fdf63f91f50466b08f23e2d93d37a4c5ea0b

Make .forceput unavailable from '.policyprocs' helper dictionary

Bug #69963 "1Policy is a dangerous operator, any callers should be odef"

Leaving the .policyprocs dictionary with a procedure which is a simple
wrapper for .forceput effectively leaves .forceput available.

It seems that the only reason to have .policyprocs is to minimise the
code in .applypolicies, so we can remove the dictionary and put the
code straight into .applypolicies, which we can then bind and make
executeonly, which hides the .forceput. Also, since we don't need
.applypolicies after startup, we can undefine that from systemdict too.

While we're here, review all the uses of .force* to make certain that
there are no other similar cases. This showed a few places where we
hadn't made a function executeonly, so do that too. Its probably not
required, since I'm reasonably sure its impossible to load those
functions as packed arrays (they are all defined as operators), but lets
have a belt and braces approach, the additional time cost is negligible.

Resource/Init/gs_diskn.ps
Resource/Init/gs_dps.ps
Resource/Init/gs_epsf.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps
Resource/Init/gs_setpd.ps


2018-10-14 00:06:46 +0100
Robin Watts <robin.watts@artifex.com>
90b8faa80a4746f7f1e0966d6c56a687d2f8d333

Pull in newly merged and updated LCMS2MT from MuPDF thirdparty repo.

The MuPDF repo should be considered canonical, as that is
the one that can pull in updates from upstream lcms2 easily.

base/gsicc_lcms2mt.c
lcms2mt/AUTHORS
lcms2mt/ChangeLog
lcms2mt/Projects/VC2010/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2010/lcms2mt.rc
lcms2mt/Projects/VC2010/lcms2mt.sln
lcms2mt/Projects/VC2010/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2010/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters
lcms2mt/Projects/VC2010/lcms2mt_static/lcms2mt_static.vcxproj
lcms2mt/Projects/VC2010/lcms2mt_static/lcms2mt_static.vcxproj.filters
lcms2mt/Projects/VC2010/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2010/psicc/psicc.vcxproj
lcms2mt/Projects/VC2010/testbed/testbed.vcxproj
lcms2mt/Projects/VC2010/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2010/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2010/transicc/transicc.vcxproj
lcms2mt/Projects/VC2012/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2012/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2012/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters
lcms2mt/Projects/VC2012/lcms2mt_static/lcms2mt_static.vcxproj
lcms2mt/Projects/VC2012/lcms2mt_static/lcms2mt_static.vcxproj.filters
lcms2mt/Projects/VC2012/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2012/psicc/psicc.vcxproj
lcms2mt/Projects/VC2012/testbed/testbed.vcxproj
lcms2mt/Projects/VC2012/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2012/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2012/transicc/transicc.vcxproj
lcms2mt/Projects/VC2013/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2013/lcms2mt.sln
lcms2mt/Projects/VC2013/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2013/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters
lcms2mt/Projects/VC2013/lcms2mt_static/lcms2mt_static.vcxproj
lcms2mt/Projects/VC2013/lcms2mt_static/lcms2mt_static.vcxproj.filters
lcms2mt/Projects/VC2013/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2013/psicc/psicc.vcxproj
lcms2mt/Projects/VC2013/testbed/testbed.vcxproj
lcms2mt/Projects/VC2013/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2013/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2013/transicc/transicc.vcxproj
lcms2mt/Projects/VC2015/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2015/lcms2mt.sln
lcms2mt/Projects/VC2015/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2015/psicc/psicc.vcxproj
lcms2mt/Projects/VC2015/testbed/testbed.vcxproj
lcms2mt/Projects/VC2015/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2015/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2015/transicc/transicc.vcxproj
lcms2mt/Projects/VC2017/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2017/lcms2mt.sln
lcms2mt/Projects/VC2017/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2017/lcms2mt_static/lcms2mt_static.vcxproj
lcms2mt/Projects/VC2017/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2017/psicc/psicc.vcxproj
lcms2mt/Projects/VC2017/testbed/testbed.vcxproj
lcms2mt/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2017/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2017/transicc/transicc.vcxproj
lcms2mt/config.guess
lcms2mt/doc/WhyThisFork.txt
lcms2mt/include/lcms2mt.h
lcms2mt/include/lcms2mt_plugin.h
lcms2mt/ltmain.sh
lcms2mt/src/cmsalpha.c
lcms2mt/src/cmscgats.c
lcms2mt/src/cmscnvrt.c
lcms2mt/src/cmserr.c
lcms2mt/src/cmsgamma.c
lcms2mt/src/cmsgmt.c
lcms2mt/src/cmshalf.c
lcms2mt/src/cmsintrp.c
lcms2mt/src/cmsio0.c
lcms2mt/src/cmsio1.c
lcms2mt/src/cmslut.c
lcms2mt/src/cmsmd5.c
lcms2mt/src/cmsnamed.c
lcms2mt/src/cmsopt.c
lcms2mt/src/cmspack.c
lcms2mt/src/cmsplugin.c
lcms2mt/src/cmsps2.c
lcms2mt/src/cmssamp.c
lcms2mt/src/cmssm.c
lcms2mt/src/cmstypes.c
lcms2mt/src/cmsvirt.c
lcms2mt/src/cmsxform.c
lcms2mt/src/extra_xform.h
lcms2mt/src/lcms2_internal.h
lcms2mt/src/lcms2mt.def
lcms2mt/testbed/Makefile.am
lcms2mt/testbed/Makefile.in
lcms2mt/testbed/testcms2.c
lcms2mt/testbed/testcms2.h
lcms2mt/testbed/testplugin.c
lcms2mt/testbed/zoo_icc.c
lcms2mt/utils/common/utils.h
lcms2mt/utils/common/vprf.c
lcms2mt/utils/delphi/lcms2dll.pas
lcms2mt/utils/jpgicc/jpgicc.c
lcms2mt/utils/linkicc/linkicc.c
lcms2mt/utils/psicc/Makefile.am
lcms2mt/utils/psicc/psicc.c
lcms2mt/utils/samples/itufax.c
lcms2mt/utils/samples/roundtrip.c
lcms2mt/utils/tificc/tifdiff.c
lcms2mt/utils/tificc/tificc.c
lcms2mt/utils/transicc/Makefile.am
lcms2mt/utils/transicc/transicc.c


2018-10-14 18:00:24 +0100
Robin Watts <robin.watts@artifex.com>
fc61ee05129b7cafb22dbce5b93c9a80d30433f7

Enable Trapping by default.

base/gxdownscale.c
doc/Devices.htm


2018-10-12 10:54:09 -0700
Ray Johnston <ray.johnston@artifex.com>
45b1d1079b563fc1722ebfb2037b80567b9932ff

Bug 699935: Change to allow GSView 5 to work with current Ghostscript.

In 2016, a change was made to consult the ProcessColorModel in order to
determine if PDF needed special Overprint Transparency handling, but for
some reason, the GSView display device doesn't have this paramemter in
the pagedevice dictionary. Change to rely on the /Colors parameter being
less than 4 for devices that don't need special Overprint trans handling.

Resource/Init/pdf_main.ps


2018-10-11 15:21:30 +0100
Robin Watts <robin.watts@artifex.com>
45450eb49522afc5ed177d93c142d0c049a864e0

Bug 699800: Fix the previous scan converter fix

There were cases where we still weren't handling the cursor
being on the edge of a pixel correctly, leading to asserts
and spurious horizontal lines on images.

base/gxscanc.c


2018-10-08 18:24:23 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
612d81e94ed0249a8e6fd15e33f409207904ecba

Bug 697545 : Prevent SEGV by propagating error code in tt_find_table.

Propagate error code by checking for return code from access function call.
Prevent SEGV during pcl_text by checking if a font file is loaded before
trying to use a font.

Error created using :-
MEMENTO_FAILAT=19130 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0210

pcl/pcl/pcpage.c
pcl/pcl/pctext.c
pcl/pcl/pcursor.c
pcl/pcl/pcursor.h
pcl/pl/plchar.c


2018-10-10 23:25:51 +0100
Chris Liddell <chris.liddell@artifex.com>
a5a9bf8c6a63aa4ac6874234fe8cd63e72077291

Bug 699938: .loadfontloop must be an operator

In the fix for Bug 699816, I omitted to make .loadfontloop into an operator, to
better hide .forceundef and .putgstringcopy.

Resource/Init/gs_fonts.ps


2018-10-11 12:22:54 +0100
Ken Sharp <ken.sharp@artifex.com>
262f94222e6965e639e92b920951ff75c2d8f081

Fix mswinpr2 device with subclassing

Bug # 699934 "mswinpr2 creates empty print jobs (with some printer drivers)"

The mswinpr2 device has a bizarre check in it, to see if the device is a
copy produced by copydevice. Its not clear to me why it does this, and
the code is very old. It looks to me like this should fail if the device
*is* a copy produced by copydevice, for the same reason it does with
subclassing, the Windows-specific parts are set to NULL.

I can't seem to provoke the device to go through this path in normal
operation, so I'm not going to try and remove it. Instead I've added
to the test a check to see if the device has been subclassed. If it has
we no longer reset the Windows-specific parts of the device, but carry
on using what we have.

While we are here, remove the annoying wdev macro which simply makes
it hard to debug. Especially when the macro has different definitions
in different parts of the source file!

devices/gdevwpr2.c


2018-10-10 16:24:38 +0100
Chris Liddell <chris.liddell@artifex.com>
bf9f3f1536487b4d67643ac3d8bddd149a2b3fa0

Close a device before any other 'finalize' actions

Previously, when a device object was being finalized, we were calling the
device's own finalize method, and (possibly) freeing the reference counted
icc data before calling gs_closedevice() to ensure the device is genuinely
closed.

Reorder the operations so closing the device is the *first* thing we do.

base/gdevsclass.c
base/gsdevice.c


2018-10-10 15:48:33 +0100
Chris Liddell <chris.liddell@artifex.com>
b7e8af4ce9f3352631c0e1efaee9b92f9bc43bb3

Fix a memory leak with subclassed devices (stype)

A dynamic stype in a subclass device wasn't being free with the device - likely
an oversight from adding the subclass device specific finalize method (rather
than using the generic device finalize).

If a subclassed device has a 'dynamic' stype,

base/gdevsclass.c


2018-10-10 15:38:10 +0100
Chris Liddell <chris.liddell@artifex.com>
34cc326eb2c5695833361887fe0b32e8d987741c

Bug 699927: don't include operator arrays in execstack output

When we transfer the contents of the execution stack into the array, take the
extra step of replacing any operator arrays on the stack with the operator
that reference them.

This prevents the contents of Postscript defined, internal only operators (those
created with .makeoperator) being exposed via execstack (and thus, via error
handling).

This necessitates a change in the resource remapping 'resource', which contains
a procedure which relies on the contents of the operators arrays being present.
As we already had internal-only variants of countexecstack and execstack
(.countexecstack and .execstack) - using those, and leaving thier operation
including the operator arrays means the procedure continues to work correctly.

Both .countexecstack and .execstack are undefined after initialization.

Also, when we store the execstack (or part thereof) for an execstackoverflow
error, make the same oparray/operator substitution as above for execstack.

Resource/Init/gs_init.ps
Resource/Init/gs_resmp.ps
psi/int.mak
psi/interp.c
psi/interp.h
psi/zcontrol.c


2018-10-10 17:12:01 +0100
Ken Sharp <ken.sharp@artifex.com>
04a517f39cc3e25a7aec9766b45aeb2144718ee6

PDF interpreter - don't use CIDFonts from the PDF file for missing ones

Bug #699937 "Poorly constructed PDF file can inappropriately reuse a CIDFont"

If we find a CIDFont is not defined (the FontDescriptor has no FontFile
entry) then we need to find a substitute. Normally this means going
to disk and either loading an explicit (user supplied) substitute, or
using a fallback CIDFont.

However, if the PDF file had defined a CIDFont with the same name
previously, we could use that instead. If the CIDFont was a complete
font this should be absolutely fine. However in this the CIDFont is a
*subset* font, but not identified as such. Using that font leads to
missing text....

This commit continues to use resourcestatus to locate a substitute
CIDFont, but it checks the 'status' flag. If its 0 then that means we
created it via an explicit defineresource, which means (I believe and
testing seems to confirm) that we created it from the PDF file. If its
1 or 2, then it was loaded from disk as a substitute (or is available
but not in VM, ie its on disk).

So if status is 0, don't use this CIDFont, it might not be reliable,
instead force an excursion to disk and load a substitute from there.

Tested with an explicit substitution defined in cidfmap to make sure
that this does not break at the same time. NB! If a PDF file does
define a CIDFont of the same name, then we won't (I believe) be able
to load the explicit CIDFont resource, we will always fall back to the
default.

Resource/Init/pdf_font.ps


2018-10-09 19:42:34 +0100
Robin Watts <robin.watts@artifex.com>
7f26bbdc84818f5ecf32c726ff8c15dbb6a94485

Add avx2 option to clusterpush.pl

toolbin/localcluster/clusterpush.pl


2018-10-09 15:34:59 +0100
Chris Liddell <chris.liddell@artifex.com>
f1a078763387dde6972b30ee55a4b985d4d130bb

Explicitly exclude /unknownerror from the SAFERERRORLIST

Since we remove /unknownerror from errordict, we want to exclude it from the
list we copy to gserrordict for SAFERERRORS

Resource/Init/gs_init.ps


2018-10-08 18:52:39 +0100
Chris Liddell <chris.liddell@artifex.com>
7df67ad89e59e1c93684eb48cef2b907076e19bc

Ensure 'token' errors are reported correctly.

Previously, any error that occurred during the actual token scanning part of
'token' would actually report an error against the internal operator:
'%token_continue'.

This commit ensures that such errors are reported against 'token'.

psi/ztoken.c


2018-10-02 16:02:58 +0100
Chris Liddell <chris.liddell@artifex.com>
a6807394bd94b708be24758287b606154daaaed9

For hidden operators, pass a name object to error handler.

In normal operation, Postscript error handlers are passed the object which
triggered the error: this is invariably an operator object.

The issue arises when an error is triggered by an operator which is for internal
use only, and that operator is then passed to the error handler, meaning it
becomes visible to the error handler code.

By converting to a name object, the error message is still valid, but we no
longer expose internal use only operators.

The change in gs_dps1.ps is related to the above: previously an error in
scheck would throw an error against .gcheck, but as .gcheck is now a hidden
operator, it resulted in a name object being passed to the error handler. As
scheck is a 'real' operator, it's better to use the real operator, rather than
the name of an internal, hidden one.

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


2018-10-04 10:42:13 +0100
Chris Liddell <chris.liddell@artifex.com>
1778db6bc10a8d60dfe986b22d2300326733ddd6

Bug 699832: add control over hiding error handlers.

With a previous commit changing error handling in SAFER so the handler gets
passed a name object (rather than executable object), it is less critical to
hide the error handlers.

This introduces a -dSAFERERRORS option to force only use of the default error
handlers.

It also adds a .setsafererrors Postscript call, meaning a caller, without
-dSAFERERRORS, can create their own default error handlers (in errordict, as
normal), and then call .setsafererrors meaning their own handlers are always
called.

With -dSAFERERRORS or after a call to .setsafererrors, .setsafererrors is
removed.

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


2018-09-29 15:34:55 +0100
Chris Liddell <chris.liddell@artifex.com>
a54c9e61e7d02bbc620bcba9b1c208462a876afb

Bug 699816: Improve hiding of security critical custom operators

Make procedures that use .forceput/.forcedef/.forceundef into operators.

The result of this is that errors get reported against the "top" operator,
rather than the "called" operator within the procedure.

For example:
/myproc
{
myop
} bind def

If 'myop' throws an error, the error handler will be passed the 'myop'
operator. Promoting 'myproc' to a operator means the error handler will be
passed 'myproc'.

Resource/Init/gs_diskn.ps
Resource/Init/gs_dps.ps
Resource/Init/gs_fntem.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_lev2.ps
Resource/Init/gs_pdfwr.ps
Resource/Init/gs_setpd.ps
Resource/Init/gs_typ32.ps
Resource/Init/gs_type1.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-09-26 20:42:32 +0100
Robin Watts <robin.watts@artifex.com>
702f6982b63fca353d9106d2dbb6bb21f826c2e6

Bug 699800: Fix scan converter problem seen with barcodes.

The new scan converter is incorrectly counting a pixel as being
touched if a line moves horizontally across the bottom edge of
that pixel.

This means that paths (for example) carefully constructed to cover
exactly a single pixel, such as:

0 0 moveto 1 0 lineto 1 1 lineto 0 1 lineto closepath fill

(when rendered at 72dpi) will fill 2 pixels, rather than 1.

The fix is rather more involved that you'd like, as we need to
treat the cursor being on this vertical edge as a special case.
We flush and "null" the cursor when we arrive on such an edge,
and ignore horizontal motion across such edges.

The identical fixes are required both for trap and rect filling.

base/gxscanc.c


2018-10-08 09:24:22 +0100
Chris Liddell <chris.liddell@artifex.com>
a73071b87a61acf1237da5ad9da59bae9316fb8c

Bug 699907: Reinstate GTK+ 2.x.x code.

The fix (from March 2018) for deprecated API calls in the GTK+ 3.x.x API
didn't account for the new, supported methods not being available in
GTK+ 2.x.x. Handle both cases, as we do elsewhere.

psi/dxmain.c


2018-10-03 17:47:06 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
0269a72336f210c1736efbf0916a41be4d808d5d

Bug 697545 : Prevent SEGV after calling gs_image_class_1_simple.

Prevent SEGV if memory allocation fails leading to penum being freed but then
used again later.

Error created using :-
MEMENTO_FAILAT=20913 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0100

base/gxifast.c


2018-09-25 22:25:26 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
52a37b63bb49e221c3f1b5d1ee11b63ce69da1f0

Bug 697545 : Prevent SEGV in gs_setdevice_no_erase.

Prevent SEGV if gsicc_init_iccmanager fails.

Error created using :-
MEMENTO_FAILAT=350 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0070

base/gsdevice.c


2018-10-03 17:00:28 +0100
Ken Sharp <ken.sharp@artifex.com>
0a7e5a1c309fa0911b892fa40996a7d55d90bace

PDF interpreter - limit page tree recusrsion checking

Bug #699856 "Attempting to open a carefully crafted PDF file results in long-running computation"

A sufficiently bad page tree can lead to us taking significant amounts
of time when checking the tree for recursion.

We can limit this by noting the number of pages in the root node
(given by /Count) and stopping the recursion check when we have
encountered that many leaf nodes.

Our other recursion checks work by reading the resources from the page
nodes and so are unaffected by this.

Resource/Init/pdf_main.ps


2018-10-03 14:48:48 +0100
Chris Liddell <chris.liddell@artifex.com>
d06af15c447f821309cabb0dba5ff97ce1ea4c99

Bug 699857: don't push userdict in preparation for Type 1 fonts

Apparently, Fontographer fonts require a writable dictionary on the
dict stack. For some reason lost in mists of time, we pushed userdict for that
purpose - the problem is, that leaves any random redefinition of operators in
place when we interpret the font file.

Instead, we now push an empty, temporary dictionary for those Fontographer
fonts. As we already explicitly push systemdict (before the writable dictionary)
that ensures a consistent environment for the interpretation of Type 1 fonts.

Resource/Init/gs_type1.ps


2018-09-30 22:57:33 +0100
Ken Sharp <ken.sharp@artifex.com>
cbdc54055b7db024951daf3dcb3cafe0af458e47

Change device put_image method to match the other methods in the API

The put_image device method was unique in that the device parameter
passed to the method was not a pointer to a device structure of the
device implementing the method, but was a pointer to a device
structure describing a memory device.

This allowed the memory device to use code from the underlying device,
which knows how its page buffer is laid out, but data from the memory
device which rendered the composited transparent operations.

However, this doesn't work at all if we have a chain of devices because
the device method which we pull from the device at the head of the
chain, is not the method used to actually rendeer to the page buffer
of the terminating deevice in the chain.

This commit alters the prorotype to take two device pointers, one for
the 'terget' device, and one for the memory device which executed the
put_image. This allows the final device in the chain to use its own
code to format the buffer pointers from the memory device, while
allowing intermediate devices to simply pass on the call.

Note that previously a few places checked the put_image method against
gx_default_put_image (before the device API rationalisation this was a
check against NULL) and only called put_image if it was not the default.

Now that we have a default implementation (which returns an error), and
knowing that the existing device methods return an error if they do not
implment some aspect of the memory layout, we can avoid the test
altogether; simply call the put_image, the code is already prepared
to deal with an error return whether that be because the device does not
implement the method or becuase the device cannot cope with some aspect
of the layout.

base/gdevdflt.c
base/gdevepo.c
base/gdevflp.c
base/gdevmem.c
base/gdevmpla.c
base/gdevnfwd.c
base/gdevoflt.c
base/gdevp14.c
base/gdevsclass.c
base/gxblend1.c
base/gxdevcli.h
base/gxdevice.h
devices/gdevbit.c
devices/gdevpng.c


2018-09-27 10:31:03 +0100
Ken Sharp <ken.sharp@artifex.com>
9565f4ca4aab712f411420fa4c8cae79a2cf88ed

Bug 699813 "filenameforall calls bad iodev with insufficent scratch"

This was a regression introduced with commit
65a9046ded8e9edd5d33bc812a9e94ae29607a1e

I hadn't realised the cleanup procedure was expected to be called in the
case of both the success *and* error conditions.

psi/zfile.c


2018-09-25 15:38:14 +0100
Chris Liddell <chris.liddell@artifex.com>
f8ccc7dfb990336b1ca55f65f2e1a8ecdcb76adf

Bug 699793: Hide the .needinput operator

This removes the .needinput operator from systemdict, ensuring it can only
be used in the initialization code, and not called erroneously from random
Postscript.

Resource/Init/gs_init.ps


2018-09-25 21:50:49 +0100
Robin Watts <robin.watts@artifex.com>
043e3d9058f414607ed8454783175db57e7e6524

Always set the tag, even if the device won't encode it.

Intended to sort an issue encountered while debugging bug 699809,
namely that tag dependent ICC handling only works for devices that
actually encode tags.

base/gxgstate.h


2018-09-25 13:57:54 -0400
Robin Watts <Robin.Watts@artifex.com>
efe6d83852b131852550de948e7d0869c01c31f8

Bug 699809: Fix uninitialised value for render_cond.

gsicc_get_srcprofile doesn't return a render_cond value in
all cases. This leads to an undefined value being read, and
this can lead to a SEGV.

base/gsicc_cache.c


2018-09-25 07:23:07 -0400
Robin Watts <Robin.Watts@artifex.com>
0bfd5394bc1ed6ef9e887071dc14391923e69ebf

Bug 699809: Avoid overrunning non terminated string buffer.

Don't call strlen on something that doesn't have a terminator.
Use the stored length instead.

base/gsicc_manage.c


2018-09-25 11:57:12 +0100
Chris Liddell <chris.liddell@artifex.com>
677da1c0ac20020760b372a0c8aa5546d0a30429

Bug 699810: Explicitly set stroke color for PDF Type 3 glyphs

When we render a cache-viable Type 3 glyphs (i.e. one that uses 'd1' rather
than 'd0'), ensure we set the stroke color to match the fill color.

This is necessary because if we do cache the glyph, we'll render to a mask, and
fill the mask. On the other hand, if we have to render the glyph uncached,
we have to ensure that the entire glyph is drawn with the same (fill) color, as
it would be when drawn cached.

Resource/Init/pdf_font.ps


2018-09-21 12:03:20 -0700
Ray Johnston <ray.johnston@artifex.com>
db606d2ffd204e89c812408773a15ef183ebd4b6

Fix Bug 699794 -- device subclass open_device call must return child code

Even with changes to detect and clean up from errors in setpagedevice (b5)
and .bigstring, the segfault was still possible because the error return
code from the child was being ignored, and the device is_open was set true
when the child device was NOT open. Attempt to 'fillpage' on a clist device
that is not open is what caused the SEGV.

base/gdevsclass.c


2018-09-21 12:00:50 -0700
Ray Johnston <ray.johnston@artifex.com>
c29ec2fff76e45bbf9cd767ff541556c5d064be4

Add parameter checking in setresolution

Found in sequence for bug 699794

Resource/Init/gs_lev2.ps


2018-09-21 11:42:19 -0700
Ray Johnston <ray.johnston@artifex.com>
379be67a6a198766e976f1e5daf43e0c0e97522a

Add parameter type checking on .bigstring

If the parameter is not an integer, this would leave 65400 on the stack.
Also, if there is no argument, signal stackunderflow.
Seen with the PS sequence of bug 699794.

Resource/Init/gs_ll3.ps


2018-09-21 11:37:38 -0700
Ray Johnston <ray.johnston@artifex.com>
9d6ac20d9b2efdabb631a0ff9b0b0fd5c32f5e75

Catch errors and cleanup stack on statusdict page size definitions

This was also found with the sequence from Bug 699794, if .setpagesize
fails, we need to clean up the two integers (page width, height) then
signal the error. Since some definitions "load" another (e.g. b5 loads
isob5) the command name in the error won't be correct for those, but
it will be close. If anybody cares, we could fix it.

Resource/Init/gs_statd.ps


2018-09-21 11:16:18 -0700
Ray Johnston <ray.johnston@artifex.com>
95aa78beae9489d5c9f898fe2032aa23f860867d

Catch errors in setpagesize, .setpagesize and setpagedevice and cleanup

Bug 699794 showed that attempt to change page size in SAFER mode when the
nulldevice was the currentdevice would leave 'false' on the stack. Run
.setdevice in stopped and clean up, and also clean up .setpagesize

Resource/Init/gs_lev2.ps
Resource/Init/gs_setpd.ps
Resource/Init/gs_statd.ps


2018-09-23 16:08:23 +0100
Ken Sharp <ken.sharp@artifex.com>
863b370ba7d791720b97ae10deb211fde8bdbd0a

pdfwrite - permit Mod and CreDate pdfmarks in PDF 2.0

Bug 699807 "-dCompatibilityLevel=2.0` prevents all metadata from being set"

PDF 2.0 has deprecated The Document Info dictionary, so we prevented
pdfmarks from modifying the data in it, as a prelude to removing it
potentially when later versions of the PDF spec are approved.

However, as the report says, the Creation Date and Modification Date
are still required for documents with PieceInfo (only), so for now we
will permit those two values (only) to be set.

devices/vector/gdevpdfm.c


2018-09-22 14:09:17 +0100
Ken Sharp <ken.sharp@artifex.com>
0fdbf706be847198be202eefd3e20fc95d60cbcb

device subclassing - fix use of put_image in memory devices

Bug 699799 "gswin64c.exe has stopped working"

The cause of this is truly ugly. It seems that the put_image device
method, uniquely, expects that the device parameter it is passed is not
the device for which it was intended, but is instead a 'memory'
device.

All the implementations of put_image start by casting the gx_device *
to a gx_device_memory *

This is problematic, because it completely disrupts any attempt at a
device chain. There's no way to have a device's method check to see if
it has a child device, if its not given its owe device to work with.

This commit hacks around the problem by descending to the terminating
device, and copying the put_image call from there into the memory device
which is what the pdf14 compositor will then use.

This needs fixing properly.

base/gdevmem.c


2017-11-30 18:39:07 -0500
Robin Watts <Robin.Watts@artifex.com>
08fb5ddb928cfc7c4cd5f348f28862d97e53d07a

Squash warnings in gen_ordered.c

Use ints instead of doubles, because the values only hold ints!

base/gen_ordered.c


2018-09-21 15:28:15 +0100
Ken Sharp <ken.sharp@artifex.com>
f31702b38fba21153e26c3417c838618e7cfd16f

pdfwrite - fix DSC comment parsing

This may affect other DSC parsing utilities. For some reason double
comment (%%) marks are being interpreted 'sometimes' in gs_init.ps
as DSC comments. This only happens when reading the init files from disk
becuase the ROM file system strips comments.

Passing these to pdfwrite causes it to drop later DSC comments, such
as %%Title: and %%Creator: which meant the information wasn't being
embedded in the document information dictionary.

Fix by converting double %% to single % comments, document this in the
header of gs_init.ps.

Resource/Init/gs_init.ps


2018-09-21 13:02:56 +0100
Ken Sharp <ken.sharp@artifex.com>
fac7eb144135f3ed8fbb0028ab1f33ce4dcc1985

Check all uses of dict_find* to ensure 0 return properly handled

dict_find and friends have the surprising quirk of returning < 0 for
an error and > 0 for no error. But they can also return 0 which means
'not found' without it being an error.

From bug 699801, if the code assumes the usual case where 0 is a success
then an attempt might be made to use the empty dictionary slot returned
by dict_find*, which can lead to seg faults, and certainly won't have
the expected result.

psi/icontext.c
psi/zcid.c
psi/zfapi.c
psi/zfcid0.c
psi/zfcid1.c
psi/zicc.c
psi/zpdf_r6.c
psi/ztoken.c


2018-09-21 09:49:58 +0100
Ken Sharp <ken.sharp@artifex.com>
7ee525fd0010a4f0bb507417860e9faa058c6315

Bug #699801 "zparse_dsc_comments can crash with invalid dsc_state"

Although zparse_dsc_comments() does check the types of its operands, it
wasn't checking the return value from dict_find_string properly. It was
effectively assuming that the dictionary parameter was the *correct*
dictionary and would contain the key/value pair it needed.

Here we check to see if the key has not been found and throw an error
if so.

psi/zdscpars.c


2018-09-21 08:45:35 +0100
Chris Liddell <chris.liddell@artifex.com>
2118711d122aeb170031ab7eb80e5a9269055772

Bug 699802: add object type check for AES key

Make sure the key string is a string.

psi/zfaes.c


2018-09-20 17:08:08 +0100
Ken Sharp <ken.sharp@artifex.com>
8ed08cb9904bc718ad57e0b4884a81a9227ce3ea

Bug 699797 "setundercolorremoval memory corruption"

What is happening is that we are not properly reference counting a
structure.

For setblackgeneration and setundercolorremoval we need to use a
continuation procedure, which samples the supplied PostScript function
and then stores the sample map.

As part of this we create an internal structure to hold the map, and we
make this the current undercolorremoval/blackgeneration entry in the
graphics state. We *also* push a reference to it onto the exec stack,
so that the continuation procedure can use it from there. However we
don't increment the reference count.

When we execute the 'grestore' in the function we reset the values in
the graphics state, and because the reference count is one we count it
down and then discard the structure.

When we then throw an error we try to copy data off the exec stack into
an array, when we hit the reference to the freed strcuture we potentially
are pointing to invalid memory, leading to a seg fault.

To fix this, increment the reference count of the object when we put
it on the exec stack, and decrement it when we remove it from the exec
stack.

psi/zcolor.c


2018-09-19 18:21:02 -0700
Nancy Durgin <nancy.durgin@artifex.com>
18e8a06bd34bb51c08760b7ebdbab68ab45712c1

Bug 699793: Fix handling of .needinput if used from interpreter

.needinput is meant as an internal function, but it is exposed
to the user. I couldn't see an easy way to undefine it.

But if user calls it, it returns gs_error_Fatal in a place that the
code wasn't expecting, and basically puts things in an undefined
state. This change returns a Fatal error at this point, instead.

psi/imain.c


2018-09-19 09:14:02 -0700
Nancy Durgin <nancy.durgin@artifex.com>
caa8b4c279a078419ee9c002106a84703c090d5d

Cleanups for FAPI functions

Fix .FAPIAvailable to check for stack underflow

Undefine FAPI functions at end of gs_fapi.ps
(.FAPIavailable, .FAPIpassfont, .FAPIrebuildfont)

The rendering functions, .FAPIBuildGlyph, .FAPIBuildChar, .FAPIBuildGlyph9,
are still defined. I noticed similar rendering funcs for other fonts are also
exposed -- not sure if this is fixable or not.

Resource/Init/gs_fapi.ps
Resource/Init/gs_init.ps
psi/zfapi.c


2018-09-20 16:35:28 +0100
Chris Liddell <chris.liddell@artifex.com>
b0222e5e39712999f22084996a6b85a120b9389e

Bug 699795: add operand checking to .setnativefontmapbuilt

.setnativefontmapbuilt .forceputs a value into systemdict - it is intended
to be a boolean, but in this case was being called with a compound object
(a dictionary). Such an object, in local VM, being forced into systemdict
would then confuse the garbager, since it could be restored away with the
reference remaining.

This adds operand checking, so .setnativefontmapbuilt will simply ignore
anything other than a boolean value, and also removes the definition of
.setnativefontmapbuilt after use, since it is only used in two, closely
related places.

Resource/Init/gs_fonts.ps


2018-09-20 14:23:29 +0100
Chris Liddell <chris.liddell@artifex.com>
78ed0a8f0339dba1674285b0aa1f460a59b0c3ee

Ensure all errors are included from initialization

Previously only Level 1 errors were added during init.

Resource/Init/gs_init.ps


2018-09-20 10:09:37 +0100
Ken Sharp <ken.sharp@artifex.com>
90e8f8d32b64bae015e19e85e693988daaea54f4

Bug #699796 "copydevice fails after stack device copies invalidated"

This isn't anything to do with .fill_identity_cmap. A simpler example
is:

.distillerdevice
nulldevice
copydevice

The problem is that when we execute nulldevice we need to invalidate any
copies, stored on the operand stack, of the device that was current
before the nulldevice was installed.

We do that by setting the pdevice member of the device structure to NULL.
However the fact that a device can be invalidated has clearly passed
by a number of developers in the intervening years, and a number of
places in the code do check the type of the operand is a device, but
they don't check to see if the device has been invalidated.

Add validation checks where required.

psi/idisp.c
psi/zdevice.c


2018-09-18 14:15:55 -0700
Nancy Durgin <nancy.durgin@artifex.com>
c1657e3b874261e254d4e132499355b22f3dd46a

Change "executeonly" to throw typecheck on gstatetype and devicetype objects

PS doesn't really have a "devicetype", but it is not listed as an
acceptable argument type to "executeonly", so we probably should not
accept it.

"gstate executeonly" throws typecheck in Acrobat, so we should do the same.

Tested the other "access related" functions (noaccess, readonly,
rcheck, wcheck, xcheck) and all of these accept "gstate" as an
argument, even though the PLRM says they should not. Also our initialization
code does things with wcheck and readonly on devices and gstates.

So, this fix is only for "executeonly".

psi/ztype.c


2018-09-19 13:17:45 +0100
Chris Liddell <chris.liddell@artifex.com>
476f6d039fadc33be09068ec09e55824ce089759

Fix commit 93d13545f90c37327bf3ca7ac75c9549d7b52f6f

The original fix was passing the px_state_t into px_process_init(), where what
it takes is actually a px_parser_state_t.

Fixes segfault spotted on the 32bit weekly cluster test.

pcl/pxl/pxsessio.c
pcl/pxl/pxtop.c


2018-09-18 21:10:33 -0600
Henry Stiles <henry.stiles@artifex.com>
93d13545f90c37327bf3ca7ac75c9549d7b52f6f

Reset the PXL parser along with state cleanup.

pcl/pxl/pxsessio.c


2018-09-18 11:54:58 -0700
Nancy Durgin <nancy.durgin@artifex.com>
c76bf1cb7cc419534006631ea139ae20801fd824

Undefine some additional internal operators.

.type, .writecvs, .setSMask, .currentSMask

These don't seem to be referenced anywhere outside of the initialization code,
which binds their usages. Passes cluster if they are removed.

Resource/Init/gs_init.ps


2018-09-13 13:06:01 -0700
Nancy Durgin <nancy.durgin@artifex.com>
29d8ed33d90bea26b24995c43ad53119a943f2d6

Fixed a bunch of incorrect parameter counts

(Note that these were basically harmless, but they make a nice hint to the
programmers, so it's nice if the hint is correct...)

psi/zcolor.c
psi/zdevice.c
psi/zfile1.c
psi/zform.c
psi/zmisc.c
psi/zvmem2.c


2018-09-17 14:06:12 +0100
Chris Liddell <chris.liddell@artifex.com>
7c3e7eee829cc3d2582e4aa7ae1fd495ca72cef1

Implement .currentoutputdevice operator

The currentdevice operator returns the device currently installed in the
graphics state. This can be the output/page device, but also could be a
forwarding device (bbox device), compositor (pdf14) or subclass device
(erasepage optimisation, First/Last page etc).

In certain circumstances (for example during a setpagedevice) we want to be
sure we're retrieving the *actual* output/page device.

The new .currentoutputdevice operator uses the spec_op device method to traverse
any chain of devices and retrieve the final device in the chain, which
should always be the output/page device.

Resource/Init/gs_init.ps
Resource/Init/gs_setpd.ps
base/gdevdflt.c
base/gxdevsop.h
psi/zdevice.c


2018-09-17 10:18:16 +0100
Chris Liddell <chris.liddell@artifex.com>
8bc783cb586231da2916f423bf5793e194092679

Bug 699778: Fix doc/* file list in base/unixinst.mak

base/unixinst.mak


2018-09-18 08:12:00 +0100
Ken Sharp <ken.sharp@artifex.com>
442b5608a6384358e26014c8dec81c169145461e

Documentation - fix a couple of typos

doc/VectorDevices.htm


2018-09-17 12:14:36 +0100
Ken Sharp <ken.sharp@artifex.com>
1535333e85a2901cc873c2694c5ee8508cffd992

Bug 699777 " -dFILTERIMAGE often loses text"

The pdfwrite device's implementation of transparency relies upon the
image for a Softmask being run, and pushing a clip, which increments the
viewer state. However if we have -dFILTERIMAGE in place, then we won't
do this (its in the pdfwrite implementation of begin_typed_image).

When we close the transparency mask, this then leads to the viewer state
stack being out by one.

There's no easy way to address this, so when we go to restore the viewer
state, if it would fall off the bottom then check to see if FILTERIMAGE
is true. If it is, then just don't return an error.

This is a rare condition, it relies upon the transparency being nested
quite deeply in groups (in this case the SoftMask is nested about four
layers deep in spurious transparency).

devices/vector/gdevpdfg.c


2018-09-11 18:47:10 +0100
Robin Watts <robin.watts@artifex.com>
fb887f9e8a318628b2b82120e1e825343264e42c

Remove unnecessary struct entry from pcl_interp_instance_s.

We no longer extend the instance from the implementation.

pcl/pcl/pctop.c
pcl/pxl/pxtop.c


2018-09-13 15:18:03 +0100
Robin Watts <robin.watts@artifex.com>
da0910fe776cf6f28391558d01bea8953235f1f7

VS Project: Add some missing files.

windows/ghostpcl.vcproj


2018-09-06 19:33:06 +0100
Robin Watts <robin.watts@artifex.com>
68b679df65f8d9ffbbb4acdc2662105e440778df

Fix "ambiguous else" warning.

pcl/pl/plmain.c


2018-09-12 15:34:50 -0600
Henry Stiles <henry.stiles@artifex.com>
96ab2635885c40a81d6146d1f3363a019d8af93a

Fix bug #699564 - pageside different from HP.

The pageside should be updated only if the page is marked. Also
refactor and simplify the Page Side Select routine.

Thanks to Norbert Janssen for identifying and analyzing this problem.

pcl/pcl/pcjob.c


2018-09-13 16:09:56 +0100
Chris Liddell <chris.liddell@artifex.com>
687e9a482e40d5e2fc6ac7aa66fb4791afccb949

Tweak examples/transparency_example.ps

So it prints a warning and runs to completion, rather than erroring out
when -dSAFER is set.

examples/transparency_example.ps


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

Bring master up to date with 9.25 release branch

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


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

Bug 699757: disable epo device for x11 devices

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

Disable epo by adding an x11 specific fillpage method.

devices/gdevx.c


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

PDF interpreter - work around GSView 5 and PAGELABEL pdfmarks

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

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

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

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

Resource/Init/pdf_main.ps


2018-09-10 09:21:26 +0100
Chris Liddell <chris.liddell@artifex.com>
7fee37d18e9cbcbc99c3e0e5048a7de78f9be58e

Move pre-release version to 9.26

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


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

Bug 699753: Windows uninstall: remove all installed files etc

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

For example:
File /r doc

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

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

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

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

psi/nsisinst.nsi


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

Correct getdeviceprops documentation

doc/Language.htm


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

Dates, product string, changelog, etc for 9.25 release

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


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

Bug 699757: disable epo device for x11 devices

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

Disable epo by adding an x11 specific fillpage method.

devices/gdevx.c


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

PDF interpreter - work around GSView 5 and PAGELABEL pdfmarks

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

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

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

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

Resource/Init/pdf_main.ps


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

Bug 699753: Windows uninstall: remove all installed files etc

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

For example:
File /r doc

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

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

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

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

psi/nsisinst.nsi


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

Correct getdeviceprops documentation

doc/Language.htm


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

Add a note about unSAFERness of ps2epsi

doc/History9.htm
doc/News.htm


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

Dates/news/history for 9.25 release candidate 1

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



Version 9.25 (2018-09-13)

Highlights in this release include:

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

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

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

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

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

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

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

Incompatible changes

  • None

Changelog

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

Dates, product string, etc for 9.25 release

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


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

Bug 699757: disable epo device for x11 devices

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

Disable epo by adding an x11 specific fillpage method.

devices/gdevx.c


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

PDF interpreter - work around GSView 5 and PAGELABEL pdfmarks

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

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

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

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

Resource/Init/pdf_main.ps


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

Bug 699753: Windows uninstall: remove all installed files etc

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

For example:
File /r doc

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

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

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

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

psi/nsisinst.nsi


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

Correct getdeviceprops documentation

doc/Language.htm


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

Add a note about unSAFERness of ps2epsi

doc/History9.htm
doc/News.htm


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

Dates etc for 9.25 release candidate 1

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


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

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

This problem only exhibits in a 64-bit build.

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

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

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

base/gsargs.c


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

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

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

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

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

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


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

gprf device: Memory leak

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

devices/gdevgprf.c


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

Get formats set properly in gscms_transform_color

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

base/gsicc_lcms2mt.c


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

Initialize a variable.

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

psi/interp.c


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

Tidy up adding the temp dirs to the PermitFile* arrays

Resource/Init/gs_init.ps


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

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

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

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

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

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

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

psi/zdevice2.c


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

Put .setdebug back into the proc removal list for SAFER

accidentally removed in a previous commit

Resource/Init/gs_init.ps


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

Bug #699707 "Security review bug - continuation procedures"

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

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

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

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

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

This could lead to memory corruption and crashes.

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

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

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


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

gscms_transform_color fails in cloning operation

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

base/gsicc_lcms2mt.c


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

Remove obsolete code and comment (from 1999)

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

base/gxstroke.c


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

gproof device supports post rendering ICC profile

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

devices/gdevgprf.c


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

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

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

Resource/Init/gs_init.ps


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

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

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

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

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


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

Bug 699722: Add the ICCProfilesDir to the PermitReading list

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

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


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

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

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

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

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

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

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

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


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

Bug 699720: Change available buffer space to int from uint

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

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

psi/interp.c


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

Delete legacy code source file, and references to it

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


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

Fix some comment typos.

Resource/Init/gs_init.ps


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

Add overprint support to knock out rect-fill

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

base/gdevp14.c


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

Fix bit rot in RAW_DUMP and TRACK_COMPOSE_GROUPS

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

base/gxblend.c


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

Fix bug in mkromfs binary compaction.

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

base/mkromfs.c


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

Remove GS_NO_UTF8

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


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

Bug 691725: Tweak gssetgs*.bat files.

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

Otherwise functionality is identical.

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


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

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

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

base/gximono.c


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

Add prototype missed from previous commit.

psi/interp.h


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

Fix arg_copy leaks.

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

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

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

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


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

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

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

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


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

Second attempt at fix for bug 699699.

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

Now we ignore empty arguments.

base/gsargs.c
psi/imainarg.c


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

Revert previous fix for Bug 699699.

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

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

base/gsargs.c
psi/imainarg.c


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

Bug 699719: Fix @ files in arg handling.

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

base/gsargs.c


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

Update signed ghostpdf.cat to new certificate

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

.gitattributes
lib/ghostpdf.cat


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

Fix incomplete comment from previous commit

Resource/Init/gs_setpd.ps


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

Bug 699714: retain .LockSafetyParams through failed .installpagedevice

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

Resource/Init/gs_setpd.ps


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

For ICC profile validation, have cups id iteself as DeviceN

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

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

cups/gdevcups.c
devices/devs.mak


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

Bring master up to date with 9.24 release branch

Doc changes, etc

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


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

Silence a coverity warning.

base/gdevdflt.c


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

Update files for jbig2dec release 0.15

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


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

PostScript interpreter - More places where exec stack is not restored

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

psi/zcolor.c


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

Bug 699699 "Crash upon bogus input argument."

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

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

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

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

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

base/gsargs.c
psi/imainarg.c


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

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

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

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

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

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

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


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

Bug 699693: Fix FAPI handling of multibyte Unicode code point

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

psi/zfapi.c


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

Bug #699687 "grestore can bypass SAFER"

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

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

base/gsdparam.c


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

Bug 699677 ".bindnow still causing side effects"

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

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

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

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

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

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


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

Fix for security issues found during internal security audit

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

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


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

Remove embedded, copyrighted ICC profile from PNG images

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


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

PDF interpreter - remove a warning message

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

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

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

Resource/Init/pdf_ops.ps


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

ps2write - modify Lab space handling

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

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

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

devices/vector/gdevpdfc.c


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

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

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

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

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

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

psi/iscanbin.c


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

Fix a typo in commit 21ae2f8d9953

psi/zfapi.c


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

Bump version on master to 9.25

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


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

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

Thanks to oss-fuzz for reporting.

jbig2dec/jbig2_arith.c


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

jbig2dec: Avoid dereferencing pointer before it is tested.

Thanks to coverity.

jbig2dec/jbig2.c


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

Update dates, product string etc for release

Fix release date

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


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

Update changelog... again

doc/History9.htm


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

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

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

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

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

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

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


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

Bug 699693: Fix FAPI handling of multibyte Unicode code point

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

psi/zfapi.c


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

Bug #699687 "grestore can bypass SAFER"

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

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

base/gsdparam.c


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

Bug 699677 ".bindnow still causing side effects"

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

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

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

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

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

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


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

Fix for security issues found during internal security audit

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

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


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

Remove embedded, copyrighted ICC profile from PNG images

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


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

Update dates etc for release candidate 2

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


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

ps2write - modify Lab space handling

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

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

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

devices/vector/gdevpdfc.c


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

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

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

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

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

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

psi/iscanbin.c


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

Update changelog post 9.24rc1

doc/History9.htm


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

Fix a typo in commit 21ae2f8d9953

psi/zfapi.c


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

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

Thanks to oss-fuzz for reporting.

jbig2dec/jbig2_arith.c


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

jbig2dec: Avoid dereferencing pointer before it is tested.

Thanks to coverity.

jbig2dec/jbig2.c


Version 9.24 (2018-09-03)

Highlights in this release include:

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

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

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

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

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

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

Incompatible changes

  • None

Changelog

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

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

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

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

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

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

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


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

Bug 699693: Fix FAPI handling of multibyte Unicode code point

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

psi/zfapi.c


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

Bug #699687 "grestore can bypass SAFER"

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

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

base/gsdparam.c


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

Bug 699677 ".bindnow still causing side effects"

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

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

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

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

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

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


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

Fix for security issues found during internal security audit

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

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


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

Update dates etc for release candidate 2

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


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

ps2write - modify Lab space handling

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

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

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

devices/vector/gdevpdfc.c


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

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

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

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

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

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

psi/iscanbin.c


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

Update changelog post 9.24rc1

doc/History9.htm


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

Fix a typo in commit 21ae2f8d9953

psi/zfapi.c


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

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

Thanks to oss-fuzz for reporting.

jbig2dec/jbig2_arith.c


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

jbig2dec: Avoid dereferencing pointer before it is tested.

Thanks to coverity.

jbig2dec/jbig2.c


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

Dates, strings and stuff for 9.24 rc1

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


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

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

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

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

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

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

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

Resource/Init/gs_init.ps


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

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

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

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

Add code to handle those cases.

psi/zfapi.c


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

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

base/stream.c


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

Bug 699676 "PDF interpreter can leave dangerous operators available"

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

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

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

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


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

Remove gssetresolution/gsgetresolution

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

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

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

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


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

Bug 699670: disallow copying of the epo device

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

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

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

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

base/gdevdflt.c
base/gdevepo.c


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

Fix error condition for SC and CS

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

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

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

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

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

psi/zcolor.c


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

Bug 699654(2): preserve LockSafetyParams in the nulldevice

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

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

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

base/gsdevice.c


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

Fix a typo in a dependency

psi/int.mak


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

Improve restore robustness

Prompted by looking at Bug 699654:

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

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

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

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

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

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


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

Improve PDF operator hiding

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

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

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

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


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

Hide the .shfill operator

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

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

Resource/Init/gs_init.ps


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

Bug 699665 "memory corruption in aesdecode"

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

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

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

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

base/aes.c
base/saes.c


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

Bug 699664: Ensure the correct is in place before cleanup

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

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

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

psi/imain.c


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

Bug 699661: Avoid sharing pointers between pdf14 compositors

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

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

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

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

base/gdevp14.c
devices/gdevxini.c


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

Fix Bug 699660 "shading_param incomplete type checking"

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

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

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

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

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


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

Bug 699668: handle stack overflow during error handling

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

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

psi/interp.c


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

Bug 699623: ICC profile creation file permissions check

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

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

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

base/gsicc_manage.c


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

Bug 699654: Check the restore operand type

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

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

psi/zdevice2.c


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

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

psi/ztype.c


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

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

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

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

Resource/Init/gs_init.ps


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

Bug 699657: properly apply file permissions to .tempfile

psi/zfile.c


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

Bug 699656: Handle LockDistillerParams not being a boolean

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

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


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

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

...when getting a value from a dictionary

psi/zcolor.c


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

Fix missing dependency declaration for gdevoflt.h

base/lib.mak


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

Fix "ignored return code" Coverity errors.

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

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

For consistency, ignore the error triggered by -dBATCH

pcl/pl/plmain.c


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

PostScrip ICC spaces - fix minor memory leak

psi/zicc.c


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

Fix a minor compiler warning

devices/gdevdsp.c


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

Fix display device (some more) with subclassing

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

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

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

devices/gdevdsp.c


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

Token buffer not freed.

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

pcl/pl/pjparse.c


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

Fix compiler warning

base/gdevepo.c


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

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

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

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

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

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

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

pcl/pl/plmain.c


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

Bug 699638(2): correct reference counts in gs_initgraphics

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

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

base/gsstate.c


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

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

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

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

base/gxccache.c


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

Change the debugging in epo to use the gs_debug stuff

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

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

base/gdbflags.h
base/gdevepo.c


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

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

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

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

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


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

Fix a couple of compiler warnings

Part of the subclassing updates.

devices/vector/gdevpdfo.c


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

Fix a couple of compiler warnings

Part of the subclassing updates.

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


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

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

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

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

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

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

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

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

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

base/gdevdflt.c


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

Device subclassing - synchronise devices on put_params

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

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

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

base/gdevprn.c


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

Device Subclassing - fix memory leaks with child device

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

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

base/gdevdflt.c
base/gdevsclass.c


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

Device Subclassing - add a finalize routine for subclassing devices

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

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

Add default subclassing finalize to system devices

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


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

Subclassing - correct reference counts on ICC profiles

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

base/gdevdflt.c


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

Fix the display device with subclassing devices

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

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

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

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

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

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


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

pdfwrite - fix stored device pointers in streams, when subclassing

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

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

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


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

device subclassing - solve several problems with short-lived subclassing

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

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

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

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

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

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

That one may need more work.

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

base/gdevdflt.c


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

Fix subclassing and page buffer reallocation in prn devices

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

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

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

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

base/gdevprn.c


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

subclassing devices - fix clist patching on unsubclass

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

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


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

Update "Font lookup" description

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

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

doc/Use.htm


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

PDF interpreter remove debug code

Accidentally left a 'pstack' in the last commit

Resource/Init/pdf_draw.ps


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

PDF interpreter - resurrect Link handling improvements

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

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

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

Resource/Init/pdf_draw.ps


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

PDF interpreter - Remove old annotation handling for pdfwrite

Bug #699619 "Annotations included twice with pdfwrite"

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

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

Just remove the old code.

Resource/Init/pdf_main.ps


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

Revert accidentally pushed "WIP: gitignore"

This reverts commit 3f6507e834e92d9f5fc07ec8e91509a54ce9ec6d.

.gitignore
jbig2dec/.gitignore


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

pdfwrite - improve further the glyph bounding box calculation

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

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

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

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

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

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

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

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

This does result in some degradation in performance.

devices/vector/gdevpdte.c


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

TrueType interpreter - set the TrueType rendering routine

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

Fix supplied by Chris Liddell

base/gstype42.c


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

WIP: gitignore

.gitignore
jbig2dec/.gitignore


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

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

jbig2dec/jbig2_text.c


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

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

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

jbig2dec/jbig2_symbol_dict.c


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

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

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

jbig2dec/jbig2.c


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

jbig2dec: Initialize entire page structure upon allocation.

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

jbig2dec/jbig2.c


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

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

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

jbig2dec/jbig2_generic.c


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

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

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

base/sjbig2.c


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

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

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

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


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

jbig2dec: Use accurate references to the specification.

jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_halftone.h


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

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

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

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

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

jbig2dec/jbig2_halftone.c


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

jbig2dec: Use corresponding stride for gray-scale bitplane.

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

jbig2dec/jbig2_halftone.c


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

jbig2dec: Fix accidental typo in context size function.

jbig2dec/jbig2_generic.c


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

jbig2dec: Ignore negative pixel runs in MMR decoder.

Previously these were fatal errors, now warn and continue.

jbig2dec/jbig2_mmr.c


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

jbig2dec: Ignore missing glyphs when rendering text region.

jbig2dec/jbig2_text.c


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

jbig2dec: Rephrase jbig2_error() messages.

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

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


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

jbig2dec: Implement support for generic region pixel skipping.

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


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

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

jbig2dec/jbig2_page.c


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

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

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

jbig2dec/jbig2_text.c


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

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

jbig2dec/jbig2_page.c


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

jbig2dec: Limit region height to page/stripe height.

Make sure to ignore regions outside of stripe/page.

jbig2dec/jbig2_generic.c
jbig2dec/jbig2_page.c


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

jbig2dec: Stripe offsets are absolute, not relative.

jbig2dec/jbig2_page.c


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

Coverity ID 305953 - uninitialised variable

Also a scan-build warning.

devices/vector/gdevpdtt.c


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

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

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

jbig2dec/jbig2_symbol_dict.c


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

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

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

jbig2dec/jbig2_symbol_dict.c


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

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

Previously this unnecessarily happened multiple times.

jbig2dec/jbig2_mmr.c


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

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

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

jbig2dec/jbig2_mmr.c


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

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

jbig2dec/jbig2_mmr.c


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

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

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

jbig2dec/jbig2_mmr.c


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

Bug 699560: Shut down libjpeg encoder in gdevjpeg

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

devices/gdevjpeg.c


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

pdfwrite - don't retry CharProc capture on error.

Bug #699561 "Infinite loop or Segfault"

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

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

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

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

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

devices/vector/gdevpdtt.c


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

jbig2dec: Change overflow check for allocations.

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

jbig2dec/jbig2.c


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

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

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

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

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

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

jbig2dec/jbig2dec.c


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

jbig2dec: Limit scanline index in MMR coded data.

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

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

jbig2dec/jbig2_mmr.c


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

jbig2dec: Handle EOFB whether it is required or not.

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

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

jbig2dec/jbig2_mmr.c


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

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

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

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

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

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

jbig2dec/jbig2_image.c


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

jbig2dec: Cast BMSIZE in symbol dicts to size_t.

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

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


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

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

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

jbig2dec/jbig2_arith.c
jbig2dec/jbig2_symbol_dict.c


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

Fix tiffpack and tifflzw devices

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

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

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

devices/gdevtfax.c


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

gx_cpath_unshare(): zero unset entries.

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

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

base/gxcpath.c
base/lib.mak


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

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

configure.ac


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

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

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


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

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

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

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

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

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

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

Resource/Init/pdf_ops.ps


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

Bug 699425, new fax device parameters added.

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

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


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

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

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

pcl/pxl/pximage.c


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

ps2write - add a check for PreserveSeparation

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

devices/vector/gdevpdfg.c


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

Documentation - Documentation on PreserveSeparation for pdfwrite was missing

doc/VectorDevices.htm


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

ps2write - improve handling of Separation colour space with Lab alternate

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

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

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

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

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


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

JBIG2DEC - add declarations which are not defined in VS 2005

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

jbig2dec/jbig2_generic.c
jbig2dec/jbig2_segment.c


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

jbig2dec: Ignore extension segments that are not marked necessary.

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

jbig2dec/jbig2_segment.c


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

jbig2dec: Improve halftoning debug message.

jbig2dec/jbig2_halftone.c


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

jbig2dec: Fix composing subset of image onto destination.

jbig2dec/jbig2_image.c


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

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

jbig2dec/jbig2_text.c


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

jbig2dec: Use already parsed size of page association field.

jbig2dec/jbig2_segment.c


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

jbig2dec: Handle text regions without symbol dictionaries.

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

jbig2dec/jbig2_text.c


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

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

jbig2dec/jbig2_image.c


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

jbig2dec: Make local functions static.

jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_halftone.h


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

jbig2dec: Handling missing OOB at end of height class.

jbig2dec/jbig2_symbol_dict.c


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

jbig2dec: Handle immediate generic regions with unknown height.

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


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

jbig2dec: Print segment number in messages when available.

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


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

jbig2dec: Avoid accessing bytes outside of MMR decoder line.

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

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

jbig2dec/jbig2_image.c
jbig2dec/jbig2_mmr.c


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

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

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

jbig2dec/jbig2_arith_int.c


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

Jbig2dec - Fix compile error on old version of Visual Studio

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

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

Sebastian may want to alter this.

jbig2dec/jbig2_arith_int.c


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

jbig2dec: Plug context leak upon errors.

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

jbig2dec/jbig2dec.c


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

jbig2dec: Free huffman tables upon symbol dictionary parse errors.

jbig2dec/jbig2_symbol_dict.c


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

jbig2dec: Free symbol images upon text region parse error.

The symbol images were previously not freed upon errors.

jbig2dec/jbig2_text.c


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

jbig2dec: Remove untested, incomplete metadata handling.

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


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

jbig2dec: Limit EXRUNLENGTH according to symbol dictionary header.

jbig2dec/jbig2_symbol_dict.c


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

jbig2dec: Remove unnecessary limitation of EXRUNLENGTH.

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

jbig2dec/jbig2_symbol_dict.c


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

jbig2dec: Make private function static.

jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_metadata.h


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

jbig2dec: Return NULL upon error, avoid returning variable.

This makes it clearer what is being returned upon error.

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


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

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

jbig2dec/jbig2_huffman.c


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

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

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


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

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

jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c


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

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

This avoids issues with negative array indices.

jbig2dec/jbig2_generic.c


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

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

jbig2dec/jbig2_huffman.c


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

jbig2dec: Label everything not yet implemented NYI.

jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_segment.c


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

jbig2dec: Validate ASCII characters in metadata comments.

jbig2dec/jbig2_metadata.c


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

jbig2dec: Implement support for profile segment.

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

jbig2dec/jbig2_segment.c


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

jbig2dec: Implement support for outputting multipage PBM files.

jbig2dec/jbig2dec.c


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

jbig2dec: Share arithmetic/huffman decoding contexts/tables.

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

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

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

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

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

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

jbig2dec/jbig2_symbol_dict.c


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

jbig2dec: Handle very large symbol code lengths without overflowing.

jbig2dec/jbig2_symbol_dict.c


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

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

jbig2dec/jbig2_symbol_dict.c


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

jbig2dec: Move text region decoder parameters initialization.

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

jbig2dec/jbig2_symbol_dict.c


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

jbig2dec: Simplify cleanup when parsing symbol dictionary.

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

jbig2dec/jbig2_symbol_dict.c


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

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

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

jbig2dec/jbig2_symbol_dict.c


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

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

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

jbig2dec/jbig2_symbol_dict.c


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

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

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

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

jbig2dec/jbig2_symbol_dict.c


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

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

jbig2dec/config_win32.h


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

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

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

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


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

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

jbig2dec/jbig2_arith_int.c


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

jbig2dec: Rename variables to closely follow the specification.

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


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

jbig2dec: Implement support for resizing image width.

jbig2dec/jbig2_image.c


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

jbig2dec: When extending image use default page color.

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


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

jbig2dec: Clarify lack of support for dependency bit.

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

jbig2dec/jbig2_segment.c


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

jbig2dec: Move arithmetic decoder test logging inside test.

Also take the opportunity to make the test stream static.

jbig2dec/jbig2_arith.c


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

jbig2dec: Enable both huffman tests when running check.

jbig2dec/jbig2_huffman.c


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

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

This includes propagating the error handling to all callers.

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


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

jbig2dec: free/release functions must handle NULL argument.

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


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

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

jbig2dec/jbig2_refinement.c


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

jbig2dec: Differentiate error messages in generic region decoder.

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

jbig2dec/jbig2_generic.c


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

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

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

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

jbig2dec/jbig2_generic.c


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

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

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

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

jbig2dec/jbig2_generic.c


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

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

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

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

jbig2dec/jbig2_generic.c


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

jbig2dec: Fix incorrect adaptive pixel location check.

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

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

jbig2dec/jbig2_generic.c


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

jbig2dec: Differentiate between errors/OOB when decoding BMSIZE.

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

jbig2dec/jbig2_symbol_dict.c


2018-04-24 13:39:46 +0800
Sebastian Rasmussen <sebras@gmail.com>
851e3885386f992af8e73ba90c8b8fcf5a6cb69a

jbig2dec: Print errors when out of boundary values occur.

According to the specification in 6.4.5 when decoding text
regions, where OOB values in IDS indicate that the last symbol
in a strip has been decoded, or in 6.5.5 when decoding symbol
dictionaries, where OOB values in DW indicate that all the
symbols in a height class have been decoded. When decoding any
other symbols than IDS or DW, OOB values are not expected, so
report these as fatal errors.

jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-04-25 02:08:40 +0800
Sebastian Rasmussen <sebras@gmail.com>
6f4075cae5c70e5f766a79d011624326c4bf5185

jbig2dec: Check if all arithmetic decoder contexts are initialized.

Previously the IADT and IARI contexts were never checked for having
been successfully initialized, possibly causing uninitialized data
issues later.

jbig2dec/jbig2_symbol_dict.c


2018-05-24 03:28:04 +0800
Sebastian Rasmussen <sebras@gmail.com>
7241bffe648d3f75cd03bbaa404fc927163e6215

jbig2dec: Skip over undecoded pages when getting pages.

jbig2dec/jbig2_page.c


2018-05-24 03:23:25 +0800
Sebastian Rasmussen <sebras@gmail.com>
7b68d2964935c40fe8f58a9540c5765fb2f53f0f

jbig2dec: Detect NULL image pointer before trying to take reference.

Attempting to take a reference to NULL is a no-op anyway.

jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_text.c


2018-06-01 10:36:53 -0700
Sebastian Rasmussen <sebras@gmail.com>
f8f900369183f908fb8e8796154e2c7b57fbd202

jbig2dec: Rename jbig2_image_clone() to jbig2_image_reference().

This more accurately explains what the function does, and
mirrors jbig2_image_release() quite well.

jbig2dec/jbig2_image.c
jbig2dec/jbig2_image.h
jbig2dec/jbig2_page.c
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-05-24 03:24:33 +0800
Sebastian Rasmussen <sebras@gmail.com>
c3707893650d631dfcc4ca5a99b2eb28f7108fd9

jbig2dec: Refinement bitmaps without images should be treated as fatal errors.

jbig2dec/jbig2_refinement.c


2018-05-23 23:12:16 +0800
Sebastian Rasmussen <sebras@gmail.com>
dc80246ab0a08f3c946d43d930c772dedb8b7bf4

jbig2dec: Report warnings if called functions indicate errors.

The first error detected ought to be a fatal error, but when this
error condition is propagated to callers, they should indicate warnings.

jbig2dec/jbig2.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-05-27 02:51:10 +0800
Sebastian Rasmussen <sebras@gmail.com>
689fa69bfd6c423194e58f22835836870cb519b5

jbig2dec: Unsupported intermediate generic region is now a fatal error.

jbig2dec/jbig2_segment.c


2018-05-27 02:50:32 +0800
Sebastian Rasmussen <sebras@gmail.com>
f394d8e7b5588bed1c2265136da0bcb2502507fb

jbig2dec: Halftone regions with skip enabled is now a fatal error.

jbig2dec/jbig2_halftone.c


2018-05-24 03:20:52 +0800
Sebastian Rasmussen <sebras@gmail.com>
de4b96e07690cde1999554b1413d79f20d1e8523

jbig2dec: Detected errors should be fatal, not warnings.

jbig2dec/jbig2_generic.c
jbig2dec/jbig2_metadata.c


2018-05-23 21:48:31 +0800
Sebastian Rasmussen <sebras@gmail.com>
d175962540cd0ff2b6dcec2a13bf61a17df93741

jbig2dec: Remember to free IAID context upon error.

Previously this might result in a memory leak.

jbig2dec/jbig2_arith_iaid.c


2018-05-24 00:52:15 +0800
Sebastian Rasmussen <sebras@gmail.com>
e32e5535ca5055e31417d022753eed67a30d482e

jbig2dec: Free referred to symbol dictionary upon error.

jbig2dec/jbig2_symbol_dict.c


2018-05-24 03:26:43 +0800
Sebastian Rasmussen <sebras@gmail.com>
fc4940d6aabebd6516befefc0b51676ccc332a7f

jbig2dec: Pages without decoded images cannot be completed.

jbig2dec/jbig2_page.c


2018-05-24 00:51:20 +0800
Sebastian Rasmussen <sebras@gmail.com>
e4e1e6ac335eaccd92eff57308e173ac67a392f0

jbig2dec: When a page fails to complete, handle as an error.

Previously this only caused a warning message but didn't fail,
but failing to complete a page means the parsing is somehow broken,
and so it ought to be best to treat it as a fatal error.

jbig2dec/jbig2dec.c


2018-05-24 00:33:18 +0800
Sebastian Rasmussen <sebras@gmail.com>
3da06c6284e3370f31382299eddf7c76f11960cd

jbig2dec: Releasing a page cannot not fail.

It can only fail if you supply a random page pointer.
Don't do that it would be a programming error.

jbig2dec/jbig2.h
jbig2dec/jbig2_page.c


2018-05-23 23:21:27 +0800
Sebastian Rasmussen <sebras@gmail.com>
451ee5588ec2616afc21ae9ccc61c2afb8144bf7

jbig2dec: Directly return jbig2_error(FATAL); they indicate errors.

Because jbig2_error(ctx, JBIG2_SEVERITY_FATAL, ...) returns -1,
it can be immediately returned or assigned as a return code.

jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_text.c


2018-05-23 23:12:43 +0800
Sebastian Rasmussen <sebras@gmail.com>
1e751b882e18fee36a16488e7b46c0e1b571d605

jbig2dec: Return jbig2_error(WARNING); they indicate errors.

Because jbig2_error(ctx, JBIG2_SEVERITY_WARNING, ...) now returns -1,
it can be immediately returned or assigned as a return code.

jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-05-24 01:24:32 +0800
Sebastian Rasmussen <sebras@gmail.com>
c159c4534b9b9af4998d6dcdee896fe2197fa542

jbig2dec: Convert debug messages in debug code to warnings.

This is because the debug code calls functions that write
PBM images or similar, these may fail and when this happens
the calling function ought to print a warning and fail itself.

jbig2dec/jbig2_page.c
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_symbol_dict.c


2018-05-23 00:22:41 +0800
Sebastian Rasmussen <sebras@gmail.com>
a8b6f19d5f5e7af568c448421c24bbe200ea9c89

jbig2dec: Error callback should not modify jbig2_error() return code.

If a function detects an error it should call
jbig2_error(ctx, JBIG2_SEVERITY_FATAL, ...) and return -1. The caller
of this function may then detect the return code indicating error
and call jbig2_error(ctx, JBIG2_SEVERITY_WARNING, ...). Previously
this latter call to jbig2_error() would not return -1, but it is good
form for the calling function to fail and return -1 to the next caller.
Therefore the error callback no longer has the option to override the
return code from jbig2_error(), instead jbig2_error() always returns -1.

base/sjbig2.c
jbig2dec/jbig2.c
jbig2dec/jbig2.h
jbig2dec/jbig2dec.c


2018-05-23 02:00:49 +0800
Sebastian Rasmussen <sebras@gmail.com>
2c743c193e1812795c9c23a8c6cc9d69d2a47eb5

jbig2dec: Only return jbig2_error() for fatal errors/warnings.

Only calls to jbig2_error() using fatal errors or warnings may
return, no calls to jbig2_error() using informational or debug
messages may return. This is preparation for jbig2_error() to
always return -1 for errors/warnings.

jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c


2018-04-06 23:43:51 +0800
Sebastian Rasmussen <sebras@gmail.com>
be59a40717ec60a5a054ccf88f7064c90788aa78

jbig2dec: Add support to process embedded JBIG2 bitstreams.

This type of stream is present in PDF files which is a good source
of test streams for jbig2dec.

jbig2dec/jbig2dec.c


2018-04-24 04:19:31 +0800
Sebastian Rasmussen <sebras@gmail.com>
d7f529ac50d61a1fe07eb1a667322234402e9894

jbig2dec: Remove check for bitmap coding context use.

The removed check used bitmask 0x80 to check for the flag
"bitmap coding context used" among the symbol dictionary flags.
The correct bitmask is 0x100, which was already checked for
later in the code, rendering this incorrect check unnecessary.

jbig2dec/jbig2_symbol_dict.c


2018-04-22 16:11:32 +0800
Sebastian Rasmussen <sebras@gmail.com>
22fbf1bb62b49316452c7556399618399c463039

jbig2dec: Return error code from get_next_word().

Previously Jbig2WordStream's get_next_word() callback
sometimes returned error codes. This contradicted the
declaration of the callback. However indicating errors
and the number of bytes returned upon successful calls
is a good idea. The declaration and all implementations
of the callback have been adjusted accordingly.

This means that jbig2dec now compiles without warnings.

jbig2dec/jbig2.c
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_priv.h


2018-04-25 05:01:41 +0800
Sebastian Rasmussen <sebras@gmail.com>
ef05820d514fd6a27d1b7690df16b63f8b20cf26

jbig2dec: Indicate success when using arithmetic decoder.

Commit 2b2dcf4ccf401ed210f03c858b304994749fd2b3 accidentally
forgot to set the out parameter to indicate success when the
call was indeed successful.

jbig2dec/jbig2_arith.c


2018-05-23 20:05:20 +0800
Sebastian Rasmussen <sebras@gmail.com>
359a15e1c8b460268ff80fb8e8a5da121fcbafc3

jbig2dec: Avoid NULL-check before jbig2_free()/jbig2_image_release().

jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c


2018-05-23 00:04:55 +0800
Sebastian Rasmussen <sebras@gmail.com>
b9f15473bdd8f48b9336b67d15dc08a6f78f750b

jbig2dec: Move declarations from jbig2_priv.h to their respective headers.

Due to this some .c-files now need new includes.

jbig2dec/jbig2.c
jbig2dec/jbig2.h
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_generic.h
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_halftone.h
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_image.h
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c
jbig2dec/jbig2_text.h


2018-05-26 19:12:28 +0800
Sebastian Rasmussen <sebras@gmail.com>
c6d6efdc340e0cac31cda1bbb654bcbfcda92b47

jbig2dec: Create jbig2_segment.h with segment declarations.

jbig2dec/jbig2.c
jbig2dec/jbig2.h
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_segment.h
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-05-26 15:00:00 +0800
Sebastian Rasmussen <sebras@gmail.com>
624bc3cc86c95bc6215d02d6bf39ff694e2c2a9d

jbig2dec: Create jbig2_refinement.h with refinement declarations.

jbig2dec/jbig2_generic.h
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_refinement.h
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-05-26 14:51:42 +0800
Sebastian Rasmussen <sebras@gmail.com>
8f4288807d659f72734d41dd8b7d434b1e15dfc2

jbig2dec: Create jbig2_page.h with page declarations.

jbig2dec/jbig2.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_page.h
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_text.c


2018-05-26 15:12:54 +0800
Sebastian Rasmussen <sebras@gmail.com>
55925ee6220fe371b1fe34fdc27cfd4dad8847b2

jbig2dec: Create jbig2_image_rw.h with image reading/writing declarations.

jbig2dec/jbig2_image.h
jbig2dec/jbig2_image_pbm.c
jbig2dec/jbig2_image_rw.h
jbig2dec/jbig2dec.c
jbig2dec/pbm2png.c


2018-05-26 15:01:37 +0800
Sebastian Rasmussen <sebras@gmail.com>
f7d2387f73488a24db04b22884d1e2c7bb83a857

jbig2dec: Remove non-existing function from header.

jbig2dec/jbig2_priv.h


2018-05-24 23:54:54 +0800
Sebastian Rasmussen <sebras@gmail.com>
cbb2072c14305de22f2334acf44a080933f26e21

jbig2dec: Add include guards to all headers.

jbig2dec/jbig2_arith.h
jbig2dec/jbig2_arith_iaid.h
jbig2dec/jbig2_arith_int.h
jbig2dec/jbig2_generic.h
jbig2dec/jbig2_huffman.h
jbig2dec/jbig2_hufftab.h
jbig2dec/jbig2_mmr.h
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_symbol_dict.h
jbig2dec/jbig2_text.h


2018-05-24 03:18:04 +0800
Sebastian Rasmussen <sebras@gmail.com>
6cc76f397ff5af382e4e49914d1b42df3e0a78e4

jbig2dec: Rephrase error messages.

jbig2dec/jbig2.c
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_image.c
jbig2dec/jbig2_image_png.c
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-05-24 02:05:36 +0800
Sebastian Rasmussen <sebras@gmail.com>
344a90c91dc03e9ae80500303e67594f175374e3

jbig2dec: Remove unnecessary scoping.

jbig2dec/jbig2_refinement.c


2018-04-25 00:50:12 +0800
Sebastian Rasmussen <sebras@gmail.com>
120732b27011a1651ebfcf50536cac953c7b4c9b

jbig2dec: Remove many unnecessary parentheses.

jbig2dec/jbig2_page.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c


2018-04-22 23:08:49 +0800
Sebastian Rasmussen <sebras@gmail.com>
b3d2e786ace758422cdeb22c1cc688bb52087ddf

jbig2dec: Remove unnecessary comments, whitespace and unused code.

jbig2dec/jbig2.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_image.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c
jbig2dec/jbig2dec.c


2018-05-08 22:35:11 +0800
Sebastian Rasmussen <sebras@gmail.com>
def343c44322ebdf609d0113884385d944dc361a

jbig2dec: Fix typos in error messages and comments.

jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2dec.1


2018-05-26 15:46:16 +0800
Sebastian Rasmussen <sebras@gmail.com>
a4ebc6d3cd3e2fcab8b3e9b7bcb7364c14f09d8d

jbig2dec: Reindent sources in the same way as before.

Accept some whitespace changes as done by the commands
from commit d3d767d9b91ae7d82c261fbdfd735f3042161032.

jbig2dec/jbig2.c
jbig2dec/jbig2_arith.h
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_image.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2dec.c


2018-07-12 16:35:12 +0100
Ken Sharp <ken.sharp@artifex.com>
bc6af8da1adc9b4939e3acbfc4194a143412af3c

Fix an error in the type 3 stitching function monotonic detection

Bug #699528 "A rare edge condition can cause a function to incorrectly signal a rangecheck error"

This is rather difficult to describe. The problem occurs when we try to
check for monotonicity of a stitching function between two data points
of the parametric variable.

We actually calculate a series of points between the two values and
check to see that they all increase (or decrease). However, a stitching
function can contain multiple functions, and so we break the range of
values into groups at the limits of each function and check each
group of values.

If the lower value of the parameteric variable is 'close' to the upper
bound of the current function, we decide to 'punt' it up to the next
function, presumably to avoid the overhead of a miniscule break. That is
we simply don't bother calculating tiny amounts at the end of a function
we just do the next function.

However, if the upper range of the parametric variable happened also
to lie close to (but less than) the upper bound of the function, then
when we used it to evaluate the next function in the array, it would lie
below the bottom bound of that function, resulting in a rangecheck error.

This commit applies two fixes; firstly, if the upper and lower values
of the parametric variable are the same then this is a point, and there
is no point in checking it, so just jump straight out.

Secondly, the upper value is now promoted to the lower bound of the
current function if it is less than that. This prevents us trying to
use an out of bound value, in case we should somehow get both an upper
*and* a lower bound which lie within the 'noise' threshold.

Because the range of 'noise' is so small (the bounds values of the
function divided by 1 million) there is no practical likelihood of
us missing a function which is not monotonic between those data
points.

base/gsfunc3.c


2015-03-19 11:33:51 +0000
Tim Waugh <twaugh@redhat.com>
00c14a25c0f0d5e5e65d2d489045e566ccf436df

bug #695876: check that page margins don't overlap in cups driver.

cups/gdevcups.c


2018-07-10 09:51:37 +0100
Ken Sharp <ken.sharp@artifex.com>
87cfc860ea49a4a39c1198b419a019ed598416f0

PDF interpreter improve handling of PageLabels as pdfmark

Patch supplied by Leon Bottou, see Bug #696568. This improves the way
the code handles the number tree when converting it to pdfmark
operations.

I don't have any reasonable way to test this, as it relies on using a
device which implements pdfmark, but doesn't implement WantsPageLabels
(to avoid getting the number tree passed).

Resource/Init/pdf_base.ps
Resource/Init/pdf_main.ps


2018-07-10 08:50:11 +0100
Ken Sharp <ken.sharp@artifex.com>
ac9f8412e8c35edd7c0bbbbcd1c7195a56bc15d8

PDF interpreter - fix new PageLabels processing for non-pdfwrite case

The commit to treat PageLabels as pdfmark operations instead of using
our internal code had a logical error when *not* using pdfwrite.

Committed verbatim as there's no simple way to test this case.

Resource/Init/pdf_main.ps


2018-07-09 09:24:27 -0700
Nancy Durgin <nancy.durgin@artifex.com>
d45ebe705de7b7618ad0d0d20fc31a960c8d9ba2

Bug 690339 - use free/alloc instead of resize when change frame buffer size

In gdev_prn_allocate(), when size of frame buffer changed, we used to call
call gs_resize_object(). Now we call gs_free_object() followed by
gs_alloc_bytes().

Two advantages -- avoids copying the old frame buffer to the new one
(which was pointless) and now the old buffer and new buffer don't need
to coexist, which could help on a low memory system.

base/gdevprn.c


2018-07-09 16:49:38 +0100
Ken Sharp <ken.sharp@artifex.com>
9d168db605fba44e6238d53d8c29f5997760d2ca

device subclassing of patterns, use the correct memory structure

Spotted by Chris while looking at a customer problem, the customer's
code allocs a new pattern accumulator using the device's memory, but it
should really be using the current VM state of the interpreter.

The reason it didn't was because that information wasn't available at
the point where the allocation is made. This commit adds the current
interpreter VM mode to the 'param' structure, which enables us to pass
it to th device, and have the device use it properly.

base/gxdevsop.h
psi/zpcolor.c


2018-07-09 14:16:31 +0100
Ken Sharp <ken.sharp@artifex.com>
4f02acd487721451256d3348760cd3c9333e7635

pdfwrite - allow PageLabels to be (optionally) transmitted as pdfmarks

Bug #696568 "Treatment of page labels"

Patch supplied by Leon Bottou, the creator and maintainer of the djvu
device for Ghostscript, very slightly modified.

The djvu device wants the PageLabels from existing PDF files sent to
the device as pdfmarks, exactly as they would be from PostScript. The
problem with this from the pdfwrite point of view is that this would
result in us unpicking the number tree to create pdfmark operations, and
then at the pdfwrite end rebuilding a number tree to emit. Not rebuilding
the tree would result in larger output.

This patch checks that the device implements pdfmark, and if it does
checks whether WantsPageLabels is set in the device. If it is then we
assume its pdfwrite (or a similar device prepared to accept the number
tree). If it is not set then we walk the tree and create a new pdfmark
for each page in the tree range.

I'm unable to test this properly, because it relies on a device which
does implement pdfmark, but doesn't want PageLabels. Rudimentary
testing seemed to work as expected, its possible that more complex
examples might require some more work.

Resource/Init/pdf_main.ps


2018-07-06 09:58:06 +0100
Ken Sharp <ken.sharp@artifex.com>
42cee04f173ccacb6aafc8243dd6c2ef12cdde54

Forgot to include the changed doc file in last commit

doc/Use.htm


2018-07-06 09:53:45 +0100
Ken Sharp <ken.sharp@artifex.com>
cc826ca86485321cbc5fc111f7dad7ee39e69a17

Update PageList processing in the FirstPage/LastPage device

The intention of the PageList was that pages would be specified in
ascending order, but the documentation didn't actually say that
explicitly, so update the documentation to make it absolutely clear.

In addition, by specifying a lower page number at the end, it was
possible to cause a buffer overrun, so prevent that here and flag an
error to the user so they know.

base/gdevflp.c


2018-07-05 18:04:28 +0100
Robin Watts <robin.watts@artifex.com>
18e4b59efeca56ec2ca716559a7b9e0639561428

Bug 699379: Fix infinite loop with filenames starting with #.

The argument handling routines treat lines starting with #
as being comments. Unfortunately, the logic for this was failing
to recognise EOF as stopping the search for the end of a line.

Doubly unfortunatately, it was extending this courtesy, intended
for lines within @files to command line arguments too. We take
steps to avoid that too.

base/gsargs.c


2018-07-05 11:22:41 +0100
Robin Watts <robin.watts@artifex.com>
f390123f8e34ec149fe1a3366ebb872368a57d7f

Bug 698928: Rework arg_next.

When I worked on arg_next before, I think I had the wrong idea of
what it was doing.

The idea of arg_next (I thought) was that we'd call it, and get back
a pointer to a decoded version of the next argument. Sadly, this
wasn't true - it would leave us with an *encoded* version of the
argument. Now, for most things this didn't matter, for for encodings
like UTF16LE, it certainly did.

So, largely revert the previous misguided commit to this code, and
update arg_next so that it really does return a "decoded" (i.e. always
utf-8 encoded) buffer.

This fixes Bug 698928 where I had an underflow read in a buffer.

base/gsargs.c
base/gsargs.h


2018-07-05 16:38:01 +0100
Ken Sharp <ken.sharp@artifex.com>
62e67ecc475d3648f32d7d8c4459bbabd740ea2b

Fix a device subclassing problem with colour mapping procedures

Bug #699520 "Seg fault with customer device utilising device subclassing"

When we retrieve colour mapping methods, we need to use the first
subclassing device in the chain which does not have a 'default' for
the colour mapping methods. This is so that the monochrome palette
device in PCL works properly.

In contrast, if none of the subclassing devices overrides the colour
mapping then we want to use the first non-subclassing device's
methods and, importantly, that device as well.

base/gxdevcli.h


2018-07-03 13:44:28 +0100
Ken Sharp <ken.sharp@artifex.com>
2f8082aa9777a7274c463c6375c2f7d01c299251

Increase limit on UniqueIDs for fonts

Bug #699513 "CFF font UniqueID greater then 2^24 - 1 causes error"

The PDF file contains a font with a UniqueID of 0x7fffff which exceeds
the PostScript definition of a font UniqueID (0 -> 2^24 - 1).

Experimentation shows that no PostScript interpreter that I have access
to (other than GS) implements this limit. However, to keep the change
conservative, I'm chosen to raise the limit to 2^32-1 to match the CFF
specification, rather than eliminate it altogether.

psi/idparam.c


2018-07-03 08:55:43 +0100
Chris Liddell <chris.liddell@artifex.com>
3e44dd7a9f112ea5334a4e189ec64f7a16139597

Remove some obsolete sections from the docs.

DOS and OS/2 install sections in install.htm

doc/Install.htm


2018-06-30 16:10:48 +0100
Ken Sharp <ken.sharp@artifex.com>
dc20112ef13ebdfc6e1ad20ac9ef5462e9145682

Fix a compiler warning

devices/vector/gdevpdfp.c


2018-06-30 14:29:43 +0100
Ken Sharp <ken.sharp@artifex.com>
aba212c73d6f10fe891786a938bb461636563dba

pdfwrite - when changing ProcessColorModel, don't just change the name

Bug 699490 "Broken PDF/X-3 generated"

The reason that an empty file was generated was due to a mismatch
between the underlying device process color model and the ICC profile
attached to the device. The profile was a CMYK profile, while the
device was set to have 3 components.

This is due to the fact that setting the ProcessColorModel separately
from the ColorConversionStrategy was not actually changing the model,
it just changed the name.

This should, of course, have generated an error and an earlier commit
had already addressed that. In this commit, we call the routine which
actually switches the colour model, and we also count down the ICC
structure attached to the device, and set it to 0. This forces a reload
of the ICC profile. That isn't needed for this particular bug but it
is needed when OutputICCProfile is not set, because we will otherwise
try to use the profile for the prior colour model, which will be
incorrect and leaed to errors.

devices/vector/gdevpdfp.c


2018-06-29 14:13:39 -0700
Michael Vrhel <michael.vrhel@artifex.com>
8d415abe6f1e0e3a7e895511e20d99eebad48ada

Fix rendering issue on tiffscaled devices

The tiffscaled contone devices have to be able to change their color model
to allow a more flexible use of the post render ICC profile with the output
intent. Prior to this commit, certain profile combinations would result in
mis-rendered results.

With this fix, if we are wanting to render to a CMYK intermediate
output intent but we want the output to be in sRGB then we need to use
-sDEVICE=tiffscaled24 -dUsePDFX3Profile -sOutputICCProfile=default_cmyk.icc
-sPostRenderProfile=srgb.icc . This should then render to a temporary
buffer the is in the OutputIntent color space and then be converted to
sRGB. This should look like the result we get when we go out to the
tiffscaled32 device. This is in contrast to the command line
sDEVICE=tiffscaled24 -dUsePDFX3Profile -sPostRenderProfile=srgb.icc which would
end up using the output intent as a proofing profile. The results may be similar
but not exact as overprint and spot colors would not appear correctly due to the
additive color model during rendering.

base/gsicc.c
base/gsicc.h
base/lib.mak
devices/devs.mak
devices/gdevtsep.c


2018-06-28 16:44:41 +0100
Ken Sharp <ken.sharp@artifex.com>
da3810ce626a1c5dca856a7bac757bf254761f69

pdfwrite - create GC desscriptors for JPEG Passthrough stream

Bug #699427 " Shrinking PDF is causing SIGSEGV"

Its not absolutely clear that this is the same problem, but I'm
reasonably confident. When passing JPEG data through untouched, we
copied the stream pointer for the uncompressed data into the device
structure (because the image enumerator isn't available at that time)
but if the stream should be relocated after the copy is taken, then the
old stream might not be valid any more.

This commit adds a GC descriptor for the copied stream pointer to the
PDF device structure. For me this solves the problem, but the nature
of these kinds of problems means that *any* change which affects memory
layout will affect the execution, so I'm not 100% certain this is the
problem.

devices/vector/gdevpdf.c
devices/vector/gdevpdfx.h


2018-06-26 14:52:22 -0700
Michael Vrhel <michael.vrhel@artifex.com>
250b5e83e923bed9b6d48bf3965f3b38af52286d

Fix errors introduced in previous commit

The commit f2cf68297e3d63cb927db3c98d317f7ee68e7898
resulted in errors with the separation type devices.
With these devices, we can simply check if the color
model matches the ICC profile since these devices
change their number of components. Will likely need
to do some testing with these device and different
profiles to see what breaks when and make sure we
exit gracefully.

base/gsicc_manage.c
devices/devs.mak
devices/gdevcmykog.c
devices/gdevgprf.c
devices/gdevpsd.c


2018-06-27 13:22:41 +0100
Chris Liddell <chris.liddell@artifex.com>
e4a7fc24c051241e4dbd14760a218290769d78a6

Fix a typo in a link

doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm


2018-06-25 09:44:34 +0100
Chris Liddell <chris.liddell@artifex.com>
6a4202691c4317a698fa23c5309ad8974fe2b003

Bug 699454: 'improve' pdfwrite guesstimate of glyph bbox

When estimating the bounding box of a glyph, we were basically only using the
FontBBox - which is often bogus (as it is in this case).

We'll now, additionally, use the advance width of the glyph in that estimate.

This could possibly result in glyphs being included whose marking operations
are outside the current clip, but whose advance width intersects with the
current clip. But that would be preferable to (as was happening) a glyph inside
the clip being dropped.

(Using the "real" glyph bbox would require executing the complete charstring,
which, obviously, has performance implications)

devices/vector/gdevpdte.c


2018-06-22 11:48:58 -0700
Michael Vrhel <michael.vrhel@artifex.com>
9ae241f271ae2eafc69ca44a0b8b70af17705c0e

Fix crash introduced by commit to make lcms thread-safe

Using a proof profile or even using -dUsePDFX3Profile with
a device color model that was different than the output
intent caused a crash after commit
9ff6b34e461fcbd4ef27fbb6c5c8a15071fe1370

Problem was that the intermediate device link was not
getting created.

base/gsicc_lcms2mt.c


2018-06-22 10:35:48 -0700
Michael Vrhel <michael.vrhel@artifex.com>
f2cf68297e3d63cb927db3c98d317f7ee68e7898

Bug 699381 Add error checking for device icc profiles

Make sure that the various types of profiles that can be set work with
the device color model and with each other. Only allow the use of
the post render ICC profile when the device supports it.

base/gdevdflt.c
base/gsdparam.c
base/gsicc_manage.c
base/gxdevsop.h
base/lib.mak
devices/devs.mak
devices/gdevtsep.c


2018-06-21 11:56:17 -0700
Michael Vrhel <michael.vrhel@artifex.com>
6b981f05c5dafe5d03e8827cb3b5c1cd879c0644

Fix crash when using PostRenderProfile

Crash was introduced by commit to make lcms thread-safe
9ff6b34e461fcbd4ef27fbb6c5c8a15071fe1370

base/gsicc_cache.c


2018-06-19 11:28:31 +0100
Chris Liddell <chris.liddell@artifex.com>
da399f89d08f66d8608e83ecf2cd5c33ec45b866

Don't overwrite filename in the event of an error.

When we 'wrap' a file to allow thread safe file access for multithreaded clist
operation, we replace the original file name with a special 'encoded' file
name - we shouldn't do the replacement if the underlying file fails to open
since it means the error message shows the encoded file name, rather than the
name of the 'real' file.

base/gxclfile.c


2018-06-14 12:47:21 -0700
Ray Johnston <ray.johnston@artifex.com>
f92376925f99cd418ce94ab738935eb88013175f

Add aarch64:Linux case to tiff config.guess

Needed for configure on 64-bit Linux on ARM (seen with SUSE 64-bit linux
on the Raspberry Pi).

tiff/config/config.guess


2018-06-14 12:42:49 -0700
Ray Johnston <ray.johnston@artifex.com>
255fe6272797351f83613e6ca079a903bdabb136

Fix typo in lib.mak. Missing sfilter2 in psfilters.dev

Both entries were $(GLOBJ)sfilter1.$(OBJ) which resulted in s_A85E_template
undefined in the link.

base/lib.mak


2018-06-14 13:57:30 +0100
Ken Sharp <ken.sharp@artifex.com>
fbf2eefa62b8dd4eb1b96aa77b7d4cf6719af5fe

fix lib.mak for Windows builds

Commit ca18b9663b10798a2bd800173df3bfbca4a87650 had an extra $(GLOBJ)
macro in the build line for psfilters.dev. On Linux this doesn't seem
to be a problem, but nmake (Windows build in Visual Studio) throws
an error.

Just remove the extraneous macro.

base/lib.mak


2018-06-13 16:27:32 +0100
Chris Liddell <chris.liddell@artifex.com>
ca18b9663b10798a2bd800173df3bfbca4a87650

Move the PS Level 1 filters into 'base/'

Oddly, Level 2 filters were already in 'base/', but the Level 1 filters were
still (partially) in 'psi/' (but at least one was partially in base/).

This not only moves the code, but puts both Level 1 and 2 filters into a
'feature' .dev (called psfilters.dev) - on the basis we don't really support
building as a Level 1 only interpreter any more.

It is still up to the interpreter makefile(s) to include the dependency on
psfilter.dev to get these built in.

This is tidier than before, but primarily done so the SubFileDecode filter
is available for use by the in-development C based PDF interpreter.

base/lib.mak
base/sfilter1.c
psi/int.mak


2018-06-12 10:08:09 +0100
Ken Sharp <ken.sharp@artifex.com>
e0b4f52ee1904ff3f1cf72d86163321b2f9d6357

Fix PageList when the last page in the file is not included in the list

It was possible to run off the end of the array of pages if the last
page was not included in the list of pages to be printed.

Also, the trailing '-' syntax (from page 'n' to the end of file) was
off by one printing the initial page.

base/gdevflp.c
base/gdevflp.h


2018-06-11 11:31:05 +0100
Ken Sharp <ken.sharp@artifex.com>
bc0b0ff9bd8dbdd91a142b46a0e5f5168c13306d

Better fix for bug #699404

Bug #699404 "Failure with psdcmyk -dGraphicsAlphaBits=4 -dFirstPage=1 -dLastPage=1"

The commit 3347a19f6fd89fc1b7d9644ff6c4703897501f7e did fix this problem
but it left a more serious underlying problem. The devices in the chain
weren't being updated to note that the standard subclassing devcies had
been installed.

This could lead to them being installed multiple times, and also to
taking the wrong code path and failing to update the device methods
when required.

This commit unwinds the previous one in gdevprn.c and applies a better
fix in gdevkrnlsclass.c

base/gdevkrnlsclass.c
base/gdevprn.c


2018-06-08 14:05:24 +0100
Ken Sharp <ken.sharp@artifex.com>
a219c745f5fd3bcf38da40f64c5b7cd053721a16

Documentation update - PageList

Update use.htm to make it clear that using PageList will override any
values for FirstPage and LastPage.

doc/Use.htm


2018-06-07 16:16:08 -0600
Henry Stiles <henry.stiles@artifex.com>
493066fceed538d3c499221aea8e085fba86c827

Add PCL symbol sets: PC-865 Norway and PC-860 Portugal.

pcl/pl/plsymbol.c


2018-06-06 17:25:00 +0100
Ken Sharp <ken.sharp@artifex.com>
3347a19f6fd89fc1b7d9644ff6c4703897501f7e

Move installation of standard subclassing devices

Bug #699404 "Failure with psdcmyk -dGraphicsAlphaBits=4 -dFirstPage=1 -dLastPage=1"

The installation of the devices in gdev_prn_open() was slightly too
early, the procs can still (quite reasonably because this is part of
the device installation) be altered by gdev_prn_allocate_memory().

If we had already subclassed the device, then the procs of the
subclassing device (ie firstPage/LastPage) would be altered rather than
the real target device's procs. This led to the wrong graphics library
call, which produced an error.

Moving the subclassing later in the installation solves the problem.

base/gdevprn.c


2018-06-05 10:16:26 -0600
Henry Stiles <henry.stiles@artifex.com>
bfbd2a02cd39c799d5d5f2d9850fb0fd06e57b7a

Fix #699390 - text position wrong.

The PCL current position (CAP) can be in two states: floating or
fixed. Floating tracks the origin with margin and orientation changes
fixed does not. The CAP is floating until we have printable data or a
command that affects the cursor position is received. We were
mistakenly resetting the the CAP from fixed to float for orientation
changes resulting in incorrect text position.

Norbert Janssen provided the analysis and code change for this fix.

pcl/pcl/pcpage.c


2018-06-01 17:40:09 +0100
Ken Sharp <ken.sharp@artifex.com>
e997c6836d243ab37fe3a5f0d57974af95eb5eac

pdfwrite - drop UTF16-BE DOCINFO strings when creating PDF/A-1

Bug #699392 " XMP metadata missing when trying to create PDF/A "

Its not obvious, but it appears to be impossible to embed UTF-16BE
strings in XMP metadata and have them be validated against the same
string in the Info dictionary, because of the specified method for
comparing such strings.

PDF/A-2 states that the document information dictionary should be
ignored, in contrast to the PDF/A-1 specification which says the
XMP and Info dictionary information must be consistent. So this
problem can't arise there.

This commit detects the use of any UTF-16BE string in a DOCINFO
pdfmark and use the usual PDFACompatibilityPolicy to decide whether to
abort PDF/A-1 production, drop the string or raise an error.

devices/vector/gdevpdfm.c


2018-05-30 15:59:32 +0100
Ken Sharp <ken.sharp@artifex.com>
71de6d0f9c2a48d6e4a69287b2123bf9efd6df88

txtwrite - Increment character index in text enumerator

Bug #699391 "segfault in txtwrite_process_plain_text()"

We need to increment the text enumerator character index no matter what
kind of operation this is, we had omitted it in the
TEXT_FROM_SINGLE_GLYPH case.

devices/vector/gdevtxtw.c


2018-05-28 17:39:55 +0100
Robin Watts <robin.watts@artifex.com>
7a91a08d9c78b5e37b0d434ffaafa30aa1d680ad

Bug 699382: Fix UTF-8 encoding screwup.

Also fix utf8_to_wchar making wchar buffers longer than required.

base/gp_wutf8.c
base/gsargs.c


2018-05-24 16:37:15 +0100
Chris Liddell <chris.liddell@artifex.com>
fa7a350708d393bad28dffff22da4f96ba037001

Ghostscript documentation pages revised to new look and feel

doc/API.htm
doc/AUTHORS
doc/C-style.htm
doc/Changes.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/Hershey.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-style.css
doc/gs.css
doc/images/.DS_Store
doc/images/Artifex_logo.png
doc/images/favicon.png
doc/images/ghostscript_logo.png
doc/images/hamburger-light.png
doc/images/x-light.png
doc/index.js
doc/sample_downscale_device.htm
doc/style.css
doc/subclass.htm
doc/thirdparty.htm


2018-05-24 09:21:17 +0100
Ken Sharp <ken.sharp@artifex.com>
1eab394d3715ac37eca4ee3d4b139520166f37f4

Improve FirstPage/LastPage image data handling

commit e92f7cbadec35ced4e38d2be9bf13fe4f362aa59 had the right idea but
erroneous implementation. We can't simply cast the image enumerator,
because we didn't allocate the enumerator that way.

Instead, add the expected height and tracking variable to the individual
enumerator.

Implement for object filtering device as well.

base/gdevflp.c
base/gdevoflt.c


2018-05-23 15:57:16 +0100
Ken Sharp <ken.sharp@artifex.com>
59dce27871a39a9f161aaaf0e852dbd05ba009fe

PDF interpreter - fix illegal CIDSystemInfo dictionaries

Bug #699294 " Ghostscript giving errors for attached pdfs and generating blank tiffs"

The supplied example file has several CIDFonts embedded which have
illegal CIDSystemInfo dictionaries; they are missing the required
Registry and Ordering entries.

A long time ago we discarded the CIDSystemInfo from the CIDFont and
created a dummy one, which is why the reporter thinks this 'used to
work'. It didn't. Discarding the information caused problems with the
pdfwrite output.

In this case we simply manufacture the missing data. Its wrong, but it
allows the file to proceed to completion. Naturally we emit a warning
so that users know their file is garbage.

Resource/Init/pdf_font.ps


2018-05-23 09:14:07 +0100
Ken Sharp <ken.sharp@artifex.com>
e92f7cbadec35ced4e38d2be9bf13fe4f362aa59

First/Last page - Fix image data handling with proc data source

Bug #699215 "Subclassing device leads to infinite(?) loop"

When processing images, its acceptable for the subclassed device to
return 0 (need more data) in response to image_plane_data, if the
source is a file, because the file will reach EOF and the code will
properly terminate.

For procedural (or string) data sources this isn't true. The code needs
to keep track of the number of rows of image data received, and return
1 (completed) when we have received enough data.

Fixed the object filtering device at the same time.

base/gdevflp.c
base/gdevoflt.c


2018-05-22 14:47:54 +0100
Ken Sharp <ken.sharp@artifex.com>
b61071c9411c3f6aa0dd594da2c5a20ff4ecd914

Replace EOI marker in JPEG passthrough

Bug #699216 " JPEG passthrough appears to truncate JPEGs in some cases"

The IJG JPEG implementation consumes the EOI marker before the JPEG
passthrough code gets to see it (in general). Most PDF consumers don't
care, but some seem to, so when we terminate the DCT decompression
send the EOI marker to the passthrough code.

base/sdctd.c


2018-05-22 14:04:31 +0100
Ken Sharp <ken.sharp@artifex.com>
4a288cb8678517c578b336b3d26e5c4115906624

Fix conversion from PDF time to XMP time for pdfwrite

Bug #699182 " Invalid XMP metadata and possibly invalid memory access for dates without timezone in pdfmark"

Two different problems; in the first case a '>' should be '>=' so that
we properly identify an empty string.

Then when converting the string, there was a different off-by-one error
in the buffer index. Also corrected a comment while passing.

devices/vector/gdevpdfe.c


2018-05-22 10:51:46 +0100
Ken Sharp <ken.sharp@artifex.com>
16ad4cc70918da40f62a919e11187dfb72f4ff63

Prevent use of CID 0 in a PDF/A output file.

Bug #699375 "PDF/A 1b / 2b Validation fails after conversion with Ghostscript on some files"

The input file(s) use CID 0 (which is defined as the /.notdef glyph)
which is illegal in PDF/A files.

'Fixing' this would require us to alter the CID, change the CMap and
the ToUnicode CMap, and runs the obvious risk of the CID we use as a
replacement being used later in the document. We could avoid this by
scanning for 'holes' in the CMap, but even that potentially leaves us
with a problem if there are no empty entries in the CMap.

Since we can't guarantee fixing the problem, a partial fix would be a
great deal of coding, would almost certainly introduce a bug tail and
still wouldn't guarantee a compliant result, don't try. Instead if we
encounter this condition abort PDF/A output, or throw an error if the
PDFACompatibilityPolicy is set that way.

devices/vector/gdevpdtc.c


2018-05-17 14:30:40 +0100
Chris Liddell <chris.liddell@artifex.com>
48e4565e967eae091b97a9037e77016d8d99f3ce

Bug 699329: add display device to default Unix build.

Previously it was only included in the .so build (it doesn't really make sense
in a monolithic exe build). But since we now have a "supported" static library
build, it makes sense to include it.

configure.ac


2018-05-17 07:35:02 +0100
Chris Liddell <chris.liddell@artifex.com>
891ea7d2813edaa3c7c874a4053afdda128e8a10

Fix for small glyph distortion

Glyphs with very few pixels (i.e. lower case "i" in 9pt text rendered at 72dpi)
we being distorted due to the specific rules applied by Freetype's dropout
compensation. This isn't a full solution but resolves the change in behaviour
between 2.7.x and 2.9.x (the change was due to different rounding being
applied).

This fix is from upstream:
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=f1458d2e44d8

So should be in future Freetype releases, and not need re-applied here.

freetype/src/base/ftobjs.c


2018-04-03 15:49:48 +0100
Chris Liddell <chris.liddell@artifex.com>
9cb169b6b260f650aac2c3c7ed7af0f345ee0707

Work around a behaviour change in freetype > 2.8

Freetype will throw an error when we try to retrieve the glyph if the x/y
advance values are too big to fit in a 16.16 fixed point value.

Since we have no need of those values, set them to zero, and avoid the error.

Bring freetype up to 2.9.1

Plus the gs makefile changes to support the new version.

Reapply "Work around a change in the zlib API for 1.2.11"

for Freetype
commit: 08482c582115a1396d0fd9186011008f889a61c5

base/fapi_ft.c
base/freetype.mak
freetype/CMakeLists.txt
freetype/ChangeLog
freetype/ChangeLog.20
freetype/ChangeLog.21
freetype/ChangeLog.22
freetype/ChangeLog.23
freetype/ChangeLog.24
freetype/ChangeLog.25
freetype/ChangeLog.26
freetype/ChangeLog.27
freetype/ChangeLog.28
freetype/Jamfile
freetype/Jamrules
freetype/Makefile
freetype/README
freetype/README.git
freetype/autogen.sh
freetype/builds/amiga/README
freetype/builds/amiga/include/config/ftconfig.h
freetype/builds/amiga/include/config/ftmodule.h
freetype/builds/amiga/makefile
freetype/builds/amiga/makefile.os4
freetype/builds/amiga/smakefile
freetype/builds/amiga/src/base/ftdebug.c
freetype/builds/amiga/src/base/ftsystem.c
freetype/builds/ansi/ansi-def.mk
freetype/builds/ansi/ansi.mk
freetype/builds/beos/beos-def.mk
freetype/builds/beos/beos.mk
freetype/builds/beos/detect.mk
freetype/builds/cmake/FindHarfBuzz.cmake
freetype/builds/cmake/iOS.cmake
freetype/builds/cmake/testbuild.sh
freetype/builds/compiler/ansi-cc.mk
freetype/builds/compiler/bcc-dev.mk
freetype/builds/compiler/bcc.mk
freetype/builds/compiler/emx.mk
freetype/builds/compiler/gcc-dev.mk
freetype/builds/compiler/gcc.mk
freetype/builds/compiler/intelc.mk
freetype/builds/compiler/unix-lcc.mk
freetype/builds/compiler/visualage.mk
freetype/builds/compiler/visualc.mk
freetype/builds/compiler/watcom.mk
freetype/builds/compiler/win-lcc.mk
freetype/builds/detect.mk
freetype/builds/dos/detect.mk
freetype/builds/dos/dos-def.mk
freetype/builds/dos/dos-emx.mk
freetype/builds/dos/dos-gcc.mk
freetype/builds/dos/dos-wat.mk
freetype/builds/exports.mk
freetype/builds/freetype.mk
freetype/builds/link_dos.mk
freetype/builds/link_std.mk
freetype/builds/mac/FreeType.m68k_cfm.make.txt
freetype/builds/mac/FreeType.m68k_far.make.txt
freetype/builds/mac/FreeType.ppc_carbon.make.txt
freetype/builds/mac/FreeType.ppc_classic.make.txt
freetype/builds/mac/ftmac.c
freetype/builds/modules.mk
freetype/builds/newline
freetype/builds/os2/detect.mk
freetype/builds/os2/os2-def.mk
freetype/builds/os2/os2-dev.mk
freetype/builds/os2/os2-gcc.mk
freetype/builds/symbian/bld.inf
freetype/builds/symbian/freetype.mmp
freetype/builds/toplevel.mk
freetype/builds/unix/aclocal.m4
freetype/builds/unix/config.guess
freetype/builds/unix/config.sub
freetype/builds/unix/configure
freetype/builds/unix/configure.ac
freetype/builds/unix/configure.raw
freetype/builds/unix/detect.mk
freetype/builds/unix/freetype-config.in
freetype/builds/unix/freetype2.in
freetype/builds/unix/freetype2.m4
freetype/builds/unix/ft-munmap.m4
freetype/builds/unix/ftconfig.in
freetype/builds/unix/ftsystem.c
freetype/builds/unix/install.mk
freetype/builds/unix/pkg.m4
freetype/builds/unix/unix-cc.in
freetype/builds/unix/unix-def.in
freetype/builds/unix/unix-dev.mk
freetype/builds/unix/unix-lcc.mk
freetype/builds/unix/unix.mk
freetype/builds/unix/unixddef.mk
freetype/builds/vms/ftconfig.h
freetype/builds/vms/ftsystem.c
freetype/builds/wince/ftdebug.c
freetype/builds/wince/vc2005-ce/freetype.vcproj
freetype/builds/wince/vc2005-ce/index.html
freetype/builds/wince/vc2008-ce/freetype.vcproj
freetype/builds/wince/vc2008-ce/index.html
freetype/builds/windows/detect.mk
freetype/builds/windows/ftdebug.c
freetype/builds/windows/vc2005/freetype.vcproj
freetype/builds/windows/vc2005/index.html
freetype/builds/windows/vc2008/freetype.vcproj
freetype/builds/windows/vc2008/index.html
freetype/builds/windows/vc2010/freetype.sln
freetype/builds/windows/vc2010/freetype.vcxproj
freetype/builds/windows/vc2010/freetype.vcxproj.filters
freetype/builds/windows/vc2010/index.html
freetype/builds/windows/visualc/freetype.dsp
freetype/builds/windows/visualc/freetype.vcproj
freetype/builds/windows/visualc/index.html
freetype/builds/windows/visualce/freetype.dsp
freetype/builds/windows/visualce/freetype.vcproj
freetype/builds/windows/visualce/index.html
freetype/builds/windows/w32-bcc.mk
freetype/builds/windows/w32-bccd.mk
freetype/builds/windows/w32-dev.mk
freetype/builds/windows/w32-gcc.mk
freetype/builds/windows/w32-icc.mk
freetype/builds/windows/w32-intl.mk
freetype/builds/windows/w32-lcc.mk
freetype/builds/windows/w32-mingw32.mk
freetype/builds/windows/w32-vcc.mk
freetype/builds/windows/w32-wat.mk
freetype/builds/windows/win32-def.mk
freetype/configure
freetype/devel/ft2build.h
freetype/devel/ftoption.h
freetype/docs/CHANGES
freetype/docs/CUSTOMIZE
freetype/docs/DEBUG
freetype/docs/FTL.TXT
freetype/docs/INSTALL
freetype/docs/INSTALL.ANY
freetype/docs/INSTALL.CROSS
freetype/docs/INSTALL.GNU
freetype/docs/INSTALL.MAC
freetype/docs/INSTALL.UNIX
freetype/docs/INSTALL.VMS
freetype/docs/MAKEPP
freetype/docs/TODO
freetype/docs/VERSIONS.TXT
freetype/docs/formats.txt
freetype/docs/freetype-config.1
freetype/docs/raster.txt
freetype/docs/reference/ft2-auto_hinter.html
freetype/docs/reference/ft2-base_interface.html
freetype/docs/reference/ft2-basic_types.html
freetype/docs/reference/ft2-bdf_fonts.html
freetype/docs/reference/ft2-bitmap_handling.html
freetype/docs/reference/ft2-bzip2.html
freetype/docs/reference/ft2-cache_subsystem.html
freetype/docs/reference/ft2-cff_driver.html
freetype/docs/reference/ft2-cid_fonts.html
freetype/docs/reference/ft2-computations.html
freetype/docs/reference/ft2-error_code_values.html
freetype/docs/reference/ft2-error_enumerations.html
freetype/docs/reference/ft2-font_formats.html
freetype/docs/reference/ft2-gasp_table.html
freetype/docs/reference/ft2-glyph_management.html
freetype/docs/reference/ft2-glyph_stroker.html
freetype/docs/reference/ft2-glyph_variants.html
freetype/docs/reference/ft2-gx_validation.html
freetype/docs/reference/ft2-gzip.html
freetype/docs/reference/ft2-header_file_macros.html
freetype/docs/reference/ft2-header_inclusion.html
freetype/docs/reference/ft2-incremental.html
freetype/docs/reference/ft2-index.html
freetype/docs/reference/ft2-lcd_filtering.html
freetype/docs/reference/ft2-list_processing.html
freetype/docs/reference/ft2-lzw.html
freetype/docs/reference/ft2-mac_specific.html
freetype/docs/reference/ft2-module_management.html
freetype/docs/reference/ft2-multiple_masters.html
freetype/docs/reference/ft2-ot_validation.html
freetype/docs/reference/ft2-outline_processing.html
freetype/docs/reference/ft2-parameter_tags.html
freetype/docs/reference/ft2-pcf_driver.html
freetype/docs/reference/ft2-pfr_fonts.html
freetype/docs/reference/ft2-properties.html
freetype/docs/reference/ft2-quick_advance.html
freetype/docs/reference/ft2-raster.html
freetype/docs/reference/ft2-sfnt_names.html
freetype/docs/reference/ft2-sizes_management.html
freetype/docs/reference/ft2-system_interface.html
freetype/docs/reference/ft2-t1_cid_driver.html
freetype/docs/reference/ft2-toc.html
freetype/docs/reference/ft2-truetype_engine.html
freetype/docs/reference/ft2-truetype_tables.html
freetype/docs/reference/ft2-tt_driver.html
freetype/docs/reference/ft2-type1_tables.html
freetype/docs/reference/ft2-user_allocation.html
freetype/docs/reference/ft2-version.html
freetype/docs/reference/ft2-winfnt_fonts.html
freetype/docs/release
freetype/include/freetype/config/ftconfig.h
freetype/include/freetype/config/ftheader.h
freetype/include/freetype/config/ftoption.h
freetype/include/freetype/config/ftstdlib.h
freetype/include/freetype/freetype.h
freetype/include/freetype/ftadvanc.h
freetype/include/freetype/ftautoh.h
freetype/include/freetype/ftbbox.h
freetype/include/freetype/ftbdf.h
freetype/include/freetype/ftbitmap.h
freetype/include/freetype/ftbzip2.h
freetype/include/freetype/ftcache.h
freetype/include/freetype/ftcffdrv.h
freetype/include/freetype/ftchapters.h
freetype/include/freetype/ftcid.h
freetype/include/freetype/ftdriver.h
freetype/include/freetype/fterrdef.h
freetype/include/freetype/fterrors.h
freetype/include/freetype/ftfntfmt.h
freetype/include/freetype/ftgasp.h
freetype/include/freetype/ftglyph.h
freetype/include/freetype/ftgxval.h
freetype/include/freetype/ftgzip.h
freetype/include/freetype/ftimage.h
freetype/include/freetype/ftincrem.h
freetype/include/freetype/ftlcdfil.h
freetype/include/freetype/ftlist.h
freetype/include/freetype/ftlzw.h
freetype/include/freetype/ftmac.h
freetype/include/freetype/ftmm.h
freetype/include/freetype/ftmodapi.h
freetype/include/freetype/ftmoderr.h
freetype/include/freetype/ftotval.h
freetype/include/freetype/ftoutln.h
freetype/include/freetype/ftparams.h
freetype/include/freetype/ftpfr.h
freetype/include/freetype/ftrender.h
freetype/include/freetype/ftsizes.h
freetype/include/freetype/ftsnames.h
freetype/include/freetype/ftstroke.h
freetype/include/freetype/ftsynth.h
freetype/include/freetype/ftsystem.h
freetype/include/freetype/fttrigon.h
freetype/include/freetype/ftttdrv.h
freetype/include/freetype/fttypes.h
freetype/include/freetype/ftwinfnt.h
freetype/include/freetype/internal/autohint.h
freetype/include/freetype/internal/cffotypes.h
freetype/include/freetype/internal/cfftypes.h
freetype/include/freetype/internal/ftcalc.h
freetype/include/freetype/internal/ftdebug.h
freetype/include/freetype/internal/ftdrv.h
freetype/include/freetype/internal/ftgloadr.h
freetype/include/freetype/internal/ftmemory.h
freetype/include/freetype/internal/ftobjs.h
freetype/include/freetype/internal/ftpic.h
freetype/include/freetype/internal/ftpsprop.h
freetype/include/freetype/internal/ftrfork.h
freetype/include/freetype/internal/ftserv.h
freetype/include/freetype/internal/ftstream.h
freetype/include/freetype/internal/fttrace.h
freetype/include/freetype/internal/ftvalid.h
freetype/include/freetype/internal/internal.h
freetype/include/freetype/internal/psaux.h
freetype/include/freetype/internal/pshints.h
freetype/include/freetype/internal/services/svbdf.h
freetype/include/freetype/internal/services/svcfftl.h
freetype/include/freetype/internal/services/svcid.h
freetype/include/freetype/internal/services/svfntfmt.h
freetype/include/freetype/internal/services/svgldict.h
freetype/include/freetype/internal/services/svgxval.h
freetype/include/freetype/internal/services/svkern.h
freetype/include/freetype/internal/services/svmetric.h
freetype/include/freetype/internal/services/svmm.h
freetype/include/freetype/internal/services/svotval.h
freetype/include/freetype/internal/services/svpfr.h
freetype/include/freetype/internal/services/svpostnm.h
freetype/include/freetype/internal/services/svprop.h
freetype/include/freetype/internal/services/svpscmap.h
freetype/include/freetype/internal/services/svpsinfo.h
freetype/include/freetype/internal/services/svsfnt.h
freetype/include/freetype/internal/services/svttcmap.h
freetype/include/freetype/internal/services/svtteng.h
freetype/include/freetype/internal/services/svttglyf.h
freetype/include/freetype/internal/services/svwinfnt.h
freetype/include/freetype/internal/sfnt.h
freetype/include/freetype/internal/t1types.h
freetype/include/freetype/internal/tttypes.h
freetype/include/freetype/t1tables.h
freetype/include/freetype/ttnameid.h
freetype/include/freetype/tttables.h
freetype/include/freetype/tttags.h
freetype/include/freetype/ttunpat.h
freetype/include/ft2build.h
freetype/modules.cfg
freetype/src/Jamfile
freetype/src/autofit/Jamfile
freetype/src/autofit/afangles.c
freetype/src/autofit/afblue.c
freetype/src/autofit/afblue.cin
freetype/src/autofit/afblue.dat
freetype/src/autofit/afblue.h
freetype/src/autofit/afblue.hin
freetype/src/autofit/afcjk.c
freetype/src/autofit/afcjk.h
freetype/src/autofit/afcover.h
freetype/src/autofit/afdummy.c
freetype/src/autofit/afdummy.h
freetype/src/autofit/aferrors.h
freetype/src/autofit/afglobal.c
freetype/src/autofit/afglobal.h
freetype/src/autofit/afhints.c
freetype/src/autofit/afhints.h
freetype/src/autofit/afindic.c
freetype/src/autofit/afindic.h
freetype/src/autofit/aflatin.c
freetype/src/autofit/aflatin.h
freetype/src/autofit/aflatin2.c
freetype/src/autofit/aflatin2.h
freetype/src/autofit/afloader.c
freetype/src/autofit/afloader.h
freetype/src/autofit/afmodule.c
freetype/src/autofit/afmodule.h
freetype/src/autofit/afpic.c
freetype/src/autofit/afpic.h
freetype/src/autofit/afranges.c
freetype/src/autofit/afranges.h
freetype/src/autofit/afscript.h
freetype/src/autofit/afshaper.c
freetype/src/autofit/afshaper.h
freetype/src/autofit/afstyles.h
freetype/src/autofit/aftypes.h
freetype/src/autofit/afwarp.c
freetype/src/autofit/afwarp.h
freetype/src/autofit/afwrtsys.h
freetype/src/autofit/autofit.c
freetype/src/autofit/module.mk
freetype/src/autofit/rules.mk
freetype/src/base/Jamfile
freetype/src/base/basepic.c
freetype/src/base/basepic.h
freetype/src/base/ftadvanc.c
freetype/src/base/ftapi.c
freetype/src/base/ftbase.c
freetype/src/base/ftbase.h
freetype/src/base/ftbbox.c
freetype/src/base/ftbdf.c
freetype/src/base/ftbitmap.c
freetype/src/base/ftcalc.c
freetype/src/base/ftcid.c
freetype/src/base/ftdbgmem.c
freetype/src/base/ftdebug.c
freetype/src/base/ftfntfmt.c
freetype/src/base/ftfstype.c
freetype/src/base/ftgasp.c
freetype/src/base/ftgloadr.c
freetype/src/base/ftglyph.c
freetype/src/base/ftgxval.c
freetype/src/base/ftinit.c
freetype/src/base/ftlcdfil.c
freetype/src/base/ftmac.c
freetype/src/base/ftmm.c
freetype/src/base/ftobjs.c
freetype/src/base/ftotval.c
freetype/src/base/ftoutln.c
freetype/src/base/ftpatent.c
freetype/src/base/ftpfr.c
freetype/src/base/ftpic.c
freetype/src/base/ftpsprop.c
freetype/src/base/ftrfork.c
freetype/src/base/ftsnames.c
freetype/src/base/ftstream.c
freetype/src/base/ftstroke.c
freetype/src/base/ftsynth.c
freetype/src/base/ftsystem.c
freetype/src/base/fttrigon.c
freetype/src/base/fttype1.c
freetype/src/base/ftutil.c
freetype/src/base/ftver.rc
freetype/src/base/ftwinfnt.c
freetype/src/base/rules.mk
freetype/src/bdf/Jamfile
freetype/src/bdf/README
freetype/src/bdf/bdf.c
freetype/src/bdf/bdfdrivr.c
freetype/src/bdf/bdflib.c
freetype/src/bzip2/Jamfile
freetype/src/bzip2/ftbzip2.c
freetype/src/bzip2/rules.mk
freetype/src/cache/Jamfile
freetype/src/cache/ftcache.c
freetype/src/cache/ftcbasic.c
freetype/src/cache/ftccache.c
freetype/src/cache/ftccache.h
freetype/src/cache/ftccback.h
freetype/src/cache/ftccmap.c
freetype/src/cache/ftcerror.h
freetype/src/cache/ftcglyph.c
freetype/src/cache/ftcglyph.h
freetype/src/cache/ftcimage.c
freetype/src/cache/ftcimage.h
freetype/src/cache/ftcmanag.c
freetype/src/cache/ftcmanag.h
freetype/src/cache/ftcmru.c
freetype/src/cache/ftcmru.h
freetype/src/cache/ftcsbits.c
freetype/src/cache/ftcsbits.h
freetype/src/cache/rules.mk
freetype/src/cff/Jamfile
freetype/src/cff/cf2intrp.c
freetype/src/cff/cff.c
freetype/src/cff/cffcmap.c
freetype/src/cff/cffcmap.h
freetype/src/cff/cffdrivr.c
freetype/src/cff/cffdrivr.h
freetype/src/cff/cfferrs.h
freetype/src/cff/cffgload.c
freetype/src/cff/cffgload.h
freetype/src/cff/cffload.c
freetype/src/cff/cffload.h
freetype/src/cff/cffobjs.c
freetype/src/cff/cffobjs.h
freetype/src/cff/cffparse.c
freetype/src/cff/cffparse.h
freetype/src/cff/cffpic.c
freetype/src/cff/cffpic.h
freetype/src/cff/cfftoken.h
freetype/src/cff/module.mk
freetype/src/cff/rules.mk
freetype/src/cid/Jamfile
freetype/src/cid/ciderrs.h
freetype/src/cid/cidgload.c
freetype/src/cid/cidgload.h
freetype/src/cid/cidload.c
freetype/src/cid/cidload.h
freetype/src/cid/cidobjs.c
freetype/src/cid/cidobjs.h
freetype/src/cid/cidparse.c
freetype/src/cid/cidparse.h
freetype/src/cid/cidriver.c
freetype/src/cid/cidriver.h
freetype/src/cid/cidtoken.h
freetype/src/cid/module.mk
freetype/src/cid/rules.mk
freetype/src/cid/type1cid.c
freetype/src/gxvalid/Jamfile
freetype/src/gxvalid/README
freetype/src/gxvalid/gxvalid.c
freetype/src/gxvalid/gxvalid.h
freetype/src/gxvalid/gxvbsln.c
freetype/src/gxvalid/gxvcommn.c
freetype/src/gxvalid/gxvcommn.h
freetype/src/gxvalid/gxverror.h
freetype/src/gxvalid/gxvfeat.c
freetype/src/gxvalid/gxvfeat.h
freetype/src/gxvalid/gxvfgen.c
freetype/src/gxvalid/gxvjust.c
freetype/src/gxvalid/gxvkern.c
freetype/src/gxvalid/gxvlcar.c
freetype/src/gxvalid/gxvmod.c
freetype/src/gxvalid/gxvmod.h
freetype/src/gxvalid/gxvmort.c
freetype/src/gxvalid/gxvmort.h
freetype/src/gxvalid/gxvmort0.c
freetype/src/gxvalid/gxvmort1.c
freetype/src/gxvalid/gxvmort2.c
freetype/src/gxvalid/gxvmort4.c
freetype/src/gxvalid/gxvmort5.c
freetype/src/gxvalid/gxvmorx.c
freetype/src/gxvalid/gxvmorx.h
freetype/src/gxvalid/gxvmorx0.c
freetype/src/gxvalid/gxvmorx1.c
freetype/src/gxvalid/gxvmorx2.c
freetype/src/gxvalid/gxvmorx4.c
freetype/src/gxvalid/gxvmorx5.c
freetype/src/gxvalid/gxvopbd.c
freetype/src/gxvalid/gxvprop.c
freetype/src/gxvalid/gxvtrak.c
freetype/src/gxvalid/module.mk
freetype/src/gxvalid/rules.mk
freetype/src/gzip/Jamfile
freetype/src/gzip/ftgzip.c
freetype/src/gzip/ftzconf.h
freetype/src/gzip/rules.mk
freetype/src/gzip/zlib.h
freetype/src/lzw/Jamfile
freetype/src/lzw/ftlzw.c
freetype/src/lzw/ftzopen.c
freetype/src/lzw/ftzopen.h
freetype/src/lzw/rules.mk
freetype/src/otvalid/Jamfile
freetype/src/otvalid/module.mk
freetype/src/otvalid/otvalid.c
freetype/src/otvalid/otvalid.h
freetype/src/otvalid/otvbase.c
freetype/src/otvalid/otvcommn.c
freetype/src/otvalid/otvcommn.h
freetype/src/otvalid/otverror.h
freetype/src/otvalid/otvgdef.c
freetype/src/otvalid/otvgpos.c
freetype/src/otvalid/otvgpos.h
freetype/src/otvalid/otvgsub.c
freetype/src/otvalid/otvjstf.c
freetype/src/otvalid/otvmath.c
freetype/src/otvalid/otvmod.c
freetype/src/otvalid/otvmod.h
freetype/src/otvalid/rules.mk
freetype/src/pcf/Jamfile
freetype/src/pcf/README
freetype/src/pcf/pcf.c
freetype/src/pcf/pcf.h
freetype/src/pcf/pcfdrivr.c
freetype/src/pcf/pcfread.c
freetype/src/pfr/Jamfile
freetype/src/pfr/module.mk
freetype/src/pfr/pfr.c
freetype/src/pfr/pfrcmap.c
freetype/src/pfr/pfrcmap.h
freetype/src/pfr/pfrdrivr.c
freetype/src/pfr/pfrdrivr.h
freetype/src/pfr/pfrerror.h
freetype/src/pfr/pfrgload.c
freetype/src/pfr/pfrgload.h
freetype/src/pfr/pfrload.c
freetype/src/pfr/pfrload.h
freetype/src/pfr/pfrobjs.c
freetype/src/pfr/pfrobjs.h
freetype/src/pfr/pfrsbit.c
freetype/src/pfr/pfrsbit.h
freetype/src/pfr/pfrtypes.h
freetype/src/pfr/rules.mk
freetype/src/psaux/Jamfile
freetype/src/psaux/afmparse.c
freetype/src/psaux/afmparse.h
freetype/src/psaux/cffdecode.c
freetype/src/psaux/cffdecode.h
freetype/src/psaux/module.mk
freetype/src/psaux/psarrst.c
freetype/src/psaux/psarrst.h
freetype/src/psaux/psaux.c
freetype/src/psaux/psauxerr.h
freetype/src/psaux/psauxmod.c
freetype/src/psaux/psauxmod.h
freetype/src/psaux/psblues.c
freetype/src/psaux/psblues.h
freetype/src/psaux/psconv.c
freetype/src/psaux/psconv.h
freetype/src/psaux/pserror.c
freetype/src/psaux/pserror.h
freetype/src/psaux/psfixed.h
freetype/src/psaux/psfont.c
freetype/src/psaux/psfont.h
freetype/src/psaux/psft.c
freetype/src/psaux/psft.h
freetype/src/psaux/psglue.h
freetype/src/psaux/pshints.c
freetype/src/psaux/pshints.h
freetype/src/psaux/psintrp.c
freetype/src/psaux/psintrp.h
freetype/src/psaux/psobjs.c
freetype/src/psaux/psobjs.h
freetype/src/psaux/psread.c
freetype/src/psaux/psread.h
freetype/src/psaux/psstack.c
freetype/src/psaux/psstack.h
freetype/src/psaux/pstypes.h
freetype/src/psaux/rules.mk
freetype/src/psaux/t1cmap.c
freetype/src/psaux/t1cmap.h
freetype/src/psaux/t1decode.c
freetype/src/psaux/t1decode.h
freetype/src/pshinter/Jamfile
freetype/src/pshinter/module.mk
freetype/src/pshinter/pshalgo.c
freetype/src/pshinter/pshalgo.h
freetype/src/pshinter/pshglob.c
freetype/src/pshinter/pshglob.h
freetype/src/pshinter/pshinter.c
freetype/src/pshinter/pshmod.c
freetype/src/pshinter/pshmod.h
freetype/src/pshinter/pshnterr.h
freetype/src/pshinter/pshpic.c
freetype/src/pshinter/pshpic.h
freetype/src/pshinter/pshrec.c
freetype/src/pshinter/pshrec.h
freetype/src/pshinter/rules.mk
freetype/src/psnames/Jamfile
freetype/src/psnames/module.mk
freetype/src/psnames/psmodule.c
freetype/src/psnames/psmodule.h
freetype/src/psnames/psnamerr.h
freetype/src/psnames/psnames.c
freetype/src/psnames/pspic.c
freetype/src/psnames/pspic.h
freetype/src/psnames/pstables.h
freetype/src/psnames/rules.mk
freetype/src/raster/Jamfile
freetype/src/raster/ftmisc.h
freetype/src/raster/ftraster.c
freetype/src/raster/ftraster.h
freetype/src/raster/ftrend1.c
freetype/src/raster/ftrend1.h
freetype/src/raster/module.mk
freetype/src/raster/raster.c
freetype/src/raster/rasterrs.h
freetype/src/raster/rastpic.c
freetype/src/raster/rastpic.h
freetype/src/raster/rules.mk
freetype/src/sfnt/Jamfile
freetype/src/sfnt/module.mk
freetype/src/sfnt/pngshim.c
freetype/src/sfnt/pngshim.h
freetype/src/sfnt/rules.mk
freetype/src/sfnt/sfdriver.c
freetype/src/sfnt/sfdriver.h
freetype/src/sfnt/sferrors.h
freetype/src/sfnt/sfnt.c
freetype/src/sfnt/sfntpic.c
freetype/src/sfnt/sfntpic.h
freetype/src/sfnt/sfobjs.c
freetype/src/sfnt/sfobjs.h
freetype/src/sfnt/ttbdf.c
freetype/src/sfnt/ttbdf.h
freetype/src/sfnt/ttcmap.c
freetype/src/sfnt/ttcmap.h
freetype/src/sfnt/ttcmapc.h
freetype/src/sfnt/ttkern.c
freetype/src/sfnt/ttkern.h
freetype/src/sfnt/ttload.c
freetype/src/sfnt/ttload.h
freetype/src/sfnt/ttmtx.c
freetype/src/sfnt/ttmtx.h
freetype/src/sfnt/ttpost.c
freetype/src/sfnt/ttpost.h
freetype/src/sfnt/ttsbit.c
freetype/src/sfnt/ttsbit.h
freetype/src/smooth/Jamfile
freetype/src/smooth/ftgrays.c
freetype/src/smooth/ftgrays.h
freetype/src/smooth/ftsmerrs.h
freetype/src/smooth/ftsmooth.c
freetype/src/smooth/ftsmooth.h
freetype/src/smooth/ftspic.c
freetype/src/smooth/ftspic.h
freetype/src/smooth/module.mk
freetype/src/smooth/rules.mk
freetype/src/smooth/smooth.c
freetype/src/tools/afblue.pl
freetype/src/tools/apinames.c
freetype/src/tools/docmaker/content.py
freetype/src/tools/docmaker/docbeauty.py
freetype/src/tools/docmaker/docmaker.py
freetype/src/tools/docmaker/formatter.py
freetype/src/tools/docmaker/sources.py
freetype/src/tools/docmaker/tohtml.py
freetype/src/tools/docmaker/utils.py
freetype/src/tools/ftfuzzer/README
freetype/src/tools/ftfuzzer/ftfuzzer.cc
freetype/src/tools/ftfuzzer/ftmutator.cc
freetype/src/tools/ftfuzzer/rasterfuzzer.cc
freetype/src/tools/ftfuzzer/runinput.cc
freetype/src/tools/ftrandom/ftrandom.c
freetype/src/tools/glnames.py
freetype/src/tools/update-copyright-year
freetype/src/truetype/Jamfile
freetype/src/truetype/module.mk
freetype/src/truetype/rules.mk
freetype/src/truetype/truetype.c
freetype/src/truetype/ttdriver.c
freetype/src/truetype/ttdriver.h
freetype/src/truetype/tterrors.h
freetype/src/truetype/ttgload.c
freetype/src/truetype/ttgload.h
freetype/src/truetype/ttgxvar.c
freetype/src/truetype/ttgxvar.h
freetype/src/truetype/ttinterp.c
freetype/src/truetype/ttinterp.h
freetype/src/truetype/ttobjs.c
freetype/src/truetype/ttobjs.h
freetype/src/truetype/ttpic.c
freetype/src/truetype/ttpic.h
freetype/src/truetype/ttpload.c
freetype/src/truetype/ttpload.h
freetype/src/truetype/ttsubpix.c
freetype/src/truetype/ttsubpix.h
freetype/src/type1/Jamfile
freetype/src/type1/module.mk
freetype/src/type1/rules.mk
freetype/src/type1/t1afm.c
freetype/src/type1/t1afm.h
freetype/src/type1/t1driver.c
freetype/src/type1/t1driver.h
freetype/src/type1/t1errors.h
freetype/src/type1/t1gload.c
freetype/src/type1/t1gload.h
freetype/src/type1/t1load.c
freetype/src/type1/t1load.h
freetype/src/type1/t1objs.c
freetype/src/type1/t1objs.h
freetype/src/type1/t1parse.c
freetype/src/type1/t1parse.h
freetype/src/type1/t1tokens.h
freetype/src/type1/type1.c
freetype/src/type42/Jamfile
freetype/src/type42/module.mk
freetype/src/type42/rules.mk
freetype/src/type42/t42drivr.c
freetype/src/type42/t42drivr.h
freetype/src/type42/t42error.h
freetype/src/type42/t42objs.c
freetype/src/type42/t42objs.h
freetype/src/type42/t42parse.c
freetype/src/type42/t42parse.h
freetype/src/type42/t42types.h
freetype/src/type42/type42.c
freetype/src/winfonts/Jamfile
freetype/src/winfonts/fnterrs.h
freetype/src/winfonts/module.mk
freetype/src/winfonts/rules.mk
freetype/src/winfonts/winfnt.c
freetype/src/winfonts/winfnt.h
freetype/vms_make.com


2018-05-16 22:25:06 -0700
Ray Johnston <ray.johnston@artifex.com>
ddace435eb99ea1c8a517f4ec94307cfe0743bce

Fixup msvclib.mak that had seriously bit-rotted.

Mainly pulling macro definition in from msvc.mak and add missing FEATURE_DEVS
and change the default device to ppmraw (more useful than ljet2).

base/msvclib.mak


2018-05-16 22:22:46 -0700
Ray Johnston <ray.johnston@artifex.com>
eab096dcf3d528c4a533ab1fb0616179dd0ee4e6

Add missing dependency for sicclib (md5 is needed for icc cache hash)

base/lib.mak


2018-05-16 13:35:26 -0700
Ray Johnston <ray.johnston@artifex.com>
cee69d4f50ff9a860040b8afdeb2cdb65a7252d8

Rename "rand" function to "gs_rand" to avoid name clash on Windows

Apparently (at least with VS 2015) stdlib.h contains a declaration for
"rand" that clashes with the local version.

base/gslib.c


2018-05-14 22:33:26 -0700
Ray Johnston <ray.johnston@artifex.com>
fc42e417956d4bf3b3b2d7138c550e04f62c3159

Fix some InterpolateControl issues.

Some devices (such as clist) rely on image->Interpolate to determine how
to handle the image. Rather than checking dev->interpolate control there,
and look for other devices that may also need it, do the force in the
gs_image_begin_typed. Also, fix gs_pdf14_device_copy_params to copy the
interpolate_control.

base/gdevp14.c
base/gsimage.c


2018-05-15 21:36:30 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f90f090c0a5c3e5744d3ec6f0430fbe1a86ac44c

Bug 697545 : Prevent SEGV in freetype if running out of memory.

Prevent SEGV when trying to use buffer after memory failure. This patch has
been accepted by the freetype team as commit e0015f7612cf07ff80561475321ce1f98c7c2b88

Error created using :-
MEMENTO_FAILAT=17104 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0051

freetype/src/autofit/afcjk.c
freetype/src/autofit/aflatin.c
freetype/src/autofit/afshaper.c


2018-05-09 11:31:38 -0700
Ray Johnston <ray.johnston@artifex.com>
43f429a2508e72d36a3b27671c8d7e43f1bbc591

Increase the data_size for pattern-clist to 128k (from 32K).

The tile cache is kept in the clist buffer, and there are a few files that
trip over the limit of the number of hash slots with the small data_size,
particularly comparefiles/Bug689851.pdf at 72 dpi. With this file, the clist
size is reduced by about 65%. Other than the pattern-clist, the tile cache
seems to work adequately without needing to delete tiles.

Also this means that more data can be accumulated for image_data before
needing to flush the buffer to the memory_clist storage, which should
improve performance a bit (but pattern-clist is never going to be fast).

base/gxpcmap.c


2018-04-26 20:11:31 +0100
Robin Watts <robin.watts@artifex.com>
9df005ac54c94dc986c3ed94b24d5ecdfe03582b

Fix problem with transparency and ROPs.

A comment from 1998 in gdevrop.c indicates that
if we are given a LOP that says "S is transparent", and
S isn't used, then we should ignore that flag. (Similarly
for T). Tests seem to indicate that this is indeed true
(See page 12 of C425.bin for an example).

Unfortunately, when we start 'folding' LOPs down onto simpler
ones, we can start with a LOP where S (or T) matters, and
end up with one where it looks like it doesn't. As such we
introduce another flag so we can avoid trying to remove
the S/T transparency flags after we have started to fold the
rop down.

We use this in mem_gray8_rgb24_strip_copy_rop, and rop_get_run_op
to ensure we don't throw away transparency by mistake.

For example, in mem_gray8_rgb24_strip_copy_rop when called with
lop=0x2fc, with S as a bitmap where both colors are the same, the
current code spots that S is always 1, and rewrites the rop to be
0xff. This in turn leads to T not being required, so it is ignored,
despite the fact that T should still be consulted for transparency.

(Check that page 12 of C425.bin is still OK!)

base/gdevmr8n.c
base/gsroprun.c
base/gsropt.h


2018-05-10 13:58:34 -0600
Henry Stiles <henry.stiles@artifex.com>
30aa9aee30bc0324359df1f931efb75c5a2c5dd7

Only add the source to the ROP if it isn't already specified.

The previous code unconditionally added the source to the ROP, so any
ROP which contained ~S was changed to S. With the extra logic, the
expression to determine the lop actual paramater was getting
unreadable so it has been split up.

base/gxdcolor.c


2018-05-09 17:34:43 +0100
Robin Watts <robin.watts@artifex.com>
8e31bcbf7214568b09a00683a19f7c4e847618f6

Tweak previous fix to rounding in image code.

Back in September 2016, commit bffe2011e1 went in, entitled "Fix bug
69707. SMask subpixel offset must match image offset."

In this, an adjustment was applied to the dda to attempt to make it
match the rounding used in the mono case.

This adjustment was made *after* the position of the first edge was
made, rather than after it, resulting in a slight difference to the
size of the first pixel of a run.

This error was spotted when comparing the output of an experimental
optimisation to use memcpy for 1:1 runs of data.

base/gxicolor.c


2018-05-08 12:37:07 +0100
Chris Liddell <chris.liddell@artifex.com>
f302fbc59b974a167a7a0023ac6f9e89ed27d243

Honor the single object clump flag when allocating strings

When checking whether a given clump was a candidate to allocate a string,
the code was not checking the flag that marks the clump as being for a
single object. That could lead to the clump being freed (with it's original,
single object content, along with the string) when the string(s) were still
in use.

This is better than resetting the flag since single object clumps are such
for a reason (they implement immovable memory), and we *never* want
immovable memory to become movable

base/gsalloc.c


2018-05-05 20:23:13 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e1652d0b73989b77a914f6a0de58ec6f53fc8e01

Bug 697545 : Prevent SEGV after gs_stroke.

Prevent SEGV if memory allocation fails.

Error created using :-
MEMENTO_FAILAT=9971 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0010

base/gspaint.c


2018-05-05 22:49:20 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
93d78c6299905fe0a192840015f71820772be95c

Bug 697545 : Fix memory leak in gx_image_enum_begin.

Fix memory leak due to buffer not being freed on error.

Error created using :-
MEMENTO_FAILAT=10035 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0010

base/gxipixel.c


2018-05-05 21:28:41 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
2b2fef0e97c148795af8c4c08b261f2807f1ba52

Bug 697545 : Prevent SEGV after fill_with_rule.

Prevent SEGV if memory allocation fails.

Error created using :-
MEMENTO_FAILAT=9999 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./tests_private/pcl/pcl5cfts/fts.0010

base/gspaint.c


2018-05-04 19:31:59 +0100
Robin Watts <robin.watts@artifex.com>
9e8ef6c2f2086adbf784ddbe71fe2799afc4002b

Fix image skip logic (again).

The device to be used is not penum->dev, that'd be far too sensible!

Pass in the actual device to be used.

base/gxidata.c
base/gximage.h


2018-05-03 22:31:31 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
7fa6e4a640857f6cfb1d520e65376c0304594980

Bug 697545 : Fix memory leak in gx_gstate_dev_ht_install.

Fix memory leak due to cache not being freed on error.

Error created using :-
MEMENTO_FAILAT=10111 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./pcl/examples/owl.pcl

base/gsht.c


2018-05-03 12:00:11 -0700
Ray Johnston <ray.johnston@artifex.com>
9df84425aab2009f6335d57b5c19da2ac49294c4

Clean up some left over RECT_RECOVER code, delete band_code from state

base/gxcldev.h
base/gxclimag.c
base/gxclrect.c


2018-05-02 08:34:52 -0700
Ray Johnston <ray.johnston@artifex.com>
fe6b6679bced0f6f9b617e72278c538da8386b5c

Remove unused clist command definitions, document unused code values.

In preparation for upcoming clist changes for tiles, do some clean up of
the definitions and document unused command codes. Note that there are
still commands with flag bits where there are unused bits when certain
flags are set, e.g. copy_mono_planes, low 3 bits unused if copy_use_tile
is set, but using these code combinations would need changes in the
clist_playback_band reader.

base/gxcldev.h
base/gxclimag.c
base/gxclpath.h
base/gxclrast.c


2018-05-03 18:49:03 +0100
Robin Watts <robin.watts@artifex.com>
a080da17f4d060b4e23d85b35989df92bb4bf76c

Remove outdated comment.

base/gxicolor.c


2018-05-03 11:51:22 +0100
Robin Watts <robin.watts@artifex.com>
23de52cfaf6e263dde824bd7be0b8d9d1d2cd053

Fix quirk in image enumerator creation routines.

When we start an image, the image code runs through the handlers
for different types of image until it finds one that can handle
the required type.

These handlers are queried with the current device in as penum->dev.

The image code then sets up any clip or rop device on top of this
device.

If the handlers were to call device functions, they would be in
the somewhat odd position of calling a different device in the setup
phase than they would be calling in the processing phase. This
upsets a forthcoming commit.

The fix is to ensure that any clip and rop devices are setup BEFORE
the image handlers are called.

base/gxipixel.c


2018-04-29 10:28:48 +0100
Chris Liddell <chris.liddell@artifex.com>
7b4ad6025f0576e2adb971230a9a2dfb62335a13

Update doc/thirdparty.htm

doc/thirdparty.htm


2018-04-25 14:22:03 +0100
Robin Watts <robin.watts@artifex.com>
f7bfa8db8f1407f70253667d832f3b219b434559

Fix source + texture both data in mem_gray8_rgb24_strip_copy_rop.

Using rop rather than lop means transparency was broken in the
(unusual) source + texture both being data based case.

Also, we were failing to update the source pointer, causing odd
repeats in output.

base/gdevmr8n.c


2018-04-27 07:52:52 -0600
Henry Stiles <henry.stiles@artifex.com>
2fd21f767d9b4065fd4f3ef1319ad6dbee8a2ffd

Change ownership of jbig2 to Sebastian.

doc/who_owns_what.txt


2018-04-27 11:27:44 +0100
Ken Sharp <ken.sharp@artifex.com>
5ff675bcb1ce0a1349a81c4c2dbfde20769616fa

pdf_info.ps - report if a PDF file uses XFA forms

toolbin/pdf_info.ps


2018-04-26 19:01:44 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
133d0c54ba05f887f67c441ceda59f49cf563902

Bug 697545 : Fix memory leak in clist_open.

Fix memory leak due to cache not being freed on error.

Error created using :-
MEMENTO_FAILAT=1835 ./membin/gpcl6 -sDEVICE=pbmraw -sDEVICE=pbmraw -o /dev/null ./pcl/examples/owl.pcl

base/gxclist.c


2018-04-25 09:55:51 -0700
Ray Johnston <ray.johnston@artifex.com>
4609498d02a91f954636124d5f5699794ffac48a

Fix bug 697671: Banding/Page mode mismatch

The simplified case had a character (copy_mono) followed by a rect
fill.

The copy_mono for the character sets the rect.height clamped to the
"cropping_max" (dev->height) for the band in the writer, but it doesn't
actually write the height to the clist for that band. Then the reader
was using the entire bitmap height, but that went past the end of the
device, so the next time the state.rect.height was used in the reader,
it was wrong.

base/gxclrast.c


2018-04-25 20:26:43 +0100
Robin Watts <robin.watts@artifex.com>
bf9c9faf78caacc7e90faf04b50611153a64d014

Update clusterpush.pl to allow for larger files.

toolbin/localcluster/clusterpush.pl


2018-04-24 16:00:31 +0100
Chris Liddell <chris.liddell@artifex.com>
8197eaf98c552991a0b7f8068ff3fcce56c07803

Bug 699201: Fix alignment of rendering bands memory

The bottom section of the "raster buffer", when rendering through the page
clist, is reserved as a cache (tile cache, to be specific). Hence to bottom
address of the memory we actually render into starts immediately after the
cache.

No account was taken when setting up that cache size of the alignment expected
by the rendering code.

We'll now ensure that the the cache ends, and the raster band memory starts
on an appropriately aligned address.

base/gxclist.c


2018-04-24 15:22:15 +0100
Robin Watts <robin.watts@artifex.com>
610862e06b739430a2994dc4a0c399fa21900521

Tweak MSVC Profile build settings.

While attempting to debug an unrelated issue, I found a note on
an MSVC forum from an MS developer suggesting that we should use
/Profile rather than /PROFILE or /profile as the flags. They
*should* do the same thing, but the suggestion is that there
might be a bug in the MS linker.

Committing this here as it certainly doesn't hurt, and might save
someone hours in future.

psi/msvc.mak


2018-04-24 11:57:28 +0100
Robin Watts <robin.watts@artifex.com>
0be413a3f3a24c3d55062273cd37e8fcac7c0c4f

Fix mem_gray8_rgb24_strip_copy_rop.

A couple of cases in this routine were failing to increment
the destination pointer after writing. I guess this shows
that a couple of cases are rarely used for partial scanlines.

base/gdevmr8n.c


2018-04-20 23:50:59 +0100
Robin Watts <robin.watts@artifex.com>
c56b2c2d72ef86f3e45882dd5b35a772ce79e8f9

Avoid 'const' warning.

base/gxi12bit.c


2018-04-20 14:45:52 +0100
Robin Watts <robin.watts@artifex.com>
7657398e7574f4a54eb35ea757a7c3037fe7c0e5

Further simplification to image_render_icc_... functions.

Avoid needless alternations in the middle of the loop in
exchange for a single function call.

base/gxcmap.c
base/gxcmap.h
base/gxi12bit.c
base/gxicolor.c


2018-04-20 18:10:12 +0100
Robin Watts <robin.watts@artifex.com>
4a2f6848f38c60eb39a5467c951cfdc06c334a19

Apply same simplification/optimisations to image_render_icc16

Apply the same changes to image_render_icc16 as we did just a few
commits ago.

base/gxi12bit.c


2018-04-19 19:13:50 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
7b539b765dcc960d257bffbcfef8a496120887a8

Bug 697545 : Prevent SEGV in c_param_add.

Prevent SEGV if pkey memory allocation fails.

Error created using :-
MEMENTO_FAILAT=1823 ./membin/gpcl6 -sDEVICE=pbmraw -r300 -dMaxBitmap=2000 -o /dev/null ./pcl/examples/owl.pcl

base/gscparam.c


2018-04-16 20:34:46 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
28c25a7aa12ab36996e12850dfc8e0935c0e4437

Bug 697545 : Prevent SEGV in pcfont_do_reset.

Prevent SEGV if memory allocation fails.

Error created using :-
MEMENTO_FAILAT=1908 ./membin/gpcl6 -sDEVICE=pbmraw -r300 -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pcfont.c


2018-04-19 17:42:06 +0100
Robin Watts <robin.watts@artifex.com>
b35f89d9bef02a02c55a377c6797afcbbe78664d

Simplify some image_render code routines.

Primarily these cut down on needlessly duplicated code.

The skew case should actually benefit in speed, because we don't
pointlessly redo the color mapping for every pixel.

base/gxicolor.c


2018-04-17 21:38:31 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
2c25f3c8582749cc9641d12ca4eb51adefa6d04d

Bug 697545 : Fix memory leak in rc_unshare_struct.

Rearrange order of macro so that the memory is freed even if the call to
rc_alloc_struct_1 fails.

Error created using :-
MEMENTO_FAILAT=10044 ./membin/gpcl6 -sDEVICE=pbmraw -r300 -o /dev/null ./pcl/examples/owl.pcl

base/gsrefct.h


2018-04-19 13:41:33 +0100
Chris Liddell <chris.liddell@artifex.com>
8f37f0e4f6325ea8f58194d81a8a6e3321e6660e

Remove some experimental code that was ifdef'ed out

base/gxfapi.c


2018-04-19 13:38:30 +0100
Chris Liddell <chris.liddell@artifex.com>
e8e91f7046645ac7334516735d06ae5109127892

Ensure uncached glyphs have the "text" tag set.

Glyphs bitmaps being drawn from FAPI, bypassing the glyph cache, were not
causing the device's tag to be set to text.

base/gxfapi.c


2018-04-18 13:54:13 +0100
Chris Liddell <chris.liddell@artifex.com>
8f912519ee1d7407126479fefc2210bc69f9e11a

Fix compiler warning with debug build

In a debug build, to facilitate logging/debugging, the rc_ajust() macro
calls a function to trace the reference count changes. The client name (cname)
parameter should be declared const to avoid a compiler warning.

base/gsmemory.c
base/gsrefct.h


2018-04-18 10:11:50 +0100
Chris Liddell <chris.liddell@artifex.com>
b8c65eab50076cfd56f0301ec764b30df9d86ae3

Bug 699214: Add and use a "no cache" flag for glyphs

Previously, to avoid using a cached glyph, the PXL code went around the
graphics library API to set a flag in the show enumerator that really should
only be touched internally.

This adds the capability to the enumerator for the client to request that no
cached glyphs be used for the current block of text, and changes the PXL code
to used it.

base/gstext.h
base/gxchar.c
pcl/pxl/pxfont.c


2018-04-18 09:07:27 +0100
Chris Liddell <chris.liddell@artifex.com>
fd22032d14134f32a42897c9db6a796340a912de

Bug 699214 (related): make text and show enums the same

This is the first part of removing the text enumerator altogether.

base/gxchar.h
base/gxtext.h
base/lib.mak
devices/vector/gdevpdtt.h
devices/vector/gdevtxtw.c


2018-04-18 15:47:20 +0100
Ken Sharp <ken.sharp@artifex.com>
49dcf2a599434f2cb9e0847a75ad61270d30e68a

Documentation - document two missing parameters

These got missed from the documentation when they were implemented.

doc/VectorDevices.htm


2018-04-18 15:46:32 +0100
Ken Sharp <ken.sharp@artifex.com>
39b1e54b2968620723bf32e96764c88797714879

pdfwrite - Guard against trying to output an infinite number

Bug #699255 " Buffer overflow on pprintg1 due to mishandle postscript file data to pdf"

The file uses an enormous parameter to xyxhow, causing an overflow in
the calculation of text positioning (value > 1e39).

Since this is basically a nonsense value, and PostScript only supports
real values up to 1e38, this patch follows the same approach as for
a degenerate CTM, and treats it as 0.

Adobe Acrobat Distiller throws a limitcheck error, so we could do that
instead if this approach proves to be a problem.

devices/vector/gdevpdts.c


2018-04-17 16:09:40 +0100
Chris Liddell <chris.liddell@artifex.com>
fb4c58a0e097e39547dde3d46893ce1b05d19539

Remove redundant references to Xfonts.htm

base/unixinst.mak
doc/Drivers.htm
doc/Readme.htm
doc/Use.htm


2018-03-30 14:38:28 +0100
Chris Liddell <chris.liddell@artifex.com>
59c722d075cb70fc076c2d41b30f16e0e54a4704

Bug 699160: rejig the .so "loaders" builds.

The two simple .so "loaders" (gsx and gsc) were built as a single step, source
to exe, process. Because of that LDFLAGS wasn't used.

We'll now separate the compile and link stages, meaning we can properly use
CFLAGS and LDFLAGS. It also means we can have more control of the order in
which the -L lib search paths are applied.

Properly pass on debug options, and extend these changes to the PCL/XPS/PDL
.so/exe targets.

Makefile.in
base/unix-dll.mak
base/unixlink.mak
configure.ac


2018-04-15 12:49:40 -0700
Ray Johnston <ray.johnston@artifex.com>
769ffb76e7cfd5eeff32251d122399f4b729477b

Fix warning on exit with ref_count > 0 due to pclxl image handling.

The pclxl_begin_image gets a link profile, but did not release the
link in pclxl_image_end_image causing the ref_count to be wrong.

devices/vector/gdevpx.c


2018-04-15 12:48:20 -0700
Ray Johnston <ray.johnston@artifex.com>
e88d8e90de569adedb614a2a7e3dda38063f4d02

Add ref_count debug to icc link cache.

base/gsicc_cache.c


2018-04-11 19:37:07 +0100
Robin Watts <robin.watts@artifex.com>
dfbf92a35d2be0aaa35bdb301c0647deec55b054

Attempt to fix vertical shifts seen in halftoning.

Differences are evident between old (slow, non SSE based) and new
(fast, C/SSE based) halftoning. This is not because of the SSE,
but rather because of different calculations in the C that prepares
the screen for the fast SSE based thresholding, specifically, I
believe, to the calculation of the y offset into the texture tile.

This commit changes the texture tile y offset calculation in the
'fast' code to involve screen_phase.y, in the hopes that this
will better match the 'old' version.

With this fix in, we see just a few PS/PDF diffs, but lots of PCL
diffs (as I guess you'd expect, as PCL makes much more use of this
kind of stuff). I've checked a random selection of them, and in all
cases the new page mode renderings with the "fast" code match the
page mode renderings given by the "old" code.

There are instances where the clist rendering no longer matches the
page mode rendering, but in the tests I've done the clist old code
does match the clist fast code. So we are consistent at least. I
suspect that there is something up with the way the y_phase is
transmitted across the clist, and have opened bug 699209 to
track that.

base/gxht_thresh.c


2018-04-11 20:28:23 +0100
Robin Watts <robin.watts@artifex.com>
b9e0722267e8770c01914da28f924cffcae1c0b8

Fix stray debugging code that was breaking windows builds.

base/write_t1.c


2018-04-10 16:01:44 +0100
Chris Liddell <chris.liddell@artifex.com>
1da9cf6dd87287b952826e8606a26f97b474c556

Multiple master font cached glyphs

In the event that the WeightVector is changed (via setweightvector) on an
already defined font object, we had no way to invalidate the glyph cache
entries already created for that font, with the previous WeightVector.

Given that MM fonts generally substitute for an entire use of a "real" font,
and changing "mid stream" is rare (and almost entirely restricted to test
files), this uses the sledgehammer approach of purging the existing glyphs
from the cache.

In real world use, this is going to have less effect on performance than adding
a conditional check on a variable length array of floating point numbers is
likely to have.

psi/int.mak
psi/zchar1.c


2018-01-30 09:31:04 +0000
Chris Liddell <chris.liddell@artifex.com>
36e7d38af2a11b5e4d7117ddd0ebf7326fad7c72

Bug 698767: Improve handling of multiple master fonts

The FAPI API didn't really handle the possibility that multiple master fonts
could change (via setweightvector) without a call to definefont/setfont etc.

We now allow two ways for FAPI to handle this: if the scaler in force allows it,
we'll set the new weight vector, and carry on as before.

If the scaler does *not* allow us to change the weight vector "on the fly",
we'll destroy the scaler's font object and related data, and recreate it with
the new weight vector in the font dictionary.

base/fapi_ft.c
base/fapibstm.c
base/fapiufst.c
base/gsalloc.c
base/gxfapi.c
base/gxfapi.h
base/write_t1.c
psi/zfapi.c


2018-04-08 20:34:43 +0800
Sebastian Rasmussen <sebras@gmail.com>
890e637bf7a1d8a5e3438c2aab4e0eef33d795f1

jbig2dec: Detect data shortage.

jbig2dec/jbig2_page.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_text.c


2018-04-08 20:33:33 +0800
Sebastian Rasmussen <sebras@gmail.com>
44ff6900ac97d53101c8585880acb9a73631cefe

jbig2dec: Remember to free halftone GB_stats in case of error.

jbig2dec/jbig2_halftone.c


2018-04-08 20:32:59 +0800
Sebastian Rasmussen <sebras@gmail.com>
9efdbd90790f87ab9f56a4cd39b703a23c9d3172

jbig2dec: Make error messages distinguishable.

jbig2dec/jbig2_symbol_dict.c


2018-04-08 14:58:23 +0800
Sebastian Rasmussen <sebras@gmail.com>
1fca43f52caa90926169fe1fe845837749bab233

jbig2dec: Plug leak of image upon error decoding text region.

jbig2dec/jbig2_symbol_dict.c


2018-04-06 00:41:01 +0800
Sebastian Rasmussen <sebras@gmail.com>
2b2dcf4ccf401ed210f03c858b304994749fd2b3

jbig2dec: Improve error handling.

Some functions detected errors but would not return these
to the caller. These functions may now indicate errors:

jbig2_arith_decode(), jbig2_image_resize()

Errors detected by following functions were not always
handled, but they are now handled properly:

jbig2_arith_decode(), jbig2_arith_iaid_decode()
jbig2_arith_int_ctx_new(), jbig2_build_huffman_table()
jbig2_complete_page(), jbig2_image_compose()
jbig2_decode_refinement_region(), jbig2_ctx_new()
jbig2_image_resize(), jbig2_image_write_pbm()
jbig2_image_write_pbm_file(), jbig2_image_write_png()
jbig2_image_write_png_file(), jbig2_metadata_add()
jbig2_page_add_result(), jbig2_renew()
jbig2_strndup()

Some functions detected errors but did not fail early enough:

jbig2_decode_pattern_dict(), jbig2_decode_halftone_region()

jbig2_decode_mmr_line() detected errors but did not produce
suitable error messages. This has been rectified.

Finally, if a subfunction indicates an error by returning an
error code, the calling function will report a warning and
return, indicating failure.

jbig2dec/jbig2.c
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith.h
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_arith_iaid.h
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_arith_int.h
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_image.c
jbig2dec/jbig2_image_pbm.c
jbig2dec/jbig2_image_png.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c
jbig2dec/jbig2dec.c
jbig2dec/pbm2png.c


2018-04-06 00:44:10 +0800
Sebastian Rasmussen <sebras@gmail.com>
7ede8fc2b5e8498619d1e32b6b7fbbf9f926a055

jbig2dec: Remove unused return value for setting pixel.

jbig2dec/jbig2_image.c
jbig2dec/jbig2_image.h


2018-04-09 21:30:07 +0800
Sebastian Rasmussen <sebras@gmail.com>
2afeb8384e4db612df56d5f02162767647893a7d

jbig2dec: Remove end of line characters to jbig2_error() messages.

jbig2dec/jbig2_image.c
jbig2dec/jbig2_symbol_dict.c


2018-04-07 00:12:15 +0800
Sebastian Rasmussen <sebras@gmail.com>
d38507b3d62d9d0710b1c5122af5db9730167082

jbig2dec: Fix some cosmetic typos in code/headers/tests.

jbig2dec/jbig2.h
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_image_png.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_text.c
jbig2dec/jbig2dec.c
jbig2dec/memento.c
jbig2dec/test_jbig2dec.py


2018-03-26 21:57:33 +0800
Sebastian Rasmussen <sebras@gmail.com>
c0f89bd215d700339429da4375a4eaf89445f872

jbig2dec: Remove unnecessary whitespace.

jbig2dec/jbig2.c
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c
jbig2dec/test_jbig2dec.py


2018-04-09 11:49:52 +0200
Tor Andersson <tor.andersson@artifex.com>
47f3be9b6676ed09e844362b267daae2a1b04a4d

jbig2dec: Make sure to include stdint.h in the generated config_types.h

The previous commit accidentally broke the autoconf build.

jbig2dec/autogen.sh


2018-04-06 12:44:38 +0100
Robin Watts <robin.watts@artifex.com>
bda3b5087d136c7839ded79594ac70e9712228e5

Fix Memento locking problem.

When calling Memento_event, it would lock, and then call
Memento_checkAllMemory which would lock again. This is fine
on windows, as locks are recursive, but not on Linux.

base/memento.c


2018-04-04 22:36:24 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
cbbe08d116ae91e0cc0ffa91eb71ec364b4d44a3

Bug 697545 : Fix memory leak in gx_pattern_load.

Fix memory leak due to pattern cache data being allocated but not used.

Error created using :-
MEMENTO_FAILAT=10103 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gxpcmap.c


2018-04-04 18:40:01 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
cbc44b82c2c63ef48c994fb2eced4350e41159aa

Bug 697545 : Fix memory leak in show_proceed.

Fix memory leak due to gsave/grestore mismatch.

Error created using :-
MEMENTO_FAILAT=10946 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gxchar.c


2018-04-05 16:28:01 +0100
Robin Watts <robin.watts@artifex.com>
4372854939842240c7edb58dd0fa285a0c2f15b1

Another attempt at fixing the 'skip' logic for halftoned images.

When rendering images, if the dda is not shared between the
halftoner and gs, gs cannot just skip lines that it knows should
be clipped, lest the halftoner get confused about it.

The previous attempt to solve this used a separate 'skip_render'
routine, but the decision as to whether to call this or not was
itself dependent on the values of the dda. When scaling down
scanlines can be completely skipped. In the cases where the dda
in gs doesn't match the one in the halftoner exactly we could
get dropouts.

So, a new attempt. Here we introduce a new function call that
checks with the halftoner whether the next scanline will be
required or not. If it is, gs unpacks the data and passes it in.
If not, the data can just be skipped.

base/gxidata.c
base/gximage.h
base/gxipixel.c


2018-04-04 18:38:02 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
5886c28f2a7376ad3818dadeb9cc3c6989f7702a

Bug 697545 : Fix memory leak in pcl_start_raster.

Fix memory leak after memory allocation failure.

Error created using :-
MEMENTO_FAILAT=11602 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/rtraster.c


2018-04-05 14:12:25 +0100
Chris Liddell <chris.liddell@artifex.com>
9ef02a883952ecc225792896a1eabac93e19f143

Bug 699158: Tidy up a validation check

Use a cleaner check to ensure UFST only gets passed Microtype fonts (from .fco
font collections).

Not sure what I was thinking when I wrote the original check, but it was clearly
a bad code day!

base/fapiufst.c


2018-04-05 14:10:54 +0100
Chris Liddell <chris.liddell@artifex.com>
410d5f9372db241713f0e9730ec18edfa117f687

Fix some link typos in Develop.html

doc/Develop.htm


2018-04-04 17:30:17 +0100
Robin Watts <robin.watts@artifex.com>
bc9e133f81e02e90e9fc9a82853d0aea18cdb905

Fix new logic for skipping clipped image lines.

In refactoring the previous commit so that it didn't cause
diffs, I broke it so that it gave no advantage.

This version should give no diffs, AND give a speed increase
by avoiding unpacking elided lines.

base/gxidata.c


2018-04-03 17:47:03 +0100
Robin Watts <robin.watts@artifex.com>
41e94a745cdbed112efc0e72d76645e8500a0791

Tweak logic for skipping clipped image lines.

As gs runs through image data, it unpacks each line into
a buffer, then checks whether that buffer is trivially
outside the clipping region. If it is, then it doesn't
bother to call the line renderer.

This has 2 implications. Firstly, we unpack the line data
even if it is to be skipped. Secondly, for line renderers
that rely on counting the number of lines they have been
passed (rather than on consulting the position of the dda)
to know where they are, this can cause problems.

Accordingly, this commit rejigs the code a bit. As well
as a function pointer within penum that points to the
rendering routine, we have a new function pointer that
points to an optional "skip_render" routine.

We also rejig the code so that we only unpack the data if
we know it is going to be used.

base/gxidata.c
base/gximage.h
base/gxipixel.c


2018-04-02 12:43:21 +0100
Robin Watts <robin.watts@artifex.com>
2870842d23f13413f3492f206cd12bb4144fc80d

Whitespace fix.

base/gxicolor.c


2018-04-02 12:44:36 +0100
Robin Watts <robin.watts@artifex.com>
8afca3fad1acbfd34b2a2910d04a5447c2e4555b

Downgrade gen_ordered solutions to VS2005.

From VS2008. VS2008 can still read the new (old!) ones.

toolbin/halftone/gen_ordered/gen_ordered.sln
toolbin/halftone/gen_ordered/gen_ordered.vcproj


2018-04-03 00:13:16 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
7891eda84b33aef5ee7540b3b3d04477e3602a3d

Prevent SEGV in memento squeeze builds.

Remove leftover variables from commit 9ff6b34e461fcbd4e.
Added conditional compilation to prevent SEGV from thread code.

base/gsicc_cache.c
base/gsicc_manage.c


2018-03-29 20:15:29 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f0e234d660dbeb774f39392f0e45e333fd9308a3

Bug 697545 : Update set_cache_device to prevent memory leaks.

Added a matching grestore for the gsave on all error paths.

base/gxchar.c


2018-03-30 09:21:28 +0100
Chris Liddell <chris.liddell@artifex.com>
bd2ce49067793d8b57c6a1b4831e16f952183f6b

Address warnings and deprecated API calls.

A number of gtk/gdk/cairo API calls have been deprecated since GTK+ 3.0 was
introduced, and using them triggers warnings - this replaces them with the
currently recommended APIs.

Also fix a couple of regular compiler warnings, and a gsapi related warning.

psi/dxmain.c


2018-03-29 14:04:10 -0700
Michael Vrhel <michael.vrhel@artifex.com>
25785cd67484e6ebf3625f7d2adedac076e80de2

Do not create a new cache for the ICC links with each page in clist mode

Right now the code currently creates a new ICC cache with every page.
This commit maintains the cache and only destroys it when we gdev_prn_tear_down

base/gxclist.c
base/gxclread.c


2018-03-27 20:13:18 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
344db7fb39f457201f243b2775e3d63cf8406010

Bug 697545 : Update functions to return error codes.

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

base/gsdps1.c
base/gxchar.c
base/gxifast.c
base/gximage4.c
pcl/pcl/pctext.c


2018-03-29 10:14:22 -0700
Robin Watts <Robin.Watts@artifex.com>
0f6ec1c44bb38175344be16d747b8feee35ae35f

Memento: Fix typo in Mutex init.

Thanks to Shelly for pointing this out.

base/memento.c


2018-03-28 14:57:56 +0100
Chris Liddell <chris.liddell@artifex.com>
a31ccd111b6ff21a1e49806c1e6e0861a9e45446

Update OpenJPEG to 2.3.0

Incorporates changes from:
1) Add predefined openjpeg headers.
71242c9a04bb76b8b17fc489d62a91d04c1ad60c

2) Import patches from Sumatra's tree.
8b89e4b5750069172522ecf85e69d094b5e567e7

3) Avoid getenv call in openjpeg
202a0318a7b3a397fcd5d015dcad4293474f464c

base/openjpeg.mak
openjpeg/CHANGELOG.md
openjpeg/NEWS.md
openjpeg/README.md
openjpeg/appveyor.yml
openjpeg/doc/CMakeLists.txt
openjpeg/doc/Doxyfile.dox.cmake.in
openjpeg/doc/jpip_architect.png
openjpeg/doc/jpip_protocol.png
openjpeg/doc/mainpage.dox.in
openjpeg/doc/man/man1/opj_compress.1
openjpeg/doc/man/man1/opj_decompress.1
openjpeg/doc/man/man1/opj_dump.1
openjpeg/doc/man/man3/libopenjp2.3
openjpeg/doc/openjpip.dox.in
openjpeg/src/bin/CMakeLists.txt
openjpeg/src/bin/common/CMakeLists.txt
openjpeg/src/bin/common/color.c
openjpeg/src/bin/common/color.h
openjpeg/src/bin/common/format_defs.h
openjpeg/src/bin/common/opj_apps_config.h.cmake.in
openjpeg/src/bin/common/opj_getopt.c
openjpeg/src/bin/common/opj_getopt.h
openjpeg/src/bin/common/opj_string.h
openjpeg/src/bin/jp2/CMakeLists.txt
openjpeg/src/bin/jp2/convert.c
openjpeg/src/bin/jp2/convert.h
openjpeg/src/bin/jp2/convertbmp.c
openjpeg/src/bin/jp2/convertpng.c
openjpeg/src/bin/jp2/converttif.c
openjpeg/src/bin/jp2/index.c
openjpeg/src/bin/jp2/index.h
openjpeg/src/bin/jp2/opj_compress.c
openjpeg/src/bin/jp2/opj_decompress.c
openjpeg/src/bin/jp2/opj_dump.c
openjpeg/src/bin/jp2/windirent.h
openjpeg/src/bin/jp3d/CMakeLists.txt
openjpeg/src/bin/jp3d/convert.c
openjpeg/src/bin/jp3d/convert.h
openjpeg/src/bin/jp3d/getopt.c
openjpeg/src/bin/jp3d/getopt.h
openjpeg/src/bin/jp3d/opj_jp3d_compress.c
openjpeg/src/bin/jp3d/opj_jp3d_decompress.c
openjpeg/src/bin/jp3d/tcltk/LPI_JP3D_VM.tcl
openjpeg/src/bin/jp3d/tcltk/README
openjpeg/src/bin/jp3d/tcltk/Thumbs.db
openjpeg/src/bin/jp3d/tcltk/decoder.tcl
openjpeg/src/bin/jp3d/tcltk/encoder.tcl
openjpeg/src/bin/jp3d/tcltk/logoLPI.gif
openjpeg/src/bin/jp3d/windirent.h
openjpeg/src/bin/jpip/CMakeLists.txt
openjpeg/src/bin/jpip/README
openjpeg/src/bin/jpip/opj_dec_server.c
openjpeg/src/bin/jpip/opj_jpip_addxml.c
openjpeg/src/bin/jpip/opj_jpip_test.c
openjpeg/src/bin/jpip/opj_jpip_transcode.c
openjpeg/src/bin/jpip/opj_server.c
openjpeg/src/bin/jpip/opj_viewer/dist/manifest.txt
openjpeg/src/bin/jpip/opj_viewer/src/ImageManager.java
openjpeg/src/bin/jpip/opj_viewer/src/ImageViewer.java
openjpeg/src/bin/jpip/opj_viewer/src/ImageWindow.java
openjpeg/src/bin/jpip/opj_viewer/src/ImgdecClient.java
openjpeg/src/bin/jpip/opj_viewer/src/JPIPHttpClient.java
openjpeg/src/bin/jpip/opj_viewer/src/MML.java
openjpeg/src/bin/jpip/opj_viewer/src/PnmImage.java
openjpeg/src/bin/jpip/opj_viewer/src/RegimViewer.java
openjpeg/src/bin/jpip/opj_viewer/src/ResizeListener.java
openjpeg/src/bin/jpip/opj_viewer_xerces/dist/manifest.txt.in
openjpeg/src/bin/jpip/opj_viewer_xerces/src/ImageViewer.java
openjpeg/src/bin/jpip/opj_viewer_xerces/src/ImageWindow.java
openjpeg/src/bin/jpip/opj_viewer_xerces/src/JP2XMLparser.java
openjpeg/src/bin/jpip/opj_viewer_xerces/src/OptionPanel.java
openjpeg/src/bin/jpwl/CMakeLists.txt
openjpeg/src/bin/jpwl/convert.c
openjpeg/src/bin/jpwl/convert.h
openjpeg/src/bin/jpwl/index.c
openjpeg/src/bin/jpwl/index.h
openjpeg/src/bin/jpwl/opj_jpwl_compress.c
openjpeg/src/bin/jpwl/opj_jpwl_decompress.c
openjpeg/src/bin/jpwl/windirent.h
openjpeg/src/bin/mj2/CMakeLists.txt
openjpeg/src/bin/mj2/meta_out.c
openjpeg/src/bin/mj2/meta_out.h
openjpeg/src/bin/mj2/mj2_to_metadata.c
openjpeg/src/bin/mj2/mj2_to_metadata.dtd
openjpeg/src/bin/mj2/mj2_to_metadata.h
openjpeg/src/bin/mj2/mj2_to_metadata.sln
openjpeg/src/bin/mj2/mj2_to_metadata.vcproj
openjpeg/src/bin/mj2/mj2_to_metadata_Notes.doc
openjpeg/src/bin/mj2/opj_mj2_compress.c
openjpeg/src/bin/mj2/opj_mj2_decompress.c
openjpeg/src/bin/mj2/opj_mj2_extract.c
openjpeg/src/bin/mj2/opj_mj2_wrap.c
openjpeg/src/bin/mj2/readme.txt
openjpeg/src/bin/wx/CMakeLists.txt
openjpeg/src/bin/wx/OPJViewer/CMakeLists.txt
openjpeg/src/bin/wx/OPJViewer/OPJViewer.iss
openjpeg/src/bin/wx/OPJViewer/Readme.txt
openjpeg/src/bin/wx/OPJViewer/about/about.htm
openjpeg/src/bin/wx/OPJViewer/about/opj_logo.png
openjpeg/src/bin/wx/OPJViewer/source/OPJAbout.cpp
openjpeg/src/bin/wx/OPJViewer/source/OPJChild.ico
openjpeg/src/bin/wx/OPJViewer/source/OPJChild16.xpm
openjpeg/src/bin/wx/OPJViewer/source/OPJDialogs.cpp
openjpeg/src/bin/wx/OPJViewer/source/OPJThreads.cpp
openjpeg/src/bin/wx/OPJViewer/source/OPJViewer.cpp
openjpeg/src/bin/wx/OPJViewer/source/OPJViewer.h
openjpeg/src/bin/wx/OPJViewer/source/OPJViewer.ico
openjpeg/src/bin/wx/OPJViewer/source/OPJViewer.rc
openjpeg/src/bin/wx/OPJViewer/source/OPJViewer16.xpm
openjpeg/src/bin/wx/OPJViewer/source/about_htm.h
openjpeg/src/bin/wx/OPJViewer/source/build.h
openjpeg/src/bin/wx/OPJViewer/source/icon1.xpm
openjpeg/src/bin/wx/OPJViewer/source/icon2.xpm
openjpeg/src/bin/wx/OPJViewer/source/icon3.xpm
openjpeg/src/bin/wx/OPJViewer/source/icon4.xpm
openjpeg/src/bin/wx/OPJViewer/source/icon5.xpm
openjpeg/src/bin/wx/OPJViewer/source/imagjpeg2000.cpp
openjpeg/src/bin/wx/OPJViewer/source/imagjpeg2000.h
openjpeg/src/bin/wx/OPJViewer/source/imagmxf.cpp
openjpeg/src/bin/wx/OPJViewer/source/imagmxf.h
openjpeg/src/bin/wx/OPJViewer/source/license.txt
openjpeg/src/bin/wx/OPJViewer/source/opj_logo.xpm
openjpeg/src/bin/wx/OPJViewer/source/readmeafter.txt
openjpeg/src/bin/wx/OPJViewer/source/readmebefore.txt
openjpeg/src/bin/wx/OPJViewer/source/wxj2kparser.cpp
openjpeg/src/bin/wx/OPJViewer/source/wxjp2parser.cpp
openjpeg/src/lib/openjp2/CMakeLists.txt
openjpeg/src/lib/openjp2/bench_dwt.c
openjpeg/src/lib/openjp2/dwt.c
openjpeg/src/lib/openjp2/dwt.h
openjpeg/src/lib/openjp2/image.c
openjpeg/src/lib/openjp2/j2k.c
openjpeg/src/lib/openjp2/j2k.h
openjpeg/src/lib/openjp2/jp2.c
openjpeg/src/lib/openjp2/jp2.h
openjpeg/src/lib/openjp2/mct.c
openjpeg/src/lib/openjp2/mct.h
openjpeg/src/lib/openjp2/mqc.c
openjpeg/src/lib/openjp2/mqc.h
openjpeg/src/lib/openjp2/mqc_inl.h
openjpeg/src/lib/openjp2/openjpeg.c
openjpeg/src/lib/openjp2/openjpeg.h
openjpeg/src/lib/openjp2/opj_codec.h
openjpeg/src/lib/openjp2/opj_config.h
openjpeg/src/lib/openjp2/opj_config_private.h
openjpeg/src/lib/openjp2/opj_includes.h
openjpeg/src/lib/openjp2/opj_intmath.h
openjpeg/src/lib/openjp2/sparse_array.c
openjpeg/src/lib/openjp2/sparse_array.h
openjpeg/src/lib/openjp2/t1.c
openjpeg/src/lib/openjp2/t1.h
openjpeg/src/lib/openjp2/t2.c
openjpeg/src/lib/openjp2/t2.h
openjpeg/src/lib/openjp2/tcd.c
openjpeg/src/lib/openjp2/tcd.h
openjpeg/src/lib/openjp2/test_sparse_array.c
openjpeg/src/lib/openjp2/thread.c


2018-03-27 16:26:13 +0100
Chris Liddell <chris.liddell@artifex.com>
25971c91d6433b0249d3b721b75ef704afe0a09c

Update libjpeg to 9c

Plus re-applying:
Bug 697186: Workaround JPEG lib bug.
8dcec8cc076a0cf8350ca7a6ec1d3136812e2a24

Bug 697186: Tweak to previous JPEG fix.
dc62c90930512f4b571f68c9110022b234cbd411

jpeg/Makefile.am
jpeg/Makefile.in
jpeg/README
jpeg/aclocal.m4
jpeg/ar-lib
jpeg/cderror.h
jpeg/change.log
jpeg/cjpeg.1
jpeg/compile
jpeg/config.guess
jpeg/config.sub
jpeg/configure
jpeg/configure.ac
jpeg/depcomp
jpeg/djpeg.1
jpeg/djpeg.c
jpeg/filelist.txt
jpeg/install-sh
jpeg/install.txt
jpeg/jcinit.c
jpeg/jcmaster.c
jpeg/jconfig.vc
jpeg/jcsample.c
jpeg/jctrans.c
jpeg/jdarith.c
jpeg/jdatadst.c
jpeg/jdatasrc.c
jpeg/jdcolor.c
jpeg/jdct.h
jpeg/jdhuff.c
jpeg/jdmainct.c
jpeg/jdmaster.c
jpeg/jdmerge.c
jpeg/jdsample.c
jpeg/jerror.c
jpeg/jfdctflt.c
jpeg/jfdctfst.c
jpeg/jfdctint.c
jpeg/jidctflt.c
jpeg/jidctfst.c
jpeg/jidctint.c
jpeg/jinclude.h
jpeg/jpegint.h
jpeg/jpeglib.h
jpeg/jpegtran.1
jpeg/jversion.h
jpeg/libjpeg.pc.in
jpeg/ltmain.sh
jpeg/makeasln.v15
jpeg/makecfil.v15
jpeg/makecvcx.v15
jpeg/makedfil.v15
jpeg/makedvcx.v15
jpeg/makefile.ansi
jpeg/makefile.b32
jpeg/makefile.bcc
jpeg/makefile.dj
jpeg/makefile.manx
jpeg/makefile.mc6
jpeg/makefile.mms
jpeg/makefile.sas
jpeg/makefile.unix
jpeg/makefile.vc
jpeg/makefile.vs
jpeg/makefile.wat
jpeg/makejfil.v15
jpeg/makejsln.v15
jpeg/makejvcx.v15
jpeg/makerfil.v15
jpeg/makervcx.v15
jpeg/maketfil.v15
jpeg/maketvcx.v15
jpeg/makewfil.v15
jpeg/makewvcx.v15
jpeg/missing
jpeg/rdbmp.c
jpeg/rdppm.c
jpeg/rdswitch.c
jpeg/rdtarga.c
jpeg/transupp.c
jpeg/usage.txt
jpeg/wrbmp.c
jpeg/wrgif.c
jpeg/wrjpgcom.c
jpeg/wrppm.c
jpeg/wrrle.c
jpeg/wrtarga.c


2018-03-27 16:16:49 +0100
Chris Liddell <chris.liddell@artifex.com>
d8a919d4b45097a527f6f39d509b920d285d709b

Update expat to 2.2.5

With a couple of tweaks to base/expat.mak to make it work.

base/expat.mak
expat/AUTHORS
expat/CMake.README
expat/CMakeLists.txt
expat/COPYING
expat/Changes
expat/ConfigureChecks.cmake
expat/MANIFEST
expat/Makefile.am
expat/Makefile.in
expat/README
expat/README.md
expat/aclocal.m4
expat/amiga/Makefile
expat/amiga/README.txt
expat/amiga/expat.xml
expat/amiga/expat_68k.c
expat/amiga/expat_68k.h
expat/amiga/expat_68k_handler_stubs.c
expat/amiga/expat_base.h
expat/amiga/expat_lib.c
expat/amiga/expat_vectors.c
expat/amiga/include/inline4/expat.h
expat/amiga/include/interfaces/expat.h
expat/amiga/include/libraries/expat.h
expat/amiga/include/proto/expat.h
expat/amiga/launch.c
expat/bcb5/README.txt
expat/bcb5/all_projects.bpg
expat/bcb5/elements.bpf
expat/bcb5/elements.bpr
expat/bcb5/elements.mak
expat/bcb5/expat.bpf
expat/bcb5/expat.bpr
expat/bcb5/expat.mak
expat/bcb5/expat_static.bpf
expat/bcb5/expat_static.bpr
expat/bcb5/expat_static.mak
expat/bcb5/expatw.bpf
expat/bcb5/expatw.bpr
expat/bcb5/expatw.mak
expat/bcb5/expatw_static.bpf
expat/bcb5/expatw_static.bpr
expat/bcb5/expatw_static.mak
expat/bcb5/libexpat_mtd.def
expat/bcb5/libexpatw_mtd.def
expat/bcb5/makefile.mak
expat/bcb5/outline.bpf
expat/bcb5/outline.bpr
expat/bcb5/outline.mak
expat/bcb5/setup.bat
expat/bcb5/xmlwf.bpf
expat/bcb5/xmlwf.bpr
expat/bcb5/xmlwf.mak
expat/configure
expat/configure.ac
expat/conftools/compile
expat/conftools/config.guess
expat/conftools/config.sub
expat/conftools/depcomp
expat/conftools/get-version.sh
expat/conftools/install-sh
expat/conftools/missing
expat/conftools/mkinstalldirs
expat/conftools/test-driver
expat/doc/Makefile.am
expat/doc/Makefile.in
expat/doc/reference.html
expat/doc/xmlwf.1
expat/doc/xmlwf.xml
expat/examples/Makefile.am
expat/examples/Makefile.in
expat/examples/elements.c
expat/examples/elements.dsp
expat/examples/elements.vcxproj
expat/examples/elements.vcxproj.filters
expat/examples/outline.c
expat/examples/outline.dsp
expat/examples/outline.vcxproj
expat/examples/outline.vcxproj.filters
expat/expat.dsw
expat/expat.sln
expat/expat_config.h
expat/expat_config.h.cmake
expat/expat_config.h.in
expat/lib/Makefile.MPW
expat/lib/Makefile.am
expat/lib/Makefile.in
expat/lib/amigaconfig.h
expat/lib/ascii.h
expat/lib/asciitab.h
expat/lib/expat.dsp
expat/lib/expat.h
expat/lib/expat.vcxproj
expat/lib/expat.vcxproj.filters
expat/lib/expat_external.h
expat/lib/expat_static.dsp
expat/lib/expat_static.vcxproj
expat/lib/expat_static.vcxproj.filters
expat/lib/expatw.dsp
expat/lib/expatw.vcxproj
expat/lib/expatw.vcxproj.filters
expat/lib/expatw_static.dsp
expat/lib/expatw_static.vcxproj
expat/lib/expatw_static.vcxproj.filters
expat/lib/iasciitab.h
expat/lib/internal.h
expat/lib/latin1tab.h
expat/lib/libexpat.def
expat/lib/libexpatw.def
expat/lib/loadlibrary.c
expat/lib/macconfig.h
expat/lib/nametab.h
expat/lib/siphash.h
expat/lib/utf8tab.h
expat/lib/winconfig.h
expat/lib/xmlparse.c
expat/lib/xmlrole.c
expat/lib/xmlrole.h
expat/lib/xmltok.c
expat/lib/xmltok.h
expat/lib/xmltok_impl.c
expat/lib/xmltok_impl.h
expat/lib/xmltok_ns.c
expat/m4/libtool.m4
expat/run.sh.in
expat/test-driver-wrapper.sh
expat/tests/Makefile.am
expat/tests/Makefile.in
expat/tests/benchmark/Makefile.am
expat/tests/benchmark/Makefile.in
expat/tests/benchmark/benchmark.c
expat/tests/benchmark/benchmark.dsp
expat/tests/benchmark/benchmark.dsw
expat/tests/benchmark/benchmark.sln
expat/tests/benchmark/benchmark.vcxproj
expat/tests/chardata.c
expat/tests/chardata.h
expat/tests/memcheck.c
expat/tests/memcheck.h
expat/tests/minicheck.c
expat/tests/minicheck.h
expat/tests/runtests.c
expat/tests/runtests.sln
expat/tests/runtests.vcxproj
expat/tests/runtests.vcxproj.filters
expat/tests/runtestspp.cpp
expat/tests/structdata.c
expat/tests/structdata.h
expat/tests/udiffer.py
expat/tests/xmltest.log.expected
expat/tests/xmltest.sh
expat/vms/README.vms
expat/vms/descrip.mms
expat/vms/expat_config.h
expat/win32/MANIFEST.txt
expat/win32/README.txt
expat/win32/expat.iss
expat/xmlwf/Makefile.am
expat/xmlwf/Makefile.in
expat/xmlwf/codepage.c
expat/xmlwf/codepage.h
expat/xmlwf/ct.c
expat/xmlwf/filemap.h
expat/xmlwf/readfilemap.c
expat/xmlwf/unixfilemap.c
expat/xmlwf/win32filemap.c
expat/xmlwf/xmlfile.c
expat/xmlwf/xmlfile.h
expat/xmlwf/xmlmime.c
expat/xmlwf/xmlmime.h
expat/xmlwf/xmltchar.h
expat/xmlwf/xmlurl.h
expat/xmlwf/xmlwf.c
expat/xmlwf/xmlwf.dsp
expat/xmlwf/xmlwf.vcxproj
expat/xmlwf/xmlwf.vcxproj.filters
expat/xmlwf/xmlwin32url.cxx


2018-03-27 14:08:47 +0100
Chris Liddell <chris.liddell@artifex.com>
003c4211a019eb5c4719860f353777e177553490

Update libtiff to 4.0.9

Add in portability changes to tiffiop.h

Portability tiffiop.h

Remove globals from tif_pixarlog.c

Tweaks to support libtiff 4.0.9

base/gstiffio.c
configure.ac
tiff/CMakeLists.txt
tiff/ChangeLog
tiff/HOWTO-RELEASE
tiff/RELEASE-DATE
tiff/VERSION
tiff/config/ltmain.sh
tiff/configure
tiff/configure.ac
tiff/html/Makefile.am
tiff/html/Makefile.in
tiff/html/index.html
tiff/html/man/CMakeLists.txt
tiff/html/man/Makefile.am
tiff/html/man/Makefile.in
tiff/html/man/rgb2ycbcr.1.html
tiff/html/man/thumbnail.1.html
tiff/html/v4.0.7.html
tiff/html/v4.0.8.html
tiff/html/v4.0.9.html
tiff/libtiff/libtiff.def
tiff/libtiff/tif_aux.c
tiff/libtiff/tif_color.c
tiff/libtiff/tif_dir.c
tiff/libtiff/tif_dir.h
tiff/libtiff/tif_dirinfo.c
tiff/libtiff/tif_dirread.c
tiff/libtiff/tif_dirwrite.c
tiff/libtiff/tif_error.c
tiff/libtiff/tif_fax3.c
tiff/libtiff/tif_fax3.h
tiff/libtiff/tif_getimage.c
tiff/libtiff/tif_jbig.c
tiff/libtiff/tif_jpeg.c
tiff/libtiff/tif_jpeg_12.c
tiff/libtiff/tif_luv.c
tiff/libtiff/tif_lzw.c
tiff/libtiff/tif_ojpeg.c
tiff/libtiff/tif_open.c
tiff/libtiff/tif_packbits.c
tiff/libtiff/tif_pixarlog.c
tiff/libtiff/tif_predict.c
tiff/libtiff/tif_print.c
tiff/libtiff/tif_read.c
tiff/libtiff/tif_strip.c
tiff/libtiff/tif_swab.c
tiff/libtiff/tif_unix.c
tiff/libtiff/tif_warning.c
tiff/libtiff/tif_win32.c
tiff/libtiff/tif_write.c
tiff/libtiff/tif_zip.c
tiff/libtiff/tiffio.h
tiff/libtiff/tiffiop.h
tiff/libtiff/tiffvers.h
tiff/m4/libtool.m4
tiff/man/CMakeLists.txt
tiff/man/Makefile.am
tiff/man/Makefile.in
tiff/man/TIFFGetField.3tiff
tiff/man/TIFFSetDirectory.3tiff
tiff/man/TIFFSetField.3tiff
tiff/man/rgb2ycbcr.1
tiff/man/thumbnail.1
tiff/nmake.opt
tiff/test/CMakeLists.txt
tiff/test/Makefile.am
tiff/test/Makefile.in
tiff/test/TiffTestCommon.cmake
tiff/test/common.sh
tiff/test/images/quad-lzw-compat.tiff
tiff/test/tiff2bw-palette-1c-8b.sh
tiff/test/tiff2bw-quad-lzw-compat.sh
tiff/test/tiff2bw-rgb-3c-8b.sh
tiff/test/tiffcp-lzw-compat.sh
tiff/tools/fax2tiff.c
tiff/tools/raw2tiff.c
tiff/tools/tiff2bw.c
tiff/tools/tiff2pdf.c
tiff/tools/tiff2ps.c
tiff/tools/tiffcp.c
tiff/tools/tiffcrop.c
tiff/tools/tiffinfo.c
tiff/tools/tiffset.c


2018-03-26 16:12:39 +0100
Chris Liddell <chris.liddell@artifex.com>
bc817a3afdb932eadac17155834f89efd1c96da4

Bring libpng up to 1.6.34

base/png.mak
libpng/ANNOUNCE
libpng/CHANGES
libpng/CMakeLists.txt
libpng/INSTALL
libpng/LICENSE
libpng/Makefile.am
libpng/Makefile.in
libpng/README
libpng/TODO
libpng/arm/filter_neon.S
libpng/config.h.in
libpng/configure
libpng/configure.ac
libpng/contrib/arm-neon/android-ndk.c
libpng/contrib/arm-neon/linux.c
libpng/contrib/examples/pngtopng.c
libpng/contrib/gregbook/README
libpng/contrib/gregbook/readpng.c
libpng/contrib/gregbook/readpng2.c
libpng/contrib/gregbook/readppm.c
libpng/contrib/gregbook/rpng-win.c
libpng/contrib/gregbook/rpng-x.c
libpng/contrib/gregbook/rpng2-win.c
libpng/contrib/gregbook/rpng2-x.c
libpng/contrib/gregbook/wpng.c
libpng/contrib/gregbook/writepng.c
libpng/contrib/intel/INSTALL
libpng/contrib/intel/intel_sse.patch
libpng/contrib/libtests/pngstest.c
libpng/contrib/libtests/pngunknown.c
libpng/contrib/libtests/pngvalid.c
libpng/contrib/oss-fuzz/Dockerfile
libpng/contrib/oss-fuzz/README.txt
libpng/contrib/oss-fuzz/build.sh
libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc
libpng/contrib/oss-fuzz/libpng_read_fuzzer.options
libpng/contrib/oss-fuzz/newcc
libpng/contrib/oss-fuzz/png.dict
libpng/contrib/pngminus/png2pnm.c
libpng/contrib/pngminus/pnm2png.c
libpng/contrib/powerpc-vsx/README
libpng/contrib/powerpc-vsx/linux.c
libpng/contrib/powerpc-vsx/linux_aux.c
libpng/contrib/testpngs/crashers/bad_iCCP.png
libpng/contrib/testpngs/crashers/badadler.png
libpng/contrib/testpngs/crashers/badcrc.png
libpng/contrib/testpngs/crashers/empty_ancillary_chunks.png
libpng/contrib/testpngs/crashers/huge_IDAT.png
libpng/contrib/testpngs/crashers/huge_bKGD_chunk.png
libpng/contrib/testpngs/crashers/huge_cHRM_chunk.png
libpng/contrib/testpngs/crashers/huge_eXIf_chunk.png
libpng/contrib/testpngs/crashers/huge_gAMA_chunk.png
libpng/contrib/testpngs/crashers/huge_hIST_chunk.png
libpng/contrib/testpngs/crashers/huge_iCCP_chunk.png
libpng/contrib/testpngs/crashers/huge_iTXt_chunk.png
libpng/contrib/testpngs/crashers/huge_juNK_unsafe_to_copy.png
libpng/contrib/testpngs/crashers/huge_juNk_safe_to_copy.png
libpng/contrib/testpngs/crashers/huge_pCAL_chunk.png
libpng/contrib/testpngs/crashers/huge_pHYs_chunk.png
libpng/contrib/testpngs/crashers/huge_sCAL_chunk.png
libpng/contrib/testpngs/crashers/huge_sPLT_chunk.png
libpng/contrib/testpngs/crashers/huge_sRGB_chunk.png
libpng/contrib/testpngs/crashers/huge_sTER_chunk.png
libpng/contrib/testpngs/crashers/huge_tEXt_chunk.png
libpng/contrib/testpngs/crashers/huge_tIME_chunk.png
libpng/contrib/testpngs/crashers/huge_zTXt_chunk.png
libpng/contrib/testpngs/gray-1-1.8-tRNS.png
libpng/contrib/testpngs/gray-1-1.8.png
libpng/contrib/testpngs/gray-1-linear-tRNS.png
libpng/contrib/testpngs/gray-1-linear.png
libpng/contrib/testpngs/gray-1-sRGB-tRNS.png
libpng/contrib/testpngs/gray-1-sRGB.png
libpng/contrib/testpngs/gray-1-tRNS.png
libpng/contrib/testpngs/gray-1.png
libpng/contrib/testpngs/gray-16-1.8-tRNS.png
libpng/contrib/testpngs/gray-16-1.8.png
libpng/contrib/testpngs/gray-16-linear-tRNS.png
libpng/contrib/testpngs/gray-16-linear.png
libpng/contrib/testpngs/gray-16-sRGB-tRNS.png
libpng/contrib/testpngs/gray-16-sRGB.png
libpng/contrib/testpngs/gray-16-tRNS.png
libpng/contrib/testpngs/gray-16.png
libpng/contrib/testpngs/gray-2-1.8-tRNS.png
libpng/contrib/testpngs/gray-2-1.8.png
libpng/contrib/testpngs/gray-2-linear-tRNS.png
libpng/contrib/testpngs/gray-2-linear.png
libpng/contrib/testpngs/gray-2-sRGB-tRNS.png
libpng/contrib/testpngs/gray-2-sRGB.png
libpng/contrib/testpngs/gray-2-tRNS.png
libpng/contrib/testpngs/gray-2.png
libpng/contrib/testpngs/gray-4-1.8-tRNS.png
libpng/contrib/testpngs/gray-4-1.8.png
libpng/contrib/testpngs/gray-4-linear-tRNS.png
libpng/contrib/testpngs/gray-4-linear.png
libpng/contrib/testpngs/gray-4-sRGB-tRNS.png
libpng/contrib/testpngs/gray-4-sRGB.png
libpng/contrib/testpngs/gray-4-tRNS.png
libpng/contrib/testpngs/gray-4.png
libpng/contrib/testpngs/gray-8-1.8-tRNS.png
libpng/contrib/testpngs/gray-8-1.8.png
libpng/contrib/testpngs/gray-8-linear-tRNS.png
libpng/contrib/testpngs/gray-8-linear.png
libpng/contrib/testpngs/gray-8-sRGB-tRNS.png
libpng/contrib/testpngs/gray-8-sRGB.png
libpng/contrib/testpngs/gray-8-tRNS.png
libpng/contrib/testpngs/gray-8.png
libpng/contrib/testpngs/gray-alpha-16-1.8.png
libpng/contrib/testpngs/gray-alpha-16-linear.png
libpng/contrib/testpngs/gray-alpha-16-sRGB.png
libpng/contrib/testpngs/gray-alpha-16.png
libpng/contrib/testpngs/gray-alpha-8-1.8.png
libpng/contrib/testpngs/gray-alpha-8-linear.png
libpng/contrib/testpngs/gray-alpha-8-sRGB.png
libpng/contrib/testpngs/gray-alpha-8.png
libpng/contrib/testpngs/makepngs.sh
libpng/contrib/testpngs/palette-1-1.8-tRNS.png
libpng/contrib/testpngs/palette-1-1.8.png
libpng/contrib/testpngs/palette-1-linear-tRNS.png
libpng/contrib/testpngs/palette-1-linear.png
libpng/contrib/testpngs/palette-1-sRGB-tRNS.png
libpng/contrib/testpngs/palette-1-sRGB.png
libpng/contrib/testpngs/palette-1-tRNS.png
libpng/contrib/testpngs/palette-1.png
libpng/contrib/testpngs/palette-2-1.8-tRNS.png
libpng/contrib/testpngs/palette-2-1.8.png
libpng/contrib/testpngs/palette-2-linear-tRNS.png
libpng/contrib/testpngs/palette-2-linear.png
libpng/contrib/testpngs/palette-2-sRGB-tRNS.png
libpng/contrib/testpngs/palette-2-sRGB.png
libpng/contrib/testpngs/palette-2-tRNS.png
libpng/contrib/testpngs/palette-2.png
libpng/contrib/testpngs/palette-4-1.8-tRNS.png
libpng/contrib/testpngs/palette-4-1.8.png
libpng/contrib/testpngs/palette-4-linear-tRNS.png
libpng/contrib/testpngs/palette-4-linear.png
libpng/contrib/testpngs/palette-4-sRGB-tRNS.png
libpng/contrib/testpngs/palette-4-sRGB.png
libpng/contrib/testpngs/palette-4-tRNS.png
libpng/contrib/testpngs/palette-4.png
libpng/contrib/testpngs/palette-8-1.8-tRNS.png
libpng/contrib/testpngs/palette-8-1.8.png
libpng/contrib/testpngs/palette-8-linear-tRNS.png
libpng/contrib/testpngs/palette-8-linear.png
libpng/contrib/testpngs/palette-8-sRGB-tRNS.png
libpng/contrib/testpngs/palette-8-sRGB.png
libpng/contrib/testpngs/palette-8-tRNS.png
libpng/contrib/testpngs/palette-8.png
libpng/contrib/testpngs/rgb-16-1.8-tRNS.png
libpng/contrib/testpngs/rgb-16-1.8.png
libpng/contrib/testpngs/rgb-16-linear-tRNS.png
libpng/contrib/testpngs/rgb-16-linear.png
libpng/contrib/testpngs/rgb-16-sRGB-tRNS.png
libpng/contrib/testpngs/rgb-16-sRGB.png
libpng/contrib/testpngs/rgb-16-tRNS.png
libpng/contrib/testpngs/rgb-16.png
libpng/contrib/testpngs/rgb-8-1.8-tRNS.png
libpng/contrib/testpngs/rgb-8-1.8.png
libpng/contrib/testpngs/rgb-8-linear-tRNS.png
libpng/contrib/testpngs/rgb-8-linear.png
libpng/contrib/testpngs/rgb-8-sRGB-tRNS.png
libpng/contrib/testpngs/rgb-8-sRGB.png
libpng/contrib/testpngs/rgb-8-tRNS.png
libpng/contrib/testpngs/rgb-8.png
libpng/contrib/testpngs/rgb-alpha-16-1.8.png
libpng/contrib/testpngs/rgb-alpha-16-linear.png
libpng/contrib/testpngs/rgb-alpha-16-sRGB.png
libpng/contrib/testpngs/rgb-alpha-16.png
libpng/contrib/testpngs/rgb-alpha-8-1.8.png
libpng/contrib/testpngs/rgb-alpha-8-linear.png
libpng/contrib/testpngs/rgb-alpha-8-sRGB.png
libpng/contrib/testpngs/rgb-alpha-8.png
libpng/contrib/tools/genpng.c
libpng/contrib/tools/pngfix.c
libpng/contrib/tools/sRGB.h
libpng/contrib/visupng/PngFile.c
libpng/contrib/visupng/VisualPng.c
libpng/example.c
libpng/intel/filter_sse2_intrinsics.c
libpng/intel/intel_init.c
libpng/libpng-manual.txt
libpng/libpng.3
libpng/libpng.pc.in
libpng/libpngpf.3
libpng/ltmain.sh
libpng/mips/filter_msa_intrinsics.c
libpng/mips/mips_init.c
libpng/png.5
libpng/png.c
libpng/png.h
libpng/pngconf.h
libpng/pngerror.c
libpng/pngget.c
libpng/pnginfo.h
libpng/pngpread.c
libpng/pngpriv.h
libpng/pngread.c
libpng/pngrtran.c
libpng/pngrutil.c
libpng/pngset.c
libpng/pngstruct.h
libpng/pngtest.c
libpng/pngtest.png
libpng/pngtrans.c
libpng/pngwrite.c
libpng/pngwutil.c
libpng/powerpc/filter_vsx_intrinsics.c
libpng/powerpc/powerpc_init.c
libpng/projects/owatcom/pngconfig.mak
libpng/projects/vstudio/README.txt
libpng/projects/vstudio/zlib.props
libpng/scripts/README.txt
libpng/scripts/def.c
libpng/scripts/libpng-config-head.in
libpng/scripts/libpng.pc.in
libpng/scripts/makefile.cegcc
libpng/scripts/makefile.linux
libpng/scripts/makefile.linux-opt
libpng/scripts/makefile.msys
libpng/scripts/makefile.ne12bsd
libpng/scripts/makefile.netbsd
libpng/scripts/makefile.openbsd
libpng/scripts/makefile.solaris-x86
libpng/scripts/pnglibconf.dfa
libpng/scripts/pnglibconf.h.prebuilt
libpng/scripts/symbols.def
libpng/tests/pngimage-full
libpng/tests/pngimage-quick
libpng/tests/pngstest
libpng/tests/pngstest-1.8
libpng/tests/pngstest-1.8-alpha
libpng/tests/pngstest-linear
libpng/tests/pngstest-linear-alpha
libpng/tests/pngstest-none
libpng/tests/pngstest-none-alpha
libpng/tests/pngstest-sRGB
libpng/tests/pngstest-sRGB-alpha
libpng/tests/pngtest
libpng/tests/pngtest-badpngs
libpng/tests/pngunknown-IDAT
libpng/tests/pngunknown-discard
libpng/tests/pngunknown-if-safe
libpng/tests/pngunknown-sAPI
libpng/tests/pngunknown-sTER
libpng/tests/pngunknown-save
libpng/tests/pngunknown-vpAg
libpng/tests/pngvalid-gamma-16-to-8
libpng/tests/pngvalid-gamma-alpha-mode
libpng/tests/pngvalid-gamma-background
libpng/tests/pngvalid-gamma-expand16-alpha-mode
libpng/tests/pngvalid-gamma-expand16-background
libpng/tests/pngvalid-gamma-expand16-transform
libpng/tests/pngvalid-gamma-sbit
libpng/tests/pngvalid-gamma-threshold
libpng/tests/pngvalid-gamma-transform
libpng/tests/pngvalid-progressive-interlace-standard
libpng/tests/pngvalid-progressive-size
libpng/tests/pngvalid-progressive-standard
libpng/tests/pngvalid-standard
libpng/tests/pngvalid-transform


2018-03-27 13:47:02 +0100
Chris Liddell <chris.liddell@artifex.com>
0a4ef8b01c2ea146b9dce7b80f21f6cd65420099

Remove symlink from docs install.

For 9.23 we moved the default installation path for the documentation to better
fit with "modern" Linux/Unix directory layouts. To minimize upheaval, we
included a symlink to the "old"style path.

Remove that now, as it was only a temporary thing.

base/unixinst.mak


2018-03-27 10:43:29 +0100
Chris Liddell <chris.liddell@artifex.com>
3de8ff9bc31edb60370e7275a7c35b557737cd84

Improve the configure check for "restrict" keyword

configure.ac


2018-03-29 12:41:37 +0200
Tor Andersson <tor.andersson@artifex.com>
5249489366cfac73e83e529bae06a08ad6703980

Clean up the stdint configuration mess.

Don't require HAVE_STDINT_H to be defined to assume the sane default of
including the C standard stdint.h header file.

Use the configuration defines to include non-standard header files.

VS 2012 and newer have stdint.h, so use it.

jbig2dec/config_win32.h
jbig2dec/os_types.h


2018-03-29 12:59:58 +0200
Tor Andersson <tor.andersson@artifex.com>
0cb8374113ae2770464b6ac7462f11f0cc9677ea

Fix undeclared function warning.

jbig2dec/jbig2_image_png.c


2018-03-29 12:56:07 +0200
Tor Andersson <tor.andersson@artifex.com>
a8430e881971485fa4a824a3488f79b7ab0abfeb

Fix signed/unsigned comparison warnings.

jbig2dec/Makefile.unix
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_image_png.c
jbig2dec/jbig2_mmr.c


2017-05-19 12:49:15 +0200
Tor Andersson <tor.andersson@artifex.com>
15f72a0b272e751ce7147bb0d8179eac68da52b0

xps: Remove needless NULL terminator when parsing abbreviated geometry.

xps/xpspath.c


2018-03-27 21:21:38 -0700
Ray Johnston <ray.johnston@artifex.com>
59d82e831e62bdf2e44331d10c88dd7837429dad

Rename lcms2art to lcms2mt, Remove cmsChangeBuffersFormat

Since cmsChangeBuffersFormat is NOT threadsafe, we want it to remove it
so that it would not be part of this package which is inteded for multi-
threaded used. The internal use in CreateNamedColorDevicelink was replaced
with the appropriate code from the removed function, but that does not
cause a thread safety issue since the link returned is new and not shared
when the buffer formatters are changed.

Note: All internal references to lcms2art are replaced with lcms2mt

Makefile.in
base/gsicc_lcms2mt.c
base/lcms2mt.mak
base/lib.mak
base/msvclib.mak
base/openvms.mak
base/ugcclib.mak
base/unix-gcc.mak
base/unixansi.mak
base/winlib.mak
configure.ac
lcms2art/include/Makefile.am
lcms2mt/.travis.yml
lcms2mt/AUTHORS
lcms2mt/COPYING
lcms2mt/ChangeLog
lcms2mt/INSTALL
lcms2mt/Lib/BC/BC.txt
lcms2mt/Lib/MS/MS.TXT
lcms2mt/Makefile.am
lcms2mt/Makefile.in
lcms2mt/Projects/.gitignore
lcms2mt/Projects/BorlandC_5.5/lcms2.rc
lcms2mt/Projects/BorlandC_5.5/lcmsdll.lk
lcms2mt/Projects/BorlandC_5.5/lcmsdll.lst
lcms2mt/Projects/BorlandC_5.5/mklcmsdll.bat
lcms2mt/Projects/VC2010/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2010/jpegicc/jpegicc.vcxproj.filters
lcms2mt/Projects/VC2010/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2010/linkicc/linkicc.vcxproj.filters
lcms2mt/Projects/VC2010/psicc/psicc.vcxproj
lcms2mt/Projects/VC2010/psicc/psicc.vcxproj.filters
lcms2mt/Projects/VC2010/resource.h
lcms2mt/Projects/VC2010/testbed/testbed.vcxproj
lcms2mt/Projects/VC2010/testbed/testbed.vcxproj.filters
lcms2mt/Projects/VC2010/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2010/tiffdiff/tiffdiff.vcxproj.filters
lcms2mt/Projects/VC2010/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2010/tifficc/tifficc.vcxproj.filters
lcms2mt/Projects/VC2010/transicc/transicc.vcxproj
lcms2mt/Projects/VC2010/transicc/transicc.vcxproj.filters
lcms2mt/Projects/VC2012/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2012/jpegicc/jpegicc.vcxproj.filters
lcms2mt/Projects/VC2012/lcms2mt.rc
lcms2mt/Projects/VC2012/lcms2mt.sln
lcms2mt/Projects/VC2012/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2012/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters
lcms2mt/Projects/VC2012/lcms2mt_static/lcms2mt_static.vcxproj
lcms2mt/Projects/VC2012/lcms2mt_static/lcms2mt_static.vcxproj.filters
lcms2mt/Projects/VC2012/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2012/linkicc/linkicc.vcxproj.filters
lcms2mt/Projects/VC2012/psicc/psicc.vcxproj
lcms2mt/Projects/VC2012/psicc/psicc.vcxproj.filters
lcms2mt/Projects/VC2012/resource.h
lcms2mt/Projects/VC2012/testbed/testbed.vcxproj
lcms2mt/Projects/VC2012/testbed/testbed.vcxproj.filters
lcms2mt/Projects/VC2012/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2012/tiffdiff/tiffdiff.vcxproj.filters
lcms2mt/Projects/VC2012/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2012/tifficc/tifficc.vcxproj.filters
lcms2mt/Projects/VC2012/transicc/transicc.vcxproj
lcms2mt/Projects/VC2012/transicc/transicc.vcxproj.filters
lcms2mt/Projects/VC2013/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2013/jpegicc/jpegicc.vcxproj.filters
lcms2mt/Projects/VC2013/lcms2mt.rc
lcms2mt/Projects/VC2013/lcms2mt.sln
lcms2mt/Projects/VC2013/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2013/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters
lcms2mt/Projects/VC2013/lcms2mt_static/lcms2mt_static.vcxproj
lcms2mt/Projects/VC2013/lcms2mt_static/lcms2mt_static.vcxproj.filters
lcms2mt/Projects/VC2013/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2013/linkicc/linkicc.vcxproj.filters
lcms2mt/Projects/VC2013/psicc/psicc.vcxproj
lcms2mt/Projects/VC2013/psicc/psicc.vcxproj.filters
lcms2mt/Projects/VC2013/resource.h
lcms2mt/Projects/VC2013/testbed/testbed.vcxproj
lcms2mt/Projects/VC2013/testbed/testbed.vcxproj.filters
lcms2mt/Projects/VC2013/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2013/tiffdiff/tiffdiff.vcxproj.filters
lcms2mt/Projects/VC2013/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2013/tifficc/tifficc.vcxproj.filters
lcms2mt/Projects/VC2013/transicc/transicc.vcxproj
lcms2mt/Projects/VC2013/transicc/transicc.vcxproj.filters
lcms2mt/Projects/VC2015/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2015/jpegicc/jpegicc.vcxproj.filters
lcms2mt/Projects/VC2015/lcms2mt.rc
lcms2mt/Projects/VC2015/lcms2mt.sln
lcms2mt/Projects/VC2015/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2015/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters
lcms2mt/Projects/VC2015/lcms2mt_static/lcms2mt_static.vcxproj
lcms2mt/Projects/VC2015/lcms2mt_static/lcms2mt_static.vcxproj.filters
lcms2mt/Projects/VC2015/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2015/linkicc/linkicc.vcxproj.filters
lcms2mt/Projects/VC2015/psicc/psicc.vcxproj
lcms2mt/Projects/VC2015/psicc/psicc.vcxproj.filters
lcms2mt/Projects/VC2015/resource.h
lcms2mt/Projects/VC2015/testbed/testbed.vcxproj
lcms2mt/Projects/VC2015/testbed/testbed.vcxproj.filters
lcms2mt/Projects/VC2015/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2015/tiffdiff/tiffdiff.vcxproj.filters
lcms2mt/Projects/VC2015/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2015/tifficc/tifficc.vcxproj.filters
lcms2mt/Projects/VC2015/transicc/transicc.vcxproj
lcms2mt/Projects/VC2015/transicc/transicc.vcxproj.filters
lcms2mt/Projects/VC2017/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2017/jpegicc/jpegicc.vcxproj.filters
lcms2mt/Projects/VC2017/lcms2mt.rc
lcms2mt/Projects/VC2017/lcms2mt.sln
lcms2mt/Projects/VC2017/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2017/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters
lcms2mt/Projects/VC2017/lcms2mt_static/lcms2mt_static.vcxproj
lcms2mt/Projects/VC2017/lcms2mt_static/lcms2mt_static.vcxproj.filters
lcms2mt/Projects/VC2017/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2017/linkicc/linkicc.vcxproj.filters
lcms2mt/Projects/VC2017/psicc/psicc.vcxproj
lcms2mt/Projects/VC2017/psicc/psicc.vcxproj.filters
lcms2mt/Projects/VC2017/resource.h
lcms2mt/Projects/VC2017/testbed/testbed.vcxproj
lcms2mt/Projects/VC2017/testbed/testbed.vcxproj.filters
lcms2mt/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2017/tiffdiff/tiffdiff.vcxproj.filters
lcms2mt/Projects/VC2017/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2017/tifficc/tifficc.vcxproj.filters
lcms2mt/Projects/VC2017/transicc/transicc.vcxproj
lcms2mt/Projects/VC2017/transicc/transicc.vcxproj.filters
lcms2mt/Projects/cppcheck/lcms2.cppcheck
lcms2mt/Projects/mac/LittleCMS/._Info.plist
lcms2mt/Projects/mac/LittleCMS/._LittleCMS.xcodeproj
lcms2mt/Projects/mac/LittleCMS/English.lproj/InfoPlist.strings
lcms2mt/Projects/mac/LittleCMS/Info.plist
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/mariama.mode1v3
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/mariama.pbxuser
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.pbxproj
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.xcworkspace/contents.xcworkspacedata
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.xcworkspace/xcuserdata/User.xcuserdatad/UserInterfaceState.xcuserstate
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.xcworkspace/xcuserdata/User.xcuserdatad/WorkspaceSettings.xcsettings
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcschemes/LittleCMS.xcscheme
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcschemes/testbed.xcscheme
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcschemes/xcschememanagement.plist
lcms2mt/Projects/mac/LittleCMS/LittleCMS_Prefix.pch
lcms2mt/Projects/mac/LittleCMS/TestBed-Info.plist
lcms2mt/README.1ST
lcms2mt/aclocal.m4
lcms2mt/autogen.sh
lcms2mt/compile
lcms2mt/config.guess
lcms2mt/config.sub
lcms2mt/configure
lcms2mt/configure.ac
lcms2mt/depcomp
lcms2mt/doc/LittleCMS2.9 API.pdf
lcms2mt/doc/LittleCMS2.9 Plugin API.pdf
lcms2mt/doc/LittleCMS2.9 tutorial.pdf
lcms2mt/doc/WhyThisFork.txt
lcms2mt/doc/src.zip
lcms2mt/include/Makefile.am
lcms2mt/include/Makefile.in
lcms2mt/include/lcms2mt.h
lcms2mt/include/lcms2mt_plugin.h
lcms2mt/install-sh
lcms2mt/lcms2mt.pc.in
lcms2mt/ltmain.sh
lcms2mt/m4/acx_pthread.m4
lcms2mt/m4/ax_append_compile_flags.m4
lcms2mt/m4/ax_append_flag.m4
lcms2mt/m4/ax_check_compile_flag.m4
lcms2mt/m4/ax_gcc_func_attribute.m4
lcms2mt/m4/ax_require_defined.m4
lcms2mt/m4/libtool.m4
lcms2mt/m4/ltoptions.m4
lcms2mt/m4/ltsugar.m4
lcms2mt/m4/ltversion.m4
lcms2mt/m4/lt~obsolete.m4
lcms2mt/missing
lcms2mt/src/Makefile.am
lcms2mt/src/Makefile.in
lcms2mt/src/cmsalpha.c
lcms2mt/src/cmscam02.c
lcms2mt/src/cmscgats.c
lcms2mt/src/cmscnvrt.c
lcms2mt/src/cmserr.c
lcms2mt/src/cmsgamma.c
lcms2mt/src/cmsgmt.c
lcms2mt/src/cmshalf.c
lcms2mt/src/cmsintrp.c
lcms2mt/src/cmsio0.c
lcms2mt/src/cmsio1.c
lcms2mt/src/cmslut.c
lcms2mt/src/cmsmd5.c
lcms2mt/src/cmsmtrx.c
lcms2mt/src/cmsnamed.c
lcms2mt/src/cmsopt.c
lcms2mt/src/cmspack.c
lcms2mt/src/cmspcs.c
lcms2mt/src/cmsplugin.c
lcms2mt/src/cmsps2.c
lcms2mt/src/cmssamp.c
lcms2mt/src/cmssm.c
lcms2mt/src/cmstypes.c
lcms2mt/src/cmsvirt.c
lcms2mt/src/cmswtpnt.c
lcms2mt/src/cmsxform.c
lcms2mt/src/extra_xform.h
lcms2mt/src/lcms2_internal.h
lcms2mt/src/lcms2mt.def
lcms2mt/testbed/Makefile.am
lcms2mt/testbed/Makefile.in
lcms2mt/testbed/bad.icc
lcms2mt/testbed/bad_mpe.icc
lcms2mt/testbed/crayons.icc
lcms2mt/testbed/ibm-t61.icc
lcms2mt/testbed/new.icc
lcms2mt/testbed/test1.icc
lcms2mt/testbed/test2.icc
lcms2mt/testbed/test3.icc
lcms2mt/testbed/test4.icc
lcms2mt/testbed/test5.icc
lcms2mt/testbed/testcms2.c
lcms2mt/testbed/testcms2.h
lcms2mt/testbed/testplugin.c
lcms2mt/testbed/testthread.cpp
lcms2mt/testbed/toosmall.icc
lcms2mt/testbed/zoo_icc.c
lcms2mt/utils/common/utils.h
lcms2mt/utils/common/vprf.c
lcms2mt/utils/common/xgetopt.c
lcms2mt/utils/delphi/delphidemo.dpr
lcms2mt/utils/delphi/delphidemo.dproj
lcms2mt/utils/delphi/delphidemo.res
lcms2mt/utils/delphi/demo1.dfm
lcms2mt/utils/delphi/demo1.pas
lcms2mt/utils/delphi/lcms2dll.pas
lcms2mt/utils/jpgicc/LICENSE_iccjpeg
lcms2mt/utils/jpgicc/Makefile.am
lcms2mt/utils/jpgicc/Makefile.in
lcms2mt/utils/jpgicc/iccjpeg.c
lcms2mt/utils/jpgicc/iccjpeg.h
lcms2mt/utils/jpgicc/jpgicc.1
lcms2mt/utils/jpgicc/jpgicc.c
lcms2mt/utils/linkicc/Makefile.am
lcms2mt/utils/linkicc/Makefile.in
lcms2mt/utils/linkicc/linkicc.1
lcms2mt/utils/linkicc/linkicc.c
lcms2mt/utils/matlab/icctrans.c
lcms2mt/utils/matlab/lcms_rsp
lcms2mt/utils/psicc/Makefile.am
lcms2mt/utils/psicc/Makefile.in
lcms2mt/utils/psicc/psicc.1
lcms2mt/utils/psicc/psicc.c
lcms2mt/utils/samples/Makefile.am
lcms2mt/utils/samples/Makefile.in
lcms2mt/utils/samples/itufax.c
lcms2mt/utils/samples/mkcmy.c
lcms2mt/utils/samples/mkgrayer.c
lcms2mt/utils/samples/mktiff8.c
lcms2mt/utils/samples/roundtrip.c
lcms2mt/utils/samples/vericc.c
lcms2mt/utils/samples/wtpt.1
lcms2mt/utils/samples/wtpt.c
lcms2mt/utils/tificc/Makefile.am
lcms2mt/utils/tificc/Makefile.in
lcms2mt/utils/tificc/tifdiff.c
lcms2mt/utils/tificc/tificc.1
lcms2mt/utils/tificc/tificc.c
lcms2mt/utils/transicc/Makefile.am
lcms2mt/utils/transicc/Makefile.in
lcms2mt/utils/transicc/transicc.1
lcms2mt/utils/transicc/transicc.c
psi/msvc.mak
psi/os2.mak
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-02-16 13:51:04 -0800
Ray Johnston <ray.johnston@artifex.com>
9ff6b34e461fcbd4ef27fbb6c5c8a15071fe1370

Make ICC profile management thread safe.

The change to ref_count of profiles needs to be protected by a lock if
the profile ref_count could be changed by another thread. Also when
decrementing the ref_count to 0, we cannot free the lock until after
the profile has been unlocked.

New routine gsicc_adjust_profile_rc replaces old (not threadsafe) function
gsicc_profile_reference.

Also add tracing "cname" to the RC_ADJUST_ macro to aid in debugging
with -Z^ debug flag.

Testing had revealed race conditions which are now fixed (eliminate use
of semaphores).

This also changes the gsicc_lcms2art.c interface functions to keep a
list of transforms configured to have differing buffer formats that
include alpha, planar IN/OUT, big_endian IN/OUT, bytes_per_component
IN/OUT which are cloned as needed by threads.

Change gscms_is_threadsafe to return "true" in gsicc_lcms2art.c

TBD: If a link fails to build a thread may hang waiting for the link
profile to become valid if it was not the thread that was building it.
Not a new condition, but exposed when gscms_is_threadsafe returns true.

TBD: Fix error handling / clean-up when links fail to build. Also not
new, but is needed to prevent leaks, and possibly hang conditions.

base/gdevp14.c
base/gscdevn.c
base/gscie.c
base/gscms.h
base/gscscie.c
base/gscspace.c
base/gsicc.c
base/gsicc_cache.c
base/gsicc_lcms2art.c
base/gsicc_manage.c
base/gsicc_manage.h
base/gsicc_monitorcm.c
base/gsicc_nocm.c
base/gsicc_replacecm.c
base/gsmemory.c
base/gsrefct.h
base/gstrans.c
base/gxclist.c
base/gxclrast.c
base/gxcmap.c
base/gxipixel.c
base/lib.mak
lcms2art/include/lcms2art.h
lcms2art/src/cmsxform.c
lcms2art/src/lcms2art.def
xps/xpscolor.c
xps/xpsimage.c
xps/xpstile.c


2018-03-28 15:24:32 +0100
Ken Sharp <ken.sharp@artifex.com>
33701ac07115cb2f634a40ab73a5c127ca870ad8

Correctly set the 'encoding' to none when we apply UTF-8

Bug 699156 " Cyrillic file names"

On Windows GhostXPS, GhostPCL and the windowed executable (gswinxx.exe)
were not setting the 'encoding' or were setting it to an incorrect
'local' encoding.

This led to us incorrectly decoding UTF-8 encoded arguments, in
particular the input filename, which caused ioerrors to result.

pcl/pl/plmain.c
psi/dwmain.c


2018-03-26 20:55:39 +0100
Chris Liddell <chris.liddell@artifex.com>
b24a4bd9bab156443c4667d4266e3deb43f933f7

Bug 699141(redux): use "restrict" on compatible compilers

The definition of gs_restrict was missing for C99 compilers.

Even with compilers that claim C99 compatibility, we honor the configure check
for restrict.

base/stdpre.h


2018-03-26 14:56:37 +0100
Chris Liddell <chris.liddell@artifex.com>
12d2e6e44c4ed919bd38f2a13314f4942decd610

Bug 699154: Fix conditional parenthesis in gstype42.c

base/gstype42.c


2018-03-26 14:35:09 +0100
Chris Liddell <chris.liddell@artifex.com>
8ec5c5ded5fc19cabd95dad385b22a506e59acaf

zfapi.c: another case of is_glyph_index set wrongly

This is related to freetype now a) automatically selecting a Unicode cmap for
every font, if one is available, and b) automatically generating a Unicode cmap
for every font when one is not available.

Logic that we had pushed down to the FAPI/FT interface layer, we now need to
apply earlier.

psi/zfapi.c


2018-03-26 09:21:53 +0100
Chris Liddell <chris.liddell@artifex.com>
6e4ac5e7f1e8ea1835a99f12a7a4e34ebd85261e

Bug 699141: add configure test for __restrict in compiler

It seems that some older compilers that claim to support __restrict really don't
and compilation fails, so check for that in configure.

base/stdpre.h
configure.ac


2018-03-16 14:49:28 +0000
Chris Liddell <chris.liddell@artifex.com>
145c288cc0b1038b14334b92d40b37d27fd732b5

Disable or fix some (benign) compiler warnings for libtiff

base/gsjconf.h
configure.ac
psi/msvc.mak


2018-03-20 14:58:01 +0000
Chris Liddell <chris.liddell@artifex.com>
e3ef00ae7bd46ac4c45bf67cbb03a2342e850dca

Fix PACIFY_VALGRIND build

VALGRIND_HG_DISABLE_CHECKING() doesn't exist in all valgrind versions.

pcl/pl/plmain.c


2018-03-16 14:50:22 +0000
Chris Liddell <chris.liddell@artifex.com>
fde9abbaf12c0a861dd47792e02752d6b9e6b011

Fix a couple of unitialized variable warnings

base/gdevdrop.c
psi/zfont2.c


2018-03-16 14:16:38 +0000
Chris Liddell <chris.liddell@artifex.com>
99deae37f3cf32feac6eefabf17bf34a436c82ab

Fix a "defined but not used" warning

pcl/pcl/rtraster.c


2018-03-16 14:12:16 +0000
Chris Liddell <chris.liddell@artifex.com>
781c6a90b501a7cfcf1cdd337344444e6b388ef6

Address some compiler warnings adding casts

devices/gdevxalt.c


2018-03-16 14:11:42 +0000
Chris Liddell <chris.liddell@artifex.com>
9a3176cae5c0cd4fea05d2369289ec41d44cf842

Fix a couple of unused variable warnings

devices/gdevdsp.c


2018-03-16 14:11:04 +0000
Chris Liddell <chris.liddell@artifex.com>
465b77b4b9187e99aabad1e436d5c588fa565f97

Squash some unitialized variable warnings

contrib/lips4/gdevl4v.c


2018-03-16 10:19:43 +0000
Chris Liddell <chris.liddell@artifex.com>
eb770edd1c4dd9bf6c561f15564e4b8e10cc54b9

Squash compiler warning in ijs code.

ijs/ijs_exec_unix.c


2018-03-16 10:16:49 +0000
Chris Liddell <chris.liddell@artifex.com>
54e6bb1a12448aca3c48cd062946f564d3a9a4d1

Address some compiler warnings in openjpeg

configure.ac
openjpeg/src/lib/openjp2/j2k.c
psi/msvc.mak


2018-03-16 09:57:02 +0000
Chris Liddell <chris.liddell@artifex.com>
d411d72de4d41e0ad436c50d89088dc13e3b3f42

Shared library compiler warnings: lcms2, openjpeg

When linking against the system lcms2 and openjpeg there were compiler
warnings (we don't see building "normally").

base/gsicc_lcms2.c
base/sjpx_openjpeg.c


2018-03-16 09:06:33 +0000
Chris Liddell <chris.liddell@artifex.com>
ee08b05dd809984df8c686231b8c8f215f5815f9

Squash compiler warning in debug code

base/siscale.c


2018-03-16 09:03:55 +0000
Chris Liddell <chris.liddell@artifex.com>
601e3663d23ddb49af248d539d9c90d9fcec8163

For now, conditionally compile out unused structures

Solves compiler warnings.

base/gdevp14.c


2018-03-26 15:16:19 +0100
Ken Sharp <ken.sharp@artifex.com>
f13d74f60441f7f35691fd4de90476057b8535a4

Bug #699153 - fix cppcheck warning

Also fix two tab whitespaces, convert to spaces.

base/gsdevice.c


2018-03-26 02:10:10 +0800
Sebastian Rasmussen <sebras@gmail.com>
41d6119463a5f013ecbe5d55d2eb707a47fdd294

Fix 699142: Adaptive pixels can not be pixel to be predicted.

The fix for 699127 didn't account for the adaptive pixel location
being that of the pixel to be predicted. This is of course invalid,
and this is now recitified.

jbig2dec/jbig2_generic.c


2018-03-26 09:59:27 +0100
Ken Sharp <ken.sharp@artifex.com>
af2cf274d086e9140b388b7b1d92ab7753108491

Coverity ID 26634 - add some return code checks

base/gsstate.c


2018-03-23 08:45:39 +0000
Chris Liddell <chris.liddell@artifex.com>
1a3fdb0a05b50a5ddff2d5d566979708ff350ffa

Add another missing file to the documentation install list

I'd missed off the example device source file.

base/unixinst.mak


2018-03-07 09:59:55 +0000
Chris Liddell <chris.liddell@artifex.com>
59b5259ffa6155c3c9341a268310e3879e96d441

Bring master up to date with 9.23 release branch

(gs923)

base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-22 11:30:03 +0000
Chris Liddell <chris.liddell@artifex.com>
57d33404ce0fab68a909fff501c0b8e2912b9956

Check __STDC_VERSION__ is defined before using it

Not all compilers (and versions) have __STDC_VERSION__

base/stdpre.h


2018-03-22 11:16:09 +0000
Chris Liddell <chris.liddell@artifex.com>
829c4c55f8b0d77ead0c3daf3ab4164c6b7d8365

Fix FAPI's CharString dictionary accessing

Because dictionaries are (generally) made up of sparse arrays (one each for
keys and values), it's not generally safe to simply access indices into those
arrays - which the FAPI code was doing.

Normally, for that type of access, we'd use the dictionary content enumerator
function but, in this case, the FAPI API does not enforce iterating through
the dictionary contents, but allows for "random" accessing the contents.

However, the requirement to handle broken or invalid CharStrings also means we
neatly handle empty slots in the sparse arrays.

So, the only change required here is to use the maximum size of the dictionary
object, rather than the "size" to know how many indices to check.

As an additional safety check, however, also add checks for the key/value
types, and treat an invalid type as an empty slot.

psi/zfapi.c


2018-03-22 11:21:13 +0000
Ken Sharp <ken.sharp@artifex.com>
8ac0975771838c7d8c17f5f2f7223607eb976788

PS interpreter - fix parsing of NChannel Colorants dictionary

The code was previously using dict_index_entry to retrieve entries
from the Colorants dictionary, but it did not account for the function
returning gs_error_undefined when a slot in the dictionary was present
but unused. Since dictionaries are sparse arrays, this is possible.

This commit reworks the code to use dict_first() and dict_next() to
retrieve elements from the dictionary, and starts at the maximum entry
and works down, instead of the previous code which started at 0 and
worked up.

psi/zcolor.c


2018-03-20 21:42:39 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e54754db42c2640c10a73b18779213d16dbd10d0

Bug 697545 : Update functions to return error codes.

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately

base/gsptype1.c
base/gximage1.c
base/gxipixel.c
base/gxpcmap.c


2018-03-21 02:43:52 +0800
Sebastian Rasmussen <sebras@gmail.com>
94d46eea5dada844ac4d9767dfb7a384a408e111

Fix 698839: Remove testcase that cannot be found from testrunner.

jbig2dec/test_jbig2dec.py


2018-03-21 02:38:15 +0800
Sebastian Rasmussen <sebras@gmail.com>
222403964eb437c0b60404fcc11bb879744d263e

Fix 698839: Add hash for testcases that fail to decode anything.

The testrunner stated that the expected hash for 042_13.jb2 and
042_14.jb2 was that of a successfully decoded image. Historically
these two images have caused jbig2dec to segfault, but nowadays
they correctly cause FATAL ERRORs. When FATAL ERRORs are
encountered as hash covering 0 bytes of image data is computed,
so the testrunner now expects this hash instead. Therefore the
check now run successfully.

jbig2dec/test_jbig2dec.py


2018-03-21 02:30:12 +0800
Sebastian Rasmussen <sebras@gmail.com>
430fcce8516a3c38f03e8f81d4d8b3e87a5aff28

Fix 698839: Have the testsuite runner return the result.

Previously the return value was None regardless of test succeeded
or failed. This meant that the test_jbig2dec.py script had an
exit code of 1 not matter the outcome. Now it is 0 upon success
and 1 upon error, as expected by the make check infrastructure.

jbig2dec/test_jbig2dec.py


2018-03-21 00:44:00 +0800
Sebastian Rasmussen <sebras@gmail.com>
3431972e91c51403cf4223f1d5c28b666ea84c6e

Fix 698839: Set correct checksum for amb_{1,2}.jb2 in test suite.

jbig2dec/test_jbig2dec.py


2018-03-20 13:16:40 +0000
Chris Liddell <chris.liddell@artifex.com>
d8d4a64468252f5b632891fa9c8fdf98930fae15

Add missing files to doc install target

These files:

VectorDevices.htm
sample_downscale_device.htm
SavedPages.htm
subclass.htm

were missing from the documentation installation target

base/unixinst.mak


2018-03-20 14:13:00 +0000
Ken Sharp <ken.sharp@artifex.com>
18ec3899047e26109548cb601f0bf830a86d9abe

Coverty ID 94548 - check return value

psi/zupath.c


2018-03-20 13:36:31 +0000
Ken Sharp <ken.sharp@artifex.com>
a9f78155bc0f5050359ea6dfbfb5166e4f72a9cf

Coverity ID 26487 - remove duplicate branch

devices/gdevpdfimg.c


2018-03-20 12:10:15 +0000
Ken Sharp <ken.sharp@artifex.com>
46b6212e1688ba5d49923908d3be3f9329dd705b

PDF interpreter - remove /.gs.pdfobj# entries from pdfmarks

Since we increased the places where we use /.gs.pfgobj# to track the
PDF object number, we have been emitting PDF files from pdfwrite
which contain dictionaries with illegal PDF names.

The '#' in PDF naming is used to escape unprintable characters (eg
space), it must be followed by 2 hex digits, ours isn't.

Trying to fix this in the pdfmark processing proved problematic, so
instead, remove it at the PostScritp level.

Resource/Init/pdf_draw.ps
Resource/Init/pdf_main.ps


2018-03-20 02:28:20 +0800
Sebastian Rasmussen <sebras@gmail.com>
8cf6ddf78db5fc4a453df1a1a9d3ea120ba47609

Fix 698840: Fix typo in exit code in command-line tool.

This was introduced in 301726dd5c9c60c1e54eb0965c1d45b36350ce2e.

Thanks to Max Rees for reporting.

jbig2dec/jbig2dec.c


2018-03-18 14:09:16 +0800
Sebastian Rasmussen <sebras@gmail.com>
71bf7cb0c4aa3d2bb06deac2df675af44b3e4c3b

Fix 699127: JBIG2 adaptive pixels restricted to field.

When decoding generic regions the adaptive pixels must be
restricted to a field, previously this was not validated,
leading to out of buffer accesses.

This is now validated and may generate a fatal error.

jbig2dec/jbig2_generic.c


2018-03-19 13:47:36 +0000
Ken Sharp <ken.sharp@artifex.com>
bb2ea8ca0482cb0bb5632c30e9184e3d19fdc8d2

pdfwrite - ensure correct ICC profile version being written out

Bug #699104 "Identify ICC profiles unsuitable for embedding in output PDF and fall back to device space"

Previously we did not check the minor version number of ICC profiles
when writing an ICCBased colour space. Since PDF versions below 1.7
support either 4.0.0 0r 4.1.0, this could mean that we wrote a version
of profile that was too great for teh PDF version.

Following on from Michael's commit f732ea3a999f73afa46c2cc4ca28b067f671d29c
we can now determine the minor version number of profiles, and we now
use that to decide whether to use the profile as it is, or drop back to
a version 2 profile.

Since falling back to a version 2 profile can cause subtle changes in
colour, we now make the default CompatibilityLevel for PDF output 1.7.
Some PDFSETTINGS convert all colours to device spaces and these have
not been altered (not required). We could have defaulted to PDF 2.0
output, but the code is rather new, and also prevents certain constructs
(eg TransferFunction in the graphics state).

Resource/Init/gs_pdfwr.ps
devices/vector/gdevpdf.c
devices/vector/gdevpdfk.c
doc/VectorDevices.htm


2018-03-19 11:13:13 +0000
Ken Sharp <ken.sharp@artifex.com>
5fe0dbb5de65ca92a0ba8ff4a96447e30e4366e8

pdfwrite - remove special case for GS_UNDEFINED ICC profile colour space

Since commit f732ea3a999f73afa46c2cc4ca28b067f671d29c the cs_data
member of ICC profiles generated internally is correctly set. So we no
longer need to special-case ICC profiles where the cs_data member is
GS_UNDEFINED.

devices/vector/gdevpdfk.c


2018-03-19 10:29:38 +0000
Ken Sharp <ken.sharp@artifex.com>
8078194fd8abe7c9c3088573b9e69a4a967b6ee0

Bug 699122 - valgrind regression

Somewhat to my surprise, calling gs_setcolorspace does not set the
device colour, and leaves 'ccolor_valid' in an undefined state.

Call gs_set_dev_color() to explicitly set the device colour after we
reset the device space to gray in gs_initgraphics()

base/gsstate.c


2018-03-16 13:27:45 +0000
Chris Liddell <chris.liddell@artifex.com>
9b9acd5a8e074bbb47107f6add7b8afb1fe43270

Fix ommission from revised documentation install path

base/unixinst.mak


2018-03-18 12:33:22 -0700
Michael Vrhel <michael.vrhel@artifex.com>
f732ea3a999f73afa46c2cc4ca28b067f671d29c

Bug 699104 make sure data_cs is populated when creating profiles

Also, added a method to return the major and minor version numbers
for use in pdf write.

base/gsciemap.c
base/gsicc_manage.c
base/gsicc_manage.h


2018-03-15 19:14:15 +0000
Ken Sharp <ken.sharp@artifex.com>
269663402c5210dd1a15131a045526e3cd6de479

pdfimage devices - fix up some minor problems

Bug #699119 " pdfimage24 creates bad PDF"

When I removed some extraneous stuff from the output (to simplify it) I
forgot to update the pdfimage devices properly, leading to them trying
to write xref entries for missing data.

In addition, there was a problem writing the Length object of the image
streams.

Ghostscript complained about both of these but rendered the content
correctly, other consumers didn't complain.

devices/gdevpdfimg.c


2018-03-15 11:04:40 +0000
Chris Liddell <chris.liddell@artifex.com>
124b37fc65fe665d8b4a6133142784c4edb3b3bf

lcms2art: byteReverse needs a ContextID

on big endian platforms - fix that.

Reported against 9.23 RC1

lcms2art/src/cmsmd5.c


2018-01-29 15:32:52 +0000
Robin Watts <robin.watts@artifex.com>
e0f461a8a634036bbff938492190c72fcef684ac

Tweak indent of comment.

base/gsicc_lcms2art.c


2018-03-14 19:49:29 +0000
Robin Watts <robin.watts@artifex.com>
40263f15745f9cf9477acc35708bf61a2de46a6b

Simplify image enumerator rectangle logic for scalers.

We store the image size as a rectangle in the image enumerator.
For the purposes of scaling, we also store the rectangle that
needs to be rendered. We expand this slightly to allow for
the support requirements of the scaler, thus giving a rectangle
that is really what we need to decode.

In order to correctly setup the scaler we then need to try to
guess how much expansion was done. My previous attempts at
this guesswork failed.

A simpler solution would appear to be to just save both the
render and decode rectangles stored separately. This simplifies
the logic.

base/gximage.h
base/gxipixel.c
base/gxiscale.c
base/sisparam.h


2018-03-12 18:53:45 +0000
Robin Watts <robin.watts@artifex.com>
088cae9953f3a692201915c91bc87260add91fc6

lcms2art: Split transforms in two.

Each cmsTransform now has a 'core' part and a part that can
be 'cloned' to change the buffer formats.

The plan is to drop cmsChangeBuffersFormat and use this instead
to make sure we truly are thread safe.

lcms2art/include/lcms2art.h
lcms2art/src/cmsalpha.c
lcms2art/src/cmsnamed.c
lcms2art/src/cmsplugin.c
lcms2art/src/cmsps2.c
lcms2art/src/cmsvirt.c
lcms2art/src/cmsxform.c
lcms2art/src/extra_xform.h
lcms2art/src/lcms2_internal.h


2018-03-12 18:53:17 +0000
Robin Watts <robin.watts@artifex.com>
85569e3bd463ff2b67c195dd84ed770d2f86eb8f

Update VS project for lcms2 -> lcms2art change.

windows/ghostscript.vcproj


2018-03-14 19:38:01 +0000
Robin Watts <robin.watts@artifex.com>
ad292af74cbb8e823cf2829d29a35661caf1c49c

Fix typo in Memento_breakpointLocked.

base/memento.c


2018-03-14 16:41:03 +0000
Robin Watts <robin.watts@artifex.com>
34e279b84a6271c37a5a51ccefaccd2362845e73

Revert "Tweak bitmap interpolater patch size."

This reverts commit 38e0c643e62087c089c59c9ad44fc468dd09cd37.

This was shown to cause problems with:

tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf.pdf.psdcmyk.300.1

(or tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf, page 2, tweaked
to rotate by 270).

Reverting for now so I can try to find a less hacky (and hence
less error prone) way of working.

base/gxiscale.c
base/sisparam.h


2018-03-01 15:04:48 +0800
Sebastian Rasmussen <sebras@gmail.com>
36ab38b53695ae4b212507c45ec07f117ff26e2d

Fix 699083: Avoid leak in symbol dictionary parsing upon error.

jbig2dec/jbig2_symbol_dict.c


2018-03-13 12:20:33 +0000
Ken Sharp <ken.sharp@artifex.com>
151aa07a734101182b1861c3113c2539d2d8a485

pdfwrite - correct a function name

stupid typo in function name, its been annoying me for years.

devices/vector/gdevpdtt.c


2018-03-13 10:37:08 +0000
Ken Sharp <ken.sharp@artifex.com>
cb018b64dea61f2d6146652dce349d3fadab1709

Squash a benign compiler warning

devices/vector/gdevpdtt.c


2018-03-13 10:36:45 +0000
Ken Sharp <ken.sharp@artifex.com>
9ad220db0c06b9a22bd757f92edaaf624b701b1b

pdfwrite - don't write device spaces for masks representing glyphs

This came up while looking into ICC profile embedding. If we are
processing a mask bitmap which represents a glyph (eg when creating a
type 3 font for a font which cannot be embedded directly in a PDF) we
do not want to write a device colour.

We probably *never* want to write a device colour in here, but I'm not
certain of that, I am certain that the high level colour will already
have been set if we are processing text though. So in this commit, limit
the change so that we don't write device colours for glyphs.

devices/vector/gdevpdfb.c


2018-03-13 10:33:52 +0000
Ken Sharp <ken.sharp@artifex.com>
f06d2b00d005012379d4a2f6f47aab99b7b13b5c

pdfwrite - reject inappropriate ICC profiles

PDF files cannot include the full possible range of ICC profiles, if
we encounter one of these (eg from an XPS file) then refuse to embed it
and instead return gs_error_rangecheck, so that the calling code will
fall back to a device space representation.

NOTE we currently permit GS_UNDEFINED as a valid data_cs which we really
shouldn't but the current code, when converting a CIEBasedDEF or
CIEBasedDEFG (possibly other CIE spaces) to ICC creates a profile
where data_cs is GS_UNDEFINED (which is 0, so probably not actually
filled in).

devices/vector/gdevpdfk.c


2018-03-06 12:22:23 +0000
Robin Watts <robin.watts@artifex.com>
d6bdb65a51e154402a173182e8d1beccba610ea0

Memento: Add Mutex to protect Memento operations.

Solves problems that Ray was seeing while debugging the multithreaded
integration of our modified LCMS2.

base/memento.c


2018-03-12 14:22:44 +0000
Ken Sharp <ken.sharp@artifex.com>
c6596a021cbe1cd716eaf50e3dd06de646e05572

pdfwrite - avoid use of /.notdef when converting PCL fonts to type 3

Bug #699102 "using -sDEVICE=pdfwrite option generate an incorrect code 128 barcode"

This is actually an Acrobat bug, every other viewer I've tested works as
expected, Acrobat does not.

The problem appears to be related to defining a /.notdef glyph and
encoding it at a position other than 0 in the Encoding. If we do that,
and use the encoded /.notdef glyph, Acrobat quietly replaces it with the
glyph encoded at position 0 in the Encoding of the font.

Because of the way that PCL fonts work, when we are converting PCL
fonts to type 3 PDF fonts, the character (PCL) 0x1D gets assigned the
glyph name /.notdef. The actual Encoding of the glyph is at position
0x1D however, which causes Acrobat to substitute the glyph at Encoding
position 0.

This is obviously wrong. However, since its Acrobat, here we add yet
another heuristic to avoid defining glyphs with the name /.notdef when
creating type 3 PDF fonts from PCL fonts.

No differences expected

devices/vector/gdevpdtt.c


2018-03-07 18:31:23 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
3b3d8f74dc026c4f1af5022a1527d41d21511401

Bug 697545 : Prevent SEGV from gs_make_pattern_common.

Prevent SEGV if memory allocation fails and returns an empty path.

Error created using :-
MEMENTO_FAILAT=9104 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gspcolor.c


2018-03-08 13:21:54 +0000
Robin Watts <robin.watts@artifex.com>
d68b62d7567f20f0f269d096b899bd2409967980

Avoid total image dropout in interplated rescales.

Tests show that the following command causes images to disappear:

gxps -o out.ppm -sDEVICE=ppmraw -72 tests_private/xps/xpsfts-a4/fts_27xx.xps

This is because we scale a 1600 wide image down to 27 pixels across.
As such the weights for each individual pixel round to zero, and we
get nothing displayed.

Adjust for this by still calculating weights as doubles, and carrying
the error across the line. This keeps the total sum of the differences
correct.

base/siscale.c


2018-03-06 21:57:06 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
676dfb338d296aa86630662714fce5f058e31b8f

Bug 697545 : Update functions to return error codes.

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately

pcl/pxl/pxsessio.c


2018-03-06 20:33:02 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
2926860ca8ce519dadf23e44a9b4828da70090c4

Bug 697545 : Update functions to return error codes.

Each parameter handling function has been updated to ensure error codes
are returned and handled appropriately and gs_c_param_list_release is
always called on exit.

pcl/pcl/pcommand.c


2018-03-07 12:16:51 +0000
Chris Liddell <chris.liddell@artifex.com>
cfada4acb65861b4361ad80dbb53f61c5dc94c96

Bump version - prep for release

Resource/Init/gs_init.ps
base/version.mak


2018-03-21 08:44:23 +0000
Chris Liddell <chris.liddell@artifex.com>
a03872ea339d60055fa09dc451ebf37442f467fb

Final changelog for 9.23 release

doc/History9.htm


2018-03-21 08:41:35 +0000
Chris Liddell <chris.liddell@artifex.com>
eb210aecab59f338ef9b8af4523edb3c8bc35092

Dates, changelog and product string for release

base/gscdef.c
base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-20 13:16:40 +0000
Chris Liddell <chris.liddell@artifex.com>
41c92643ce1325893d0f491a49fb2edad1684d17

Add missing files to doc install target

These files:

VectorDevices.htm
sample_downscale_device.htm
SavedPages.htm
subclass.htm

were missing from the documentation installation target

base/unixinst.mak


2018-03-16 13:27:45 +0000
Chris Liddell <chris.liddell@artifex.com>
6ca20f5735e9cde19eee6577059cd9d844e94525

Fix ommission from revised documentation install path

base/unixinst.mak


2018-03-15 19:14:15 +0000
Ken Sharp <ken.sharp@artifex.com>
713d80d0dde40a5d1d1f402e8347997896b9a8f7

pdfimage devices - fix up some minor problems

Bug #699119 " pdfimage24 creates bad PDF"

When I removed some extraneous stuff from the output (to simplify it) I
forgot to update the pdfimage devices properly, leading to them trying
to write xref entries for missing data.

In addition, there was a problem writing the Length object of the image
streams.

Ghostscript complained about both of these but rendered the content
correctly, other consumers didn't complain.

devices/gdevpdfimg.c


2018-03-15 11:04:40 +0000
Chris Liddell <chris.liddell@artifex.com>
7f822afbb52a6b37fc4766f840e714d9f491da81

lcms2art: byteReverse needs a ContextID

on big endian platforms - fix that.

Reported against 9.23 RC1

lcms2art/src/cmsmd5.c


2018-03-15 07:50:41 +0000
Chris Liddell <chris.liddell@artifex.com>
36bc37e414b695b1fa39c7e99be9d83f8628e889

Changelog and product string for 9.23 rc3

base/gscdef.c
doc/History9.htm


2018-03-14 16:41:03 +0000
Robin Watts <robin.watts@artifex.com>
e31e3879532fd23ca2658aea26bf4cadd665687f

Revert "Tweak bitmap interpolater patch size."

This reverts commit 38e0c643e62087c089c59c9ad44fc468dd09cd37.

This was shown to cause problems with:

tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf.pdf.psdcmyk.300.1

(or tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf, page 2, tweaked
to rotate by 270).

Reverting for now so I can try to find a less hacky (and hence
less error prone) way of working.

base/gxiscale.c
base/sisparam.h


2018-03-14 07:47:37 +0000
Chris Liddell <chris.liddell@artifex.com>
56888d7a2e8b9cade1fc9535b67bd9841e2aca6e

Update changelog for 9.23 rc2

doc/History9.htm


2018-03-14 07:45:29 +0000
Chris Liddell <chris.liddell@artifex.com>
f7acb2502eadeff35dc791b52400d1a301059927

Dates etc for 9.23 rc2

base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-13 10:37:08 +0000
Ken Sharp <ken.sharp@artifex.com>
7c9a54209a2758769102361a456353e7e5993821

Squash a benign compiler warning

devices/vector/gdevpdtt.c


2018-03-13 10:33:52 +0000
Ken Sharp <ken.sharp@artifex.com>
353c6caa4b8dea6baae337b30217139e996e9b94

pdfwrite - reject inappropriate ICC profiles

PDF files cannot include the full possible range of ICC profiles, if
we encounter one of these (eg from an XPS file) then refuse to embed it
and instead return gs_error_rangecheck, so that the calling code will
fall back to a device space representation.

NOTE we currently permit GS_UNDEFINED as a valid data_cs which we really
shouldn't but the current code, when converting a CIEBasedDEF or
CIEBasedDEFG (possibly other CIE spaces) to ICC creates a profile
where data_cs is GS_UNDEFINED (which is 0, so probably not actually
filled in).

devices/vector/gdevpdfk.c


2018-03-12 14:22:44 +0000
Ken Sharp <ken.sharp@artifex.com>
23f66c8eec91e8efcbc600d987cf8bde7e3dce4b

pdfwrite - avoid use of /.notdef when converting PCL fonts to type 3

Bug #699102 "using -sDEVICE=pdfwrite option generate an incorrect code 128 barcode"

This is actually an Acrobat bug, every other viewer I've tested works as
expected, Acrobat does not.

The problem appears to be related to defining a /.notdef glyph and
encoding it at a position other than 0 in the Encoding. If we do that,
and use the encoded /.notdef glyph, Acrobat quietly replaces it with the
glyph encoded at position 0 in the Encoding of the font.

Because of the way that PCL fonts work, when we are converting PCL
fonts to type 3 PDF fonts, the character (PCL) 0x1D gets assigned the
glyph name /.notdef. The actual Encoding of the glyph is at position
0x1D however, which causes Acrobat to substitute the glyph at Encoding
position 0.

This is obviously wrong. However, since its Acrobat, here we add yet
another heuristic to avoid defining glyphs with the name /.notdef when
creating type 3 PDF fonts from PCL fonts.

No differences expected

devices/vector/gdevpdtt.c


2018-03-08 13:21:54 +0000
Robin Watts <robin.watts@artifex.com>
1567dba0b505a0bb816e7b2e34f3915165a7d5b3

Avoid total image dropout in interplated rescales.

Tests show that the following command causes images to disappear:

gxps -o out.ppm -sDEVICE=ppmraw -72 tests_private/xps/xpsfts-a4/fts_27xx.xps

This is because we scale a 1600 wide image down to 27 pixels across.
As such the weights for each individual pixel round to zero, and we
get nothing displayed.

Adjust for this by still calculating weights as doubles, and carrying
the error across the line. This keeps the total sum of the differences
correct.

base/siscale.c


2018-03-07 14:40:21 +0000
Chris Liddell <chris.liddell@artifex.com>
7a6acdfce9344574638c2553f605d86f801f7393

News and Changelog for 9.23 rc1

doc/History9.htm
doc/News.htm


2018-03-07 12:19:48 +0000
Chris Liddell <chris.liddell@artifex.com>
c6285cdd7ae7b1c97ffcf0c824234659b03d6d6a

Dates and versions for 9.23 rc1

doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-07 09:59:55 +0000
Chris Liddell <chris.liddell@artifex.com>
0df45c3d11246d773110d5b1a563d7462f3acac1

Revision date and product for release candidate

base/gscdef.c
base/version.mak



Changelog

2018-03-21 08:41:35 +0000
Chris Liddell <chris.liddell@artifex.com>
eb210aecab59f338ef9b8af4523edb3c8bc35092

Dates, changelog and product string for release

base/gscdef.c
base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-20 13:16:40 +0000
Chris Liddell <chris.liddell@artifex.com>
41c92643ce1325893d0f491a49fb2edad1684d17

Add missing files to doc install target

These files:

VectorDevices.htm
sample_downscale_device.htm
SavedPages.htm
subclass.htm

were missing from the documentation installation target

base/unixinst.mak


2018-03-16 13:27:45 +0000
Chris Liddell <chris.liddell@artifex.com>
6ca20f5735e9cde19eee6577059cd9d844e94525

Fix ommission from revised documentation install path

base/unixinst.mak


2018-03-15 19:14:15 +0000
Ken Sharp <ken.sharp@artifex.com>
713d80d0dde40a5d1d1f402e8347997896b9a8f7

pdfimage devices - fix up some minor problems

Bug #699119 " pdfimage24 creates bad PDF"

When I removed some extraneous stuff from the output (to simplify it) I
forgot to update the pdfimage devices properly, leading to them trying
to write xref entries for missing data.

In addition, there was a problem writing the Length object of the image
streams.

Ghostscript complained about both of these but rendered the content
correctly, other consumers didn't complain.

devices/gdevpdfimg.c


2018-03-15 11:04:40 +0000
Chris Liddell <chris.liddell@artifex.com>
7f822afbb52a6b37fc4766f840e714d9f491da81

lcms2art: byteReverse needs a ContextID

on big endian platforms - fix that.

Reported against 9.23 RC1

lcms2art/src/cmsmd5.c


2018-03-15 07:50:41 +0000
Chris Liddell <chris.liddell@artifex.com>
36bc37e414b695b1fa39c7e99be9d83f8628e889

Changelog and product string for 9.23 rc3

base/gscdef.c
doc/History9.htm


2018-03-14 16:41:03 +0000
Robin Watts <robin.watts@artifex.com>
e31e3879532fd23ca2658aea26bf4cadd665687f

Revert "Tweak bitmap interpolater patch size."

This reverts commit 38e0c643e62087c089c59c9ad44fc468dd09cd37.

This was shown to cause problems with:

tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf.pdf.psdcmyk.300.1

(or tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf, page 2, tweaked
to rotate by 270).

Reverting for now so I can try to find a less hacky (and hence
less error prone) way of working.

base/gxiscale.c
base/sisparam.h


2018-03-14 07:45:29 +0000
Chris Liddell <chris.liddell@artifex.com>
f7acb2502eadeff35dc791b52400d1a301059927

Dates etc for 9.23 rc2

base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-13 10:37:08 +0000
Ken Sharp <ken.sharp@artifex.com>
7c9a54209a2758769102361a456353e7e5993821

Squash a benign compiler warning

devices/vector/gdevpdtt.c


2018-03-13 10:33:52 +0000
Ken Sharp <ken.sharp@artifex.com>
353c6caa4b8dea6baae337b30217139e996e9b94

pdfwrite - reject inappropriate ICC profiles

PDF files cannot include the full possible range of ICC profiles, if
we encounter one of these (eg from an XPS file) then refuse to embed it
and instead return gs_error_rangecheck, so that the calling code will
fall back to a device space representation.

NOTE we currently permit GS_UNDEFINED as a valid data_cs which we really
shouldn't but the current code, when converting a CIEBasedDEF or
CIEBasedDEFG (possibly other CIE spaces) to ICC creates a profile
where data_cs is GS_UNDEFINED (which is 0, so probably not actually
filled in).

devices/vector/gdevpdfk.c


2018-03-12 14:22:44 +0000
Ken Sharp <ken.sharp@artifex.com>
23f66c8eec91e8efcbc600d987cf8bde7e3dce4b

pdfwrite - avoid use of /.notdef when converting PCL fonts to type 3

Bug #699102 "using -sDEVICE=pdfwrite option generate an incorrect code 128 barcode"

This is actually an Acrobat bug, every other viewer I've tested works as
expected, Acrobat does not.

The problem appears to be related to defining a /.notdef glyph and
encoding it at a position other than 0 in the Encoding. If we do that,
and use the encoded /.notdef glyph, Acrobat quietly replaces it with the
glyph encoded at position 0 in the Encoding of the font.

Because of the way that PCL fonts work, when we are converting PCL
fonts to type 3 PDF fonts, the character (PCL) 0x1D gets assigned the
glyph name /.notdef. The actual Encoding of the glyph is at position
0x1D however, which causes Acrobat to substitute the glyph at Encoding
position 0.

This is obviously wrong. However, since its Acrobat, here we add yet
another heuristic to avoid defining glyphs with the name /.notdef when
creating type 3 PDF fonts from PCL fonts.

No differences expected

devices/vector/gdevpdtt.c


2018-03-08 13:21:54 +0000
Robin Watts <robin.watts@artifex.com>
1567dba0b505a0bb816e7b2e34f3915165a7d5b3

Avoid total image dropout in interplated rescales.

Tests show that the following command causes images to disappear:

gxps -o out.ppm -sDEVICE=ppmraw -72 tests_private/xps/xpsfts-a4/fts_27xx.xps

This is because we scale a 1600 wide image down to 27 pixels across.
As such the weights for each individual pixel round to zero, and we
get nothing displayed.

Adjust for this by still calculating weights as doubles, and carrying
the error across the line. This keeps the total sum of the differences
correct.

base/siscale.c


2018-03-07 12:19:48 +0000
Chris Liddell <chris.liddell@artifex.com>
c6285cdd7ae7b1c97ffcf0c824234659b03d6d6a

Dates and versions for 9.23 rc1

doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-07 09:59:55 +0000
Chris Liddell <chris.liddell@artifex.com>
0df45c3d11246d773110d5b1a563d7462f3acac1

Revision date and product for release candidate

base/gscdef.c
base/version.mak


2018-02-26 15:48:45 +0100
David Kaspar [Dee'Kej] <dkaspar@redhat.com>
8c206ceeeac12b048aeafc9ea51080b624750ff4

Bug 699068: configure.ac: forcibly disable strict aliasing via CFLAGS

In case user specifies their own CFLAGS that contains -O2, -O3, -Os or
-fstrict-aliasing, the default behaviour to disable the strict
aliasing will be overriden and enabled, which is not correct...

This commit will append the -fno-strict-aliasing option to CFLAGS set
by user, which will effectively force the disabling of strict aliasing.

NOTE: originally the patch issued a warning when appending -fno-strict-aliasing
and I've changed it to a normal checking/result message pattern - it seems less
likely to cause end user confusion/panic

configure.ac


2018-03-05 21:48:02 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
39686173fd26eb6e5eee91202433f5e5f307f61c

Bug 697545 : Update functions to return error codes.

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

base/gscolor.c
base/gsdparam.c
base/gsptype1.c
pcl/pcl/pcbiptrn.c
pcl/pcl/pcpatrn.c
pcl/pcl/pginit.c
pcl/pcl/pglabel.c
pcl/pcl/rtraster.c
pcl/pl/plparams.c
pcl/pxl/pxgstate.c
pcl/pxl/pxink.c
pcl/pxl/pxpthr.c
psi/ztrans.c


2018-02-21 19:59:25 +0100
David Kaspar [Dee'Kej] <dkaspar@redhat.com>
469bd6ecf5b223b3e6e3f32ec5a4900866c35e57

Bug 699057: Makefile.in: @LDFLAGS@ added into GCFLAGS

Previously, the 'gsc' and 'gsx' binaries were not using LDFLAGS when
they were built with shared library. Adding LDFLAGS into GCFLAGS fixes
this issue, and specifying LDFLAGS now works for these binaries as well.

Makefile.in


2018-03-06 10:16:43 +0000
Chris Liddell <chris.liddell@artifex.com>
71e152462e2b47e8e31aec7cf1238934640aa480

Update zlib to 1.2.11

zlib/CMakeLists.txt
zlib/ChangeLog
zlib/Makefile.in
zlib/README
zlib/adler32.c
zlib/as400/bndsrc
zlib/as400/compile.clp
zlib/as400/readme.txt
zlib/compress.c
zlib/configure
zlib/contrib/README.contrib
zlib/contrib/ada/zlib-streams.ads
zlib/contrib/ada/zlib-thin.ads
zlib/contrib/blast/blast.c
zlib/contrib/blast/blast.h
zlib/contrib/delphi/ZLib.pas
zlib/contrib/dotzlib/DotZLib/UnitTests.cs
zlib/contrib/infback9/inftree9.c
zlib/contrib/minizip/configure.ac
zlib/contrib/minizip/iowin32.c
zlib/contrib/minizip/unzip.c
zlib/contrib/minizip/zip.c
zlib/contrib/pascal/zlibpas.pas
zlib/contrib/puff/puff.c
zlib/contrib/vstudio/readme.txt
zlib/contrib/vstudio/vc10/zlib.rc
zlib/contrib/vstudio/vc10/zlibvc.def
zlib/contrib/vstudio/vc11/zlib.rc
zlib/contrib/vstudio/vc11/zlibvc.def
zlib/contrib/vstudio/vc12/miniunz.vcxproj
zlib/contrib/vstudio/vc12/minizip.vcxproj
zlib/contrib/vstudio/vc12/testzlib.vcxproj
zlib/contrib/vstudio/vc12/testzlibdll.vcxproj
zlib/contrib/vstudio/vc12/zlib.rc
zlib/contrib/vstudio/vc12/zlibstat.vcxproj
zlib/contrib/vstudio/vc12/zlibvc.def
zlib/contrib/vstudio/vc12/zlibvc.sln
zlib/contrib/vstudio/vc12/zlibvc.vcxproj
zlib/contrib/vstudio/vc14/miniunz.vcxproj
zlib/contrib/vstudio/vc14/minizip.vcxproj
zlib/contrib/vstudio/vc14/testzlib.vcxproj
zlib/contrib/vstudio/vc14/testzlibdll.vcxproj
zlib/contrib/vstudio/vc14/zlib.rc
zlib/contrib/vstudio/vc14/zlibstat.vcxproj
zlib/contrib/vstudio/vc14/zlibvc.def
zlib/contrib/vstudio/vc14/zlibvc.sln
zlib/contrib/vstudio/vc14/zlibvc.vcxproj
zlib/contrib/vstudio/vc9/zlib.rc
zlib/contrib/vstudio/vc9/zlibvc.def
zlib/crc32.c
zlib/deflate.c
zlib/deflate.h
zlib/examples/gun.c
zlib/examples/gzlog.c
zlib/examples/zran.c
zlib/gzguts.h
zlib/gzlib.c
zlib/gzread.c
zlib/gzwrite.c
zlib/infback.c
zlib/inffast.c
zlib/inflate.c
zlib/inflate.h
zlib/inftrees.c
zlib/msdos/Makefile.dj2
zlib/msdos/Makefile.emx
zlib/old/Makefile.emx
zlib/old/os2/Makefile.os2
zlib/os400/README400
zlib/os400/bndsrc
zlib/os400/make.sh
zlib/os400/zlib.inc
zlib/qnx/package.qpg
zlib/test/example.c
zlib/test/infcover.c
zlib/test/minigzip.c
zlib/treebuild.xml
zlib/trees.c
zlib/uncompr.c
zlib/win32/Makefile.gcc
zlib/win32/Makefile.msc
zlib/win32/README-WIN32.txt
zlib/win32/VisualC.txt
zlib/win32/zlib.def
zlib/win32/zlib1.rc
zlib/zconf.h
zlib/zconf.h.cmakein
zlib/zconf.h.in
zlib/zlib.3
zlib/zlib.3.pdf
zlib/zlib.h
zlib/zlib.map
zlib/zutil.c
zlib/zutil.h


2018-03-06 12:36:11 +0000
Chris Liddell <chris.liddell@artifex.com>
08482c582115a1396d0fd9186011008f889a61c5

Work around a change in the zlib API for 1.2.11

where it's used in the Freetype/zlib interface debugging code.

freetype/src/gzip/zutil.h


2018-03-02 10:54:06 +0000
Ken Sharp <ken.sharp@artifex.com>
3da667d889e54fb1a323769fbb4f93b971d0fff4

CCITT Fax - ensure calculation rounds up

Still Bug #696413, follows on from commit 0221c9

When calculating the number of bytes required to store the encoded lines
we multiply the number of columns byt the number of bits required
for 2 pixels, then divide by 16 to get the required number of bytes.

This commit simply ensures that the division by 16 is rounded *up* and
not down. Previously we could end up dropping up to 7 bits of required
space. Generally this is not likely to be a problem but it is technically
a problem, and can be demonstrated on pathological cases.

base/scfe.c


2018-03-01 18:13:13 +0000
Ken Sharp <ken.sharp@artifex.com>
0221c9e4c43b25375dab6c9d15a777eecf20d261

Fix CCITT Fax Encoder

Bug #696413 "Seg faults found by fuzzing in pdf_store_page_resources (gdevpdfu.c:1663)"

As noted it eh bug report, the problem is that the encoding buffer is
allocated with a size based on the maximum number of bits for horizontal
encoding (6 bits per pixel), but for 2D encoding some of the bits might
use vertical encoding. Vertically encoded bits with an offset of 3 use
7 bits per pixel, not 6.

If we get a line with sufficient 7-bit encodings, where the horizontal
bits are encoded with 6 bits (eg runs of 1 pixel), then we can end up
running off the end of the buffer. Make the allocation assume a maximum
of 7 encoded bits per pixel instead.

base/scfe.c


2018-02-27 20:56:07 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e27f0530e3410547563daf757dc5c121c21d2f1c

Bug 697545 : Fix memory leak in show_proceed.

Fix memory leak and SEGV when gs_newpath returns an error code.

Error created using :-
MEMENTO_FAILAT=9017 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gxchar.c


2018-02-27 21:12:12 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
49974a63cad8c792067fbf63905a271022b0e806

Bug 697545 : Fix memory leaks in hpgl_print_char.

Fix memory leak when pcl_mark_page_for_current_pos returns an error code.
Also prevent path becoming orphaned in cpath_set_rectangle.

Error created using :-
MEMENTO_FAILAT=9010 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gxcpath.c
pcl/pcl/pglabel.c


2018-02-28 17:17:23 +0000
Ken Sharp <ken.sharp@artifex.com>
03194b72312b6777021f0554bdd30fecc89db486

txtwrite - guard against infinite loop

vertical text could result in an advance width of 0, which would cause
us to try and write an infinite number of spaces.

devices/vector/gdevtxtw.c


2018-02-28 14:04:32 +0000
Ken Sharp <ken.sharp@artifex.com>
d57bd7ce641d8134d559f5e8190e2578137e1d39

txtwrite - better dynamic resizing

A better fix for bug #699078, this implemnets the thought I had while
writing up the description of the problem. In this case we check whether
the current 'effective size' of the monospaced font would lead to
the end of the current run of text lying to the right of the 'next' run
of text on this line. If it would, then use the newly calculated
effective size, no matter how small it is, to avoid collisions.

devices/vector/gdevtxtw.c


2018-02-28 09:34:06 +0000
Ken Sharp <ken.sharp@artifex.com>
d0d4e282f98487ca2979edbaf6834d9341bcee53

txtwrite - slacken a restriction on minimum width selection

Bug #699078 " Extracted text is not properly seperated"

Allow the minimum size assigned to the monospaced output to be smaller
than previously (previously we limited it to .75 of the smallest point
size of any used font).

This will reduce the number of horizontal text collisions at the cost
of potentially making the text output wider.

Essentially this is caused by using a monospaced font to represent the
original proportionally spaced input. A sufficiently long run of
characters which are significantly less than the M width could result in
the position being further to the right (when converted to monspaced
text) than the neext horizontal fragment. So we wouldn't try to
space it any further.

Previously we limited the calculation of the minimum character size in
a run to 3/4 of the M space. Here we reduce that to 1/2 which will
permit more flexibility, but as stated, at the potential cost of the
output text being 'wider' (containing more spaces).

devices/vector/gdevtxtw.c


2018-02-26 21:25:19 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
a16736bc4ea251c46f1aa1d3b6176aadf5f0b914

Bug 697545 : Update PCL to return error codes (Patch VI).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pl/plparams.c
pcl/pl/pluchar.c


2018-02-25 20:36:29 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
50f7fc4f7a99d874af86e4a874067ba3a7760c42

Bug 697545 : Update PCL to return error codes (Patch V).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pcl/rtraster.c
pcl/pl/plchar.c
pcl/pl/plht.c
pcl/pl/pllfont.c


2018-02-23 18:02:47 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
0edcf910b80a1656c9441f32bd1770d2600ab915

Bug 697545 : Update PCL to return error codes (Patch IV).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pcl/pginit.c
pcl/pcl/pginit.h
pcl/pcl/pglabel.c
pcl/pcl/pglfill.c
pcl/pcl/pgmand.h
pcl/pcl/pgmisc.c
pcl/pcl/pgpoly.c
pcl/pcl/pgvector.c


2018-02-22 20:34:53 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
9f90d1361564289e6dbe56863a5fe1be1ca28f83

Bug 697545 : Update PCL to return error codes (Patch III).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pcl/pgchar.c
pcl/pcl/pgconfig.c
pcl/pcl/pgdraw.c
pcl/pcl/pgfdata.c
pcl/pcl/pgfont.c
pcl/pcl/pgframe.c


2018-02-23 14:35:57 +0000
Ken Sharp <ken.sharp@artifex.com>
6375e295893a71b5695fba2ca117747e326c8ec2

pdfwrite - gracefully handle inappropriate PDFA command line

If a user sets -dPDFA, but does not set ColorConversionStrategy, and
then processes an input file which has a DeviceN space with an alternate
space which does not match the ProcessColorModel, then we would write
an invalid PDF file (invalid function for the colour space).

Now technically this shouldn't happen, but we can guard against this
specific user error by spotting the problem and returning a rangecheck
error instead, which will cause the earlier code to fall back to
writing a device colour instead.

No diffrences expected.

devices/vector/gdevpdfc.c


2018-02-20 22:13:51 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
03607549d598b14ebbb6d4aea9591e10fc35c6cc

Bug 697545 : Update PCL to return error codes (Patch II).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pcl/pcsfont.c
pcl/pcl/pcsymbol.c
pcl/pcl/pctext.c
pcl/pcl/pctop.c
pcl/pcl/pcuptrn.c


2018-02-20 18:40:37 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
de2c3c2c536d5aff97091b146ed259270228dcb9

Bug 697545 : Update PCL to return error codes (Patch I).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pcl/pccolor.c
pcl/pcl/pcdraw.c
pcl/pcl/pcfontpg.c
pcl/pcl/pcindxed.c
pcl/pcl/pcjob.c
pcl/pcl/pcmacros.c
pcl/pcl/pcpalet.c
pcl/pcl/pcparse.c
pcl/pcl/pcpatrn.c


2018-02-14 17:26:23 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
8f2f27a730fc7ba76847d39fc46d6d7183cd27a3

Bug 697545 : Fix memory leaks during font loading.

Fix memory leaks for numerous allocation events.

Error created using :-
MEMENTO_FAILAT=1564 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gstype42.c
base/gxfapi.c
pcl/pl/plfapi.c
pcl/pl/plfont.c
pcl/pl/pllfont.c


2018-02-18 16:05:18 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
cceb3db394d9547d309f596001b02c63dec4d7f5

Bug 697545 : Fix memory leak in gx_path_new.

During a memory allocation event failure the orginal path would not be
decremented and hence become orphaned.

Error created using :-
MEMENTO_FAILAT=8959 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gxpath.c


2018-02-19 15:43:20 +0000
Ken Sharp <ken.sharp@artifex.com>
3f5736cb8a255cdfe00d59896dc39d050d1db00e

Add more bounds checking to type 2 font interpreter

Bug #699042 "stack out of bounds read in gs_type2_interpret, gstype2.c line 701"

The warning is caused by 'csp' being below the cstack bottom bound.
Adding a check for that prevents this warning. While we're here, add
checks to the bounds of 'transient_array' which wasn't being checked
previously.

base/gstype2.c
base/gxtype1.h


2018-02-19 14:26:29 +0000
Ken Sharp <ken.sharp@artifex.com>
cc2bfef83b1dca09e016e43238f71ca6c7a622b3

PDF interpreter - fix ToUnicode processing of bfrange with high byte set

Bug #699041 "Cyrilic text not respected"

The title is a misnomer, the problem is not Cyrillic fonts as such.

The example file has an unusually complex ToUnicode CMap, which includes
bfrange entries where the CID has a value > 0xFF. The code in pdf_font.ps
to create our internal GlyphNames2Unicode table was adding the 'offset'
(The high byte of the index) to the CID, which basically means we were
adding the high byte twice (the key already included the high byte).

Fix this by simply not adding the offset to the keys.

Its surprisingly hard to find examples of this, I can't immediately see
any in our test suite. I have gone through some of the files which
have been reported as problems with ToUnicode processing in the past
but none of them fall into this condition.

A couple of files show difference, but these are irrelevant, they are of
the 'wrong before, differently wrong now' category.

Resource/Init/pdf_font.ps


2018-02-18 14:18:10 +0000
Ken Sharp <ken.sharp@artifex.com>
eb2aa457387429b84c043430354b8476ac918961

Squash a couple of build warnings

Sort out negation of the PDFA flag

Ensure a variable is initialised under all conceivable circumstances

devices/vector/gdevpdtd.c
devices/vector/gdevpdtt.c


2018-02-16 19:32:11 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f006720c87026a67cdcaeab983fe888d4401cb0e

Bug 697545 : Prevent SEGV by returning error codes.

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

Error created using :-
MEMENTO_FAILAT=8961 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pgconfig.c
pcl/pcl/pgframe.c


2018-02-16 18:56:23 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
833333a6df506ad9525bb797245042442a0f31cb

Bug 697545 : Prevent SEGV in palette_do_reset.

Prevent SEGV when trying to access contents of empty palette.

Error created using :-
MEMENTO_FAILAT=8956 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pcpalet.c


2018-02-16 18:39:30 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
0ebfdae6fceedbbe7036c487916193b4349d4dd3

Bug 697545 : Fix memory leak in alloc_indexed_cspace.

Fix memory leak for allocation event 8953.

Error created using :-
MEMENTO_FAILAT=8954 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pcindxed.c


2018-02-13 15:53:09 -0800
Ray Johnston <ray.johnston@artifex.com>
9f9daedfdf98bab590eba53e34fba76b96307ec0

Fix Bug 698969 SEGV caused by overflow in mark_line_*** functions

Clipping needs to be performed in 64-bit to allow for the original
line segment being larger than can fit in signed 32-bit.

base/gxscanc.c


2018-02-16 10:29:00 +0000
Ken Sharp <ken.sharp@artifex.com>
ad07c06b7f898eeb663ee7eed336c2c602a91551

pdf_info.ps - check for null DescendantFonts after oforce

pdf_info.ps was modified to check for circular references when resolving
indirect objects. Now if we find recursion we return a null.

However, we weren't checking that when resolving DescendantFonts which
could lead to a typecheck error if we had two different CIDFonts on
the same page, and the CIDFonts used the same DescendantFonts array
(which is silly, of course).

toolbin/pdf_info.ps


2018-02-15 10:15:28 -0700
Henry Stiles <henry.stiles@artifex.com>
6a8c1d6be02fc7020ab4cf5cfbecf91790f7dc10

Bug 696654 - PCL/PXL fails to build with system-shared libjpeg.

Remove the HP CLJ 3500/3500/3600 emulation until it can be properly
integrated with libjpeg.

base/gdevpxat.h
base/gdevpxen.h
pcl/pxl/pxl.mak
pcl/pxl/pxptable.c
pcl/pxl/pxsessio.c
pcl/pxl/pxstate.h
pcl/pxl/pxvendor.c
pcl/pxl/pxvendor.h


2018-02-15 14:36:10 +0000
Ken Sharp <ken.sharp@artifex.com>
094aebef5c058ad312e5d2bfd46d897c21fac398

pdfwrite - remove dead code

Commit efb9bf3949617b4c733a6dcce04acd142c50115d changed the flow of
control to avoid going through code which could not work, since it left
a variable unassigned (and didn't do any part of the work that would
be required to give the variable a sensible value).

That left some code unreachable leading to a coverity warning (Coverity
ID 262411). I was unable to find any way to trigger the original
condition, and the code as it stands should at least work, even if it
might be sub-optimal in some cases. So remove the dead code to prevent
the warning, if this needs fixing in future there will need to be more
code written anyway.

devices/vector/gdevpdfb.c


2018-02-15 09:02:01 +0000
Ken Sharp <ken.sharp@artifex.com>
4384f85cbb9383cbeefea80e45e8893a5d64c7af

PDF interpreter - remove a debug pstack

accidentally left some debugging code in place, remove it now.

Resource/Init/pdf_main.ps


2018-02-14 17:01:21 +0000
Ken Sharp <ken.sharp@artifex.com>
7d1b64fe9474d4c1e6d5f4185c77cb42a8ac5bc0

Remove a long obselete C source file

Also remove a documentation reference and Windows project references

doc/Develop.htm
psi/zhsb.c
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-02-14 17:26:23 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
ecf45b80c55bc79c17bed5143426cd9f8060ec2f

Bug 697545 : Fix memory leaks during tt font loading.

Fix memory leak for allocation event numbers 1551, 1552 and 1553.

Error created using :-
MEMENTO_FAILAT=1554 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/plfont.c
pcl/pl/pllfont.c


2018-02-14 15:38:42 +0000
Ken Sharp <ken.sharp@artifex.com>
bb8f0822a31e0e976cb659000532fde2fdbccd8c

PDF interpreter - detect and ignore circular references in Outlines

Bug #699029 "infinite loop on pdfium test file"

If the /Next in an Outline points to any previously encountered
Outline entry, terminate processing of Outlines and warn the user.

Resource/Init/pdf_main.ps


2018-02-14 10:28:37 +0000
Ken Sharp <ken.sharp@artifex.com>
06ceaa2715fcbe2056214b0f958edc7deb4fa085

pdfwrite - improve stack bounds checking on font interpreters

Bug #699020 "stack buffer underflow (read) in gs_type2_interpret / gstype2.c line 567"

The internal type 1 and type 2 font interpreters are only used by
the vector devices (in particular pdfwrite), for rendering we use
FreeType.

This commit improves the bounds checking of the operand stacks used
by these interpreters, to catch more cases of badly formed or
corrupted fonts and throw an error in these cases.

This addresses the stated bug, but should actually prevent a lot
more problems which we haven't yet seen test cases for.

base/gstype1.c
base/gstype2.c
base/gxtype1.h


2018-02-13 12:00:10 +0000
Ken Sharp <ken.sharp@artifex.com>
c1a8dc52c0e320c41d04b6f32086622150962d61

fix commit bcef41ad72a16472a3003d357bf8d8680174ab85

Accidentally left currentdict on the operand stack afetr startup.

Resource/Init/gs_init.ps


2018-02-13 10:48:16 +0000
Chris Liddell <chris.liddell@artifex.com>
16586a6a0d8fac17d5201f102e0775e527d3a529

Bug 699019: bounds check stack access in Type 2 vmoveto

base/gstype2.c


2018-02-13 10:22:56 +0000
Ken Sharp <ken.sharp@artifex.com>
bcef41ad72a16472a3003d357bf8d8680174ab85

PS interpreter - fix setpagedevice with -dDELAYBIND

When a user sets a fixed resolution using -r, then the setpagedevice
code looks for the existence of a /HWResolution key in the page device
dictionary and attempts to remove it using .undef to prevent the
resolution being altered.

However, if DELAYBIND is set, then the .undef operator is removed
before .bindnow is run, which means that, when setpagedevice executes,
the .undef operator is not defined.

So add the same code for .undef as we use for other similar operators
(eg .forceundef), don't remove the definition if DELAYBIND is set, but
do remove it when .bindnow executes.

This is, of course, a security hole, but then the whole DELAYBIND
situation is.

While we are here, add a key /NOBIND with the value false to systemdict.
This is because some ancient, badly-behaved and no longer maintained
software checks this key unconditionally, if its not present it fails
with an undefined error. Setting it to false pacifies that software.

Resource/Init/gs_init.ps


2018-02-13 08:52:32 +0000
Chris Liddell <chris.liddell@artifex.com>
310a0bcaba3527903fc66fed2984f30d0bd4e4ab

Bug 699016: add stack bounds check for Type 1 seac

The macro for checking the stack bounds is now called from both the Type 1 and
Type 2 charstring code, so move it to a common header, and tweak the name to
fit.

base/gstype2.c
base/gxtype1.c
base/gxtype1.h


2018-02-13 08:35:22 +0000
Chris Liddell <chris.liddell@artifex.com>
9bbf14bc7210bc54613b0f64a5ad95368891982a

Bug 699015: bounds check stack for Type 2 callsubr

base/gstype2.c


2018-02-12 21:47:29 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
0e9ba7084176c7834db00927a8326310c6b83a67

Fix memory leak in xps_imp_set_device.

The param list can become orphaned if an error occurs early on in the code.

xps/xpstop.c


2018-02-11 20:44:04 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
5e9639e974afaa89027a5ccd573e50ff98e3ca3f

Bug 697545 : Fix memory leak in pcl_load_built_in_symbol_sets.

Fix memory leak for allocation event number 1266.

Error created using :-
MEMENTO_FAILAT=1267 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pcsymbol.c


2018-02-11 20:20:36 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
3e4c6beff724a4e0078a48e6f5200c23ae73f52b

Bug 697545 : Fix memory leak in pl_top_create_device.

The param list can become orphaned if an error occurs early on in the code.

Error created using :-
MEMENTO_FAILAT=676 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/plmain.c


2018-02-12 15:23:19 +0000
Chris Liddell <chris.liddell@artifex.com>
a4445fe0a312af901a79d6f41ace975a50d88a31

Bug 699012: bounds check point index in Move_Zp2_Point()

base/ttinterp.c


2018-02-12 12:05:44 +0000
Chris Liddell <chris.liddell@artifex.com>
e7abbb92e92ba326b4fc06491bd3c3cde61932b3

Bug 699013: Check glyph has a contour before accessing it.

in Ins_IUP()

base/ttinterp.c


2018-02-12 15:20:23 +0000
Ken Sharp <ken.sharp@artifex.com>
edf3684305414731fbdb9b90de7dbcbab0dace5f

Fix comments

The comments in zinitgrpahics and the PostScript definition of
initgraphics in gs_cspace.ps were incorrect, now that gs_initgraphics
does reset the colour space properly.

However, we do still need the /initgraphics override in gs_cspace.ps
in order to correctly set the colour space which we store in the
'interpreter' graphics state. We only use that to hand back in response
to a currentcolorspace, but we do need it.

Resource/Init/gs_cspace.ps
psi/zgstate.c


2018-02-12 13:47:18 +0000
Ken Sharp <ken.sharp@artifex.com>
b7a0556297296d8355748b9b130de02923a1c4cd

Check for error case in gs_cspace_new_ICC()

If we fail to allocate memory for a new colour space, simply return
NULL, don't try to use the failed allocation!

base/gscspace.c


2018-02-12 12:21:50 +0000
Ken Sharp <ken.sharp@artifex.com>
7a708d9fdcba9efbe21f236830e47eb4f4085672

More work with initgraphics

Firstly, remove the kludgy gs_initgraphics_no_cspace() and have the
PostScript operator zinitgraphics() call gs_initgraphics().

This meant fixing the gs_initgraphics routine; the previous commit
d527031607a881237819835c2b1045c81e24c387 simply overwrote the existing
colour spaces in the graphics state with the new DeviceGray space. This
could lead to memory leaks if the previous colour space had been
reference counted up. So now we call gs_setcolorspace instead, which also
correctly sets the current colour.

This led to the interesting discovery that the null brush in PXL has
never been handled properly by the high level devices. This is
handled by the PXL interpreter setting a DeviceGray colour space, and
then directly editing the device colour 'type' field and setting it to
'typ_null'. This doesn't seem like the best way to proceed to me, I
would have expected us to push the nulldevice, but its what is done.

No in gx_hld_is_hl_color_available() the code simply tested whether
the device color 'ccolor_valid' flag was set. Since the PXL interpreter
simply stomped on the type field, and did not update any of the other
fields, the result of this was unknown. Sometimes we would decide it
was valid, and sometimes not. If we did decide it was valid then we
used the DeviceGray space and colour (0, black) which was also set up
by the null brush code to draw the object, which means that we could
end up drawing objects which should not be drawn.

'Fixed' this by having the code explicitly test for the device color
type being 'null' as well as being valid. In passing, it did appear
to me that we do not always update the ccolor_valid flag in the device
color structure, which may well lead to more problems of this kind.

This does result in a number of differences in the output. Mostly
these are due to the error page now always being rendered in DeviceGray
which results in a slightly (invisible) difference in printed gray text.
A very large number of the Quality Logic files exhibit progressions
due to the fact that we are now correctly processing the null brush.

base/gsstate.c
base/gxhldevc.c
psi/zgstate.c


2018-02-04 18:45:26 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
1af4fced38d9d842195e5635c9e0aa4b5e13f21b

Bug 697545 : Fix memory leak in pcl interpreter.

If an error occurs during pl_set_device then the new interpreter is partially
set up but the old interpreter is still listed as current so the cleanup
code does not reclaim the partially set up memory. The patch ensures the
correct interpreter is cleaned up and also zeros out unset fields to prevent
a SEGV during memory freeing.

Fix memory leak for allocation event number 1265.

Error created using :-
MEMENTO_FAILAT=1266 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pctop.c
pcl/pl/plmain.c


2018-02-10 22:28:04 -0800
Ray Johnston <ray.johnston@artifex.com>
98d8f8d12a40bf36f0acdaefc0c63a7562326cab

Fix compile warning about possible uninitialized procedure pointers

Setting to NULL is OK since it will trigger a SEGV, but it looks
like the code will always set the procedures if it needs the source
colors.

base/gdevmpla.c


2018-02-10 11:43:15 -0800
Ray Johnston <ray.johnston@artifex.com>
2fe4c53757ef143071517216cacdbb228dfc4243

Fix compiler warning: mlut_size

This is OK because mlut_size is only used when 'clut' is non-NULL
but if so, it is initialized in line 1179.

base/gsicc_create.c


2018-02-10 11:28:48 -0800
Ray Johnston <ray.johnston@artifex.com>
d3fb0f876971f604597c10519259520a8035cb58

Fix gcc warning: gscms_is_threadsafe prototype

base/gsicc_cms.h
base/gsicc_lcms2.c
base/gsicc_lcms2art.c


2018-02-06 11:53:24 -0800
Ray Johnston <ray.johnston@artifex.com>
01a71ecbfe576d0a840946a0089f23ce131e995d

Change from CMM_THREAD_SAFE #define to a gscms_is_threadsafe function

In preparation for enabling sharing the profiles and link cache among
rendering threads, switch from a compile time flag to a function that
is returned by the CMS interface module linked in (e.g gsicc_lcms2.c)

This avoids more build machinery to propagate the flag, and ensures
that the flag won't be mis-matched to the CMS in use.

Also flag a few FIXME places identified that relate to multi-threaded
sharing of profiles and the profile link cache. Initially, even though
lcms2art is thread safe, return "false" until the multi-threaded
rendering works.

base/gdevp14.c
base/gsicc_cms.h
base/gsicc_lcms2.c
base/gsicc_lcms2art.c
base/gxcldev.h
base/gxclthrd.c


2018-02-10 10:59:29 +0000
Ken Sharp <ken.sharp@artifex.com>
da66356a665432f998642b2e9c45756f876f0996

PCL interpreter - correctly identify high level devices

Pointed out by Chris, the code in here explicitly tested the name of the
device to decide if it was a high level device. We deprecated that
approach some time ago, replacing it with a spec_op call instead.

The comment said 'this needs a better solution' and this is it.

Should work correctly now with any device which identifies itself as a
high level device.

pcl/pl/plmain.c


2018-02-08 13:57:54 -0700
Henry Stiles <henry.stiles@artifex.com>
4b4a301c90a8905d6b7ba703342ddc9cb1c8ff69

Fix 694689 - Seg faults found by fuzzing.

Allow clients of the decompression routines to pass in a parameter to
indicate no further input or output is expected. The decompression
routines should produce an error if the parameter is set and more
processing is needed. The pattern code uses this to indicate indicate
the final scanline has been processed, it is not needed by the image
code.

pcl/pxl/pximage.c


2018-02-07 17:03:04 -0700
Henry Stiles <henry.stiles@artifex.com>
8e4764d61562a44c77920ee67884ca846184b25c

Add line pointer to the pattern enumerator.

This tracks the scan line position within the pattern while reading,
simplifying bounds checking.

pcl/pxl/pximage.c


2018-02-05 13:28:52 -0700
Henry Stiles <henry.stiles@artifex.com>
faef871274167e12e93fc24026096474d00b794d

Remove pushed argument.

No need to push the filename simply run the file and use a do while
loop.

pcl/pl/plmain.c


2018-02-02 10:35:28 -0700
Henry Stiles <henry.stiles@artifex.com>
f29e2296e81378ed42b93215137361ab586b2393

Warning cleanup.

pcl/pcl/pcpalet.c
pcl/pcl/pcparse.c
pcl/pcl/pglabel.c
pcl/pl/pllfont.c
pcl/pxl/pxtop.c


2018-02-07 21:08:46 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
b808ea741efe357cf71254d9064e782dfd753584

Bug 697545 : Fix memory leak in gs_state_alloc.

The colour allocation code in gs_gstate_alloc was being repeated in the call
to gs_initgraphics leading to the first set of allocated colours becoming
orphaned. Given that gs_initigraphics is always called from gs_gstate_alloc
the duplicate code can be safely removed.

Error created using :-
MEMENTO_FAILAT=419 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsstate.c


2018-02-06 18:04:07 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
98e5b234b27d82e52d660a9e0bfc6c14e3d7a5cd

Bug 697545 : Prevent SEGV in pcpage_do_reset.

Prevent SEGV if memory allocation fails and returns a NULL paper size.

Error created using :-
MEMENTO_FAILAT=1215 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pcpage.c


2018-02-07 15:46:28 +0000
Ken Sharp <ken.sharp@artifex.com>
10dcb4943e552a3d53fbaf0b4e8741258238f7a7

Handle a potential error condition in PXL

Bug #698995 "Fixing error returns in gxicolor.c can cause PXL to enter an infinite loop or seg fault"

This started off as a fix to a scanbuild warning and spiralled somewhat.

Fixing gs_image_class_4_color() so that it didn't ignore an error return
led to the possibility of the PXL interpreter seg faulting or ending up
in an infinte loop.

Initially this turned out to be because gs_initgraphics() was no longer
setting the colour space to the proper default, leading to us trying
to use the very pattern space which failed. That was fixed in the
previous commit.

After that it turned out that in an error condition we were freeing
an image enumerator twice. This didn't seem to cause the PostScript
interpreter a problem, though it seems likely it did really, it simply
didn't exhibit before the interpreter exited. The PXL interpreter
however threw an error in the memory manager rather rapidly.

Fixed that by not calling gx_default_end_image in gx_enum_begin()
when we hit this particular error condition (no handler for an image).

This removes one of the free instances, and seems more reasonable anyway
it seems wrong to end an image we haven't yet begun.

This allows us to now propagate the error up from px_remap_pattern
without causing a seg fault or infinite loop. (finally)

base/gxipixel.c
pcl/pxl/pxink.c


2018-02-07 09:55:41 +0000
Ken Sharp <ken.sharp@artifex.com>
d527031607a881237819835c2b1045c81e24c387

Alter gs_initgraphcis to once again set the colour space and colour

At some time in the past gs_initgraphics was altered for 'colour substitution'
so that it did not reset the colour space and current colour. This is
surprising because the PostScript initgraphics operator is supposed to
do exactly that.

Restoring the code resulted in many seg faults with the PDF interpreter
so this is obviously a requirement, even though I can't see why.

However, leaving gs_initgraphics as it is would mean that (as per the
comment above the procedure) that all the interpreters (clients) would
have to reset the colour space and colour after calling it, which is
entirely unreasonable. Not only that, it hasn't been done leading to
the PXL interpreter printing error pages in the wrong colour.

This commit restores the setting of the colour space and colour to
gs_initgraphics, but introduces a new gs_initgraphics_no_cpsace()
procedure to be called from zinitgraphics, which behaves exactly as
the modified gs_initgraphics did, and does not set the colour space
or colour values.

The PDF interpreter now continues to work and the PXL interpreter now
prints a number of error pages in black where it previously was using a
pattern, grey or in one case green colour.

base/gsstate.c
base/gsstate.h
psi/zgstate.c


2018-02-07 09:49:34 +0000
Ken Sharp <ken.sharp@artifex.com>
28c58b4114ec145b8597372b6e29cec9e1f5df15

Yet more scanbuild warnings

gxhintn.c remove some unnecessary assignemnts

gxicolor.c remove an assignement, add an error check

gximono.c add an error check

gxiscale.c refactor code to remove some unnecessary assignments

gdevpsft.c remove unnecessary assignment

base/gxhintn.c
base/gxicolor.c
base/gximono.c
base/gxiscale.c
devices/vector/gdevpsft.c


2018-01-29 15:32:34 +0000
Robin Watts <robin.watts@artifex.com>
1b1015dc0e07b5269c4ee2009d5b896702550a3a

Tweak scale parameters in structure.

Be consistent with naming. Add PatchHeightOut and TopMarginOut so
we have the complete set. These are required for forthcoming work.

base/gxiscale.c
base/sidscale.c
base/siscale.c
base/sisparam.h
devices/vector/gdevpsdi.c


2018-02-02 12:48:07 +0000
Robin Watts <robin.watts@artifex.com>
38e0c643e62087c089c59c9ad44fc468dd09cd37

Tweak bitmap interpolater patch size.

When we interpolate an image, we restrict the interpolation to
the "patch" of the destination image that is actually visible.
Previously, the calculation of this patch has been inaccurate,
resulting in a larger area being decoded than was actually
needed.

While this extra work was largely mitigated by the "Active" area
detection code, it has meant that the contribution calculations
within the scaler were 'wrapping' the outside pixels in the
region to avoid accessing out of bounds.

This upsets the new library we are working on to do the scaling,
and it's basically inelegant. Instead we fix the destination
patch calculations so that the patch is correctly sized based
upon the available source data. This is safe to do because we
know the source data was already expanded.

base/gxiscale.c
base/sisparam.h


2018-02-06 11:46:56 +0000
Ken Sharp <ken.sharp@artifex.com>
f6005484617ada241d2f5f4deee4808616474831

Address more scanbuild/gcc/clang warnings

gdevkrnlsclass.c Change a while...do into a do...while to see if it
pacifies a 'dereference of NULL pointer' in scanbuild

gsparamx.c Incorrect return code could lead to an earlier error not
being preserved. Fortunately this is currently only called by claptrap.

gsptype1.c remove unnecessary assignments
gssprintf.c " " "
gstype2.c " " "
gstype42.c " " "
gxfill.c " " "

gsptype2.c rejig the code to avoid setting a return code that isn't used.
Add a check on a return code that was missing.

gxchar.c add return code checking
gxcmap.c " " " "

base/gdevkrnlsclass.c
base/gsparamx.c
base/gsptype1.c
base/gsptype2.c
base/gssprintf.c
base/gstype2.c
base/gstype42.c
base/gxchar.c
base/gxcmap.c
base/gxfill.c


2018-02-06 10:30:32 +0000
Ken Sharp <ken.sharp@artifex.com>
16688a8b833cf4e8950265e933604c32b1f2392e

Address more scanbuild/gcc/clang warnings

gp_os2.c free buffer and close file on memory full (as per other
error conditions).

gscicach.c remove unnecessary assignment
gsdparam.c " " " "
gxfapi.c " " " "

gscscie.c check a return code
zicc.c " " " "
zpcolor.c " " " "

mkromfs.c If realloc should fail in process_path, free working memory
print an error and exit as per other error conditions.

zcolor.c ensure depth cannot be 0. This should not be possible, no
existing code causes this, but its best to be safe and it prevents a
possible unassigned pointer dereference (possibly NULL) which is what
scanbuild complains of. Best to catch this in the interpreter.

base/gp_os2.c
base/gscicach.c
base/gscscie.c
base/gsdparam.c
base/gxfapi.c
base/mkromfs.c
psi/zcolor.c
psi/zicc.c
psi/zpcolor.c


2018-02-05 16:09:28 +0000
Ken Sharp <ken.sharp@artifex.com>
650aae633131396b802b2cae6e09afbd5aae6ad6

Coverity ID #261212

This probably showed up because of Ray's work adding return value
checking. Previously there were probably enough places not checking
the return code for Coverity to decide it was deliberate, now it is
raising a warning.

Add a check and take action on an error return.

psi/zcrd.c


2018-02-05 16:08:25 +0000
Ken Sharp <ken.sharp@artifex.com>
d7a5f0a14e873c7f5f557c4b635f4b4f166b41d2

Coverity ID #261211 - unchecked return value

This probably showed up because of Ray's work adding return value
checking. Previously there were probably enough places not checking
the return code for Coverity to decide t was deliberate, now it is
raising a warning.

Add a check of the return code.

devices/vector/gdevpsdi.c


2018-02-05 15:34:58 +0000
Ken Sharp <ken.sharp@artifex.com>
b8e36896913713f46a43dbbc0c0ed83f34ab4f10

Try to squash 3 identical scanbuild warnings

I think scanbuild is deciding that 'depth' could be less than 0, leading
us to not enter the loop which assigns 'obj'. This is not true, the
depth cannot be less than 0.

Try making 'depth' an unsigned int as a hint to scanbuild, and see if
the warning goes away.

psi/zcolor.c


2018-02-05 15:32:44 +0000
Ken Sharp <ken.sharp@artifex.com>
88e7812d362483d07ce63b47ae75c4852fe01a8f

txtwrite - honour error conditions

2 warnings from scanbuild, we were ignoring a potential error return in
two places.

devices/vector/gdevtxtw.c


2018-02-05 11:55:11 +0000
Ken Sharp <ken.sharp@artifex.com>
9c38c79741193010b23dabceb76996488415bd09

Clean up another scanbuild warning

We increment a local variable just before it goes out of scope, which is
clearly pointless.

devices/vector/gdevpsft.c


2018-02-05 11:54:14 +0000
Ken Sharp <ken.sharp@artifex.com>
0b4c59be1793c81e9d8cfeba04e74b6020571f5d

Fix another scanbuild warning

We don't seem to have any test cases which hit this, but it does look
possible from the code that we can end up trying to dereference
p_tile, and we don't check to see if its not NULL, which we do in a
lot of other places in this fucntion.

To be safe, test it first and return an error if its NULL.

devices/vector/gdevpdfv.c


2018-02-05 10:39:21 +0000
Ken Sharp <ken.sharp@artifex.com>
5d9d4bc1bbd272478bb9fd24fc1c0e44b0edc22a

Remove an unused function, clear a scanbuild warning

The function cos_write_stream_from_pipeline was never used, so remove
its definition.

At the same time try to squash a harmless scanbuild warning. We us a
'while(s....' loop to try and find a stream, scanbuild regards this as
implying that 's' might be NULL *initially*, which is not true. This
leads to a 'NULL pointer dereference' warning in the line after the
loop, because scanbuild thinks we can get to s->state with s being an
inital NULL.

Since we already check for s becoming NULL inside the loop, we don't
need to check it in while condition.

devices/vector/gdevpdfo.c


2018-02-05 10:35:16 +0000
Ken Sharp <ken.sharp@artifex.com>
43b2b593743433f45590b02b788c54d6bcf563a7

Prevent potential garbage pointer dereference

Picked up by scanbuild, if pdf_enter_substream failed then pres would be
left uninitialised, but we would then try to dereference it and assign a
value to a member before acting on the error return code.

Change the order of execution to test the return code first.

devices/vector/gdevpdti.c


2018-02-05 09:43:01 +0000
Ken Sharp <ken.sharp@artifex.com>
efb9bf3949617b4c733a6dcce04acd142c50115d

Remove faulty code picked up by scanbuild

scanbuild correctly warned that a variable was uninitialised. In fact
it looks to me like the code that was flagged simply can't work.

Fortunately it isn't exercised by any files in our test suite, and has
never been reported as a bug, so its clearly an uncommon (perhaps even
impossible) case.

All the same, lets fall back to the default handling if we hit it,
because at least that works, which the old code definitely didn't.

devices/vector/gdevpdfb.c


2018-02-05 09:40:50 +0000
Ken Sharp <ken.sharp@artifex.com>
ba6d8c5ec0fa27822041cb3bbc620e531fabcf0a

remove a scanbuild warning

We don't care about errors in this case, we are already aborting due
to an error. So just discard the status return.

devices/vector/gdevpdfj.c


2018-02-03 10:46:23 +0000
Ken Sharp <ken.sharp@artifex.com>
b119c51e5ce8d671bc33e38b7ebf7a5bdf5f9af5

Remove unused variable

another scanbuild warning

base/gsdevice.c


2018-02-03 10:26:18 +0000
Ken Sharp <ken.sharp@artifex.com>
dde422bb086ce0b2f56609fa3fc9af87867fc757

partially revert 07f9da3cb5647b18458cd52d1be35ab5365790eb

This was a scanbuild false positive, the original code was in fact
correct.

base/gdevkrnlsclass.c


2018-02-02 15:29:09 +0000
Ken Sharp <ken.sharp@artifex.com>
fa4941c607680159ed62bfe79b754a099adf5a4e

squash more scanbuild warnings

check some return values.

Remove some initialisations that aren't required.

Remove soem unused variables.

base/gsdparam.c
base/gsfunc0.c
base/gsht.c
base/gsht1.c


2018-02-02 14:43:23 +0000
Chris Liddell <chris.liddell@artifex.com>
3f38e3eeb6e6e7d88abbe1dca7675e237d5274e7

Remove spurious semi-colons introduced in 63f0fcc87e7c

I mistakenly left the trailing semi-colon in the macros defining the contents
of two pairs of structures.

Oddly, this caused a warning on VS2017, but not gcc/clang.

Thanks to Shailesh Mistry for pointing it out.

pcl/pl/pjparse.c


2018-02-02 13:11:05 +0000
Chris Liddell <chris.liddell@artifex.com>
452efeca35ee7e3fe381cae9a71d6efbcce68cd0

Address warning in gdevbit.c

Fix the "missing braces in initializer" warning - the explicit declaration of
the gs_bitrgbtags_device initializer had gotten out of step with the
gx_device_printer_s definition.

devices/gdevbit.c


2018-02-02 14:10:44 +0000
Ken Sharp <ken.sharp@artifex.com>
9036e05dfbcfa7968e00a53ef7ae9f6146740e94

Remove the 'device filter chain'

This was an early attempt to allow the possibility of 'chaining'
devices together. I believe it was never actually completed, although
the stack existed and was carefully preserved in the graphcis state,
the only code which accessed it was '.popdevicefilter'.

No C code or PostScript code ever actually pushed a device onto the
device filter stack, and nothing ever examined the stack to pass
operations through the 'chain'.

Since its been superseded by device subclassing, and didn't actually
seem to do anything anyway, remove it altogether. In addition to
removing clutter this also reduces the amount of 'magic' surrounding
reference counted objects in gstates.

base/gdevp14.c
base/gsgstate.c
base/gsstate.c
base/gxgstate.h
base/lib.mak
doc/Develop.htm
doc/who_owns_what.txt
psi/int.mak
psi/zdfilter.c
psi/ztrans.c
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-02-02 11:55:05 +0000
Ken Sharp <ken.sharp@artifex.com>
154f27478bdf5b27858a9f446433d5b62febb89d

remove some unused code - scanbuild warnings....

base/gsdevice.c


2018-02-02 11:17:19 +0000
Ken Sharp <ken.sharp@artifex.com>
84370aa9d391c37eccd467760c471e99e355a8ec

Fix some debug prints - scanbuild warning fix

The number of parameters and number of format specifiers didn't match,
this would only be apparent when built with DISPLAY_DEBUG defined.

psi/dpmain.c
psi/dwmainc.c


2018-02-02 11:16:11 +0000
Ken Sharp <ken.sharp@artifex.com>
1552615d4ae39a50a5f7bb40e5f481919ef0cb58

Fix memory leak - scanbuild warning

Not really a leak as such, but it prevents the warning.

psi/apitest.c


2018-02-02 11:15:13 +0000
Ken Sharp <ken.sharp@artifex.com>
ab8d4f968c01900e94438575ce33ae7a4fd63167

LCMS2art - fix some warnings from scanbuild

Make three functions static, to avoid 'no prototype' warnings.

lcms2art/src/cmsalpha.c
lcms2art/src/cmssamp.c


2018-02-02 09:45:39 +0000
Ken Sharp <ken.sharp@artifex.com>
0c9d19b947f9ca5bfe6ed1ba221e303d60bfc0cb

Remove the Mitsubishi CP50 colour dot matrix printer device

Recent changes caused this device to enter clist mode more frequently
and our automated testing revealed that in clist mode this device
does not work. It calls a device method which should never be called.

Its possible to remove the call, but we have no way to determine whether
the resulting output actually works.

Given the age of this device (and Mitsubishi have reused the model
number for a different device, so it must be old) we are removing
support for this device and deleting it fro the build.

If someone is still using this device, we'll reinstate support if they
are prepared to test the outptu for us.

base/unix-gcc.mak
configure.ac
devices/contrib.mak
devices/gdevcp50.c
doc/Develop.htm
psi/msvc.mak
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-02-02 08:54:35 +0000
Chris Liddell <chris.liddell@artifex.com>
252527b4257133a722f4f03dce1e8abcbcc3f3c8

Fix jmp_buf related compiler warning (setjmp_.h)

The compiler (gcc/clang) considers the alignment of entries in a structure to
be a run-time "variable", thus gives a warning when that value is used to
size an array used in a globally available data type.

The solution (suggested by Robin) is to use a buffer twice the size of a jmpbuf,
thus guaranteeing we have enough space to offset into the buffer, and get the
required alignment.

base/setjmp_.h


2018-02-01 14:56:31 +0000
Chris Liddell <chris.liddell@artifex.com>
f52a7ccf96f1b9bb90194ba1dd6a50040dd63896

Fix debug flag for TTF loading

Two places were erroneously using PDFDEBUG instead of TTFDEBUG

Resource/Init/gs_ttf.ps


2018-02-01 09:46:21 +0000
Chris Liddell <chris.liddell@artifex.com>
5b546c80e79e6d1f1c6c3a9a71bfb58ee23a328c

Address the popen prototype warning

Only include the hacky popen() prototype if it doesn't already exist in the
standard header files.

Makefile.in
base/pipe_.h
configure.ac


2018-02-01 11:40:20 +0000
Ken Sharp <ken.sharp@artifex.com>
88aea05567f36d4d37c00a51b818c80f88291f6b

Remove another unused procedure from the OpenJPEG interface

base/sjpx_openjpeg.c


2018-01-31 09:56:46 +0000
Chris Liddell <chris.liddell@artifex.com>
63f0fcc87e7c6a0ca38e92b7b3d72f1e936f2d0e

Fix discarded qualifier warnings in pcl/pl/pjparse.c

Create separate structure definitions for the normal and default PJL
environment and PJL font sources data.

The only difference between the two is the default one qualifies string
values as const.

pcl/pl/pjparse.c


2018-01-31 11:59:02 +0000
Chris Liddell <chris.liddell@artifex.com>
4d2f9f48fc272b7bb396f36704de03a7c15d2b3f

Fix _MSC_VER undefined warnings on non-MSC compilers

lcms2art/src/lcms2_internal.h


2018-01-31 10:22:34 +0000
Chris Liddell <chris.liddell@artifex.com>
b272292d9294e88e32d177d8b5e916f8bfaeb78b

Add a zlib specific CFLAGS and avoid discarded const warning

zlib has a table initialization with string literals that gcc
automatically makes const, but the structure definition for the table does not
qualify those entries as const. Hence we get warnings.

This adds ZLIB_CFLAGS and, with a gcc compatible compiler, sets it to:
-Wno-write-strings

which kills that warning.

Done this way because we want to retain that warning in the Ghostscript code.

Makefile.in
base/zlib.mak
configure.ac


2018-01-31 09:34:39 +0000
Chris Liddell <chris.liddell@artifex.com>
aea7d587749819b7e59d24720efe86b1f8555186

Add a TIFF specific CFLAGS and avoid discarded const warning

libtiff has a large table initialization with string literals that gcc
automatically makes const, but the structure definition for the table does not
qualify those entries as const. Hence we get warnings.

This adds TIFF_CFLAGS and, with a gcc compatible compiler, sets it to:
-Wno-write-strings

which kills that warning.

Done this way because we want to retain that warning in the Ghostscript code.

Makefile.in
base/tiff.mak
configure.ac


2018-01-27 23:11:13 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
865c3a83a449dc2c28f58095183b7493ccd970c4

Update error code checking to use hpgl_call within pgdraw.c file. Also
revert error code check in hpgl_draw_current_path to prevent failures
during cluster run.

pcl/pcl/pgdraw.c


2018-01-27 17:50:41 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
4ae64a398e6d5693c1dd4dd9348054cd21ef2443

Check all return code from param_write_float_array.

pcl/pcl/pcommand.c
pcl/pxl/pxsessio.c


2018-01-27 16:50:23 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
d372efa33d9e2550b887154e2d6a3b9d03bc6438

Check all return codes from pxPassthrough_init.

pcl/pxl/pxpthr.c


2018-01-27 16:27:08 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
cc620400517cd76a5276602aea59f1231f934c46

Check all return codes from pcl_enter_graphics_mode.

pcl/pcl/rtgmode.c


2018-01-27 15:18:02 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
db10b7b56e5de12f92c1df83237ec4ff4b0dcf2a

Check all return codes from pcl_end_graphics_mode.

pcl/pcl/pctop.c
pcl/pcl/rtgmode.c


2018-01-26 22:45:54 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
1df8810b79c5ef5979b1cad5ffe22a1fed824871

Update propagation of error codes from pcl_end_page.

pcl/pcl/pcjob.c
pcl/pcl/pcpage.c


2018-01-26 22:17:36 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e63064cfa3142e7a893a1666570f390d83662360

Update pcl_mark_page_for_character to propagate error codes.

pcl/pcl/pcpage.c
pcl/pcl/pcpage.h
pcl/pcl/pctext.c


2018-01-26 21:57:56 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
6f514a99fdb079d76df981a39dcb45f090766849

Update functionality to propagate error codes.

pcl/pcl/pcpage.c
pcl/pcl/pcpage.h
pcl/pcl/pgdraw.c
pcl/pcl/pglabel.c


2018-01-26 21:20:02 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
193d143d1843edb2515138e6b4b9e7c4f5c06aa5

Update functionality to propagate error codes returned from new_page_size.

pcl/pcl/pcpage.c
pcl/pcl/pcpage.h


2018-01-26 17:59:15 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
0d3c2753172bb9e22aa879d7503ec44f4b33e8f4

Update pcl_transform_rect to remove unused memory variable.

pcl/pcl/pcpage.c
pcl/pcl/pcpatxfm.c
pcl/pcl/pcpatxfm.h
pcl/pcl/rtgmode.c


2018-01-31 15:37:17 +0000
Ken Sharp <ken.sharp@artifex.com>
961b01a6e50e640afac0e696f9ce74a677e648ec

Squash more scan build warnings

Remove initialisations which aren't required (sometimes due to multiple
initialisations.

In interp.c, store the error value in the actual return code.

Action error return codes.

Fix a few white space oddities.

psi/dscparse.c
psi/gs.c
psi/imain.c
psi/interp.c
psi/zcie.c
psi/zcolor.c


2018-01-31 14:47:41 +0000
Ken Sharp <ken.sharp@artifex.com>
7220e8e037ccee1c234872d143ec0ca14682604b

Squash some more warnings

scan build this time, none of them serious.

Check some return codes and remove some unused variables.

devices/gdevpdfimg.c
devices/vector/gdevpdf.c
devices/vector/gdevpdfc.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdft.c
devices/vector/gdevpdfu.c
devices/vector/gdevpsdp.c


2018-01-31 09:59:01 +0000
Ken Sharp <ken.sharp@artifex.com>
68fcaea85611267eec9f4bac3443977fe15627dc

squash GCC warnings

remove an unused variable from a (large) macro in gxfilltr.h

remove some unused variables, and an entire unused function in
sjpx_openjpeg.c

remove an unused variable in gdevbit.c

remove an unused variable in gdevjpeg.c

bracket a variable declaration and usage with #ifdef DEBUG to prevent
the compiler warning that the variable is set but not read on non-debug
builds. gdevxps.c

preserve 'const' when passing a memory pointer to a procedure to
avoid a warning about discarding const. zcie.c

base/gxfilltr.h
base/sjpx_openjpeg.c
devices/gdevbit.c
devices/gdevjpeg.c
devices/vector/gdevxps.c
psi/zcie.c


2018-01-31 09:55:34 +0000
Ken Sharp <ken.sharp@artifex.com>
07f9da3cb5647b18458cd52d1be35ab5365790eb

Device subclassing - fix potential problems

Flagged by scan build, the code to work a chain of devices had a
potential problem in walking up and down the chain.

Also flagged by scan build, the create_compositor method checked the
target child device before trying to use it to set the saved target
color info, but didn't check it before trying to set the procs.

base/gdevdflt.c
base/gdevkrnlsclass.c


2018-01-30 11:49:19 -0800
Ray Johnston <ray.johnston@artifex.com>
67daf3d995d83da98988085e68548a4920fe1747

Get rid of some gcc warnings.

Add initializers for variables that confuse gcc. Also get rid of the
clist_reinit_output_file which was only needed for the RETRYING code
and the partial page rendering (this function had unused variable
warnings). THis should have been part of commit 7eda41b.

base/gxclist.c
base/gxclpath.c
base/gxclrast.c


2018-01-30 16:37:58 +0000
Ken Sharp <ken.sharp@artifex.com>
22cf826fe4d0c0206be582d35c99954199dee999

Update copyright notice with new head office address.

Also update copyright dates.

Remove gs_cmdl.ps as we no longer use it, and remove its entry from
psfiles.htm.

Remove xfonts.htm as this feature (xfont support) is long, long gone.

Makefile.in
Resource/CIDFont/ArtifexBullet
Resource/CMap/Identity-UTF16-H
Resource/ColorSpace/DefaultCMYK
Resource/ColorSpace/DefaultGray
Resource/ColorSpace/DefaultRGB
Resource/ColorSpace/TrivialCMYK
Resource/ColorSpace/sGray
Resource/ColorSpace/sRGB
Resource/Decoding/FCO_Dingbats
Resource/Decoding/FCO_Symbol
Resource/Decoding/FCO_Unicode
Resource/Decoding/FCO_Wingdings
Resource/Decoding/Latin1
Resource/Decoding/StandardEncoding
Resource/Decoding/Unicode
Resource/Encoding/CEEncoding
Resource/Encoding/ExpertEncoding
Resource/Encoding/ExpertSubsetEncoding
Resource/Encoding/NotDefEncoding
Resource/Encoding/Wingdings
Resource/Init/FCOfontmap-PCLPS2
Resource/Init/Fontmap.GS
Resource/Init/gs_agl.ps
Resource/Init/gs_btokn.ps
Resource/Init/gs_cff.ps
Resource/Init/gs_cidcm.ps
Resource/Init/gs_ciddc.ps
Resource/Init/gs_cidfm.ps
Resource/Init/gs_cidfn.ps
Resource/Init/gs_cidtt.ps
Resource/Init/gs_cmap.ps
Resource/Init/gs_cspace.ps
Resource/Init/gs_dbt_e.ps
Resource/Init/gs_diskn.ps
Resource/Init/gs_dpnxt.ps
Resource/Init/gs_dps.ps
Resource/Init/gs_dps1.ps
Resource/Init/gs_dps2.ps
Resource/Init/gs_dscp.ps
Resource/Init/gs_epsf.ps
Resource/Init/gs_fapi.ps
Resource/Init/gs_fntem.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_frsd.ps
Resource/Init/gs_icc.ps
Resource/Init/gs_il1_e.ps
Resource/Init/gs_img.ps
Resource/Init/gs_init.ps
Resource/Init/gs_l2img.ps
Resource/Init/gs_lev2.ps
Resource/Init/gs_ll3.ps
Resource/Init/gs_mex_e.ps
Resource/Init/gs_mgl_e.ps
Resource/Init/gs_mro_e.ps
Resource/Init/gs_pdf_e.ps
Resource/Init/gs_pdfwr.ps
Resource/Init/gs_res.ps
Resource/Init/gs_resmp.ps
Resource/Init/gs_setpd.ps
Resource/Init/gs_statd.ps
Resource/Init/gs_std_e.ps
Resource/Init/gs_sym_e.ps
Resource/Init/gs_trap.ps
Resource/Init/gs_ttf.ps
Resource/Init/gs_typ32.ps
Resource/Init/gs_typ42.ps
Resource/Init/gs_type1.ps
Resource/Init/gs_wan_e.ps
Resource/Init/pdf_base.ps
Resource/Init/pdf_draw.ps
Resource/Init/pdf_font.ps
Resource/Init/pdf_main.ps
Resource/Init/pdf_ops.ps
Resource/Init/pdf_rbld.ps
Resource/Init/pdf_sec.ps
Resource/SubstCID/CNS1-WMode
Resource/SubstCID/GB1-WMode
Resource/SubstCID/Japan1-WMode
Resource/SubstCID/Korea1-WMode
arch/arch_autoconf.h.in
arch/windows-arm-msvc.h
arch/windows-x64-msvc.h
arch/windows-x86-msvc.h
base/all-arch.mak
base/assert_.h
base/bench.c
base/bobbin.c
base/bobbin.h
base/claptrap-init.c
base/claptrap-planar.c
base/claptrap.c
base/claptrap.h
base/ctype_.h
base/dirent_.h
base/dos_.h
base/echogs.c
base/errno_.h
base/expat.mak
base/fapi_bs.mak
base/fapi_ft.c
base/fapibstm.c
base/fapiufst.c
base/fcntl_.h
base/freetype.mak
base/gconf.c
base/gconf.h
base/gdbflags.h
base/gdebug.h
base/gdevabuf.c
base/gdevbbox.c
base/gdevbbox.h
base/gdevdbit.c
base/gdevdcrd.c
base/gdevdcrd.h
base/gdevddrw.c
base/gdevddrw.h
base/gdevdevn.c
base/gdevdevn.h
base/gdevdevnprn.h
base/gdevdflt.c
base/gdevdgbr.c
base/gdevdrop.c
base/gdevdsha.c
base/gdevemap.c
base/gdevflp.c
base/gdevflp.h
base/gdevhit.c
base/gdevkrnlsclass.c
base/gdevkrnlsclass.h
base/gdevm1.c
base/gdevm16.c
base/gdevm2.c
base/gdevm24.c
base/gdevm32.c
base/gdevm4.c
base/gdevm40.c
base/gdevm48.c
base/gdevm56.c
base/gdevm64.c
base/gdevm8.c
base/gdevmem.c
base/gdevmem.h
base/gdevmpla.c
base/gdevmpla.h
base/gdevmplt.c
base/gdevmplt.h
base/gdevmr1.c
base/gdevmr2n.c
base/gdevmr8n.c
base/gdevmrop.h
base/gdevmrun.c
base/gdevmrun.h
base/gdevmx.c
base/gdevnfwd.c
base/gdevoflt.c
base/gdevoflt.h
base/gdevp14.c
base/gdevp14.h
base/gdevpccm.c
base/gdevpccm.h
base/gdevpipe.c
base/gdevplnx.c
base/gdevplnx.h
base/gdevppla.c
base/gdevppla.h
base/gdevprn.c
base/gdevprn.h
base/gdevpxat.h
base/gdevpxen.h
base/gdevpxop.h
base/gdevrops.c
base/gdevsclass.c
base/gdevsclass.h
base/gdevvec.c
base/gdevvec.h
base/gen_ordered.c
base/gen_ordered.h
base/genarch.c
base/genconf.c
base/gendev.c
base/genht.c
base/gp.h
base/gp_dosfe.c
base/gp_dosfs.c
base/gp_dvx.c
base/gp_getnv.c
base/gp_mktmp.c
base/gp_msdll.c
base/gp_msdos.c
base/gp_mshdl.c
base/gp_mslib.c
base/gp_mspol.c
base/gp_msprn.c
base/gp_mswin.c
base/gp_mswin.h
base/gp_nsync.c
base/gp_ntfs.c
base/gp_nxpsprn.c
base/gp_os2.c
base/gp_os2.h
base/gp_os2fs.c
base/gp_os2pr.c
base/gp_os9.c
base/gp_paper.c
base/gp_psync.c
base/gp_stdia.c
base/gp_stdin.c
base/gp_strdl.c
base/gp_sysv.c
base/gp_unifn.c
base/gp_unifs.c
base/gp_unix.c
base/gp_upapr.c
base/gp_vms.c
base/gp_wgetv.c
base/gp_win32.c
base/gp_wpapr.c
base/gp_wsync.c
base/gp_wutf8.c
base/gp_wxpsprn.cpp
base/gpcheck.h
base/gpgetenv.h
base/gpmisc.c
base/gpmisc.h
base/gpsync.h
base/gs.mak
base/gs_dll_call.h
base/gs_mgl_e.h
base/gs_mro_e.h
base/gsalloc.c
base/gsalloc.h
base/gsalpha.c
base/gsalpha.h
base/gsalphac.c
base/gsalphac.h
base/gsargs.c
base/gsargs.h
base/gsbitcom.c
base/gsbitmap.h
base/gsbitops.c
base/gsbitops.h
base/gsbittab.c
base/gsbittab.h
base/gsccode.h
base/gsccolor.h
base/gscdef.c
base/gscdefs.h
base/gscdevn.c
base/gscdevn.h
base/gscedata.c
base/gscedata.h
base/gscencs.c
base/gscencs.h
base/gschar.c
base/gschar.h
base/gschar0.c
base/gscicach.c
base/gscicach.h
base/gscie.c
base/gscie.h
base/gsciemap.c
base/gscindex.h
base/gsclipsr.c
base/gsclipsr.h
base/gscms.h
base/gscolor.c
base/gscolor.h
base/gscolor1.c
base/gscolor1.h
base/gscolor2.c
base/gscolor2.h
base/gscolor3.c
base/gscolor3.h
base/gscompt.h
base/gscoord.c
base/gscoord.h
base/gscparam.c
base/gscpixel.c
base/gscpixel.h
base/gscpm.h
base/gscrd.c
base/gscrd.h
base/gscrdp.c
base/gscrdp.h
base/gscrypt1.c
base/gscrypt1.h
base/gscscie.c
base/gscsel.h
base/gscsepr.c
base/gscsepr.h
base/gscspace.c
base/gscspace.h
base/gscssub.c
base/gscssub.h
base/gsdcolor.h
base/gsdevice.c
base/gsdevice.h
base/gsdevmem.c
base/gsdfilt.c
base/gsdfilt.h
base/gsdll.h
base/gsdllwin.h
base/gsdparam.c
base/gsdpnext.h
base/gsdps.c
base/gsdps.h
base/gsdps1.c
base/gsdsrc.c
base/gsdsrc.h
base/gsequivc.c
base/gsequivc.h
base/gserrors.h
base/gsexit.h
base/gsfcid.c
base/gsfcid2.c
base/gsfcmap.c
base/gsfcmap.h
base/gsfcmap1.c
base/gsflip.c
base/gsflip.h
base/gsfname.c
base/gsfname.h
base/gsfont.c
base/gsfont.h
base/gsfont0.c
base/gsfont0c.c
base/gsform1.h
base/gsfunc.c
base/gsfunc.h
base/gsfunc0.c
base/gsfunc0.h
base/gsfunc3.c
base/gsfunc3.h
base/gsfunc4.c
base/gsfunc4.h
base/gsgc.h
base/gsgcache.c
base/gsgcache.h
base/gsgdata.c
base/gsgdata.h
base/gsgstate.c
base/gshsb.c
base/gshsb.h
base/gsht.c
base/gsht.h
base/gsht1.c
base/gsht1.h
base/gshtscr.c
base/gshtx.c
base/gshtx.h
base/gsicc.c
base/gsicc.h
base/gsicc_cache.c
base/gsicc_cache.h
base/gsicc_cms.h
base/gsicc_create.c
base/gsicc_create.h
base/gsicc_lcms2.c
base/gsicc_lcms2art.c
base/gsicc_manage.c
base/gsicc_manage.h
base/gsicc_monitorcm.c
base/gsicc_nocm.c
base/gsicc_profilecache.c
base/gsicc_profilecache.h
base/gsicc_replacecm.c
base/gsimage.c
base/gsimage.h
base/gsimpath.c
base/gsinit.c
base/gsio.h
base/gsiodev.c
base/gsiodevs.c
base/gsiodisk.c
base/gsioram.c
base/gsiorom.c
base/gsiorom.h
base/gsipar3x.h
base/gsiparam.h
base/gsiparm2.h
base/gsiparm3.h
base/gsiparm4.h
base/gsjconf.h
base/gsjmorec.h
base/gslib.c
base/gslib.h
base/gslibctx.c
base/gslibctx.h
base/gsline.c
base/gsline.h
base/gslparam.h
base/gsmalloc.c
base/gsmalloc.h
base/gsmatrix.c
base/gsmatrix.h
base/gsmchunk.c
base/gsmchunk.h
base/gsmd5.c
base/gsmd5.h
base/gsmdebug.h
base/gsmemory.c
base/gsmemory.h
base/gsmemraw.h
base/gsmemret.c
base/gsmemret.h
base/gsmisc.c
base/gsnamecl.c
base/gsnamecl.h
base/gsncdummy.c
base/gsncdummy.h
base/gsnogc.c
base/gsnogc.h
base/gsnotify.c
base/gsnotify.h
base/gsovrc.c
base/gsovrc.h
base/gspaint.c
base/gspaint.h
base/gsparam.c
base/gsparam.h
base/gsparam2.c
base/gsparams.c
base/gsparams.h
base/gsparamx.c
base/gsparamx.h
base/gspath.c
base/gspath.h
base/gspath1.c
base/gspath2.h
base/gspcolor.c
base/gspcolor.h
base/gspenum.h
base/gspmdrv.c
base/gspmdrv.h
base/gspmdrv.rc
base/gsptype1.c
base/gsptype1.h
base/gsptype2.c
base/gsptype2.h
base/gsrect.h
base/gsrefct.h
base/gsromfs0.c
base/gsrop.c
base/gsrop.h
base/gsroprun.c
base/gsroprun1.h
base/gsroprun24.h
base/gsroprun8.h
base/gsropt.h
base/gsroptab.c
base/gsserial.c
base/gsserial.h
base/gsshade.c
base/gsshade.h
base/gssprintf.h
base/gsstate.c
base/gsstate.h
base/gsstrl.h
base/gsstrtok.h
base/gsstruct.h
base/gsstype.h
base/gstext.c
base/gstext.h
base/gstiffio.c
base/gstiffio.h
base/gstparam.h
base/gstrans.c
base/gstrans.h
base/gstrap.c
base/gstrap.h
base/gstype1.c
base/gstype1.h
base/gstype2.c
base/gstype42.c
base/gstypes.h
base/gsuid.h
base/gsutil.c
base/gsutil.h
base/gswin.rc
base/gsxfont.h
base/gx.h
base/gxacpath.c
base/gxalloc.h
base/gxalpha.h
base/gxarith.h
base/gxband.h
base/gxbcache.c
base/gxbcache.h
base/gxbitfmt.h
base/gxbitmap.h
base/gxbitops.h
base/gxblend.c
base/gxblend.h
base/gxblend1.c
base/gxccache.c
base/gxccman.c
base/gxcdevn.h
base/gxchar.c
base/gxchar.h
base/gxchrout.c
base/gxchrout.h
base/gxcht.c
base/gxcid.h
base/gxcie.h
base/gxcindex.h
base/gxclbits.c
base/gxcldev.h
base/gxclfile.c
base/gxclimag.c
base/gxclio.h
base/gxclip.c
base/gxclip.h
base/gxclip2.c
base/gxclip2.h
base/gxclipm.c
base/gxclipm.h
base/gxclipsr.h
base/gxclist.c
base/gxclist.h
base/gxcllzw.c
base/gxclmem.c
base/gxclmem.h
base/gxclpage.c
base/gxclpage.h
base/gxclpath.c
base/gxclpath.h
base/gxclrast.c
base/gxclread.c
base/gxclrect.c
base/gxclthrd.c
base/gxclthrd.h
base/gxclutil.c
base/gxclzlib.c
base/gxcmap.c
base/gxcmap.h
base/gxcolor2.h
base/gxcomp.h
base/gxcoord.h
base/gxcpath.c
base/gxcpath.h
base/gxcspace.h
base/gxctable.c
base/gxctable.h
base/gxcvalue.h
base/gxdcconv.c
base/gxdcconv.h
base/gxdcolor.c
base/gxdcolor.h
base/gxdda.h
base/gxdevbuf.h
base/gxdevcli.h
base/gxdevice.h
base/gxdevmem.h
base/gxdevndi.c
base/gxdevndi.h
base/gxdevrop.h
base/gxdevsop.h
base/gxdht.h
base/gxdhtres.h
base/gxdhtserial.c
base/gxdhtserial.h
base/gxdither.h
base/gxdownscale.c
base/gxdownscale.h
base/gxdtfill.h
base/gxfapi.c
base/gxfapi.h
base/gxfapiu.c
base/gxfapiu.h
base/gxfarith.h
base/gxfcache.h
base/gxfcid.h
base/gxfcmap.h
base/gxfcmap1.h
base/gxfill.c
base/gxfill.h
base/gxfillsl.h
base/gxfilltr.h
base/gxfillts.h
base/gxfixed.h
base/gxfmap.h
base/gxfont.h
base/gxfont0.h
base/gxfont0c.h
base/gxfont1.h
base/gxfont42.h
base/gxfrac.h
base/gxftype.h
base/gxfunc.h
base/gxgetbit.h
base/gxgstate.h
base/gxhintn.c
base/gxhintn.h
base/gxhintn1.c
base/gxhldevc.c
base/gxhldevc.h
base/