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.23 (2018-03-21)

This is the seventeenth full release in the stable 9.x series.

Highlights in this release include:

  • Ghostscript now has a family of 'pdfimage' devices (pdfimage8, pdfimage24 and pdfimage32) which produce rendered output wrapped up as an image in a PDF. Additionally, there is a 'pclm' device which produces PCLm format output.

  • There is now a ColorAccuracy parameter allowing the user to decide between speed or accuracy in ICC color transforms.

  • JPEG Passthrough: devices which support it can now receive the 'raw' JPEG stream from the interpreter. The main use of this is the pdfwrite/ps2write family of devices that can now take JPEG streams from the input file(s) and write them unchanged to the output (thus avoiding additional quantization effects).

  • PDF transparency performance improvements

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

  • We have continued the focus on code hygiene in this release cleaning up security issues, ignored return values, and compiler warnings.

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

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

Incompatible changes

  • The planned device API tidy has, unfortunately, been indefinitely postponed, until appropriate resources are available.

Changelog

2018-03-21 08:41:35 +0000
Chris Liddell <chris.liddell@artifex.com>
eb210aecab59f338ef9b8af4523edb3c8bc35092

Dates, changelog and product string for release

base/gscdef.c
base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-20 13:16:40 +0000
Chris Liddell <chris.liddell@artifex.com>
41c92643ce1325893d0f491a49fb2edad1684d17

Add missing files to doc install target

These files:

VectorDevices.htm
sample_downscale_device.htm
SavedPages.htm
subclass.htm

were missing from the documentation installation target

base/unixinst.mak


2018-03-16 13:27:45 +0000
Chris Liddell <chris.liddell@artifex.com>
6ca20f5735e9cde19eee6577059cd9d844e94525

Fix ommission from revised documentation install path

base/unixinst.mak


2018-03-15 19:14:15 +0000
Ken Sharp <ken.sharp@artifex.com>
713d80d0dde40a5d1d1f402e8347997896b9a8f7

pdfimage devices - fix up some minor problems

Bug #699119 " pdfimage24 creates bad PDF"

When I removed some extraneous stuff from the output (to simplify it) I
forgot to update the pdfimage devices properly, leading to them trying
to write xref entries for missing data.

In addition, there was a problem writing the Length object of the image
streams.

Ghostscript complained about both of these but rendered the content
correctly, other consumers didn't complain.

devices/gdevpdfimg.c


2018-03-15 11:04:40 +0000
Chris Liddell <chris.liddell@artifex.com>
7f822afbb52a6b37fc4766f840e714d9f491da81

lcms2art: byteReverse needs a ContextID

on big endian platforms - fix that.

Reported against 9.23 RC1

lcms2art/src/cmsmd5.c


2018-03-15 07:50:41 +0000
Chris Liddell <chris.liddell@artifex.com>
36bc37e414b695b1fa39c7e99be9d83f8628e889

Changelog and product string for 9.23 rc3

base/gscdef.c
doc/History9.htm


2018-03-14 16:41:03 +0000
Robin Watts <robin.watts@artifex.com>
e31e3879532fd23ca2658aea26bf4cadd665687f

Revert "Tweak bitmap interpolater patch size."

This reverts commit 38e0c643e62087c089c59c9ad44fc468dd09cd37.

This was shown to cause problems with:

tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf.pdf.psdcmyk.300.1

(or tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf, page 2, tweaked
to rotate by 270).

Reverting for now so I can try to find a less hacky (and hence
less error prone) way of working.

base/gxiscale.c
base/sisparam.h


2018-03-14 07:45:29 +0000
Chris Liddell <chris.liddell@artifex.com>
f7acb2502eadeff35dc791b52400d1a301059927

Dates etc for 9.23 rc2

base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-13 10:37:08 +0000
Ken Sharp <ken.sharp@artifex.com>
7c9a54209a2758769102361a456353e7e5993821

Squash a benign compiler warning

devices/vector/gdevpdtt.c


2018-03-13 10:33:52 +0000
Ken Sharp <ken.sharp@artifex.com>
353c6caa4b8dea6baae337b30217139e996e9b94

pdfwrite - reject inappropriate ICC profiles

PDF files cannot include the full possible range of ICC profiles, if
we encounter one of these (eg from an XPS file) then refuse to embed it
and instead return gs_error_rangecheck, so that the calling code will
fall back to a device space representation.

NOTE we currently permit GS_UNDEFINED as a valid data_cs which we really
shouldn't but the current code, when converting a CIEBasedDEF or
CIEBasedDEFG (possibly other CIE spaces) to ICC creates a profile
where data_cs is GS_UNDEFINED (which is 0, so probably not actually
filled in).

devices/vector/gdevpdfk.c


2018-03-12 14:22:44 +0000
Ken Sharp <ken.sharp@artifex.com>
23f66c8eec91e8efcbc600d987cf8bde7e3dce4b

pdfwrite - avoid use of /.notdef when converting PCL fonts to type 3

Bug #699102 "using -sDEVICE=pdfwrite option generate an incorrect code 128 barcode"

This is actually an Acrobat bug, every other viewer I've tested works as
expected, Acrobat does not.

The problem appears to be related to defining a /.notdef glyph and
encoding it at a position other than 0 in the Encoding. If we do that,
and use the encoded /.notdef glyph, Acrobat quietly replaces it with the
glyph encoded at position 0 in the Encoding of the font.

Because of the way that PCL fonts work, when we are converting PCL
fonts to type 3 PDF fonts, the character (PCL) 0x1D gets assigned the
glyph name /.notdef. The actual Encoding of the glyph is at position
0x1D however, which causes Acrobat to substitute the glyph at Encoding
position 0.

This is obviously wrong. However, since its Acrobat, here we add yet
another heuristic to avoid defining glyphs with the name /.notdef when
creating type 3 PDF fonts from PCL fonts.

No differences expected

devices/vector/gdevpdtt.c


2018-03-08 13:21:54 +0000
Robin Watts <robin.watts@artifex.com>
1567dba0b505a0bb816e7b2e34f3915165a7d5b3

Avoid total image dropout in interplated rescales.

Tests show that the following command causes images to disappear:

gxps -o out.ppm -sDEVICE=ppmraw -72 tests_private/xps/xpsfts-a4/fts_27xx.xps

This is because we scale a 1600 wide image down to 27 pixels across.
As such the weights for each individual pixel round to zero, and we
get nothing displayed.

Adjust for this by still calculating weights as doubles, and carrying
the error across the line. This keeps the total sum of the differences
correct.

base/siscale.c


2018-03-07 12:19:48 +0000
Chris Liddell <chris.liddell@artifex.com>
c6285cdd7ae7b1c97ffcf0c824234659b03d6d6a

Dates and versions for 9.23 rc1

doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2018-03-07 09:59:55 +0000
Chris Liddell <chris.liddell@artifex.com>
0df45c3d11246d773110d5b1a563d7462f3acac1

Revision date and product for release candidate

base/gscdef.c
base/version.mak


2018-02-26 15:48:45 +0100
David Kaspar [Dee'Kej] <dkaspar@redhat.com>
8c206ceeeac12b048aeafc9ea51080b624750ff4

Bug 699068: configure.ac: forcibly disable strict aliasing via CFLAGS

In case user specifies their own CFLAGS that contains -O2, -O3, -Os or
-fstrict-aliasing, the default behaviour to disable the strict
aliasing will be overriden and enabled, which is not correct...

This commit will append the -fno-strict-aliasing option to CFLAGS set
by user, which will effectively force the disabling of strict aliasing.

NOTE: originally the patch issued a warning when appending -fno-strict-aliasing
and I've changed it to a normal checking/result message pattern - it seems less
likely to cause end user confusion/panic

configure.ac


2018-03-05 21:48:02 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
39686173fd26eb6e5eee91202433f5e5f307f61c

Bug 697545 : Update functions to return error codes.

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

base/gscolor.c
base/gsdparam.c
base/gsptype1.c
pcl/pcl/pcbiptrn.c
pcl/pcl/pcpatrn.c
pcl/pcl/pginit.c
pcl/pcl/pglabel.c
pcl/pcl/rtraster.c
pcl/pl/plparams.c
pcl/pxl/pxgstate.c
pcl/pxl/pxink.c
pcl/pxl/pxpthr.c
psi/ztrans.c


2018-02-21 19:59:25 +0100
David Kaspar [Dee'Kej] <dkaspar@redhat.com>
469bd6ecf5b223b3e6e3f32ec5a4900866c35e57

Bug 699057: Makefile.in: @LDFLAGS@ added into GCFLAGS

Previously, the 'gsc' and 'gsx' binaries were not using LDFLAGS when
they were built with shared library. Adding LDFLAGS into GCFLAGS fixes
this issue, and specifying LDFLAGS now works for these binaries as well.

Makefile.in


2018-03-06 10:16:43 +0000
Chris Liddell <chris.liddell@artifex.com>
71e152462e2b47e8e31aec7cf1238934640aa480

Update zlib to 1.2.11

zlib/CMakeLists.txt
zlib/ChangeLog
zlib/Makefile.in
zlib/README
zlib/adler32.c
zlib/as400/bndsrc
zlib/as400/compile.clp
zlib/as400/readme.txt
zlib/compress.c
zlib/configure
zlib/contrib/README.contrib
zlib/contrib/ada/zlib-streams.ads
zlib/contrib/ada/zlib-thin.ads
zlib/contrib/blast/blast.c
zlib/contrib/blast/blast.h
zlib/contrib/delphi/ZLib.pas
zlib/contrib/dotzlib/DotZLib/UnitTests.cs
zlib/contrib/infback9/inftree9.c
zlib/contrib/minizip/configure.ac
zlib/contrib/minizip/iowin32.c
zlib/contrib/minizip/unzip.c
zlib/contrib/minizip/zip.c
zlib/contrib/pascal/zlibpas.pas
zlib/contrib/puff/puff.c
zlib/contrib/vstudio/readme.txt
zlib/contrib/vstudio/vc10/zlib.rc
zlib/contrib/vstudio/vc10/zlibvc.def
zlib/contrib/vstudio/vc11/zlib.rc
zlib/contrib/vstudio/vc11/zlibvc.def
zlib/contrib/vstudio/vc12/miniunz.vcxproj
zlib/contrib/vstudio/vc12/minizip.vcxproj
zlib/contrib/vstudio/vc12/testzlib.vcxproj
zlib/contrib/vstudio/vc12/testzlibdll.vcxproj
zlib/contrib/vstudio/vc12/zlib.rc
zlib/contrib/vstudio/vc12/zlibstat.vcxproj
zlib/contrib/vstudio/vc12/zlibvc.def
zlib/contrib/vstudio/vc12/zlibvc.sln
zlib/contrib/vstudio/vc12/zlibvc.vcxproj
zlib/contrib/vstudio/vc14/miniunz.vcxproj
zlib/contrib/vstudio/vc14/minizip.vcxproj
zlib/contrib/vstudio/vc14/testzlib.vcxproj
zlib/contrib/vstudio/vc14/testzlibdll.vcxproj
zlib/contrib/vstudio/vc14/zlib.rc
zlib/contrib/vstudio/vc14/zlibstat.vcxproj
zlib/contrib/vstudio/vc14/zlibvc.def
zlib/contrib/vstudio/vc14/zlibvc.sln
zlib/contrib/vstudio/vc14/zlibvc.vcxproj
zlib/contrib/vstudio/vc9/zlib.rc
zlib/contrib/vstudio/vc9/zlibvc.def
zlib/crc32.c
zlib/deflate.c
zlib/deflate.h
zlib/examples/gun.c
zlib/examples/gzlog.c
zlib/examples/zran.c
zlib/gzguts.h
zlib/gzlib.c
zlib/gzread.c
zlib/gzwrite.c
zlib/infback.c
zlib/inffast.c
zlib/inflate.c
zlib/inflate.h
zlib/inftrees.c
zlib/msdos/Makefile.dj2
zlib/msdos/Makefile.emx
zlib/old/Makefile.emx
zlib/old/os2/Makefile.os2
zlib/os400/README400
zlib/os400/bndsrc
zlib/os400/make.sh
zlib/os400/zlib.inc
zlib/qnx/package.qpg
zlib/test/example.c
zlib/test/infcover.c
zlib/test/minigzip.c
zlib/treebuild.xml
zlib/trees.c
zlib/uncompr.c
zlib/win32/Makefile.gcc
zlib/win32/Makefile.msc
zlib/win32/README-WIN32.txt
zlib/win32/VisualC.txt
zlib/win32/zlib.def
zlib/win32/zlib1.rc
zlib/zconf.h
zlib/zconf.h.cmakein
zlib/zconf.h.in
zlib/zlib.3
zlib/zlib.3.pdf
zlib/zlib.h
zlib/zlib.map
zlib/zutil.c
zlib/zutil.h


2018-03-06 12:36:11 +0000
Chris Liddell <chris.liddell@artifex.com>
08482c582115a1396d0fd9186011008f889a61c5

Work around a change in the zlib API for 1.2.11

where it's used in the Freetype/zlib interface debugging code.

freetype/src/gzip/zutil.h


2018-03-02 10:54:06 +0000
Ken Sharp <ken.sharp@artifex.com>
3da667d889e54fb1a323769fbb4f93b971d0fff4

CCITT Fax - ensure calculation rounds up

Still Bug #696413, follows on from commit 0221c9

When calculating the number of bytes required to store the encoded lines
we multiply the number of columns byt the number of bits required
for 2 pixels, then divide by 16 to get the required number of bytes.

This commit simply ensures that the division by 16 is rounded *up* and
not down. Previously we could end up dropping up to 7 bits of required
space. Generally this is not likely to be a problem but it is technically
a problem, and can be demonstrated on pathological cases.

base/scfe.c


2018-03-01 18:13:13 +0000
Ken Sharp <ken.sharp@artifex.com>
0221c9e4c43b25375dab6c9d15a777eecf20d261

Fix CCITT Fax Encoder

Bug #696413 "Seg faults found by fuzzing in pdf_store_page_resources (gdevpdfu.c:1663)"

As noted it eh bug report, the problem is that the encoding buffer is
allocated with a size based on the maximum number of bits for horizontal
encoding (6 bits per pixel), but for 2D encoding some of the bits might
use vertical encoding. Vertically encoded bits with an offset of 3 use
7 bits per pixel, not 6.

If we get a line with sufficient 7-bit encodings, where the horizontal
bits are encoded with 6 bits (eg runs of 1 pixel), then we can end up
running off the end of the buffer. Make the allocation assume a maximum
of 7 encoded bits per pixel instead.

base/scfe.c


2018-02-27 20:56:07 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e27f0530e3410547563daf757dc5c121c21d2f1c

Bug 697545 : Fix memory leak in show_proceed.

Fix memory leak and SEGV when gs_newpath returns an error code.

Error created using :-
MEMENTO_FAILAT=9017 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gxchar.c


2018-02-27 21:12:12 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
49974a63cad8c792067fbf63905a271022b0e806

Bug 697545 : Fix memory leaks in hpgl_print_char.

Fix memory leak when pcl_mark_page_for_current_pos returns an error code.
Also prevent path becoming orphaned in cpath_set_rectangle.

Error created using :-
MEMENTO_FAILAT=9010 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gxcpath.c
pcl/pcl/pglabel.c


2018-02-28 17:17:23 +0000
Ken Sharp <ken.sharp@artifex.com>
03194b72312b6777021f0554bdd30fecc89db486

txtwrite - guard against infinite loop

vertical text could result in an advance width of 0, which would cause
us to try and write an infinite number of spaces.

devices/vector/gdevtxtw.c


2018-02-28 14:04:32 +0000
Ken Sharp <ken.sharp@artifex.com>
d57bd7ce641d8134d559f5e8190e2578137e1d39

txtwrite - better dynamic resizing

A better fix for bug #699078, this implemnets the thought I had while
writing up the description of the problem. In this case we check whether
the current 'effective size' of the monospaced font would lead to
the end of the current run of text lying to the right of the 'next' run
of text on this line. If it would, then use the newly calculated
effective size, no matter how small it is, to avoid collisions.

devices/vector/gdevtxtw.c


2018-02-28 09:34:06 +0000
Ken Sharp <ken.sharp@artifex.com>
d0d4e282f98487ca2979edbaf6834d9341bcee53

txtwrite - slacken a restriction on minimum width selection

Bug #699078 " Extracted text is not properly seperated"

Allow the minimum size assigned to the monospaced output to be smaller
than previously (previously we limited it to .75 of the smallest point
size of any used font).

This will reduce the number of horizontal text collisions at the cost
of potentially making the text output wider.

Essentially this is caused by using a monospaced font to represent the
original proportionally spaced input. A sufficiently long run of
characters which are significantly less than the M width could result in
the position being further to the right (when converted to monspaced
text) than the neext horizontal fragment. So we wouldn't try to
space it any further.

Previously we limited the calculation of the minimum character size in
a run to 3/4 of the M space. Here we reduce that to 1/2 which will
permit more flexibility, but as stated, at the potential cost of the
output text being 'wider' (containing more spaces).

devices/vector/gdevtxtw.c


2018-02-26 21:25:19 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
a16736bc4ea251c46f1aa1d3b6176aadf5f0b914

Bug 697545 : Update PCL to return error codes (Patch VI).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pl/plparams.c
pcl/pl/pluchar.c


2018-02-25 20:36:29 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
50f7fc4f7a99d874af86e4a874067ba3a7760c42

Bug 697545 : Update PCL to return error codes (Patch V).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pcl/rtraster.c
pcl/pl/plchar.c
pcl/pl/plht.c
pcl/pl/pllfont.c


2018-02-23 18:02:47 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
0edcf910b80a1656c9441f32bd1770d2600ab915

Bug 697545 : Update PCL to return error codes (Patch IV).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pcl/pginit.c
pcl/pcl/pginit.h
pcl/pcl/pglabel.c
pcl/pcl/pglfill.c
pcl/pcl/pgmand.h
pcl/pcl/pgmisc.c
pcl/pcl/pgpoly.c
pcl/pcl/pgvector.c


2018-02-22 20:34:53 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
9f90d1361564289e6dbe56863a5fe1be1ca28f83

Bug 697545 : Update PCL to return error codes (Patch III).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pcl/pgchar.c
pcl/pcl/pgconfig.c
pcl/pcl/pgdraw.c
pcl/pcl/pgfdata.c
pcl/pcl/pgfont.c
pcl/pcl/pgframe.c


2018-02-23 14:35:57 +0000
Ken Sharp <ken.sharp@artifex.com>
6375e295893a71b5695fba2ca117747e326c8ec2

pdfwrite - gracefully handle inappropriate PDFA command line

If a user sets -dPDFA, but does not set ColorConversionStrategy, and
then processes an input file which has a DeviceN space with an alternate
space which does not match the ProcessColorModel, then we would write
an invalid PDF file (invalid function for the colour space).

Now technically this shouldn't happen, but we can guard against this
specific user error by spotting the problem and returning a rangecheck
error instead, which will cause the earlier code to fall back to
writing a device colour instead.

No diffrences expected.

devices/vector/gdevpdfc.c


2018-02-20 22:13:51 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
03607549d598b14ebbb6d4aea9591e10fc35c6cc

Bug 697545 : Update PCL to return error codes (Patch II).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pcl/pcsfont.c
pcl/pcl/pcsymbol.c
pcl/pcl/pctext.c
pcl/pcl/pctop.c
pcl/pcl/pcuptrn.c


2018-02-20 18:40:37 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
de2c3c2c536d5aff97091b146ed259270228dcb9

Bug 697545 : Update PCL to return error codes (Patch I).

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

pcl/pcl/pccolor.c
pcl/pcl/pcdraw.c
pcl/pcl/pcfontpg.c
pcl/pcl/pcindxed.c
pcl/pcl/pcjob.c
pcl/pcl/pcmacros.c
pcl/pcl/pcpalet.c
pcl/pcl/pcparse.c
pcl/pcl/pcpatrn.c


2018-02-14 17:26:23 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
8f2f27a730fc7ba76847d39fc46d6d7183cd27a3

Bug 697545 : Fix memory leaks during font loading.

Fix memory leaks for numerous allocation events.

Error created using :-
MEMENTO_FAILAT=1564 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gstype42.c
base/gxfapi.c
pcl/pl/plfapi.c
pcl/pl/plfont.c
pcl/pl/pllfont.c


2018-02-18 16:05:18 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
cceb3db394d9547d309f596001b02c63dec4d7f5

Bug 697545 : Fix memory leak in gx_path_new.

During a memory allocation event failure the orginal path would not be
decremented and hence become orphaned.

Error created using :-
MEMENTO_FAILAT=8959 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gxpath.c


2018-02-19 15:43:20 +0000
Ken Sharp <ken.sharp@artifex.com>
3f5736cb8a255cdfe00d59896dc39d050d1db00e

Add more bounds checking to type 2 font interpreter

Bug #699042 "stack out of bounds read in gs_type2_interpret, gstype2.c line 701"

The warning is caused by 'csp' being below the cstack bottom bound.
Adding a check for that prevents this warning. While we're here, add
checks to the bounds of 'transient_array' which wasn't being checked
previously.

base/gstype2.c
base/gxtype1.h


2018-02-19 14:26:29 +0000
Ken Sharp <ken.sharp@artifex.com>
cc2bfef83b1dca09e016e43238f71ca6c7a622b3

PDF interpreter - fix ToUnicode processing of bfrange with high byte set

Bug #699041 "Cyrilic text not respected"

The title is a misnomer, the problem is not Cyrillic fonts as such.

The example file has an unusually complex ToUnicode CMap, which includes
bfrange entries where the CID has a value > 0xFF. The code in pdf_font.ps
to create our internal GlyphNames2Unicode table was adding the 'offset'
(The high byte of the index) to the CID, which basically means we were
adding the high byte twice (the key already included the high byte).

Fix this by simply not adding the offset to the keys.

Its surprisingly hard to find examples of this, I can't immediately see
any in our test suite. I have gone through some of the files which
have been reported as problems with ToUnicode processing in the past
but none of them fall into this condition.

A couple of files show difference, but these are irrelevant, they are of
the 'wrong before, differently wrong now' category.

Resource/Init/pdf_font.ps


2018-02-18 14:18:10 +0000
Ken Sharp <ken.sharp@artifex.com>
eb2aa457387429b84c043430354b8476ac918961

Squash a couple of build warnings

Sort out negation of the PDFA flag

Ensure a variable is initialised under all conceivable circumstances

devices/vector/gdevpdtd.c
devices/vector/gdevpdtt.c


2018-02-16 19:32:11 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f006720c87026a67cdcaeab983fe888d4401cb0e

Bug 697545 : Prevent SEGV by returning error codes.

Prevent numerous SEGV points by ensuring error codes are returned and
handled appropriately.

Error created using :-
MEMENTO_FAILAT=8961 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pgconfig.c
pcl/pcl/pgframe.c


2018-02-16 18:56:23 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
833333a6df506ad9525bb797245042442a0f31cb

Bug 697545 : Prevent SEGV in palette_do_reset.

Prevent SEGV when trying to access contents of empty palette.

Error created using :-
MEMENTO_FAILAT=8956 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pcpalet.c


2018-02-16 18:39:30 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
0ebfdae6fceedbbe7036c487916193b4349d4dd3

Bug 697545 : Fix memory leak in alloc_indexed_cspace.

Fix memory leak for allocation event 8953.

Error created using :-
MEMENTO_FAILAT=8954 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pcindxed.c


2018-02-13 15:53:09 -0800
Ray Johnston <ray.johnston@artifex.com>
9f9daedfdf98bab590eba53e34fba76b96307ec0

Fix Bug 698969 SEGV caused by overflow in mark_line_*** functions

Clipping needs to be performed in 64-bit to allow for the original
line segment being larger than can fit in signed 32-bit.

base/gxscanc.c


2018-02-16 10:29:00 +0000
Ken Sharp <ken.sharp@artifex.com>
ad07c06b7f898eeb663ee7eed336c2c602a91551

pdf_info.ps - check for null DescendantFonts after oforce

pdf_info.ps was modified to check for circular references when resolving
indirect objects. Now if we find recursion we return a null.

However, we weren't checking that when resolving DescendantFonts which
could lead to a typecheck error if we had two different CIDFonts on
the same page, and the CIDFonts used the same DescendantFonts array
(which is silly, of course).

toolbin/pdf_info.ps


2018-02-15 10:15:28 -0700
Henry Stiles <henry.stiles@artifex.com>
6a8c1d6be02fc7020ab4cf5cfbecf91790f7dc10

Bug 696654 - PCL/PXL fails to build with system-shared libjpeg.

Remove the HP CLJ 3500/3500/3600 emulation until it can be properly
integrated with libjpeg.

base/gdevpxat.h
base/gdevpxen.h
pcl/pxl/pxl.mak
pcl/pxl/pxptable.c
pcl/pxl/pxsessio.c
pcl/pxl/pxstate.h
pcl/pxl/pxvendor.c
pcl/pxl/pxvendor.h


2018-02-15 14:36:10 +0000
Ken Sharp <ken.sharp@artifex.com>
094aebef5c058ad312e5d2bfd46d897c21fac398

pdfwrite - remove dead code

Commit efb9bf3949617b4c733a6dcce04acd142c50115d changed the flow of
control to avoid going through code which could not work, since it left
a variable unassigned (and didn't do any part of the work that would
be required to give the variable a sensible value).

That left some code unreachable leading to a coverity warning (Coverity
ID 262411). I was unable to find any way to trigger the original
condition, and the code as it stands should at least work, even if it
might be sub-optimal in some cases. So remove the dead code to prevent
the warning, if this needs fixing in future there will need to be more
code written anyway.

devices/vector/gdevpdfb.c


2018-02-15 09:02:01 +0000
Ken Sharp <ken.sharp@artifex.com>
4384f85cbb9383cbeefea80e45e8893a5d64c7af

PDF interpreter - remove a debug pstack

accidentally left some debugging code in place, remove it now.

Resource/Init/pdf_main.ps


2018-02-14 17:01:21 +0000
Ken Sharp <ken.sharp@artifex.com>
7d1b64fe9474d4c1e6d5f4185c77cb42a8ac5bc0

Remove a long obselete C source file

Also remove a documentation reference and Windows project references

doc/Develop.htm
psi/zhsb.c
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-02-14 17:26:23 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
ecf45b80c55bc79c17bed5143426cd9f8060ec2f

Bug 697545 : Fix memory leaks during tt font loading.

Fix memory leak for allocation event numbers 1551, 1552 and 1553.

Error created using :-
MEMENTO_FAILAT=1554 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/plfont.c
pcl/pl/pllfont.c


2018-02-14 15:38:42 +0000
Ken Sharp <ken.sharp@artifex.com>
bb8f0822a31e0e976cb659000532fde2fdbccd8c

PDF interpreter - detect and ignore circular references in Outlines

Bug #699029 "infinite loop on pdfium test file"

If the /Next in an Outline points to any previously encountered
Outline entry, terminate processing of Outlines and warn the user.

Resource/Init/pdf_main.ps


2018-02-14 10:28:37 +0000
Ken Sharp <ken.sharp@artifex.com>
06ceaa2715fcbe2056214b0f958edc7deb4fa085

pdfwrite - improve stack bounds checking on font interpreters

Bug #699020 "stack buffer underflow (read) in gs_type2_interpret / gstype2.c line 567"

The internal type 1 and type 2 font interpreters are only used by
the vector devices (in particular pdfwrite), for rendering we use
FreeType.

This commit improves the bounds checking of the operand stacks used
by these interpreters, to catch more cases of badly formed or
corrupted fonts and throw an error in these cases.

This addresses the stated bug, but should actually prevent a lot
more problems which we haven't yet seen test cases for.

base/gstype1.c
base/gstype2.c
base/gxtype1.h


2018-02-13 12:00:10 +0000
Ken Sharp <ken.sharp@artifex.com>
c1a8dc52c0e320c41d04b6f32086622150962d61

fix commit bcef41ad72a16472a3003d357bf8d8680174ab85

Accidentally left currentdict on the operand stack afetr startup.

Resource/Init/gs_init.ps


2018-02-13 10:48:16 +0000
Chris Liddell <chris.liddell@artifex.com>
16586a6a0d8fac17d5201f102e0775e527d3a529

Bug 699019: bounds check stack access in Type 2 vmoveto

base/gstype2.c


2018-02-13 10:22:56 +0000
Ken Sharp <ken.sharp@artifex.com>
bcef41ad72a16472a3003d357bf8d8680174ab85

PS interpreter - fix setpagedevice with -dDELAYBIND

When a user sets a fixed resolution using -r, then the setpagedevice
code looks for the existence of a /HWResolution key in the page device
dictionary and attempts to remove it using .undef to prevent the
resolution being altered.

However, if DELAYBIND is set, then the .undef operator is removed
before .bindnow is run, which means that, when setpagedevice executes,
the .undef operator is not defined.

So add the same code for .undef as we use for other similar operators
(eg .forceundef), don't remove the definition if DELAYBIND is set, but
do remove it when .bindnow executes.

This is, of course, a security hole, but then the whole DELAYBIND
situation is.

While we are here, add a key /NOBIND with the value false to systemdict.
This is because some ancient, badly-behaved and no longer maintained
software checks this key unconditionally, if its not present it fails
with an undefined error. Setting it to false pacifies that software.

Resource/Init/gs_init.ps


2018-02-13 08:52:32 +0000
Chris Liddell <chris.liddell@artifex.com>
310a0bcaba3527903fc66fed2984f30d0bd4e4ab

Bug 699016: add stack bounds check for Type 1 seac

The macro for checking the stack bounds is now called from both the Type 1 and
Type 2 charstring code, so move it to a common header, and tweak the name to
fit.

base/gstype2.c
base/gxtype1.c
base/gxtype1.h


2018-02-13 08:35:22 +0000
Chris Liddell <chris.liddell@artifex.com>
9bbf14bc7210bc54613b0f64a5ad95368891982a

Bug 699015: bounds check stack for Type 2 callsubr

base/gstype2.c


2018-02-12 21:47:29 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
0e9ba7084176c7834db00927a8326310c6b83a67

Fix memory leak in xps_imp_set_device.

The param list can become orphaned if an error occurs early on in the code.

xps/xpstop.c


2018-02-11 20:44:04 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
5e9639e974afaa89027a5ccd573e50ff98e3ca3f

Bug 697545 : Fix memory leak in pcl_load_built_in_symbol_sets.

Fix memory leak for allocation event number 1266.

Error created using :-
MEMENTO_FAILAT=1267 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pcsymbol.c


2018-02-11 20:20:36 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
3e4c6beff724a4e0078a48e6f5200c23ae73f52b

Bug 697545 : Fix memory leak in pl_top_create_device.

The param list can become orphaned if an error occurs early on in the code.

Error created using :-
MEMENTO_FAILAT=676 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/plmain.c


2018-02-12 15:23:19 +0000
Chris Liddell <chris.liddell@artifex.com>
a4445fe0a312af901a79d6f41ace975a50d88a31

Bug 699012: bounds check point index in Move_Zp2_Point()

base/ttinterp.c


2018-02-12 12:05:44 +0000
Chris Liddell <chris.liddell@artifex.com>
e7abbb92e92ba326b4fc06491bd3c3cde61932b3

Bug 699013: Check glyph has a contour before accessing it.

in Ins_IUP()

base/ttinterp.c


2018-02-12 15:20:23 +0000
Ken Sharp <ken.sharp@artifex.com>
edf3684305414731fbdb9b90de7dbcbab0dace5f

Fix comments

The comments in zinitgrpahics and the PostScript definition of
initgraphics in gs_cspace.ps were incorrect, now that gs_initgraphics
does reset the colour space properly.

However, we do still need the /initgraphics override in gs_cspace.ps
in order to correctly set the colour space which we store in the
'interpreter' graphics state. We only use that to hand back in response
to a currentcolorspace, but we do need it.

Resource/Init/gs_cspace.ps
psi/zgstate.c


2018-02-12 13:47:18 +0000
Ken Sharp <ken.sharp@artifex.com>
b7a0556297296d8355748b9b130de02923a1c4cd

Check for error case in gs_cspace_new_ICC()

If we fail to allocate memory for a new colour space, simply return
NULL, don't try to use the failed allocation!

base/gscspace.c


2018-02-12 12:21:50 +0000
Ken Sharp <ken.sharp@artifex.com>
7a708d9fdcba9efbe21f236830e47eb4f4085672

More work with initgraphics

Firstly, remove the kludgy gs_initgraphics_no_cspace() and have the
PostScript operator zinitgraphics() call gs_initgraphics().

This meant fixing the gs_initgraphics routine; the previous commit
d527031607a881237819835c2b1045c81e24c387 simply overwrote the existing
colour spaces in the graphics state with the new DeviceGray space. This
could lead to memory leaks if the previous colour space had been
reference counted up. So now we call gs_setcolorspace instead, which also
correctly sets the current colour.

This led to the interesting discovery that the null brush in PXL has
never been handled properly by the high level devices. This is
handled by the PXL interpreter setting a DeviceGray colour space, and
then directly editing the device colour 'type' field and setting it to
'typ_null'. This doesn't seem like the best way to proceed to me, I
would have expected us to push the nulldevice, but its what is done.

No in gx_hld_is_hl_color_available() the code simply tested whether
the device color 'ccolor_valid' flag was set. Since the PXL interpreter
simply stomped on the type field, and did not update any of the other
fields, the result of this was unknown. Sometimes we would decide it
was valid, and sometimes not. If we did decide it was valid then we
used the DeviceGray space and colour (0, black) which was also set up
by the null brush code to draw the object, which means that we could
end up drawing objects which should not be drawn.

'Fixed' this by having the code explicitly test for the device color
type being 'null' as well as being valid. In passing, it did appear
to me that we do not always update the ccolor_valid flag in the device
color structure, which may well lead to more problems of this kind.

This does result in a number of differences in the output. Mostly
these are due to the error page now always being rendered in DeviceGray
which results in a slightly (invisible) difference in printed gray text.
A very large number of the Quality Logic files exhibit progressions
due to the fact that we are now correctly processing the null brush.

base/gsstate.c
base/gxhldevc.c
psi/zgstate.c


2018-02-04 18:45:26 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
1af4fced38d9d842195e5635c9e0aa4b5e13f21b

Bug 697545 : Fix memory leak in pcl interpreter.

If an error occurs during pl_set_device then the new interpreter is partially
set up but the old interpreter is still listed as current so the cleanup
code does not reclaim the partially set up memory. The patch ensures the
correct interpreter is cleaned up and also zeros out unset fields to prevent
a SEGV during memory freeing.

Fix memory leak for allocation event number 1265.

Error created using :-
MEMENTO_FAILAT=1266 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pctop.c
pcl/pl/plmain.c


2018-02-10 22:28:04 -0800
Ray Johnston <ray.johnston@artifex.com>
98d8f8d12a40bf36f0acdaefc0c63a7562326cab

Fix compile warning about possible uninitialized procedure pointers

Setting to NULL is OK since it will trigger a SEGV, but it looks
like the code will always set the procedures if it needs the source
colors.

base/gdevmpla.c


2018-02-10 11:43:15 -0800
Ray Johnston <ray.johnston@artifex.com>
2fe4c53757ef143071517216cacdbb228dfc4243

Fix compiler warning: mlut_size

This is OK because mlut_size is only used when 'clut' is non-NULL
but if so, it is initialized in line 1179.

base/gsicc_create.c


2018-02-10 11:28:48 -0800
Ray Johnston <ray.johnston@artifex.com>
d3fb0f876971f604597c10519259520a8035cb58

Fix gcc warning: gscms_is_threadsafe prototype

base/gsicc_cms.h
base/gsicc_lcms2.c
base/gsicc_lcms2art.c


2018-02-06 11:53:24 -0800
Ray Johnston <ray.johnston@artifex.com>
01a71ecbfe576d0a840946a0089f23ce131e995d

Change from CMM_THREAD_SAFE #define to a gscms_is_threadsafe function

In preparation for enabling sharing the profiles and link cache among
rendering threads, switch from a compile time flag to a function that
is returned by the CMS interface module linked in (e.g gsicc_lcms2.c)

This avoids more build machinery to propagate the flag, and ensures
that the flag won't be mis-matched to the CMS in use.

Also flag a few FIXME places identified that relate to multi-threaded
sharing of profiles and the profile link cache. Initially, even though
lcms2art is thread safe, return "false" until the multi-threaded
rendering works.

base/gdevp14.c
base/gsicc_cms.h
base/gsicc_lcms2.c
base/gsicc_lcms2art.c
base/gxcldev.h
base/gxclthrd.c


2018-02-10 10:59:29 +0000
Ken Sharp <ken.sharp@artifex.com>
da66356a665432f998642b2e9c45756f876f0996

PCL interpreter - correctly identify high level devices

Pointed out by Chris, the code in here explicitly tested the name of the
device to decide if it was a high level device. We deprecated that
approach some time ago, replacing it with a spec_op call instead.

The comment said 'this needs a better solution' and this is it.

Should work correctly now with any device which identifies itself as a
high level device.

pcl/pl/plmain.c


2018-02-08 13:57:54 -0700
Henry Stiles <henry.stiles@artifex.com>
4b4a301c90a8905d6b7ba703342ddc9cb1c8ff69

Fix 694689 - Seg faults found by fuzzing.

Allow clients of the decompression routines to pass in a parameter to
indicate no further input or output is expected. The decompression
routines should produce an error if the parameter is set and more
processing is needed. The pattern code uses this to indicate indicate
the final scanline has been processed, it is not needed by the image
code.

pcl/pxl/pximage.c


2018-02-07 17:03:04 -0700
Henry Stiles <henry.stiles@artifex.com>
8e4764d61562a44c77920ee67884ca846184b25c

Add line pointer to the pattern enumerator.

This tracks the scan line position within the pattern while reading,
simplifying bounds checking.

pcl/pxl/pximage.c


2018-02-05 13:28:52 -0700
Henry Stiles <henry.stiles@artifex.com>
faef871274167e12e93fc24026096474d00b794d

Remove pushed argument.

No need to push the filename simply run the file and use a do while
loop.

pcl/pl/plmain.c


2018-02-02 10:35:28 -0700
Henry Stiles <henry.stiles@artifex.com>
f29e2296e81378ed42b93215137361ab586b2393

Warning cleanup.

pcl/pcl/pcpalet.c
pcl/pcl/pcparse.c
pcl/pcl/pglabel.c
pcl/pl/pllfont.c
pcl/pxl/pxtop.c


2018-02-07 21:08:46 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
b808ea741efe357cf71254d9064e782dfd753584

Bug 697545 : Fix memory leak in gs_state_alloc.

The colour allocation code in gs_gstate_alloc was being repeated in the call
to gs_initgraphics leading to the first set of allocated colours becoming
orphaned. Given that gs_initigraphics is always called from gs_gstate_alloc
the duplicate code can be safely removed.

Error created using :-
MEMENTO_FAILAT=419 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsstate.c


2018-02-06 18:04:07 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
98e5b234b27d82e52d660a9e0bfc6c14e3d7a5cd

Bug 697545 : Prevent SEGV in pcpage_do_reset.

Prevent SEGV if memory allocation fails and returns a NULL paper size.

Error created using :-
MEMENTO_FAILAT=1215 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pcpage.c


2018-02-07 15:46:28 +0000
Ken Sharp <ken.sharp@artifex.com>
10dcb4943e552a3d53fbaf0b4e8741258238f7a7

Handle a potential error condition in PXL

Bug #698995 "Fixing error returns in gxicolor.c can cause PXL to enter an infinite loop or seg fault"

This started off as a fix to a scanbuild warning and spiralled somewhat.

Fixing gs_image_class_4_color() so that it didn't ignore an error return
led to the possibility of the PXL interpreter seg faulting or ending up
in an infinte loop.

Initially this turned out to be because gs_initgraphics() was no longer
setting the colour space to the proper default, leading to us trying
to use the very pattern space which failed. That was fixed in the
previous commit.

After that it turned out that in an error condition we were freeing
an image enumerator twice. This didn't seem to cause the PostScript
interpreter a problem, though it seems likely it did really, it simply
didn't exhibit before the interpreter exited. The PXL interpreter
however threw an error in the memory manager rather rapidly.

Fixed that by not calling gx_default_end_image in gx_enum_begin()
when we hit this particular error condition (no handler for an image).

This removes one of the free instances, and seems more reasonable anyway
it seems wrong to end an image we haven't yet begun.

This allows us to now propagate the error up from px_remap_pattern
without causing a seg fault or infinite loop. (finally)

base/gxipixel.c
pcl/pxl/pxink.c


2018-02-07 09:55:41 +0000
Ken Sharp <ken.sharp@artifex.com>
d527031607a881237819835c2b1045c81e24c387

Alter gs_initgraphcis to once again set the colour space and colour

At some time in the past gs_initgraphics was altered for 'colour substitution'
so that it did not reset the colour space and current colour. This is
surprising because the PostScript initgraphics operator is supposed to
do exactly that.

Restoring the code resulted in many seg faults with the PDF interpreter
so this is obviously a requirement, even though I can't see why.

However, leaving gs_initgraphics as it is would mean that (as per the
comment above the procedure) that all the interpreters (clients) would
have to reset the colour space and colour after calling it, which is
entirely unreasonable. Not only that, it hasn't been done leading to
the PXL interpreter printing error pages in the wrong colour.

This commit restores the setting of the colour space and colour to
gs_initgraphics, but introduces a new gs_initgraphics_no_cpsace()
procedure to be called from zinitgraphics, which behaves exactly as
the modified gs_initgraphics did, and does not set the colour space
or colour values.

The PDF interpreter now continues to work and the PXL interpreter now
prints a number of error pages in black where it previously was using a
pattern, grey or in one case green colour.

base/gsstate.c
base/gsstate.h
psi/zgstate.c


2018-02-07 09:49:34 +0000
Ken Sharp <ken.sharp@artifex.com>
28c58b4114ec145b8597372b6e29cec9e1f5df15

Yet more scanbuild warnings

gxhintn.c remove some unnecessary assignemnts

gxicolor.c remove an assignement, add an error check

gximono.c add an error check

gxiscale.c refactor code to remove some unnecessary assignments

gdevpsft.c remove unnecessary assignment

base/gxhintn.c
base/gxicolor.c
base/gximono.c
base/gxiscale.c
devices/vector/gdevpsft.c


2018-01-29 15:32:34 +0000
Robin Watts <robin.watts@artifex.com>
1b1015dc0e07b5269c4ee2009d5b896702550a3a

Tweak scale parameters in structure.

Be consistent with naming. Add PatchHeightOut and TopMarginOut so
we have the complete set. These are required for forthcoming work.

base/gxiscale.c
base/sidscale.c
base/siscale.c
base/sisparam.h
devices/vector/gdevpsdi.c


2018-02-02 12:48:07 +0000
Robin Watts <robin.watts@artifex.com>
38e0c643e62087c089c59c9ad44fc468dd09cd37

Tweak bitmap interpolater patch size.

When we interpolate an image, we restrict the interpolation to
the "patch" of the destination image that is actually visible.
Previously, the calculation of this patch has been inaccurate,
resulting in a larger area being decoded than was actually
needed.

While this extra work was largely mitigated by the "Active" area
detection code, it has meant that the contribution calculations
within the scaler were 'wrapping' the outside pixels in the
region to avoid accessing out of bounds.

This upsets the new library we are working on to do the scaling,
and it's basically inelegant. Instead we fix the destination
patch calculations so that the patch is correctly sized based
upon the available source data. This is safe to do because we
know the source data was already expanded.

base/gxiscale.c
base/sisparam.h


2018-02-06 11:46:56 +0000
Ken Sharp <ken.sharp@artifex.com>
f6005484617ada241d2f5f4deee4808616474831

Address more scanbuild/gcc/clang warnings

gdevkrnlsclass.c Change a while...do into a do...while to see if it
pacifies a 'dereference of NULL pointer' in scanbuild

gsparamx.c Incorrect return code could lead to an earlier error not
being preserved. Fortunately this is currently only called by claptrap.

gsptype1.c remove unnecessary assignments
gssprintf.c " " "
gstype2.c " " "
gstype42.c " " "
gxfill.c " " "

gsptype2.c rejig the code to avoid setting a return code that isn't used.
Add a check on a return code that was missing.

gxchar.c add return code checking
gxcmap.c " " " "

base/gdevkrnlsclass.c
base/gsparamx.c
base/gsptype1.c
base/gsptype2.c
base/gssprintf.c
base/gstype2.c
base/gstype42.c
base/gxchar.c
base/gxcmap.c
base/gxfill.c


2018-02-06 10:30:32 +0000
Ken Sharp <ken.sharp@artifex.com>
16688a8b833cf4e8950265e933604c32b1f2392e

Address more scanbuild/gcc/clang warnings

gp_os2.c free buffer and close file on memory full (as per other
error conditions).

gscicach.c remove unnecessary assignment
gsdparam.c " " " "
gxfapi.c " " " "

gscscie.c check a return code
zicc.c " " " "
zpcolor.c " " " "

mkromfs.c If realloc should fail in process_path, free working memory
print an error and exit as per other error conditions.

zcolor.c ensure depth cannot be 0. This should not be possible, no
existing code causes this, but its best to be safe and it prevents a
possible unassigned pointer dereference (possibly NULL) which is what
scanbuild complains of. Best to catch this in the interpreter.

base/gp_os2.c
base/gscicach.c
base/gscscie.c
base/gsdparam.c
base/gxfapi.c
base/mkromfs.c
psi/zcolor.c
psi/zicc.c
psi/zpcolor.c


2018-02-05 16:09:28 +0000
Ken Sharp <ken.sharp@artifex.com>
650aae633131396b802b2cae6e09afbd5aae6ad6

Coverity ID #261212

This probably showed up because of Ray's work adding return value
checking. Previously there were probably enough places not checking
the return code for Coverity to decide it was deliberate, now it is
raising a warning.

Add a check and take action on an error return.

psi/zcrd.c


2018-02-05 16:08:25 +0000
Ken Sharp <ken.sharp@artifex.com>
d7a5f0a14e873c7f5f557c4b635f4b4f166b41d2

Coverity ID #261211 - unchecked return value

This probably showed up because of Ray's work adding return value
checking. Previously there were probably enough places not checking
the return code for Coverity to decide t was deliberate, now it is
raising a warning.

Add a check of the return code.

devices/vector/gdevpsdi.c


2018-02-05 15:34:58 +0000
Ken Sharp <ken.sharp@artifex.com>
b8e36896913713f46a43dbbc0c0ed83f34ab4f10

Try to squash 3 identical scanbuild warnings

I think scanbuild is deciding that 'depth' could be less than 0, leading
us to not enter the loop which assigns 'obj'. This is not true, the
depth cannot be less than 0.

Try making 'depth' an unsigned int as a hint to scanbuild, and see if
the warning goes away.

psi/zcolor.c


2018-02-05 15:32:44 +0000
Ken Sharp <ken.sharp@artifex.com>
88e7812d362483d07ce63b47ae75c4852fe01a8f

txtwrite - honour error conditions

2 warnings from scanbuild, we were ignoring a potential error return in
two places.

devices/vector/gdevtxtw.c


2018-02-05 11:55:11 +0000
Ken Sharp <ken.sharp@artifex.com>
9c38c79741193010b23dabceb76996488415bd09

Clean up another scanbuild warning

We increment a local variable just before it goes out of scope, which is
clearly pointless.

devices/vector/gdevpsft.c


2018-02-05 11:54:14 +0000
Ken Sharp <ken.sharp@artifex.com>
0b4c59be1793c81e9d8cfeba04e74b6020571f5d

Fix another scanbuild warning

We don't seem to have any test cases which hit this, but it does look
possible from the code that we can end up trying to dereference
p_tile, and we don't check to see if its not NULL, which we do in a
lot of other places in this fucntion.

To be safe, test it first and return an error if its NULL.

devices/vector/gdevpdfv.c


2018-02-05 10:39:21 +0000
Ken Sharp <ken.sharp@artifex.com>
5d9d4bc1bbd272478bb9fd24fc1c0e44b0edc22a

Remove an unused function, clear a scanbuild warning

The function cos_write_stream_from_pipeline was never used, so remove
its definition.

At the same time try to squash a harmless scanbuild warning. We us a
'while(s....' loop to try and find a stream, scanbuild regards this as
implying that 's' might be NULL *initially*, which is not true. This
leads to a 'NULL pointer dereference' warning in the line after the
loop, because scanbuild thinks we can get to s->state with s being an
inital NULL.

Since we already check for s becoming NULL inside the loop, we don't
need to check it in while condition.

devices/vector/gdevpdfo.c


2018-02-05 10:35:16 +0000
Ken Sharp <ken.sharp@artifex.com>
43b2b593743433f45590b02b788c54d6bcf563a7

Prevent potential garbage pointer dereference

Picked up by scanbuild, if pdf_enter_substream failed then pres would be
left uninitialised, but we would then try to dereference it and assign a
value to a member before acting on the error return code.

Change the order of execution to test the return code first.

devices/vector/gdevpdti.c


2018-02-05 09:43:01 +0000
Ken Sharp <ken.sharp@artifex.com>
efb9bf3949617b4c733a6dcce04acd142c50115d

Remove faulty code picked up by scanbuild

scanbuild correctly warned that a variable was uninitialised. In fact
it looks to me like the code that was flagged simply can't work.

Fortunately it isn't exercised by any files in our test suite, and has
never been reported as a bug, so its clearly an uncommon (perhaps even
impossible) case.

All the same, lets fall back to the default handling if we hit it,
because at least that works, which the old code definitely didn't.

devices/vector/gdevpdfb.c


2018-02-05 09:40:50 +0000
Ken Sharp <ken.sharp@artifex.com>
ba6d8c5ec0fa27822041cb3bbc620e531fabcf0a

remove a scanbuild warning

We don't care about errors in this case, we are already aborting due
to an error. So just discard the status return.

devices/vector/gdevpdfj.c


2018-02-03 10:46:23 +0000
Ken Sharp <ken.sharp@artifex.com>
b119c51e5ce8d671bc33e38b7ebf7a5bdf5f9af5

Remove unused variable

another scanbuild warning

base/gsdevice.c


2018-02-03 10:26:18 +0000
Ken Sharp <ken.sharp@artifex.com>
dde422bb086ce0b2f56609fa3fc9af87867fc757

partially revert 07f9da3cb5647b18458cd52d1be35ab5365790eb

This was a scanbuild false positive, the original code was in fact
correct.

base/gdevkrnlsclass.c


2018-02-02 15:29:09 +0000
Ken Sharp <ken.sharp@artifex.com>
fa4941c607680159ed62bfe79b754a099adf5a4e

squash more scanbuild warnings

check some return values.

Remove some initialisations that aren't required.

Remove soem unused variables.

base/gsdparam.c
base/gsfunc0.c
base/gsht.c
base/gsht1.c


2018-02-02 14:43:23 +0000
Chris Liddell <chris.liddell@artifex.com>
3f38e3eeb6e6e7d88abbe1dca7675e237d5274e7

Remove spurious semi-colons introduced in 63f0fcc87e7c

I mistakenly left the trailing semi-colon in the macros defining the contents
of two pairs of structures.

Oddly, this caused a warning on VS2017, but not gcc/clang.

Thanks to Shailesh Mistry for pointing it out.

pcl/pl/pjparse.c


2018-02-02 13:11:05 +0000
Chris Liddell <chris.liddell@artifex.com>
452efeca35ee7e3fe381cae9a71d6efbcce68cd0

Address warning in gdevbit.c

Fix the "missing braces in initializer" warning - the explicit declaration of
the gs_bitrgbtags_device initializer had gotten out of step with the
gx_device_printer_s definition.

devices/gdevbit.c


2018-02-02 14:10:44 +0000
Ken Sharp <ken.sharp@artifex.com>
9036e05dfbcfa7968e00a53ef7ae9f6146740e94

Remove the 'device filter chain'

This was an early attempt to allow the possibility of 'chaining'
devices together. I believe it was never actually completed, although
the stack existed and was carefully preserved in the graphcis state,
the only code which accessed it was '.popdevicefilter'.

No C code or PostScript code ever actually pushed a device onto the
device filter stack, and nothing ever examined the stack to pass
operations through the 'chain'.

Since its been superseded by device subclassing, and didn't actually
seem to do anything anyway, remove it altogether. In addition to
removing clutter this also reduces the amount of 'magic' surrounding
reference counted objects in gstates.

base/gdevp14.c
base/gsgstate.c
base/gsstate.c
base/gxgstate.h
base/lib.mak
doc/Develop.htm
doc/who_owns_what.txt
psi/int.mak
psi/zdfilter.c
psi/ztrans.c
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-02-02 11:55:05 +0000
Ken Sharp <ken.sharp@artifex.com>
154f27478bdf5b27858a9f446433d5b62febb89d

remove some unused code - scanbuild warnings....

base/gsdevice.c


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

Fix some debug prints - scanbuild warning fix

The number of parameters and number of format specifiers didn't match,
this would only be apparent when built with DISPLAY_DEBUG defined.

psi/dpmain.c
psi/dwmainc.c


2018-02-02 11:16:11 +0000
Ken Sharp <ken.sharp@artifex.com>
1552615d4ae39a50a5f7bb40e5f481919ef0cb58

Fix memory leak - scanbuild warning

Not really a leak as such, but it prevents the warning.

psi/apitest.c


2018-02-02 11:15:13 +0000
Ken Sharp <ken.sharp@artifex.com>
ab8d4f968c01900e94438575ce33ae7a4fd63167

LCMS2art - fix some warnings from scanbuild

Make three functions static, to avoid 'no prototype' warnings.

lcms2art/src/cmsalpha.c
lcms2art/src/cmssamp.c


2018-02-02 09:45:39 +0000
Ken Sharp <ken.sharp@artifex.com>
0c9d19b947f9ca5bfe6ed1ba221e303d60bfc0cb

Remove the Mitsubishi CP50 colour dot matrix printer device

Recent changes caused this device to enter clist mode more frequently
and our automated testing revealed that in clist mode this device
does not work. It calls a device method which should never be called.

Its possible to remove the call, but we have no way to determine whether
the resulting output actually works.

Given the age of this device (and Mitsubishi have reused the model
number for a different device, so it must be old) we are removing
support for this device and deleting it fro the build.

If someone is still using this device, we'll reinstate support if they
are prepared to test the outptu for us.

base/unix-gcc.mak
configure.ac
devices/contrib.mak
devices/gdevcp50.c
doc/Develop.htm
psi/msvc.mak
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-02-02 08:54:35 +0000
Chris Liddell <chris.liddell@artifex.com>
252527b4257133a722f4f03dce1e8abcbcc3f3c8

Fix jmp_buf related compiler warning (setjmp_.h)

The compiler (gcc/clang) considers the alignment of entries in a structure to
be a run-time "variable", thus gives a warning when that value is used to
size an array used in a globally available data type.

The solution (suggested by Robin) is to use a buffer twice the size of a jmpbuf,
thus guaranteeing we have enough space to offset into the buffer, and get the
required alignment.

base/setjmp_.h


2018-02-01 14:56:31 +0000
Chris Liddell <chris.liddell@artifex.com>
f52a7ccf96f1b9bb90194ba1dd6a50040dd63896

Fix debug flag for TTF loading

Two places were erroneously using PDFDEBUG instead of TTFDEBUG

Resource/Init/gs_ttf.ps


2018-02-01 09:46:21 +0000
Chris Liddell <chris.liddell@artifex.com>
5b546c80e79e6d1f1c6c3a9a71bfb58ee23a328c

Address the popen prototype warning

Only include the hacky popen() prototype if it doesn't already exist in the
standard header files.

Makefile.in
base/pipe_.h
configure.ac


2018-02-01 11:40:20 +0000
Ken Sharp <ken.sharp@artifex.com>
88aea05567f36d4d37c00a51b818c80f88291f6b

Remove another unused procedure from the OpenJPEG interface

base/sjpx_openjpeg.c


2018-01-31 09:56:46 +0000
Chris Liddell <chris.liddell@artifex.com>
63f0fcc87e7c6a0ca38e92b7b3d72f1e936f2d0e

Fix discarded qualifier warnings in pcl/pl/pjparse.c

Create separate structure definitions for the normal and default PJL
environment and PJL font sources data.

The only difference between the two is the default one qualifies string
values as const.

pcl/pl/pjparse.c


2018-01-31 11:59:02 +0000
Chris Liddell <chris.liddell@artifex.com>
4d2f9f48fc272b7bb396f36704de03a7c15d2b3f

Fix _MSC_VER undefined warnings on non-MSC compilers

lcms2art/src/lcms2_internal.h


2018-01-31 10:22:34 +0000
Chris Liddell <chris.liddell@artifex.com>
b272292d9294e88e32d177d8b5e916f8bfaeb78b

Add a zlib specific CFLAGS and avoid discarded const warning

zlib has a table initialization with string literals that gcc
automatically makes const, but the structure definition for the table does not
qualify those entries as const. Hence we get warnings.

This adds ZLIB_CFLAGS and, with a gcc compatible compiler, sets it to:
-Wno-write-strings

which kills that warning.

Done this way because we want to retain that warning in the Ghostscript code.

Makefile.in
base/zlib.mak
configure.ac


2018-01-31 09:34:39 +0000
Chris Liddell <chris.liddell@artifex.com>
aea7d587749819b7e59d24720efe86b1f8555186

Add a TIFF specific CFLAGS and avoid discarded const warning

libtiff has a large table initialization with string literals that gcc
automatically makes const, but the structure definition for the table does not
qualify those entries as const. Hence we get warnings.

This adds TIFF_CFLAGS and, with a gcc compatible compiler, sets it to:
-Wno-write-strings

which kills that warning.

Done this way because we want to retain that warning in the Ghostscript code.

Makefile.in
base/tiff.mak
configure.ac


2018-01-27 23:11:13 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
865c3a83a449dc2c28f58095183b7493ccd970c4

Update error code checking to use hpgl_call within pgdraw.c file. Also
revert error code check in hpgl_draw_current_path to prevent failures
during cluster run.

pcl/pcl/pgdraw.c


2018-01-27 17:50:41 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
4ae64a398e6d5693c1dd4dd9348054cd21ef2443

Check all return code from param_write_float_array.

pcl/pcl/pcommand.c
pcl/pxl/pxsessio.c


2018-01-27 16:50:23 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
d372efa33d9e2550b887154e2d6a3b9d03bc6438

Check all return codes from pxPassthrough_init.

pcl/pxl/pxpthr.c


2018-01-27 16:27:08 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
cc620400517cd76a5276602aea59f1231f934c46

Check all return codes from pcl_enter_graphics_mode.

pcl/pcl/rtgmode.c


2018-01-27 15:18:02 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
db10b7b56e5de12f92c1df83237ec4ff4b0dcf2a

Check all return codes from pcl_end_graphics_mode.

pcl/pcl/pctop.c
pcl/pcl/rtgmode.c


2018-01-26 22:45:54 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
1df8810b79c5ef5979b1cad5ffe22a1fed824871

Update propagation of error codes from pcl_end_page.

pcl/pcl/pcjob.c
pcl/pcl/pcpage.c


2018-01-26 22:17:36 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e63064cfa3142e7a893a1666570f390d83662360

Update pcl_mark_page_for_character to propagate error codes.

pcl/pcl/pcpage.c
pcl/pcl/pcpage.h
pcl/pcl/pctext.c


2018-01-26 21:57:56 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
6f514a99fdb079d76df981a39dcb45f090766849

Update functionality to propagate error codes.

pcl/pcl/pcpage.c
pcl/pcl/pcpage.h
pcl/pcl/pgdraw.c
pcl/pcl/pglabel.c


2018-01-26 21:20:02 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
193d143d1843edb2515138e6b4b9e7c4f5c06aa5

Update functionality to propagate error codes returned from new_page_size.

pcl/pcl/pcpage.c
pcl/pcl/pcpage.h


2018-01-26 17:59:15 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
0d3c2753172bb9e22aa879d7503ec44f4b33e8f4

Update pcl_transform_rect to remove unused memory variable.

pcl/pcl/pcpage.c
pcl/pcl/pcpatxfm.c
pcl/pcl/pcpatxfm.h
pcl/pcl/rtgmode.c


2018-01-31 15:37:17 +0000
Ken Sharp <ken.sharp@artifex.com>
961b01a6e50e640afac0e696f9ce74a677e648ec

Squash more scan build warnings

Remove initialisations which aren't required (sometimes due to multiple
initialisations.

In interp.c, store the error value in the actual return code.

Action error return codes.

Fix a few white space oddities.

psi/dscparse.c
psi/gs.c
psi/imain.c
psi/interp.c
psi/zcie.c
psi/zcolor.c


2018-01-31 14:47:41 +0000
Ken Sharp <ken.sharp@artifex.com>
7220e8e037ccee1c234872d143ec0ca14682604b

Squash some more warnings

scan build this time, none of them serious.

Check some return codes and remove some unused variables.

devices/gdevpdfimg.c
devices/vector/gdevpdf.c
devices/vector/gdevpdfc.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdft.c
devices/vector/gdevpdfu.c
devices/vector/gdevpsdp.c


2018-01-31 09:59:01 +0000
Ken Sharp <ken.sharp@artifex.com>
68fcaea85611267eec9f4bac3443977fe15627dc

squash GCC warnings

remove an unused variable from a (large) macro in gxfilltr.h

remove some unused variables, and an entire unused function in
sjpx_openjpeg.c

remove an unused variable in gdevbit.c

remove an unused variable in gdevjpeg.c

bracket a variable declaration and usage with #ifdef DEBUG to prevent
the compiler warning that the variable is set but not read on non-debug
builds. gdevxps.c

preserve 'const' when passing a memory pointer to a procedure to
avoid a warning about discarding const. zcie.c

base/gxfilltr.h
base/sjpx_openjpeg.c
devices/gdevbit.c
devices/gdevjpeg.c
devices/vector/gdevxps.c
psi/zcie.c


2018-01-31 09:55:34 +0000
Ken Sharp <ken.sharp@artifex.com>
07f9da3cb5647b18458cd52d1be35ab5365790eb

Device subclassing - fix potential problems

Flagged by scan build, the code to work a chain of devices had a
potential problem in walking up and down the chain.

Also flagged by scan build, the create_compositor method checked the
target child device before trying to use it to set the saved target
color info, but didn't check it before trying to set the procs.

base/gdevdflt.c
base/gdevkrnlsclass.c


2018-01-30 11:49:19 -0800
Ray Johnston <ray.johnston@artifex.com>
67daf3d995d83da98988085e68548a4920fe1747

Get rid of some gcc warnings.

Add initializers for variables that confuse gcc. Also get rid of the
clist_reinit_output_file which was only needed for the RETRYING code
and the partial page rendering (this function had unused variable
warnings). THis should have been part of commit 7eda41b.

base/gxclist.c
base/gxclpath.c
base/gxclrast.c


2018-01-30 16:37:58 +0000
Ken Sharp <ken.sharp@artifex.com>
22cf826fe4d0c0206be582d35c99954199dee999

Update copyright notice with new head office address.

Also update copyright dates.

Remove gs_cmdl.ps as we no longer use it, and remove its entry from
psfiles.htm.

Remove xfonts.htm as this feature (xfont support) is long, long gone.

Makefile.in
Resource/CIDFont/ArtifexBullet
Resource/CMap/Identity-UTF16-H
Resource/ColorSpace/DefaultCMYK
Resource/ColorSpace/DefaultGray
Resource/ColorSpace/DefaultRGB
Resource/ColorSpace/TrivialCMYK
Resource/ColorSpace/sGray
Resource/ColorSpace/sRGB
Resource/Decoding/FCO_Dingbats
Resource/Decoding/FCO_Symbol
Resource/Decoding/FCO_Unicode
Resource/Decoding/FCO_Wingdings
Resource/Decoding/Latin1
Resource/Decoding/StandardEncoding
Resource/Decoding/Unicode
Resource/Encoding/CEEncoding
Resource/Encoding/ExpertEncoding
Resource/Encoding/ExpertSubsetEncoding
Resource/Encoding/NotDefEncoding
Resource/Encoding/Wingdings
Resource/Init/FCOfontmap-PCLPS2
Resource/Init/Fontmap.GS
Resource/Init/gs_agl.ps
Resource/Init/gs_btokn.ps
Resource/Init/gs_cff.ps
Resource/Init/gs_cidcm.ps
Resource/Init/gs_ciddc.ps
Resource/Init/gs_cidfm.ps
Resource/Init/gs_cidfn.ps
Resource/Init/gs_cidtt.ps
Resource/Init/gs_cmap.ps
Resource/Init/gs_cspace.ps
Resource/Init/gs_dbt_e.ps
Resource/Init/gs_diskn.ps
Resource/Init/gs_dpnxt.ps
Resource/Init/gs_dps.ps
Resource/Init/gs_dps1.ps
Resource/Init/gs_dps2.ps
Resource/Init/gs_dscp.ps
Resource/Init/gs_epsf.ps
Resource/Init/gs_fapi.ps
Resource/Init/gs_fntem.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_frsd.ps
Resource/Init/gs_icc.ps
Resource/Init/gs_il1_e.ps
Resource/Init/gs_img.ps
Resource/Init/gs_init.ps
Resource/Init/gs_l2img.ps
Resource/Init/gs_lev2.ps
Resource/Init/gs_ll3.ps
Resource/Init/gs_mex_e.ps
Resource/Init/gs_mgl_e.ps
Resource/Init/gs_mro_e.ps
Resource/Init/gs_pdf_e.ps
Resource/Init/gs_pdfwr.ps
Resource/Init/gs_res.ps
Resource/Init/gs_resmp.ps
Resource/Init/gs_setpd.ps
Resource/Init/gs_statd.ps
Resource/Init/gs_std_e.ps
Resource/Init/gs_sym_e.ps
Resource/Init/gs_trap.ps
Resource/Init/gs_ttf.ps
Resource/Init/gs_typ32.ps
Resource/Init/gs_typ42.ps
Resource/Init/gs_type1.ps
Resource/Init/gs_wan_e.ps
Resource/Init/pdf_base.ps
Resource/Init/pdf_draw.ps
Resource/Init/pdf_font.ps
Resource/Init/pdf_main.ps
Resource/Init/pdf_ops.ps
Resource/Init/pdf_rbld.ps
Resource/Init/pdf_sec.ps
Resource/SubstCID/CNS1-WMode
Resource/SubstCID/GB1-WMode
Resource/SubstCID/Japan1-WMode
Resource/SubstCID/Korea1-WMode
arch/arch_autoconf.h.in
arch/windows-arm-msvc.h
arch/windows-x64-msvc.h
arch/windows-x86-msvc.h
base/all-arch.mak
base/assert_.h
base/bench.c
base/bobbin.c
base/bobbin.h
base/claptrap-init.c
base/claptrap-planar.c
base/claptrap.c
base/claptrap.h
base/ctype_.h
base/dirent_.h
base/dos_.h
base/echogs.c
base/errno_.h
base/expat.mak
base/fapi_bs.mak
base/fapi_ft.c
base/fapibstm.c
base/fapiufst.c
base/fcntl_.h
base/freetype.mak
base/gconf.c
base/gconf.h
base/gdbflags.h
base/gdebug.h
base/gdevabuf.c
base/gdevbbox.c
base/gdevbbox.h
base/gdevdbit.c
base/gdevdcrd.c
base/gdevdcrd.h
base/gdevddrw.c
base/gdevddrw.h
base/gdevdevn.c
base/gdevdevn.h
base/gdevdevnprn.h
base/gdevdflt.c
base/gdevdgbr.c
base/gdevdrop.c
base/gdevdsha.c
base/gdevemap.c
base/gdevflp.c
base/gdevflp.h
base/gdevhit.c
base/gdevkrnlsclass.c
base/gdevkrnlsclass.h
base/gdevm1.c
base/gdevm16.c
base/gdevm2.c
base/gdevm24.c
base/gdevm32.c
base/gdevm4.c
base/gdevm40.c
base/gdevm48.c
base/gdevm56.c
base/gdevm64.c
base/gdevm8.c
base/gdevmem.c
base/gdevmem.h
base/gdevmpla.c
base/gdevmpla.h
base/gdevmplt.c
base/gdevmplt.h
base/gdevmr1.c
base/gdevmr2n.c
base/gdevmr8n.c
base/gdevmrop.h
base/gdevmrun.c
base/gdevmrun.h
base/gdevmx.c
base/gdevnfwd.c
base/gdevoflt.c
base/gdevoflt.h
base/gdevp14.c
base/gdevp14.h
base/gdevpccm.c
base/gdevpccm.h
base/gdevpipe.c
base/gdevplnx.c
base/gdevplnx.h
base/gdevppla.c
base/gdevppla.h
base/gdevprn.c
base/gdevprn.h
base/gdevpxat.h
base/gdevpxen.h
base/gdevpxop.h
base/gdevrops.c
base/gdevsclass.c
base/gdevsclass.h
base/gdevvec.c
base/gdevvec.h
base/gen_ordered.c
base/gen_ordered.h
base/genarch.c
base/genconf.c
base/gendev.c
base/genht.c
base/gp.h
base/gp_dosfe.c
base/gp_dosfs.c
base/gp_dvx.c
base/gp_getnv.c
base/gp_mktmp.c
base/gp_msdll.c
base/gp_msdos.c
base/gp_mshdl.c
base/gp_mslib.c
base/gp_mspol.c
base/gp_msprn.c
base/gp_mswin.c
base/gp_mswin.h
base/gp_nsync.c
base/gp_ntfs.c
base/gp_nxpsprn.c
base/gp_os2.c
base/gp_os2.h
base/gp_os2fs.c
base/gp_os2pr.c
base/gp_os9.c
base/gp_paper.c
base/gp_psync.c
base/gp_stdia.c
base/gp_stdin.c
base/gp_strdl.c
base/gp_sysv.c
base/gp_unifn.c
base/gp_unifs.c
base/gp_unix.c
base/gp_upapr.c
base/gp_vms.c
base/gp_wgetv.c
base/gp_win32.c
base/gp_wpapr.c
base/gp_wsync.c
base/gp_wutf8.c
base/gp_wxpsprn.cpp
base/gpcheck.h
base/gpgetenv.h
base/gpmisc.c
base/gpmisc.h
base/gpsync.h
base/gs.mak
base/gs_dll_call.h
base/gs_mgl_e.h
base/gs_mro_e.h
base/gsalloc.c
base/gsalloc.h
base/gsalpha.c
base/gsalpha.h
base/gsalphac.c
base/gsalphac.h
base/gsargs.c
base/gsargs.h
base/gsbitcom.c
base/gsbitmap.h
base/gsbitops.c
base/gsbitops.h
base/gsbittab.c
base/gsbittab.h
base/gsccode.h
base/gsccolor.h
base/gscdef.c
base/gscdefs.h
base/gscdevn.c
base/gscdevn.h
base/gscedata.c
base/gscedata.h
base/gscencs.c
base/gscencs.h
base/gschar.c
base/gschar.h
base/gschar0.c
base/gscicach.c
base/gscicach.h
base/gscie.c
base/gscie.h
base/gsciemap.c
base/gscindex.h
base/gsclipsr.c
base/gsclipsr.h
base/gscms.h
base/gscolor.c
base/gscolor.h
base/gscolor1.c
base/gscolor1.h
base/gscolor2.c
base/gscolor2.h
base/gscolor3.c
base/gscolor3.h
base/gscompt.h
base/gscoord.c
base/gscoord.h
base/gscparam.c
base/gscpixel.c
base/gscpixel.h
base/gscpm.h
base/gscrd.c
base/gscrd.h
base/gscrdp.c
base/gscrdp.h
base/gscrypt1.c
base/gscrypt1.h
base/gscscie.c
base/gscsel.h
base/gscsepr.c
base/gscsepr.h
base/gscspace.c
base/gscspace.h
base/gscssub.c
base/gscssub.h
base/gsdcolor.h
base/gsdevice.c
base/gsdevice.h
base/gsdevmem.c
base/gsdfilt.c
base/gsdfilt.h
base/gsdll.h
base/gsdllwin.h
base/gsdparam.c
base/gsdpnext.h
base/gsdps.c
base/gsdps.h
base/gsdps1.c
base/gsdsrc.c
base/gsdsrc.h
base/gsequivc.c
base/gsequivc.h
base/gserrors.h
base/gsexit.h
base/gsfcid.c
base/gsfcid2.c
base/gsfcmap.c
base/gsfcmap.h
base/gsfcmap1.c
base/gsflip.c
base/gsflip.h
base/gsfname.c
base/gsfname.h
base/gsfont.c
base/gsfont.h
base/gsfont0.c
base/gsfont0c.c
base/gsform1.h
base/gsfunc.c
base/gsfunc.h
base/gsfunc0.c
base/gsfunc0.h
base/gsfunc3.c
base/gsfunc3.h
base/gsfunc4.c
base/gsfunc4.h
base/gsgc.h
base/gsgcache.c
base/gsgcache.h
base/gsgdata.c
base/gsgdata.h
base/gsgstate.c
base/gshsb.c
base/gshsb.h
base/gsht.c
base/gsht.h
base/gsht1.c
base/gsht1.h
base/gshtscr.c
base/gshtx.c
base/gshtx.h
base/gsicc.c
base/gsicc.h
base/gsicc_cache.c
base/gsicc_cache.h
base/gsicc_cms.h
base/gsicc_create.c
base/gsicc_create.h
base/gsicc_lcms2.c
base/gsicc_lcms2art.c
base/gsicc_manage.c
base/gsicc_manage.h
base/gsicc_monitorcm.c
base/gsicc_nocm.c
base/gsicc_profilecache.c
base/gsicc_profilecache.h
base/gsicc_replacecm.c
base/gsimage.c
base/gsimage.h
base/gsimpath.c
base/gsinit.c
base/gsio.h
base/gsiodev.c
base/gsiodevs.c
base/gsiodisk.c
base/gsioram.c
base/gsiorom.c
base/gsiorom.h
base/gsipar3x.h
base/gsiparam.h
base/gsiparm2.h
base/gsiparm3.h
base/gsiparm4.h
base/gsjconf.h
base/gsjmorec.h
base/gslib.c
base/gslib.h
base/gslibctx.c
base/gslibctx.h
base/gsline.c
base/gsline.h
base/gslparam.h
base/gsmalloc.c
base/gsmalloc.h
base/gsmatrix.c
base/gsmatrix.h
base/gsmchunk.c
base/gsmchunk.h
base/gsmd5.c
base/gsmd5.h
base/gsmdebug.h
base/gsmemory.c
base/gsmemory.h
base/gsmemraw.h
base/gsmemret.c
base/gsmemret.h
base/gsmisc.c
base/gsnamecl.c
base/gsnamecl.h
base/gsncdummy.c
base/gsncdummy.h
base/gsnogc.c
base/gsnogc.h
base/gsnotify.c
base/gsnotify.h
base/gsovrc.c
base/gsovrc.h
base/gspaint.c
base/gspaint.h
base/gsparam.c
base/gsparam.h
base/gsparam2.c
base/gsparams.c
base/gsparams.h
base/gsparamx.c
base/gsparamx.h
base/gspath.c
base/gspath.h
base/gspath1.c
base/gspath2.h
base/gspcolor.c
base/gspcolor.h
base/gspenum.h
base/gspmdrv.c
base/gspmdrv.h
base/gspmdrv.rc
base/gsptype1.c
base/gsptype1.h
base/gsptype2.c
base/gsptype2.h
base/gsrect.h
base/gsrefct.h
base/gsromfs0.c
base/gsrop.c
base/gsrop.h
base/gsroprun.c
base/gsroprun1.h
base/gsroprun24.h
base/gsroprun8.h
base/gsropt.h
base/gsroptab.c
base/gsserial.c
base/gsserial.h
base/gsshade.c
base/gsshade.h
base/gssprintf.h
base/gsstate.c
base/gsstate.h
base/gsstrl.h
base/gsstrtok.h
base/gsstruct.h
base/gsstype.h
base/gstext.c
base/gstext.h
base/gstiffio.c
base/gstiffio.h
base/gstparam.h
base/gstrans.c
base/gstrans.h
base/gstrap.c
base/gstrap.h
base/gstype1.c
base/gstype1.h
base/gstype2.c
base/gstype42.c
base/gstypes.h
base/gsuid.h
base/gsutil.c
base/gsutil.h
base/gswin.rc
base/gsxfont.h
base/gx.h
base/gxacpath.c
base/gxalloc.h
base/gxalpha.h
base/gxarith.h
base/gxband.h
base/gxbcache.c
base/gxbcache.h
base/gxbitfmt.h
base/gxbitmap.h
base/gxbitops.h
base/gxblend.c
base/gxblend.h
base/gxblend1.c
base/gxccache.c
base/gxccman.c
base/gxcdevn.h
base/gxchar.c
base/gxchar.h
base/gxchrout.c
base/gxchrout.h
base/gxcht.c
base/gxcid.h
base/gxcie.h
base/gxcindex.h
base/gxclbits.c
base/gxcldev.h
base/gxclfile.c
base/gxclimag.c
base/gxclio.h
base/gxclip.c
base/gxclip.h
base/gxclip2.c
base/gxclip2.h
base/gxclipm.c
base/gxclipm.h
base/gxclipsr.h
base/gxclist.c
base/gxclist.h
base/gxcllzw.c
base/gxclmem.c
base/gxclmem.h
base/gxclpage.c
base/gxclpage.h
base/gxclpath.c
base/gxclpath.h
base/gxclrast.c
base/gxclread.c
base/gxclrect.c
base/gxclthrd.c
base/gxclthrd.h
base/gxclutil.c
base/gxclzlib.c
base/gxcmap.c
base/gxcmap.h
base/gxcolor2.h
base/gxcomp.h
base/gxcoord.h
base/gxcpath.c
base/gxcpath.h
base/gxcspace.h
base/gxctable.c
base/gxctable.h
base/gxcvalue.h
base/gxdcconv.c
base/gxdcconv.h
base/gxdcolor.c
base/gxdcolor.h
base/gxdda.h
base/gxdevbuf.h
base/gxdevcli.h
base/gxdevice.h
base/gxdevmem.h
base/gxdevndi.c
base/gxdevndi.h
base/gxdevrop.h
base/gxdevsop.h
base/gxdht.h
base/gxdhtres.h
base/gxdhtserial.c
base/gxdhtserial.h
base/gxdither.h
base/gxdownscale.c
base/gxdownscale.h
base/gxdtfill.h
base/gxfapi.c
base/gxfapi.h
base/gxfapiu.c
base/gxfapiu.h
base/gxfarith.h
base/gxfcache.h
base/gxfcid.h
base/gxfcmap.h
base/gxfcmap1.h
base/gxfill.c
base/gxfill.h
base/gxfillsl.h
base/gxfilltr.h
base/gxfillts.h
base/gxfixed.h
base/gxfmap.h
base/gxfont.h
base/gxfont0.h
base/gxfont0c.h
base/gxfont1.h
base/gxfont42.h
base/gxfrac.h
base/gxftype.h
base/gxfunc.h
base/gxgetbit.h
base/gxgstate.h
base/gxhintn.c
base/gxhintn.h
base/gxhintn1.c
base/gxhldevc.c
base/gxhldevc.h
base/gxht.c
base/gxht.h
base/gxht_thresh.c
base/gxht_thresh.h
base/gxhtbit.c
base/gxhttile.h
base/gxhttype.h
base/gxi12bit.c
base/gxi16bit.c
base/gxiclass.h
base/gxicolor.c
base/gxidata.c
base/gxifast.c
base/gximag3x.c
base/gximag3x.h
base/gximage.c
base/gximage.h
base/gximage1.c
base/gximage2.c
base/gximage3.c
base/gximage3.h
base/gximage4.c
base/gximask.c
base/gximask.h
base/gximdecode.c
base/gximdecode.h
base/gximono.c
base/gxiodev.h
base/gxiparam.h
base/gxipixel.c
base/gxiscale.c
base/gxline.h
base/gxlum.h
base/gxmatrix.h
base/gxmclip.c
base/gxmclip.h
base/gxobj.h
base/gxoprect.c
base/gxoprect.h
base/gxp1fill.c
base/gxp1impl.h
base/gxpaint.c
base/gxpaint.h
base/gxpath.c
base/gxpath.h
base/gxpath2.c
base/gxpcache.h
base/gxpcmap.c
base/gxpcolor.h
base/gxpcopy.c
base/gxpdash.c
base/gxpflat.c
base/gxrplane.h
base/gxsample.c
base/gxsample.h
base/gxsamplp.h
base/gxscanc.c
base/gxscanc.h
base/gxshade.c
base/gxshade.h
base/gxshade1.c
base/gxshade4.c
base/gxshade4.h
base/gxshade6.c
base/gxstate.h
base/gxstdio.h
base/gxstroke.c
base/gxsync.c
base/gxsync.h
base/gxtext.h
base/gxtmap.h
base/gxttf.h
base/gxttfb.c
base/gxttfb.h
base/gxtype1.c
base/gxtype1.h
base/gxxfont.h
base/gzacpath.h
base/gzcpath.h
base/gzht.h
base/gzline.h
base/gzpath.h
base/gzspotan.c
base/gzspotan.h
base/gzstate.h
base/ijs.mak
base/instcopy
base/jbig2.mak
base/jerror_.h
base/jmemcust.c
base/jmemcust.h
base/jpeg.mak
base/jpegxr.mak
base/lcms2.mak
base/lcms2art.mak
base/lcups.mak
base/lcupsi.mak
base/ldf_jb2.mak
base/lib.mak
base/locale_.h
base/lwf_jp2.mak
base/malloc_.h
base/math_.h
base/md5main.c
base/memento.c
base/memento.h
base/memory_.h
base/mkromfs.c
base/msvccmd.mak
base/msvclib.mak
base/msvctail.mak
base/openjpeg.mak
base/openvms.mak
base/openvms.mmk
base/pack_ps.c
base/pcwin.mak
base/pipe_.h
base/png.mak
base/png_.h
base/ramfs.c
base/ramfs.h
base/sa85d.c
base/sa85d.h
base/sa85x.h
base/saes.c
base/saes.h
base/sarc4.c
base/sarc4.h
base/sbcp.c
base/sbcp.h
base/sbtx.h
base/scanchar.h
base/scantab.c
base/scf.h
base/scfd.c
base/scfdgen.c
base/scfdtab.c
base/scfe.c
base/scfetab.c
base/scfparam.c
base/scfx.h
base/scommon.h
base/sdcparam.c
base/sdcparam.h
base/sdct.h
base/sdctc.c
base/sdctd.c
base/sdcte.c
base/sddparam.c
base/sdeparam.c
base/seexec.c
base/setjmp_.h
base/sfilter.h
base/sfilter2.c
base/sfxboth.c
base/sfxcommon.c
base/sfxfd.c
base/sfxstdio.c
base/shc.c
base/shc.h
base/sidscale.c
base/sidscale.h
base/siinterp.c
base/siinterp.h
base/simscale.c
base/simscale.h
base/siscale.c
base/siscale.h
base/sisparam.h
base/sjbig2.c
base/sjbig2.h
base/sjbig2_luratech.c
base/sjbig2_luratech.h
base/sjpeg.h
base/sjpegc.c
base/sjpegd.c
base/sjpege.c
base/sjpx_luratech.c
base/sjpx_luratech.h
base/sjpx_none.c
base/sjpx_openjpeg.c
base/sjpx_openjpeg.h
base/slzwc.c
base/slzwd.c
base/slzwe.c
base/slzwx.h
base/smd5.c
base/smd5.h
base/smtf.h
base/spdiff.c
base/spdiffx.h
base/spngp.c
base/spngpx.h
base/spprint.c
base/spprint.h
base/spsdf.c
base/spsdf.h
base/spwgd.c
base/spwgx.h
base/srdline.h
base/srld.c
base/srle.c
base/srlx.h
base/ssha2.c
base/ssha2.h
base/sstring.c
base/sstring.h
base/stat_.h
base/std.h
base/stdint_.h
base/stdio_.h
base/stdpre.h
base/stream.c
base/stream.h
base/strimpl.h
base/string_.h
base/strmio.c
base/strmio.h
base/stub.mak
base/szlibc.c
base/szlibd.c
base/szlibe.c
base/szlibx.h
base/szlibxx.h
base/tiff.mak
base/time_.h
base/ttcalc.c
base/ttcalc.h
base/ttcommon.h
base/ttconf.h
base/ttconfig.h
base/ttfinp.c
base/ttfinp.h
base/ttfmain.c
base/ttfmemd.c
base/ttfmemd.h
base/ttfoutl.h
base/ttfsfnt.h
base/ttinterp.c
base/ttinterp.h
base/ttload.c
base/ttload.h
base/ttmisc.h
base/ttobjs.c
base/ttobjs.h
base/tttables.h
base/tttype.h
base/tttypes.h
base/ugcclib.mak
base/unistd_.h
base/unix-aux.mak
base/unix-dll.mak
base/unix-end.mak
base/unix-gcc.mak
base/unixansi.mak
base/unixhead.mak
base/unixinst.mak
base/unixlink.mak
base/valgrind.h
base/version.mak
base/vms_x_fix.h
base/vmsmath.h
base/windows_.h
base/winlib.mak
base/winplat.mak
base/winrtsup.cpp
base/winrtsup.h
base/wrfont.c
base/wrfont.h
base/write_t1.c
base/write_t1.h
base/write_t2.c
base/write_t2.h
base/x_.h
base/zlib.mak
configure.ac
devices/contrib.mak
devices/devs.mak
devices/gdev3852.c
devices/gdev4081.c
devices/gdev8510.c
devices/gdev8bcm.c
devices/gdev8bcm.h
devices/gdevatx.c
devices/gdevbit.c
devices/gdevbj10.c
devices/gdevbjc.h
devices/gdevbjcl.c
devices/gdevbjcl.h
devices/gdevbmp.c
devices/gdevbmp.h
devices/gdevbmpc.c
devices/gdevccr.c
devices/gdevcdj.c
devices/gdevcfax.c
devices/gdevcif.c
devices/gdevclj.c
devices/gdevcljc.c
devices/gdevcmykog.c
devices/gdevcp50.c
devices/gdevcslw.c
devices/gdevdfax.c
devices/gdevdjet.c
devices/gdevdjtc.c
devices/gdevdljm.c
devices/gdevdljm.h
devices/gdevdm24.c
devices/gdevdsp.c
devices/gdevdsp.h
devices/gdevdsp2.h
devices/gdevepsc.c
devices/gdevepsn.c
devices/gdevescp.c
devices/gdevfax.c
devices/gdevfax.h
devices/gdevfpng.c
devices/gdevgprf.c
devices/gdevhl7x.c
devices/gdevicov.c
devices/gdevijs.c
devices/gdevimgn.c
devices/gdevjbig2.c
devices/gdevjpeg.c
devices/gdevjpx.c
devices/gdevl31s.c
devices/gdevlbp8.c
devices/gdevlj56.c
devices/gdevlp8k.c
devices/gdevlxm.c
devices/gdevmeds.c
devices/gdevmeds.h
devices/gdevmgr.c
devices/gdevmgr.h
devices/gdevmiff.c
devices/gdevn533.c
devices/gdevo182.c
devices/gdevokii.c
devices/gdevpbm.c
devices/gdevpcl.c
devices/gdevpcl.h
devices/gdevpcx.c
devices/gdevpe.c
devices/gdevperm.c
devices/gdevphex.c
devices/gdevpjet.c
devices/gdevplan.c
devices/gdevplib.c
devices/gdevplib.h
devices/gdevpm.h
devices/gdevpng.c
devices/gdevpsd.c
devices/gdevpsd.h
devices/gdevpsim.c
devices/gdevpxut.c
devices/gdevpxut.h
devices/gdevrinkj.c
devices/gdevsj48.c
devices/gdevsnfb.c
devices/gdevsppr.c
devices/gdevstc.c
devices/gdevstc.h
devices/gdevstc1.c
devices/gdevstc2.c
devices/gdevstc3.c
devices/gdevstc4.c
devices/gdevtfax.c
devices/gdevtfax.h
devices/gdevtfnx.c
devices/gdevtifs.c
devices/gdevtifs.h
devices/gdevtknk.c
devices/gdevtrac.c
devices/gdevtsep.c
devices/gdevupd.c
devices/gdevwpr2.c
devices/gdevx.c
devices/gdevx.h
devices/gdevxalt.c
devices/gdevxcf.c
devices/gdevxcmp.c
devices/gdevxcmp.h
devices/gdevxini.c
devices/gdevxres.c
devices/gxfcopy.c
devices/gxfcopy.h
devices/minftrsz.c
devices/minftrsz.h
devices/rinkj/evenbetter-rll.c
devices/rinkj/evenbetter-rll.h
devices/rinkj/rinkj-byte-stream.c
devices/rinkj/rinkj-byte-stream.h
devices/rinkj/rinkj-config.c
devices/rinkj/rinkj-config.h
devices/rinkj/rinkj-device.c
devices/rinkj/rinkj-device.h
devices/rinkj/rinkj-dither.c
devices/rinkj/rinkj-dither.h
devices/rinkj/rinkj-epson870.c
devices/rinkj/rinkj-epson870.h
devices/rinkj/rinkj-screen-eb.c
devices/rinkj/rinkj-screen-eb.h
devices/vector/gdevagl.c
devices/vector/gdevagl.h
devices/vector/gdevpdf.c
devices/vector/gdevpdfb.c
devices/vector/gdevpdfb.h
devices/vector/gdevpdfc.c
devices/vector/gdevpdfc.h
devices/vector/gdevpdfd.c
devices/vector/gdevpdfe.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfg.h
devices/vector/gdevpdfi.c
devices/vector/gdevpdfj.c
devices/vector/gdevpdfk.c
devices/vector/gdevpdfm.c
devices/vector/gdevpdfo.c
devices/vector/gdevpdfo.h
devices/vector/gdevpdfp.c
devices/vector/gdevpdfr.c
devices/vector/gdevpdft.c
devices/vector/gdevpdfu.c
devices/vector/gdevpdfv.c
devices/vector/gdevpdfx.h
devices/vector/gdevpdt.c
devices/vector/gdevpdt.h
devices/vector/gdevpdtb.c
devices/vector/gdevpdtb.h
devices/vector/gdevpdtc.c
devices/vector/gdevpdtd.c
devices/vector/gdevpdtd.h
devices/vector/gdevpdte.c
devices/vector/gdevpdtf.c
devices/vector/gdevpdtf.h
devices/vector/gdevpdti.c
devices/vector/gdevpdti.h
devices/vector/gdevpdts.c
devices/vector/gdevpdts.h
devices/vector/gdevpdtt.c
devices/vector/gdevpdtt.h
devices/vector/gdevpdtv.c
devices/vector/gdevpdtv.h
devices/vector/gdevpdtw.c
devices/vector/gdevpdtw.h
devices/vector/gdevpdtx.h
devices/vector/gdevpsdf.h
devices/vector/gdevpsdi.c
devices/vector/gdevpsdp.c
devices/vector/gdevpsds.c
devices/vector/gdevpsds.h
devices/vector/gdevpsdu.c
devices/vector/gdevpsf.h
devices/vector/gdevpsf1.c
devices/vector/gdevpsf2.c
devices/vector/gdevpsfm.c
devices/vector/gdevpsft.c
devices/vector/gdevpsfu.c
devices/vector/gdevpsfx.c
devices/vector/gdevpsu.c
devices/vector/gdevpsu.h
devices/vector/gdevpx.c
devices/vector/gdevtxtw.c
devices/vector/gdevxps.c
devices/vector/opdfread.ps
devices/vector/whitelst.c
devices/vector/whitelst.h
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/GS9_Color_Management.tex
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gdevds32.c
doc/sample_downscale_device.htm
doc/thirdparty.htm
examples/waterfal.ps
gpdl/gpdl.mak
gpdl/psi/gpdlpsi.mak
gpdl/psi/psitop.c
gpdl/pspcl6_gcc.mak
gpdl/pspcl6_msvc.mak
ijs/Makefile.am
ijs/configure.ac
ijs/ijs.c
ijs/ijs.h
ijs/ijs_client.c
ijs/ijs_client.h
ijs/ijs_client_example.c
ijs/ijs_exec_unix.c
ijs/ijs_exec_win.c
ijs/ijs_server.c
ijs/ijs_server_example.c
ijs/unistd_.h
ios/ios_arch-arm.h
ios/ios_arch-x86.h
jbig2dec/config_win32.h
jbig2dec/jbig2.c
jbig2dec/jbig2.h
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith.h
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_arith_iaid.h
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_arith_int.h
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_generic.h
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_halftone.h
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_huffman.h
jbig2dec/jbig2_hufftab.h
jbig2dec/jbig2_image.c
jbig2dec/jbig2_image.h
jbig2dec/jbig2_image_pbm.c
jbig2dec/jbig2_image_png.c
jbig2dec/jbig2_metadata.c
jbig2dec/jbig2_metadata.h
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_mmr.h
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_symbol_dict.h
jbig2dec/jbig2_text.c
jbig2dec/jbig2_text.h
jbig2dec/jbig2dec.c
jbig2dec/memcmp.c
jbig2dec/memento.c
jbig2dec/memento.h
jbig2dec/os_types.h
jbig2dec/pbm2png.c
lib/FCOfontmap-PCLPS3
lib/FCOfontmap-PS3
lib/Fontmap.ATB
lib/Fontmap.ATM
lib/Fontmap.OS2
lib/Fontmap.SGI
lib/Fontmap.Sol
lib/Fontmap.URW-136.T1
lib/Fontmap.URW-136.TT
lib/Fontmap.Ult
lib/Fontmap.VMS
lib/align.ps
lib/caption.ps
lib/cat.ps
lib/cid2code.ps
lib/docie.ps
lib/font2pcl.ps
lib/gs_ce_e.ps
lib/gs_cmdl.ps
lib/gs_il2_e.ps
lib/gs_kanji.ps
lib/gs_ksb_e.ps
lib/gs_lgo_e.ps
lib/gs_lgx_e.ps
lib/gs_wl1_e.ps
lib/gs_wl2_e.ps
lib/gs_wl5_e.ps
lib/gslp.ps
lib/gsnup.ps
lib/image-qa.ps
lib/jispaper.ps
lib/lines.ps
lib/mkcidfm.ps
lib/pdf2dsc.ps
lib/pfbtopfa.ps
lib/ppath.ps
lib/pphs.ps
lib/prfont.ps
lib/ps2ai.ps
lib/ps2epsi.ps
lib/rollconv.ps
lib/stcinfo.ps
lib/stcolor.ps
lib/stocht.ps
lib/traceimg.ps
lib/traceop.ps
lib/uninfo.ps
lib/viewcmyk.ps
lib/viewgif.ps
lib/viewjpeg.ps
lib/viewmiff.ps
lib/viewpbm.ps
lib/viewpcx.ps
lib/viewps2a.ps
lib/viewpwg.ps
lib/viewraw.ps
lib/viewrgb.ps
lib/winmaps.ps
lib/zeroline.ps
pcl/LICENSE
pcl/pcl/pcbiptrn.c
pcl/pcl/pcbiptrn.h
pcl/pcl/pccid.c
pcl/pcl/pccid.h
pcl/pcl/pccolor.c
pcl/pcl/pccoord.h
pcl/pcl/pccprint.c
pcl/pcl/pccsbase.c
pcl/pcl/pccsbase.h
pcl/pcl/pcdict.h
pcl/pcl/pcdither.c
pcl/pcl/pcdither.h
pcl/pcl/pcdraw.c
pcl/pcl/pcdraw.h
pcl/pcl/pcfont.c
pcl/pcl/pcfont.h
pcl/pcl/pcfontpg.c
pcl/pcl/pcfontst.h
pcl/pcl/pcfrgrnd.c
pcl/pcl/pcfrgrnd.h
pcl/pcl/pcfsel.c
pcl/pcl/pcfsel.h
pcl/pcl/pcht.c
pcl/pcl/pcht.h
pcl/pcl/pcident.c
pcl/pcl/pcident.h
pcl/pcl/pcimpl.c
pcl/pcl/pcindxed.c
pcl/pcl/pcindxed.h
pcl/pcl/pcjob.c
pcl/pcl/pcl.mak
pcl/pcl/pcl_top.mak
pcl/pcl/pclookup.c
pcl/pcl/pclookup.h
pcl/pcl/pcmacros.c
pcl/pcl/pcmisc.c
pcl/pcl/pcmtx3.c
pcl/pcl/pcmtx3.h
pcl/pcl/pcommand.c
pcl/pcl/pcommand.h
pcl/pcl/pcpage.c
pcl/pcl/pcpage.h
pcl/pcl/pcpalet.c
pcl/pcl/pcpalet.h
pcl/pcl/pcparam.h
pcl/pcl/pcparse.c
pcl/pcl/pcparse.h
pcl/pcl/pcpatrn.c
pcl/pcl/pcpatrn.h
pcl/pcl/pcpattyp.h
pcl/pcl/pcpatxfm.c
pcl/pcl/pcpatxfm.h
pcl/pcl/pcrect.c
pcl/pcl/pcsfont.c
pcl/pcl/pcstate.h
pcl/pcl/pcstatus.c
pcl/pcl/pcsymbol.c
pcl/pcl/pcsymbol.h
pcl/pcl/pctext.c
pcl/pcl/pctop.c
pcl/pcl/pctop.h
pcl/pcl/pctpm.h
pcl/pcl/pcuptrn.c
pcl/pcl/pcuptrn.h
pcl/pcl/pcursor.c
pcl/pcl/pcursor.h
pcl/pcl/pcwhtidx.c
pcl/pcl/pcwhtidx.h
pcl/pcl/pcxfmst.h
pcl/pcl/pgchar.c
pcl/pcl/pgcolor.c
pcl/pcl/pgconfig.c
pcl/pcl/pgdraw.c
pcl/pcl/pgdraw.h
pcl/pcl/pgfdata.c
pcl/pcl/pgfdata.h
pcl/pcl/pgfont.c
pcl/pcl/pgfont.h
pcl/pcl/pgframe.c
pcl/pcl/pggeom.c
pcl/pcl/pggeom.h
pcl/pcl/pginit.c
pcl/pcl/pginit.h
pcl/pcl/pglabel.c
pcl/pcl/pglfill.c
pcl/pcl/pgmand.h
pcl/pcl/pgmisc.c
pcl/pcl/pgmisc.h
pcl/pcl/pgparse.c
pcl/pcl/pgpoly.c
pcl/pcl/pgstate.h
pcl/pcl/pgvector.c
pcl/pcl/rtgmode.c
pcl/pcl/rtgmode.h
pcl/pcl/rtmisc.c
pcl/pcl/rtmisc.h
pcl/pcl/rtraster.c
pcl/pcl/rtraster.h
pcl/pcl/rtrstcmp.c
pcl/pcl/rtrstcmp.h
pcl/pcl/rtrstst.h
pcl/pl/pjparse.c
pcl/pl/pjparse.h
pcl/pl/pjparsei.c
pcl/pl/pjtop.c
pcl/pl/pjtop.h
pcl/pl/pl.mak
pcl/pl/plalloc.c
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plchar.c
pcl/pl/plchar.h
pcl/pl/plcursor.c
pcl/pl/plcursor.h
pcl/pl/pldebug.h
pcl/pl/pldict.c
pcl/pl/pldict.h
pcl/pl/pldraw.c
pcl/pl/pldraw.h
pcl/pl/plfapi.c
pcl/pl/plfapi.h
pcl/pl/plfont.c
pcl/pl/plfont.h
pcl/pl/plftable.c
pcl/pl/plftable.h
pcl/pl/plht.c
pcl/pl/plht.h
pcl/pl/plimpl.c
pcl/pl/pllfont.c
pcl/pl/pllfont.h
pcl/pl/plmain.c
pcl/pl/plmain.h
pcl/pl/plparams.c
pcl/pl/plparams.h
pcl/pl/plparse.h
pcl/pl/plromfs.mak
pcl/pl/plsymbol.c
pcl/pl/plsymbol.h
pcl/pl/pltop.c
pcl/pl/pltop.h
pcl/pl/pluchar.c
pcl/pl/plufont.c
pcl/pl/plufstlp.c
pcl/pl/plufstlp.h
pcl/pl/plufstlp1.c
pcl/pl/plulfont.c
pcl/pl/plvalue.c
pcl/pl/plvalue.h
pcl/pl/plvocab.c
pcl/pl/plvocab.h
pcl/pl/plwimg.c
pcl/pl/plwimg.h
pcl/pl/plwmainc.c
pcl/pl/plwreg.c
pcl/pl/plwreg.h
pcl/pl/plwres.h
pcl/pl/realmain.c
pcl/pxl/pxasm.ps
pcl/pxl/pxattr.h
pcl/pxl/pxbfont.c
pcl/pxl/pxbfont.h
pcl/pxl/pxbfont.ps
pcl/pxl/pxcet.txt
pcl/pxl/pxdict.h
pcl/pxl/pxdiff.txt
pcl/pxl/pxenum.h
pcl/pxl/pxerrors.c
pcl/pxl/pxerrors.h
pcl/pxl/pxffont.c
pcl/pxl/pxfont.c
pcl/pxl/pxfont.h
pcl/pxl/pxfts.txt
pcl/pxl/pxgstate.c
pcl/pxl/pxgstate.h
pcl/pxl/pximage.c
pcl/pxl/pximpl.c
pcl/pxl/pxink.c
pcl/pxl/pxl.mak
pcl/pxl/pxlib.txt
pcl/pxl/pxoper.h
pcl/pxl/pxpaint.c
pcl/pxl/pxparse.c
pcl/pxl/pxparse.h
pcl/pxl/pxptable.c
pcl/pxl/pxptable.h
pcl/pxl/pxpthr.c
pcl/pxl/pxpthr.h
pcl/pxl/pxsessio.c
pcl/pxl/pxspec.txt
pcl/pxl/pxstate.c
pcl/pxl/pxstate.h
pcl/pxl/pxstream.c
pcl/pxl/pxsymbol.ps
pcl/pxl/pxsymbol.psc
pcl/pxl/pxsymbol.psh
pcl/pxl/pxtag.h
pcl/pxl/pxtop.c
pcl/pxl/pxvalue.c
pcl/pxl/pxvalue.h
pcl/pxl/pxvendor.c
pcl/pxl/pxvendor.h
pcl/tools/cmpi/cmpi.cpp
pcl/tools/pxlasm.py
pcl/tools/pxldis.py
pcl/tools/suite.tcl
psi/bfont.h
psi/btoken.h
psi/dmmain.c
psi/dmmain.r
psi/dpmain.c
psi/dscparse.c
psi/dscparse.h
psi/dstack.h
psi/dwdll.c
psi/dwdll.h
psi/dwimg.c
psi/dwimg.h
psi/dwmain.c
psi/dwmain.rc
psi/dwmainc.c
psi/dwnodll.c
psi/dwreg.c
psi/dwreg.h
psi/dwres.h
psi/dwtext.c
psi/dwtext.h
psi/dwtrace.c
psi/dwtrace.h
psi/dxmain.c
psi/dxmainc.c
psi/estack.h
psi/files.h
psi/ghost.h
psi/gs.c
psi/gsdll.c
psi/gsdll2.rc
psi/gsdll32.rc
psi/gserver.c
psi/gsos2.rc
psi/ialloc.c
psi/ialloc.h
psi/iapi.c
psi/iapi.h
psi/iastate.h
psi/iastruct.h
psi/ibnum.c
psi/ibnum.h
psi/ichar.h
psi/ichar1.h
psi/icharout.h
psi/icid.h
psi/icie.h
psi/icolor.h
psi/iconf.c
psi/iconf.h
psi/icontext.c
psi/icontext.h
psi/icremap.h
psi/icsmap.h
psi/icstate.h
psi/iddict.h
psi/iddstack.h
psi/idebug.c
psi/idebug.h
psi/idict.c
psi/idict.h
psi/idictdef.h
psi/idicttpl.h
psi/idisp.c
psi/idisp.h
psi/idosave.h
psi/idparam.c
psi/idparam.h
psi/idsdata.h
psi/idstack.c
psi/idstack.h
psi/ierrors.h
psi/iesdata.h
psi/iestack.h
psi/ifapi.h
psi/ifcid.h
psi/ifilter.h
psi/ifilter2.h
psi/ifont.h
psi/ifont1.h
psi/ifont2.h
psi/ifont42.h
psi/ifrpred.h
psi/ifunc.h
psi/ifwpred.h
psi/igc.c
psi/igc.h
psi/igcref.c
psi/igcstr.c
psi/igcstr.h
psi/igstate.h
psi/iht.h
psi/iimage.h
psi/iimage2.h
psi/iinit.c
psi/iinit.h
psi/ilevel.h
psi/ilocate.c
psi/imain.c
psi/imain.h
psi/imainarg.c
psi/imainarg.h
psi/imemory.h
psi/iminst.h
psi/iname.c
psi/iname.h
psi/inamedef.h
psi/inameidx.h
psi/inames.h
psi/inamestr.h
psi/inobtokn.c
psi/inouparm.c
psi/int.mak
psi/interp.c
psi/interp.h
psi/iosdata.h
psi/iostack.h
psi/ipacked.h
psi/iparam.c
psi/iparam.h
psi/iparray.h
psi/ipcolor.h
psi/iplugin.c
psi/iplugin.h
psi/ireclaim.c
psi/iref.h
psi/isave.c
psi/isave.h
psi/iscan.c
psi/iscan.h
psi/iscanbin.c
psi/iscanbin.h
psi/iscannum.c
psi/iscannum.h
psi/isdata.h
psi/isstate.h
psi/istack.c
psi/istack.h
psi/istkparm.h
psi/istream.h
psi/istruct.h
psi/itoken.h
psi/iutil.c
psi/iutil.h
psi/iutil2.c
psi/iutil2.h
psi/ivmem2.h
psi/ivmspace.h
psi/main.h
psi/mkfilelt.cpp
psi/msvc.mak
psi/msvc32.mak
psi/msvc64.mak
psi/nsisinst.nsi
psi/oparc.h
psi/opcheck.h
psi/opdef.h
psi/oper.h
psi/opextern.h
psi/os2.mak
psi/ostack.h
psi/psromfs.mak
psi/sfilter1.c
psi/store.h
psi/winint.mak
psi/zalg.c
psi/zarith.c
psi/zarray.c
psi/zbfont.c
psi/zbseq.c
psi/zcfont.c
psi/zchar.c
psi/zchar1.c
psi/zchar2.c
psi/zchar32.c
psi/zchar42.c
psi/zchar42.h
psi/zcharout.c
psi/zcharx.c
psi/zcid.c
psi/zcie.c
psi/zcie.h
psi/zcolor.c
psi/zcolor.h
psi/zcolor1.c
psi/zcolor2.c
psi/zcolor3.c
psi/zcontext.c
psi/zcontrol.c
psi/zcrd.c
psi/zcsindex.c
psi/zcspixel.c
psi/zcssepr.c
psi/zdevcal.c
psi/zdevice.c
psi/zdevice2.c
psi/zdfilter.c
psi/zdict.c
psi/zdouble.c
psi/zdpnext.c
psi/zdps.c
psi/zdps1.c
psi/zdscpars.c
psi/zfaes.c
psi/zfapi.c
psi/zfarc4.c
psi/zfbcp.c
psi/zfcid.c
psi/zfcid0.c
psi/zfcid1.c
psi/zfcmap.c
psi/zfdctd.c
psi/zfdcte.c
psi/zfdecode.c
psi/zfile.c
psi/zfile.h
psi/zfile1.c
psi/zfileio.c
psi/zfilter.c
psi/zfilter2.c
psi/zfimscale.c
psi/zfjbig2.c
psi/zfjpx.c
psi/zfmd5.c
psi/zfont.c
psi/zfont0.c
psi/zfont1.c
psi/zfont2.c
psi/zfont32.c
psi/zfont42.c
psi/zfontenum.c
psi/zform.c
psi/zfproc.c
psi/zfrsd.c
psi/zfrsd.h
psi/zfsample.c
psi/zfsha2.c
psi/zfunc.c
psi/zfunc.h
psi/zfunc0.c
psi/zfunc3.c
psi/zfunc4.c
psi/zfzlib.c
psi/zgeneric.c
psi/zgstate.c
psi/zhsb.c
psi/zht.c
psi/zht1.c
psi/zht2.c
psi/zht2.h
psi/zicc.c
psi/zicc.h
psi/zimage.c
psi/zimage2.c
psi/zimage3.c
psi/ziodev.c
psi/ziodev2.c
psi/ziodevs.c
psi/ziodevsc.c
psi/zmath.c
psi/zmatrix.c
psi/zmedia2.c
psi/zmisc.c
psi/zmisc1.c
psi/zmisc2.c
psi/zmisc3.c
psi/zncdummy.c
psi/zpacked.c
psi/zpaint.c
psi/zpath.c
psi/zpath1.c
psi/zpcolor.c
psi/zpdf_r6.c
psi/zpdfops.c
psi/zrelbit.c
psi/zshade.c
psi/zstack.c
psi/zstring.c
psi/zsysvm.c
psi/ztoken.c
psi/ztrans.c
psi/ztrap.c
psi/ztype.c
psi/zupath.c
psi/zusparam.c
psi/zutf8.c
psi/zvmem.c
psi/zvmem2.c
psi/zwinutf8.c
toolbin/GenSubstCID.ps
toolbin/afmutil.py
toolbin/color/icc_creator/ICC_Creator/CIELAB.h
toolbin/color/icc_creator/ICC_Creator/ICC_Creator.cpp
toolbin/color/icc_creator/ICC_Creator/ICC_Creator.h
toolbin/color/icc_creator/ICC_Creator/ICC_CreatorDlg.cpp
toolbin/color/icc_creator/ICC_Creator/ICC_CreatorDlg.h
toolbin/color/icc_creator/ICC_Creator/icc_create.cpp
toolbin/color/icc_creator/ICC_Creator/icc_create.h
toolbin/color/icc_creator/README.txt
toolbin/encs2c.ps
toolbin/errlist.tcl
toolbin/extractFonts.ps
toolbin/extractICCprofiles.ps
toolbin/gen_ldf_jb2.py
toolbin/genfontmap.ps
toolbin/gitlog2changelog.py
toolbin/gsmake.tcl
toolbin/halftone/gen_ordered/README
toolbin/halftone/gen_ordered/gen_ordered_main.c
toolbin/halftone/gen_stochastic/gen_stochastic.c
toolbin/halftone/thresh_remap/thresh_remap.c
toolbin/headers.tcl
toolbin/jpxtopdf.c
toolbin/leaks.tcl
toolbin/makehist.tcl
toolbin/memory.py
toolbin/ocheck.py
toolbin/pdf_info.ps
toolbin/pre.tcl
toolbin/precheck.tcl
toolbin/split_changelog.py
toolbin/suite.tcl
toolbin/tests/build_revision.py
toolbin/tests/check_all.py
toolbin/tests/check_comments.py
toolbin/tests/check_dirs.py
toolbin/tests/check_docrefs.py
toolbin/tests/cmpi.py
toolbin/tests/compare_checksumdb.py
toolbin/tests/compare_checksums.py
toolbin/tests/dump_checksum.py
toolbin/tests/dump_checksum_plus.py
toolbin/tests/dump_checksum_raw.py
toolbin/tests/fuzzy.c
toolbin/tests/get_baseline_log.py
toolbin/tests/get_baselines.py
toolbin/tests/gscheck_all.py
toolbin/tests/gscheck_fuzzypdf.py
toolbin/tests/gscheck_pdfwrite.py
toolbin/tests/gscheck_raster.py
toolbin/tests/gscheck_testfiles.py
toolbin/tests/gsconf.py
toolbin/tests/gsparamsets.py
toolbin/tests/gssum.py
toolbin/tests/gstestgs.py
toolbin/tests/gstestutils.py
toolbin/tests/gsutil.py
toolbin/tests/make_baselinedb.py
toolbin/tests/make_testdb.py
toolbin/tests/make_two_pdfversions
toolbin/tests/make_two_versions
toolbin/tests/myoptparse.py
toolbin/tests/rasterdb.py
toolbin/tests/revert_baseline
toolbin/tests/revert_pdfbaseline
toolbin/tests/run_nightly.py
toolbin/tests/run_parallel
toolbin/tests/run_regression.py
toolbin/tests/testdiff.py
toolbin/tests/update_baseline.py
toolbin/tests/update_specific
toolbin/tmake.tcl
xps/ghostxps.h
xps/xps.mak
xps/xpsanalyze.c
xps/xpscff.c
xps/xpscolor.c
xps/xpscommon.c
xps/xpscrc.c
xps/xpsdoc.c
xps/xpsfapi.c
xps/xpsfapi.h
xps/xpsfont.c
xps/xpsglyphs.c
xps/xpsgradient.c
xps/xpshash.c
xps/xpsimage.c
xps/xpsjpeg.c
xps/xpsjxr.c
xps/xpsmem.c
xps/xpsopacity.c
xps/xpspage.c
xps/xpspath.c
xps/xpspng.c
xps/xpsresource.c
xps/xpsromfs.mak
xps/xpstiff.c
xps/xpstile.c
xps/xpstop.c
xps/xpsttf.c
xps/xpsutf.c
xps/xpsvisual.c
xps/xpsxml.c
xps/xpszip.c


2018-01-30 08:35:40 +0000
Ken Sharp <ken.sharp@artifex.com>
013b8208180cccf65d3c5ee374b678ceffe39cf7

Documentation - restore docs on image-qa.ps

Commit b223c93caa34ad34dfd33d534529b3f11d067aab was slightly over
enthusiastic and accidentally removed the documentation for the file
image-qa.ps.

Restore it here.

doc/Psfiles.htm


2018-01-29 12:27:04 +0000
Chris Liddell <chris.liddell@artifex.com>
ad8f4138ad44647125424aa4b635aade1a2557ad

Compiler warning in base/gsicc_manage.c

Comparing a pointer to '\0' should be comparing to NULL to check for a valid
string argument,

base/gsicc_manage.c


2018-01-29 16:12:36 +0000
Ken Sharp <ken.sharp@artifex.com>
b223c93caa34ad34dfd33d534529b3f11d067aab

Documentation - correct erroneous information in psfiles.htm

Psfiles.htm incorrectly listed a number of files as being in 'lib'
when in fact they have been moved to 'Resource/Init. In addition
Several files were listed which no longer exist, and some files in
'examples' were not listed or described.

I suspect this listing is still not comprehensive, but at I believe
the information that is there is now at least correct.

doc/Psfiles.htm


2018-01-29 14:05:50 +0000
Ken Sharp <ken.sharp@artifex.com>
d8ec036836a0abcfe3cc677bb88a61bdfd1a65bb

pdfwrite - remove a global from gdevpdtt.c


See bug #693376

In gdevpdtt.c we hold a static gs_glyph standard_glyph_code_for_notdef
which is initially assinged to GS_NO_GLYPH, and is later assigned a
value from the encoding table:

standard_glyph_code_for_notdef =
gs_c_name_glyph((const byte *)".notdef", 7) - gs_c_min_std_encoding_glyph;

However, this is only done if the current value is GS_NO_GLYPH. In effect
standard_glyph_code_for_notdef is a constant. But we can't define it as
a constant because the actual value depends on the contents of a table
which is built at compile time.

This appears to be an attempt to limit the number of times we call
gs_c_name_glyph because that is a relatively expensive operation, and
the actual value returned never changes between builds.

But we don't want to have globals, really, so this commit simply gets
and stores the value when the PDF font resource is created in
font_resource_alloc(). We then can look up the value when we need it.

This is, obviously, slightly slower than a one-time lookup, because
we execute it once for every font. It also uses up a fraction more
memory. However, compared to the performance and memory usage of pdfrwite
the differences are miniscule.

devices/vector/gdevpdtf.c
devices/vector/gdevpdtf.h
devices/vector/gdevpdtt.c


2018-01-28 10:31:26 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e29a7e00401549ebb7c03c8324209489b7c87681

Coverity ID: 259882 Fix typo in pcl_impl_allocate_interp_instance.

Fix typo to allow conditional freeing of pcli->pcs.pids.

pcl/pcl/pctop.c


2018-01-19 14:28:46 +0000
Chris Liddell <chris.liddell@artifex.com>
2b155ebd780b5737aac4e8096c8fbaa5cb78212c

Bug 694260: FAPI: tidy up error return for broken TT glyph

In the event of an error retrieving a TTF glyph, we were storing the negative
error code in the same variable we use to store the glyph length for a valid
glyph, which is an unsigned variable, causing a valgrind error, and potential
security issue reading uninitialized memory.

In fact, other consumers silently cope with this type of problem and
(presumably) use a notdef glyph instead. So this tweaks the error codes to
do the same.

Because we now have to differentiate between different types of error, we
can no longer just use a negative value, so there is an enumerated type for
the error values.

base/fapi_ft.c
base/gxfapi.h
psi/zfapi.c


2016-08-25 09:28:59 +0100
Chris Liddell <chris.liddell@artifex.com>
b82848bc26f47b5b5727d24f03d08eb3679c7243

Add script and arch*.h headers for ios build

This results in a "fat" libgs.a library which can be linked used either for the
simulator or a "real" ios build.

Really, this script just automates/simplifies the process of using our existing
cross-compile support.

The only slightly out of the ordinary part is combining the Intel and arm
libraries into the single fat library.

configure.ac
ios/build_ios_gslib.sh
ios/ios-README.txt
ios/ios_arch-arm.h
ios/ios_arch-x86.h


2018-01-24 19:23:42 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
83f78ff2c85413866f0d4e549fc6a39aa72417e6

Bug 697545 : Fix memory leak in cmsCreateLab2ProfileTHR.

Fix memory leak for allocation event numbers 821 - 854.

Error created using :-
MEMENTO_FAILAT=860 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

lcms2art/src/cmsvirt.c


2018-01-24 18:42:46 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e8501487c929db1bc1a624bf101a3464b447db07

Bug 697545 : Fix memory leak in BuildRGBOutputMatrixShaper.

Fix memory leak for allocation event numbers 787 - 792.

Error created using :-
MEMENTO_FAILAT=795 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

lcms2art/src/cmsio1.c


2018-01-23 18:10:04 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
571200a055310b157f3640742f32564fc2de5697

Bug 697545 : Fix memory leak c_param_write.

Fix memory leak for allocation event number 676.

Error created using :-
MEMENTO_FAILAT=677 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gscparam.c


2018-01-23 18:18:49 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
92ccfa3dcb2ca9fd2273611f7ed2111d3ae319a8

Bug 697545 : Fix memory leak in cmsStageAllocMatrix.

Fix memory leak for allocation event numbers 753 - 754.

Error created using :-
MEMENTO_FAILAT=755 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

lcms2art/src/cmslut.c


2016-12-20 12:30:50 +0100
Tor Andersson <tor.andersson@artifex.com>
0c498888ca6c0bdf4b90d1b3a79a4a185d810a22

Fix clusterpush detection for mupdf repositories.

toolbin/localcluster/clusterpush.pl


2018-01-24 17:02:26 +0100
Tor Andersson <tor.andersson@artifex.com>
bb6abd533cdfed34d076c3320c931d778189c202

Make gitpush.sh script executable.

toolbin/localcluster/gitpush.sh


2018-01-24 15:18:07 +0000
Ken Sharp <ken.sharp@artifex.com>
9010c622cd4d17053ee405bb378ed08bcaa16251

pdfwrite - ensure we have a substream Resource dictionary before using it

Bug #692182 "xps -> pdfwrite SEGVs with softmasked pattern"

After much messing about with this bug over the years, it appears
that most of the bugs have been fixed. However one still remained;
we could attempt to add a ProcSet Resource to a substream, even
though we had not yet allocated a Resource for that substream.

Although it shows up with this file, technically it could
probably happen with any kind of input.

Fixed here by allocating a substream Resource dictionary if we
don't already have one when we want to add the Procsets to it.

No differences expected

devices/vector/gdevpdfi.c


2018-01-24 09:33:20 +0000
Chris Liddell <chris.liddell@artifex.com>
eb5f2a85c5c3f6436df6158d7fba1977be68116f

Bug 698903: bounds check t2 charstring stack in op

Add a stack bounds checking macro for the Type 2 charstring stack, and use it
for the rmoveto op.

base/gstype2.c


2018-01-23 18:15:18 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f5e42eb1dc1cc96bab67990e886756a089a3fa5a

Bug 697545 : Fix memory leak in AllocateToneCurveStruct.

Fix memory leak for allocation event number 741.

Error created using :-
MEMENTO_FAILAT=742 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

lcms2art/src/cmsgamma.c


2018-01-23 18:05:54 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
ebae375c979146fd8c2457e217dcb4e67618a718

Bug 697545 : Fix memory leak in gs_copydevice2.

Fix memory leak for allocation event number 673.

Error created using :-
MEMENTO_FAILAT=674 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsdevice.c


2018-01-23 08:49:04 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
34f29fe8f77a626ef71c1f04fd781dd8b8bacd85

Bug 697545 : Fix pxstate memory leak.

Fix memory leak for allocation event numbers 517 - 520.

Error created using :-
MEMENTO_FAILAT=578 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsfont.c
pcl/pxl/pxstate.c


2018-01-23 16:42:34 +0000
Ken Sharp <ken.sharp@artifex.com>
2ce962cfc20267b3e678d8d1357dfc2643b7a477

pdfwrite - take advantage of GSUB table glyph substitution enhancement

Bug #691574 "vert punctuation is rotated when convert ps to 1.3 pdf"

Commit 7dd033589ce40649ab602fba4c0473aa40c48439 was an enhancement to
apply vertical glyph substitution from a TrueType GSUB table. This is
primarily used when a user specifies a TrueType font to be used as a
replacement for a missing CIDFont (especially in PDF files). Using a
horizontal font as a replacement for a vertical font can result in
punctuation marks at the wrong orientation.

This commit uses the machinery added in that previous commit to apply
the same fix for pdfwrite. Note that this still does not produce
'correct' output, because its still a substitute font being used. It
does produce punctuation marks at the correct orientation now though,
for the limited selection of test files we have. The other relevant
report is 698471, though that was reported against rendering, the same
effect occurs with pdfwrite.

The cluster shows one diff, a progression, which surprises me since I
cannot duplicate the reference output, but I'm not going to complain
since its a progression.

devices/gxfcopy.c
devices/gxfcopy.h
devices/vector/gdevpdtb.c
devices/vector/gdevpdtc.c


2018-01-22 17:14:31 -0700
Henry Stiles <henry.stiles@artifex.com>
de0bad3a42012d57fea6c2d55325c033db7a3ded

Fix Bug 698874 - incorrect text positioning.

The bug title is misleading, this a font selection problem where 1 of
2 fonts with the same attributes must be selected. Experiments
suggest the HP chooses the font which was defined earliest. We
emulate the same effect in our interpreter by creating sequential PJL
font numbers for downloaded fonts and the selection algorithm
prefering lower numbers.

Progression with the test file bug690520.pcl.

pcl/pcl/pcfont.c
pcl/pcl/pcfsel.c
pcl/pcl/pcsfont.c
pcl/pcl/pcstate.h


2018-01-22 11:32:20 -0800
Ray Johnston <ray.johnston@artifex.com>
b5b6ffad4c3e6d12fbb1caf9d0f17d7de77ca3c3

Fix rc_increment for CMM_THREAD_SAFE case (only 1 param, not 2)

Thanks to Michael Vrhel for tripping over this first.

base/gxclthrd.c


2018-01-20 18:12:08 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
8089072692df101c5464e67b3c3a2cebf9b6682d

Bug 697545 : Fix memory leak in gstate_free_contents.

Fix memory leak for allocation event numbers 346 - 348.

Error created using :-
MEMENTO_FAILAT=349 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsstate.c


2018-01-20 13:01:22 -0800
Ray Johnston <ray.johnston@artifex.com>
6adaf9b4d691bfec64d6d6888bb4fed776a2da12

Bug 698867: Don't push texttransparency knockout group for invisible text

The customer's example file had text that was not opaque, but was being
rendered in TextRenderingMode 3 (invisible). Don't push the extra
transparency group for this. Reduces time from 483 seconds to 44 seconds
with default clist params, and with BufferSpace of > 32m down to 14 seconds.
Also reduces page mode (-dBufferSpace=2000m) from 40 minutes to 9 seconds.

base/gdevp14.c


2018-01-20 10:55:29 -0800
Ray Johnston <ray.johnston@artifex.com>
1bc1bfaf123e866695813895d02da0956f79cb31

Minor fix and addition of debugging info for clist cropping.

base/gxclimag.c
base/gxclist.c


2018-01-22 15:20:29 +0000
Ken Sharp <ken.sharp@artifex.com>
eb5d417375e1c7052aeb9f2532d34573bfd07f53

Feature - JPEG Pass through

This commit adds the capability for the PostScript and PDF interpreters
to pass JPEG compressed image data directly to a device (currently the
pdfwrite family of devices) as the original JPEG data.

This allows us to avoid the compression artefacts caused by decompressing
JPEG image data, and then applying JPEG compression again.

This works by having the JPEG decoder inquire (via spec_op) if the
current device would like the original uncompressed data. If so then it
instructs the JPEG stream decoder to call a routine which will use
more spec_ops to pass the uncompressed data to the device.

The interpreter still calls the image methods with the decompressed
data, its up to the device to ignore these calls while handling JPEG
pass-through.

We have to work this way in PostScript, as we must decompress the data
as it arrives in order to find the end of the DCT compressed data. In
addition, this allows the device to change its mind about accepting
compressed data directly if it discovers from the image data that it
is not suitable for preserving unchanged.

This approach does not work with the PXL and XPS interpreters. These
interpreters appear to completely decompress the JPEG data before
starting an image, unlike the PostScript and PDF interpreters where the
image methods are called as the stream is decopressed.

As a result this feature is disabled for these interpreters.

Resource/Init/gs_pdfwr.ps
base/gxdevsop.h
base/sdct.h
base/sdctd.c
devices/vector/gdevpdfb.h
devices/vector/gdevpdfi.c
devices/vector/gdevpdfj.c
devices/vector/gdevpdfx.h
devices/vector/gdevpsdf.h
devices/vector/gdevpsdi.c
devices/vector/gdevpsdp.c
doc/VectorDevices.htm
pcl/pxl/pximage.c
pcl/pxl/pxvendor.c
psi/int.mak
psi/zfdctd.c
xps/xpsjpeg.c
xps/xpstiff.c
xps/xpstile.c


2018-01-21 14:53:08 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f858f560061560cbd3670509206dfdd98fea4d07

Bug 697545 : Fix memory leak in px_state_alloc.

Fix memory leak for allocation event numbers 515 and 516.

Error created using :-
MEMENTO_FAILAT=517 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pxl/pxstate.c


2018-01-20 22:17:57 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
9e0509877950e3ffef5c576472ff12a3e3fb37b3

Bug 697545 : Fix memory leak of hpgl_parser_state.

Fix memory leak for allocation event number 420.

Error created using :-
MEMENTO_FAILAT=421 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pcommand.c
pcl/pcl/pgparse.c


2018-01-20 21:29:08 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
0177158989db4de55199e1b482cbffb033c4a213

Bug 697545 : Fix memory leak in pcl_impl_allocate_interp_instance.

Fix memory leak for allocation event numbers 328 - 417.

Error created using :-
MEMENTO_FAILAT=419 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pcl/pctop.c


2018-01-20 20:02:53 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
3278973da5d771e3fc56d1a4295c3bdb3a1a51b5

Bug 697545 : Fix memory leak in file_prepare_stream.

Fix memory leak for allocation event number 357.

Error created using :-
MEMENTO_FAILAT=358 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/sfxcommon.c


2018-01-20 19:07:34 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
43711760b611b1a8e17f3490e3b58914508098f9

Bug 697545 : Fix memory leak in gs_nulldevice.

Fix memory leak for allocation event number 355.

Error created using :-
MEMENTO_FAILAT=356 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsdevice.c


2018-01-19 10:01:22 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
76aea30116ea14ebb2238d34251e44a7e547ebf0

Bug 697545 : Fix memory leak in gs_gstate_alloc.

Fix memory leak for allocation event numbers 330 - 334. The path, clip_path and
effective_clip_path are initialised at the start of gs_gstate_alloc during the
call to gstate_alloc so this redundant code can be removed.

Error created using :-
MEMENTO_FAILAT=348 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsstate.c


2018-01-20 14:34:13 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
b09da43f803fda306d3eb8eca99d825f70156db7

Bug 697545 : Fix memory leak in gp_enumerate_files_init.

Fix memory leak for allocation event numbers 199 and 200.

Error created using :-
MEMENTO_FAILAT=201 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gp_unifs.c


2018-01-17 20:02:32 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
76c335c7672e3841055d6c6effc2ae61715c8b6a

Bug 697545 : Fix memory leak in gs_enumerate_files_init.

Fix memory leak for allocation event numbers 183 and 184.

Error created using :-
MEMENTO_FAILAT=185 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsiodev.c


2018-01-18 12:06:11 +0000
Chris Liddell <chris.liddell@artifex.com>
4b8eb0c07b84667b0e3f5ab47f328767012781bf

Bug 691224 : Remove the long non-functional DISKFONTS feature.

This feature (allowing Type 1 fonts to be loaded into VM without CharStrings
and individual CharStrings read from the font file on demand) only ever worked
with very specifically formatted Type 1 fonts (those coming from the also long
dead and gone bdftops.ps tool). Any significant variation from that format
would not work.

As we no longer use fonts derived from BDF (and BDF are very much a thing of the
past!), DISKFONTS has not worked for a *long* time, hence removing it.

In addition, even on printers, memory is no longer quite the issue it was, nor
are the core Postscript fonts as widely used or relied upon as they were.

Resource/Init/gs_diskf.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_init.ps
Resource/Init/gs_type1.ps
doc/Psfiles.htm
doc/Use.htm
doc/gs-vms.hlp
man/gs.1
psi/int.mak
psi/psromfs.mak


2018-01-18 12:39:00 -0800
Ray Johnston <ray.johnston@artifex.com>
f3e26b054b866678512cd6c0c2e2daba9f4c17db

Bug 697856: Reduce clist buffer memory usage for worst case files.

The band_height is chosen based on number of bytes per scan line, and
a fudge factor if the page uses transparency. For pages with a large
number of raster lines, the number of bands could cause the space
needed for the band "states" to exceed the space remaining in the
buffer. This was handled by doubling the BufferSpace until there
was enough space for the band states. Improve by increasing the space
available more gradually. For one of the worst case files, Bug689581.pdf,
this reduces the memory needed from 40Mb to 24Mb.

base/gdevprn.c


2018-01-17 17:33:48 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
c470009cbf8be2aaed7b4b438307479959949625

Bug 697545 : Fix memory leak in pl_main_delete_instance.

Fix memory leak for allocation event number 28.

Error created using :-
MEMENTO_FAILAT=183 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/plmain.c


2018-01-17 12:54:59 -0800
Ray Johnston <ray.johnston@artifex.com>
3c90c6e03844713000f0e300e371487fa49980f5

Fix bug 697843: Use after free in pdf14_device_finalize

The trans_group_parent_cmap_procs (misnamed because it has a LOT of
parent color info along with the cmap procs) needs to be allocated
in stable_memory to prevent a dangling pointer being seen during the
pdf14_device_finalize during alloc_restore_all because the parent
color info may be freed before the pdf14 device itself.

base/gdevp14.c


2018-01-17 11:43:55 -0800
Ray Johnston <ray.johnston@artifex.com>
bfda8d1f442e3c8e81018833c3698ffcb63535fb

Fix (some) missing dependencies

Noticed during other work, but not committed as part of those fixes
since this is unrelatd.

devices/devs.mak


2018-01-17 11:18:42 -0800
Ray Johnston <ray.johnston@artifex.com>
c998242a1168320aba8efb909189654f153b8dd3

Fix bug 698306: consecutive pushpdf14devicefilter leads to SEGV

If we get to pushpdf14devicefilter with the pdf14 device, the closedevice
will forward the close to the target, but if the pdf14 device hasn't
been disabled, the opendevice won't forward to the target. Call the
pdf14_disable_device to make sure the pdf14_open_device will forward.

base/gdevp14.c
psi/int.mak
psi/ztrans.c


2018-01-17 12:29:00 +0000
Chris Liddell <chris.liddell@artifex.com>
f0fe2481a2e9b0b632a1d4e804a5a1d27fe9c017

Prevent undefined error with -DDEBUG

The procedure for dumping VM stats with -DDEBUG and -DINITDEBUG was not being
bound, so the .<operator> internal operators we now undefine after
initialization were missing by the time the procedure was called.

Now, simply bind the procedure

Resource/Init/gs_init.ps


2018-01-16 20:04:30 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
6e7149bae6bd5c2a7b5acff50ba6600b3beb3818

Bug 697545 : Memory squeezing fix for double freeing of ToneCurve.

Avoid SEGV by removing unnecessary freeing of ToneCurve.

Error created using :-
MEMENTO_FAILAT=751 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

lcms2art/src/cmsio1.c


2018-01-16 19:41:55 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
1bbf91df4b8df650f3efe0effd37cf1cf91c9657

Bug 697545 : Memory squeezing fix for mutex in lcms2art code

Prevent SEGV by checking for NULL mutex pointer before attempting
to use or destroy it.

lcms2art/src/cmserr.c


2018-01-15 17:26:37 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
3aeff79d28e832aefcd005c99ae67304c927b3d3

Bug 697545 : Fix memory leaks and SEGVs.

Prevent table being orphaned due to early memory allocation failures. Remove
cleanup code to prevent double freeing iodev entries. Prevent SEGV when ramfs
state fails to allocate.

Error created using :-
MEMENTO_FAILAT=25 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

base/gsiodev.c
base/gsioram.c


2018-01-16 11:18:27 +0000
Chris Liddell <chris.liddell@artifex.com>
d250ce572e7f2e067693a19de8d38b6612b73501

Fix segfault with "all devices" test.

Turns out there's a group of devices that actually open a file as they are being
closed, which causes problems if we've already freed up the I/O device table,
which commit 2e86e7f64e added.

So, rejig the Postscript interpreter's I/O device table init/finit functions to
allow later freeing of the table (whilst keeping the two consistent in their
parameters).

psi/iinit.c
psi/iinit.h
psi/imain.c


2018-01-16 10:47:14 +0000
Ken Sharp <ken.sharp@artifex.com>
e62df8bbd78e8db1cb254a6ab4c2ebf1232c6c7e

Reduce severity of memory debug problem detection

Bug #698849 "gs_abort with Bad object"

The error occurs because of the combination of -Z? and -dLastPage. In
order to do First/Last Page processing, we insert a subclassing device
ahead of the regular device (ppmraw in this case).

The subclassing works by making a new device structure, copying the
existing device to it, and replacing the content of the existing
device structure. This is done to maintain coherency of gsave/grestore
and save/restore; the structures maintain pointers to the device in
the graphics state structure, so we can't simply move it.

When subclassing, we change the declared size of the structure (ssize)
but we don't (can't!) change the size that the memory manager allocated
in the first place. This leads to a mismatch between the declared size
of the structure and the allocated size. I mentioned this in the
original commit for subclassing, but noted that in normal use there is
nowhere that actually checks.

However, if you set -Z? then additional checks are done on memory
validity, and this discrepancy is flagged. It also raises an abort,
presumably because this is seen as serious enough to stop and
investigate.

I don't want to remove this check altogether, as it may still be useful,
but we don't want to abort now because this might be a benign change
caused by subclassing.

So here, pull the size != ssize check out separately from the other
consistency checks, and if it is not true raise a warning, but do
*not* abort the process.

psi/ilocate.c


2018-01-15 11:41:01 -0800
Ray Johnston <ray.johnston@artifex.com>
4d730d2087680cff4e3b153536922406bfcf4493

Fix bug 698823. Segfault with psdrgb and transparency_example.ps

The psdrgb device has max_components == 3, but the pdf14 device was
using spot_colors to set it more than that (transparency_example.ps
doed not set PageSpotColors so it was -1, leading to underflow).
If page_spot_colors is the default -1, then don't use it, and also
limit the num_components to max_components for the device.

base/gdevp14.c


2018-01-15 08:14:02 -0800
Ray Johnston <ray.johnston@artifex.com>
afe8e5468db1f875432aa711676eaf4007d13daa

Fix opening of files > 2GB on Windows built with VS after VS2013

For whatever reason, even on 64 bit builds, Visual Studio changed
behaviour and the compiler/run-time now invoke __fstat64i32 for
fstat. This returns an error if the file size can't fit in int32
(the older fstat just returned a negative number, ignoring overflow)
Change to use __fstat64 which works on VS 2005 so it should be
fine. I also tested this build on an ancient Dell with 760Mb RAM
running Windows XP SP3 and it runs fine, so __fstat64 is not a
problem going back that far.

base/stat_.h


2018-01-15 17:22:38 +0000
Ken Sharp <ken.sharp@artifex.com>
b199f558834d0fbd365cccc426eed0fdc3e035c7

pdfwrite - Fix the detection of type 3 descendants in composite fonts

Bug #698844 "ps2pdf creates unusually large PDF files starting with version 9.21"
Bug #698647 "PCL5 - Downloadfont not as T3 Font interpreted"
Bug #607462 "Ghostscript falls into infinite loop with pdfwrite"

The actual problem was that a Type 0 composite font with a single
descendant was used with stringwidth and the space glyph. This was not
detected by pdf_text_begin() and so the glyph was cached, but it was not
added to any type 3 font, it was simply processed as a stringwidth.

Later the same glyph from the same font was used in earnest, pdfwrite
noticed it didn't have a copy of the glyph and set up to capture the
CharProc. But the glyph was present in the glyph cache which meant the
CharProc wasn't executed, leading to an infinite loop.

The fix applied prevented caching type 3 fonts, but that caused problems
with cases where we wanted to convert a font to type 3, so the fix
was extended to only prevent caching of input type 3 fonts, not
synthesised ones.

However, this still caused problems with programs which used type 3 fonts
with glyphshow. Because we did not cache the glyphs we would detect each
glyph use through glyphshow as a new glyph, and so there would be no
glyph reuse, leading to large slow PDF files.

Here we extend the check on descendants of type 3 fonts so that if no
font change takes place, we still check the 'current' descendant to
see if its type 3. If a type 3 descendant is detected then we skip
caching the glyph which prevents the whole problem.

No differences expected.

devices/vector/gdevpdtt.c


2018-01-15 14:06:34 +0000
Chris Liddell <chris.liddell@artifex.com>
99a839311c7d7e1dab919bd88f7632c5e230708f

Remove hamrless/pointless no-op assignment from previous commit

psi/zfapi.c


2018-01-15 13:48:27 +0000
Chris Liddell <chris.liddell@artifex.com>
ead0b5bee31a6e2756749a5c8fb6508e49b64703

Bug 698856: Ensure is_glyph_index flag is consistently set

The is_glyph_index is (now) set as a local variable, then copied to
the structure before the ps_get_glyphname_or_cid() function returns.

A couple of branches in the code were still setting the structure value directly
meaning the local variable was wrong.

psi/zfapi.c


2018-01-15 08:17:46 +0000
Chris Liddell <chris.liddell@artifex.com>
2e86e7f64ed169345c9fb49b9c9eaf0a1bf78720

Bug 698842: cleanup the io_dev table and contents

This is slightly complicated as (in the Ghostscript case) the table can be
freed explicitly, or by the garbager.

base/gdevpipe.c
base/gp_mshdl.c
base/gp_msprn.c
base/gp_os2pr.c
base/gsiodev.c
base/gsiodevs.c
base/gsiodisk.c
base/gsioram.c
base/gsiorom.c
base/gslib.c
base/gxiodev.h
base/lib.mak
pcl/pl/pl.mak
pcl/pl/plmain.c
psi/iinit.c
psi/iinit.h
psi/imain.c
psi/int.mak
psi/zdevcal.c
psi/ziodev.c
psi/ziodev2.c
psi/ziodevs.c
psi/ziodevsc.c


2018-01-12 08:48:21 +0000
Chris Liddell <chris.liddell@artifex.com>
d0829c3cc4d64594499035d664c918acc9047d70

Update to latest CMap release from Adobe

From:
https://github.com/adobe-type-tools/cmap-resources

Resource/CMap/78-EUC-H
Resource/CMap/78-EUC-V
Resource/CMap/78-H
Resource/CMap/78-RKSJ-H
Resource/CMap/78-RKSJ-V
Resource/CMap/78-V
Resource/CMap/78ms-RKSJ-H
Resource/CMap/78ms-RKSJ-V
Resource/CMap/83pv-RKSJ-H
Resource/CMap/90ms-RKSJ-H
Resource/CMap/90ms-RKSJ-V
Resource/CMap/90msp-RKSJ-H
Resource/CMap/90msp-RKSJ-V
Resource/CMap/90pv-RKSJ-H
Resource/CMap/90pv-RKSJ-V
Resource/CMap/Add-H
Resource/CMap/Add-RKSJ-H
Resource/CMap/Add-RKSJ-V
Resource/CMap/Add-V
Resource/CMap/Adobe-CNS1-0
Resource/CMap/Adobe-CNS1-1
Resource/CMap/Adobe-CNS1-2
Resource/CMap/Adobe-CNS1-3
Resource/CMap/Adobe-CNS1-4
Resource/CMap/Adobe-CNS1-5
Resource/CMap/Adobe-CNS1-6
Resource/CMap/Adobe-CNS1-7
Resource/CMap/Adobe-GB1-0
Resource/CMap/Adobe-GB1-1
Resource/CMap/Adobe-GB1-2
Resource/CMap/Adobe-GB1-3
Resource/CMap/Adobe-GB1-4
Resource/CMap/Adobe-GB1-5
Resource/CMap/Adobe-Japan1-0
Resource/CMap/Adobe-Japan1-1
Resource/CMap/Adobe-Japan1-2
Resource/CMap/Adobe-Japan1-3
Resource/CMap/Adobe-Japan1-4
Resource/CMap/Adobe-Japan1-5
Resource/CMap/Adobe-Japan1-6
Resource/CMap/Adobe-Japan2-0
Resource/CMap/Adobe-Korea1-0
Resource/CMap/Adobe-Korea1-1
Resource/CMap/Adobe-Korea1-2
Resource/CMap/B5-H
Resource/CMap/B5-V
Resource/CMap/B5pc-H
Resource/CMap/B5pc-V
Resource/CMap/CNS-EUC-H
Resource/CMap/CNS-EUC-V
Resource/CMap/CNS1-H
Resource/CMap/CNS1-V
Resource/CMap/CNS2-H
Resource/CMap/CNS2-V
Resource/CMap/ETHK-B5-H
Resource/CMap/ETHK-B5-V
Resource/CMap/ETen-B5-H
Resource/CMap/ETen-B5-V
Resource/CMap/ETenms-B5-H
Resource/CMap/ETenms-B5-V
Resource/CMap/EUC-H
Resource/CMap/EUC-V
Resource/CMap/Ext-H
Resource/CMap/Ext-RKSJ-H
Resource/CMap/Ext-RKSJ-V
Resource/CMap/Ext-V
Resource/CMap/GB-EUC-H
Resource/CMap/GB-EUC-V
Resource/CMap/GB-H
Resource/CMap/GB-V
Resource/CMap/GBK-EUC-H
Resource/CMap/GBK-EUC-V
Resource/CMap/GBK2K-H
Resource/CMap/GBK2K-V
Resource/CMap/GBKp-EUC-H
Resource/CMap/GBKp-EUC-V
Resource/CMap/GBT-EUC-H
Resource/CMap/GBT-EUC-V
Resource/CMap/GBT-H
Resource/CMap/GBT-V
Resource/CMap/GBTpc-EUC-H
Resource/CMap/GBTpc-EUC-V
Resource/CMap/GBpc-EUC-H
Resource/CMap/GBpc-EUC-V
Resource/CMap/H
Resource/CMap/HKdla-B5-H
Resource/CMap/HKdla-B5-V
Resource/CMap/HKdlb-B5-H
Resource/CMap/HKdlb-B5-V
Resource/CMap/HKgccs-B5-H
Resource/CMap/HKgccs-B5-V
Resource/CMap/HKm314-B5-H
Resource/CMap/HKm314-B5-V
Resource/CMap/HKm471-B5-H
Resource/CMap/HKm471-B5-V
Resource/CMap/HKscs-B5-H
Resource/CMap/HKscs-B5-V
Resource/CMap/Hankaku
Resource/CMap/Hiragana
Resource/CMap/Hojo-EUC-H
Resource/CMap/Hojo-EUC-V
Resource/CMap/Hojo-H
Resource/CMap/Hojo-V
Resource/CMap/Identity-H
Resource/CMap/Identity-V
Resource/CMap/KSC-EUC-H
Resource/CMap/KSC-EUC-V
Resource/CMap/KSC-H
Resource/CMap/KSC-Johab-H
Resource/CMap/KSC-Johab-V
Resource/CMap/KSC-V
Resource/CMap/KSCms-UHC-H
Resource/CMap/KSCms-UHC-HW-H
Resource/CMap/KSCms-UHC-HW-V
Resource/CMap/KSCms-UHC-V
Resource/CMap/KSCpc-EUC-H
Resource/CMap/KSCpc-EUC-V
Resource/CMap/Katakana
Resource/CMap/NWP-H
Resource/CMap/NWP-V
Resource/CMap/RKSJ-H
Resource/CMap/RKSJ-V
Resource/CMap/Roman
Resource/CMap/UniCNS-UCS2-H
Resource/CMap/UniCNS-UCS2-V
Resource/CMap/UniCNS-UTF16-H
Resource/CMap/UniCNS-UTF16-V
Resource/CMap/UniCNS-UTF32-H
Resource/CMap/UniCNS-UTF32-V
Resource/CMap/UniCNS-UTF8-H
Resource/CMap/UniCNS-UTF8-V
Resource/CMap/UniGB-UCS2-H
Resource/CMap/UniGB-UCS2-V
Resource/CMap/UniGB-UTF16-H
Resource/CMap/UniGB-UTF16-V
Resource/CMap/UniGB-UTF32-H
Resource/CMap/UniGB-UTF32-V
Resource/CMap/UniGB-UTF8-H
Resource/CMap/UniGB-UTF8-V
Resource/CMap/UniHojo-UCS2-H
Resource/CMap/UniHojo-UCS2-V
Resource/CMap/UniHojo-UTF16-H
Resource/CMap/UniHojo-UTF16-V
Resource/CMap/UniHojo-UTF32-H
Resource/CMap/UniHojo-UTF32-V
Resource/CMap/UniHojo-UTF8-H
Resource/CMap/UniHojo-UTF8-V
Resource/CMap/UniJIS-UCS2-H
Resource/CMap/UniJIS-UCS2-HW-H
Resource/CMap/UniJIS-UCS2-HW-V
Resource/CMap/UniJIS-UCS2-V
Resource/CMap/UniJIS-UTF16-H
Resource/CMap/UniJIS-UTF16-V
Resource/CMap/UniJIS-UTF32-H
Resource/CMap/UniJIS-UTF32-V
Resource/CMap/UniJIS-UTF8-H
Resource/CMap/UniJIS-UTF8-V
Resource/CMap/UniJIS2004-UTF16-H
Resource/CMap/UniJIS2004-UTF16-V
Resource/CMap/UniJIS2004-UTF32-H
Resource/CMap/UniJIS2004-UTF32-V
Resource/CMap/UniJIS2004-UTF8-H
Resource/CMap/UniJIS2004-UTF8-V
Resource/CMap/UniJISPro-UCS2-HW-V
Resource/CMap/UniJISPro-UCS2-V
Resource/CMap/UniJISPro-UTF8-V
Resource/CMap/UniJISX0213-UTF32-H
Resource/CMap/UniJISX0213-UTF32-V
Resource/CMap/UniJISX02132004-UTF32-H
Resource/CMap/UniJISX02132004-UTF32-V
Resource/CMap/UniKS-UCS2-H
Resource/CMap/UniKS-UCS2-V
Resource/CMap/UniKS-UTF16-H
Resource/CMap/UniKS-UTF16-V
Resource/CMap/UniKS-UTF32-H
Resource/CMap/UniKS-UTF32-V
Resource/CMap/UniKS-UTF8-H
Resource/CMap/UniKS-UTF8-V
Resource/CMap/V
Resource/CMap/WP-Symbol


2018-01-13 13:10:08 +0000
Robin Watts <robin.watts@artifex.com>
3b0c7a01433c16f007dd3d92c04edc19bfb79970

Revert GhostPDL.sln due to stray commit

I use VS2017 for profiling, so had converted the solution file.
It should not have been committed, but slipped through. Reverting
it here.

windows/GhostPDL.sln


2018-01-13 10:45:32 +0000
Ken Sharp <ken.sharp@artifex.com>
112021a361e9300d9cd0cde0bfc9e691a6e5d0d7

pdf_info.ps - gracefully handle circular Resource references

Although not strictly part of Ghostscript, pdf_info.ps is used by
customers and this is reasonably easy to improve.

When checking for transparency, pdf_info.ps uses the Ghostscript
PDF interpreter to do the work. However, other aspects of its operation
(Media Sizes, Font use) aren't available from the PDF interpreter.

When detecting Font usage, pdf_info.ps walks the Page Resource chain,
and any the Resource chains of any Pattern or XObject Resources used
on that page, as well as the Resources for any Annots (and also any
XObject or Pattern Resources used by the Annots). If any of these
Resource chains contains a circular reference (which they absolutely
should not) then pdf_info will enter a loop and process unwil it
exceeds the execution stack limit, throwing an error.

In this commit we borrow the technique used by the PDF interpreter, we
create a dictionary and every object which we inspect has its object
number stored in that dictionary. Whenever we encounter a new object
we first check to see if its number is in that dictionary. If it is, we
know we've seen it before and this is (possibly) a circular reference.

Even if it is not a circular reference, we've already checked that chain
so we don't need to check it again.

This isn't cluster checked.

toolbin/pdf_info.ps


2017-12-23 21:19:22 -0800
Ray Johnston <ray.johnston@artifex.com>
3012651caace0d2d4dd26631e0e10d81fdeab181

Fix Bug 698729: White lines with LeadingEdge=3 and InterpolateControl>1

Images are always painted in X from left to right, but for landscape the
lines come in the original order, so if dy is negative we need to back up
the starting Y coordinate (scaled_y) by the (scaled_h - 1).

base/gxiscale.c


2018-01-12 09:52:20 -0800
Ray Johnston <ray.johnston@artifex.com>
3110ffa4ee4de170248317813e2e5e5f2d84e75c

Fix errors: Interpolated images + overprint + devn device

When using the overprint compositor, the underlying device may be able
to handle copy_alpha_hl_color (planar devices) so forward to it even
when the overprint compositor isn't active and use the correct
overprint_copy_alpha_hl_color for the generic_procs.

Fix regression errors with psdcmyk device from files in
tests_private/comparefiles: Bug688308.ps T2CharString.eps and
from tests_private/ps/ps3cet: 09-47N.PS 10-08.PS 10-14.PS 10-16.PS
11-01.PS 11-02.PS 11-03.PS 11-04.PS 11-05.PS 11-06.PS 11-07.PS
11-09.PS 11-10.PS 11-11.PS 11-12.PS 11-14.PS 11-15.PS 11-16.PS
11-17.PS 11-18.PS 11-19.PS 11-21.PS 11-22.PS 11-26D.PS 11-28.PS
12-02.PS 12-04.PS 12-06.PS 12-07D.PS 12-08D.PS 12-11.PS 12-12.PS
12-13.PS 13-01.PS 13-02.PS 13-05.PS 13-16.PS 13-17.PS 13-19.PS
13-20.PS 13-22.PS 13-26.PS 13-27.PS 13-28.PS 13-29.PS 21-11.PS

base/gsovrc.c


2018-01-12 08:23:09 -0800
Ray Johnston <ray.johnston@artifex.com>
1508f69d9ed68baac7e659e6089edbf12c9717a9

Fix devn color affecting psdcmyk tests/pdf/Bug6901014_launch_leaflet.pdf p2

The image interpolation uses copy_alpha_hl_color so when InterpolateControl=-1
is used with this file in clist mode, playback ends up calling the
default_no_copy_alpha_hl_color function which throws an "undefined" error. If
this proc is seen, instead pass to copy_alpha which can work as long as the
devn color can be packed into a chunky color which is the case as long as the
num_components is <= 8, which is useful enough to make it worth trying. If
the num_components is too large, the copy_alpha will throw a "rangecheck".

base/gxclrast.c


2018-01-02 11:32:10 -0800
Michael Vrhel <michael.vrhel@artifex.com>
d6a0412e281b786847ec96acc0ba85ffa22bf04d

Switch to lcms2 Artifex version for CMM

MuPDF is using Artifex's thread-safe version of lcms2. This commit switches gs to using that
same version. Having gs take advantage of the thread-safe capabilities will be in a different
commit.

Makefile.in
base/gscms.h
base/gsicc_cache.c
base/gsicc_cms.h
base/gsicc_lcms.c
base/gsicc_lcms2.c
base/gsicc_lcms2art.c
base/gsicc_manage.c
base/lcms2art.mak
base/lib.mak
base/msvclib.mak
base/openvms.mak
base/ugcclib.mak
base/unix-gcc.mak
base/unixansi.mak
base/winlib.mak
configure.ac
devices/gdevpsd.c
devices/gdevrinkj.c
devices/vector/gdevpx.c
lcms2/README.1ST
lcms2/doc/LittleCMS2.8 API.pdf
lcms2/doc/LittleCMS2.8 Plugin API.pdf
lcms2/doc/LittleCMS2.8 tutorial.pdf
lcms2/include/Makefile.am
lcms2art/.travis.yml
lcms2art/AUTHORS
lcms2art/COPYING
lcms2art/ChangeLog
lcms2art/INSTALL
lcms2art/Lib/BC/BC.txt
lcms2art/Lib/MS/MS.TXT
lcms2art/Makefile.am
lcms2art/Makefile.in
lcms2art/Projects/.gitignore
lcms2art/Projects/BorlandC_5.5/lcms2.rc
lcms2art/Projects/BorlandC_5.5/lcmsdll.lk
lcms2art/Projects/BorlandC_5.5/lcmsdll.lst
lcms2art/Projects/BorlandC_5.5/mklcmsdll.bat
lcms2art/Projects/VC2010/jpegicc/jpegicc.vcxproj
lcms2art/Projects/VC2010/jpegicc/jpegicc.vcxproj.filters
lcms2art/Projects/VC2010/linkicc/linkicc.vcxproj
lcms2art/Projects/VC2010/linkicc/linkicc.vcxproj.filters
lcms2art/Projects/VC2010/psicc/psicc.vcxproj
lcms2art/Projects/VC2010/psicc/psicc.vcxproj.filters
lcms2art/Projects/VC2010/resource.h
lcms2art/Projects/VC2010/testbed/testbed.vcxproj
lcms2art/Projects/VC2010/testbed/testbed.vcxproj.filters
lcms2art/Projects/VC2010/tiffdiff/tiffdiff.vcxproj
lcms2art/Projects/VC2010/tiffdiff/tiffdiff.vcxproj.filters
lcms2art/Projects/VC2010/tifficc/tifficc.vcxproj
lcms2art/Projects/VC2010/tifficc/tifficc.vcxproj.filters
lcms2art/Projects/VC2010/transicc/transicc.vcxproj
lcms2art/Projects/VC2010/transicc/transicc.vcxproj.filters
lcms2art/Projects/VC2012/jpegicc/jpegicc.vcxproj
lcms2art/Projects/VC2012/jpegicc/jpegicc.vcxproj.filters
lcms2art/Projects/VC2012/lcms2art.rc
lcms2art/Projects/VC2012/lcms2art.sln
lcms2art/Projects/VC2012/lcms2art_DLL/lcms2art_DLL.vcxproj
lcms2art/Projects/VC2012/lcms2art_DLL/lcms2art_DLL.vcxproj.filters
lcms2art/Projects/VC2012/lcms2art_static/lcms2art_static.vcxproj
lcms2art/Projects/VC2012/lcms2art_static/lcms2art_static.vcxproj.filters
lcms2art/Projects/VC2012/linkicc/linkicc.vcxproj
lcms2art/Projects/VC2012/linkicc/linkicc.vcxproj.filters
lcms2art/Projects/VC2012/psicc/psicc.vcxproj
lcms2art/Projects/VC2012/psicc/psicc.vcxproj.filters
lcms2art/Projects/VC2012/resource.h
lcms2art/Projects/VC2012/testbed/testbed.vcxproj
lcms2art/Projects/VC2012/testbed/testbed.vcxproj.filters
lcms2art/Projects/VC2012/tiffdiff/tiffdiff.vcxproj
lcms2art/Projects/VC2012/tiffdiff/tiffdiff.vcxproj.filters
lcms2art/Projects/VC2012/tifficc/tifficc.vcxproj
lcms2art/Projects/VC2012/tifficc/tifficc.vcxproj.filters
lcms2art/Projects/VC2012/transicc/transicc.vcxproj
lcms2art/Projects/VC2012/transicc/transicc.vcxproj.filters
lcms2art/Projects/VC2013/jpegicc/jpegicc.vcxproj
lcms2art/Projects/VC2013/jpegicc/jpegicc.vcxproj.filters
lcms2art/Projects/VC2013/lcms2art.rc
lcms2art/Projects/VC2013/lcms2art.sln
lcms2art/Projects/VC2013/lcms2art_DLL/lcms2art_DLL.vcxproj
lcms2art/Projects/VC2013/lcms2art_DLL/lcms2art_DLL.vcxproj.filters
lcms2art/Projects/VC2013/lcms2art_static/lcms2art_static.vcxproj
lcms2art/Projects/VC2013/lcms2art_static/lcms2art_static.vcxproj.filters
lcms2art/Projects/VC2013/linkicc/linkicc.vcxproj
lcms2art/Projects/VC2013/linkicc/linkicc.vcxproj.filters
lcms2art/Projects/VC2013/psicc/psicc.vcxproj
lcms2art/Projects/VC2013/psicc/psicc.vcxproj.filters
lcms2art/Projects/VC2013/resource.h
lcms2art/Projects/VC2013/testbed/testbed.vcxproj
lcms2art/Projects/VC2013/testbed/testbed.vcxproj.filters
lcms2art/Projects/VC2013/tiffdiff/tiffdiff.vcxproj
lcms2art/Projects/VC2013/tiffdiff/tiffdiff.vcxproj.filters
lcms2art/Projects/VC2013/tifficc/tifficc.vcxproj
lcms2art/Projects/VC2013/tifficc/tifficc.vcxproj.filters
lcms2art/Projects/VC2013/transicc/transicc.vcxproj
lcms2art/Projects/VC2013/transicc/transicc.vcxproj.filters
lcms2art/Projects/VC2015/jpegicc/jpegicc.vcxproj
lcms2art/Projects/VC2015/jpegicc/jpegicc.vcxproj.filters
lcms2art/Projects/VC2015/lcms2art.rc
lcms2art/Projects/VC2015/lcms2art.sln
lcms2art/Projects/VC2015/lcms2art_DLL/lcms2art_DLL.vcxproj
lcms2art/Projects/VC2015/lcms2art_DLL/lcms2art_DLL.vcxproj.filters
lcms2art/Projects/VC2015/lcms2art_static/lcms2art_static.vcxproj
lcms2art/Projects/VC2015/lcms2art_static/lcms2art_static.vcxproj.filters
lcms2art/Projects/VC2015/linkicc/linkicc.vcxproj
lcms2art/Projects/VC2015/linkicc/linkicc.vcxproj.filters
lcms2art/Projects/VC2015/psicc/psicc.vcxproj
lcms2art/Projects/VC2015/psicc/psicc.vcxproj.filters
lcms2art/Projects/VC2015/resource.h
lcms2art/Projects/VC2015/testbed/testbed.vcxproj
lcms2art/Projects/VC2015/testbed/testbed.vcxproj.filters
lcms2art/Projects/VC2015/tiffdiff/tiffdiff.vcxproj
lcms2art/Projects/VC2015/tiffdiff/tiffdiff.vcxproj.filters
lcms2art/Projects/VC2015/tifficc/tifficc.vcxproj
lcms2art/Projects/VC2015/tifficc/tifficc.vcxproj.filters
lcms2art/Projects/VC2015/transicc/transicc.vcxproj
lcms2art/Projects/VC2015/transicc/transicc.vcxproj.filters
lcms2art/Projects/VC2017/jpegicc/jpegicc.vcxproj
lcms2art/Projects/VC2017/jpegicc/jpegicc.vcxproj.filters
lcms2art/Projects/VC2017/lcms2art.rc
lcms2art/Projects/VC2017/lcms2art.sln
lcms2art/Projects/VC2017/lcms2art_DLL/lcms2art_DLL.vcxproj
lcms2art/Projects/VC2017/lcms2art_DLL/lcms2art_DLL.vcxproj.filters
lcms2art/Projects/VC2017/lcms2art_static/lcms2art_static.vcxproj
lcms2art/Projects/VC2017/lcms2art_static/lcms2art_static.vcxproj.filters
lcms2art/Projects/VC2017/linkicc/linkicc.vcxproj
lcms2art/Projects/VC2017/linkicc/linkicc.vcxproj.filters
lcms2art/Projects/VC2017/psicc/psicc.vcxproj
lcms2art/Projects/VC2017/psicc/psicc.vcxproj.filters
lcms2art/Projects/VC2017/resource.h
lcms2art/Projects/VC2017/testbed/testbed.vcxproj
lcms2art/Projects/VC2017/testbed/testbed.vcxproj.filters
lcms2art/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
lcms2art/Projects/VC2017/tiffdiff/tiffdiff.vcxproj.filters
lcms2art/Projects/VC2017/tifficc/tifficc.vcxproj
lcms2art/Projects/VC2017/tifficc/tifficc.vcxproj.filters
lcms2art/Projects/VC2017/transicc/transicc.vcxproj
lcms2art/Projects/VC2017/transicc/transicc.vcxproj.filters
lcms2art/Projects/cppcheck/lcms2.cppcheck
lcms2art/Projects/mac/LittleCMS/._Info.plist
lcms2art/Projects/mac/LittleCMS/._LittleCMS.xcodeproj
lcms2art/Projects/mac/LittleCMS/English.lproj/InfoPlist.strings
lcms2art/Projects/mac/LittleCMS/Info.plist
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/mariama.mode1v3
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/mariama.pbxuser
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.pbxproj
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.xcworkspace/contents.xcworkspacedata
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.xcworkspace/xcuserdata/User.xcuserdatad/UserInterfaceState.xcuserstate
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.xcworkspace/xcuserdata/User.xcuserdatad/WorkspaceSettings.xcsettings
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcschemes/LittleCMS.xcscheme
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcschemes/testbed.xcscheme
lcms2art/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcschemes/xcschememanagement.plist
lcms2art/Projects/mac/LittleCMS/LittleCMS_Prefix.pch
lcms2art/Projects/mac/LittleCMS/TestBed-Info.plist
lcms2art/README.1ST
lcms2art/aclocal.m4
lcms2art/autogen.sh
lcms2art/compile
lcms2art/config.guess
lcms2art/config.sub
lcms2art/configure
lcms2art/configure.ac
lcms2art/depcomp
lcms2art/doc/LittleCMS2.9 API.pdf
lcms2art/doc/LittleCMS2.9 Plugin API.pdf
lcms2art/doc/LittleCMS2.9 tutorial.pdf
lcms2art/doc/WhyThisFork.txt
lcms2art/doc/src.zip
lcms2art/include/Makefile.am
lcms2art/include/Makefile.in
lcms2art/include/lcms2art.h
lcms2art/include/lcms2art_plugin.h
lcms2art/install-sh
lcms2art/lcms2art.pc.in
lcms2art/ltmain.sh
lcms2art/m4/acx_pthread.m4
lcms2art/m4/ax_append_compile_flags.m4
lcms2art/m4/ax_append_flag.m4
lcms2art/m4/ax_check_compile_flag.m4
lcms2art/m4/ax_gcc_func_attribute.m4
lcms2art/m4/ax_require_defined.m4
lcms2art/m4/libtool.m4
lcms2art/m4/ltoptions.m4
lcms2art/m4/ltsugar.m4
lcms2art/m4/ltversion.m4
lcms2art/m4/lt~obsolete.m4
lcms2art/missing
lcms2art/src/Makefile.am
lcms2art/src/Makefile.in
lcms2art/src/cmsalpha.c
lcms2art/src/cmscam02.c
lcms2art/src/cmscgats.c
lcms2art/src/cmscnvrt.c
lcms2art/src/cmserr.c
lcms2art/src/cmsgamma.c
lcms2art/src/cmsgmt.c
lcms2art/src/cmshalf.c
lcms2art/src/cmsintrp.c
lcms2art/src/cmsio0.c
lcms2art/src/cmsio1.c
lcms2art/src/cmslut.c
lcms2art/src/cmsmd5.c
lcms2art/src/cmsmtrx.c
lcms2art/src/cmsnamed.c
lcms2art/src/cmsopt.c
lcms2art/src/cmspack.c
lcms2art/src/cmspcs.c
lcms2art/src/cmsplugin.c
lcms2art/src/cmsps2.c
lcms2art/src/cmssamp.c
lcms2art/src/cmssm.c
lcms2art/src/cmstypes.c
lcms2art/src/cmsvirt.c
lcms2art/src/cmswtpnt.c
lcms2art/src/cmsxform.c
lcms2art/src/extra_xform.h
lcms2art/src/lcms2_internal.h
lcms2art/src/lcms2art.def
lcms2art/testbed/Makefile.am
lcms2art/testbed/Makefile.in
lcms2art/testbed/bad.icc
lcms2art/testbed/bad_mpe.icc
lcms2art/testbed/crayons.icc
lcms2art/testbed/ibm-t61.icc
lcms2art/testbed/new.icc
lcms2art/testbed/test1.icc
lcms2art/testbed/test2.icc
lcms2art/testbed/test3.icc
lcms2art/testbed/test4.icc
lcms2art/testbed/test5.icc
lcms2art/testbed/testcms2.c
lcms2art/testbed/testcms2.h
lcms2art/testbed/testplugin.c
lcms2art/testbed/testthread.cpp
lcms2art/testbed/toosmall.icc
lcms2art/testbed/zoo_icc.c
lcms2art/utils/common/utils.h
lcms2art/utils/common/vprf.c
lcms2art/utils/common/xgetopt.c
lcms2art/utils/delphi/delphidemo.dpr
lcms2art/utils/delphi/delphidemo.dproj
lcms2art/utils/delphi/delphidemo.res
lcms2art/utils/delphi/demo1.dfm
lcms2art/utils/delphi/demo1.pas
lcms2art/utils/delphi/lcms2dll.pas
lcms2art/utils/jpgicc/LICENSE_iccjpeg
lcms2art/utils/jpgicc/Makefile.am
lcms2art/utils/jpgicc/Makefile.in
lcms2art/utils/jpgicc/iccjpeg.c
lcms2art/utils/jpgicc/iccjpeg.h
lcms2art/utils/jpgicc/jpgicc.1
lcms2art/utils/jpgicc/jpgicc.c
lcms2art/utils/linkicc/Makefile.am
lcms2art/utils/linkicc/Makefile.in
lcms2art/utils/linkicc/linkicc.1
lcms2art/utils/linkicc/linkicc.c
lcms2art/utils/matlab/icctrans.c
lcms2art/utils/matlab/lcms_rsp
lcms2art/utils/psicc/Makefile.am
lcms2art/utils/psicc/Makefile.in
lcms2art/utils/psicc/psicc.1
lcms2art/utils/psicc/psicc.c
lcms2art/utils/samples/Makefile.am
lcms2art/utils/samples/Makefile.in
lcms2art/utils/samples/itufax.c
lcms2art/utils/samples/mkcmy.c
lcms2art/utils/samples/mkgrayer.c
lcms2art/utils/samples/mktiff8.c
lcms2art/utils/samples/roundtrip.c
lcms2art/utils/samples/vericc.c
lcms2art/utils/samples/wtpt.1
lcms2art/utils/samples/wtpt.c
lcms2art/utils/tificc/Makefile.am
lcms2art/utils/tificc/Makefile.in
lcms2art/utils/tificc/tifdiff.c
lcms2art/utils/tificc/tificc.1
lcms2art/utils/tificc/tificc.c
lcms2art/utils/transicc/Makefile.am
lcms2art/utils/transicc/Makefile.in
lcms2art/utils/transicc/transicc.1
lcms2art/utils/transicc/transicc.c
psi/msvc.mak
psi/os2.mak
psi/zicc.c
psi/ztrans.c
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2018-01-12 10:56:29 +0000
Ken Sharp <ken.sharp@artifex.com>
b5ac1a6e73af59d5106bf68ed3ab1a456a1c26dc

PS interpreter - don't use findresource for Idiom Recognition in bind

The current implementation of idiom recognition uses findresource in
the definition of the bind operator to check all existing IdiomSets
for a candidate to substitute.

This is, in fact, wrong. The PLRM (p135 3rd Edition) states that :

"This matching by value occurs only for IdiomSet instances that are
defined in VM; bind does not consider instances that are in not in VM
but only in external storage."

and:

To ensure that the instances in VM are consistent with the external
ones, the interpreter automatically invokes findresource to load
external IdiomSet instances into VM at the beginning of each job and at
certain other times."

We were not loading the IdiomSet resources into VM, and we were searching
external resources during bind.

Not only is this incorrect, but because findresource ends up calling
filenameforall on every directory in the search path, its also very
slow.

While normally we don't expect to see many occurences of bind during the
course of a job, the customer supplied file did multiple binds on every
page, and had > 50,000 pages. This led to a fourfold decrease in
performance compared to Acrobat Distiller.

Here we load the external resources into gobal VM at startup, and we
now *only* search instances in VM. This is more correct going by the
spec, and improves the performance by the desired factor of 4 for the
customer. It provides a small benefit on cluster testing, which is
expected as this only affects PostScript input.

No differences expected.

Resource/Init/gs_ll3.ps


2018-01-11 19:58:11 +0000
Robin Watts <robin.watts@artifex.com>
338c13198e658b084bbe45930e4837c31102b61f

ROP Fix: Fix misindexing of scolors/tcolors.

More evidence that this isn't used much.

base/gsroprun8.h


2018-01-11 18:34:51 +0000
Robin Watts <robin.watts@artifex.com>
c6fda7403e881ec53f2da6bb6f97f2e647ef523c

ROPs: Squash scan build warnings.

base/gsroprun24.h
base/gsroprun8.h


2018-01-10 21:27:32 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
fc5f089b580040fb70a662e44721fe2fb457ecfa

Bug 697545 : Fix new_font_defaults memory leak.

Fix memory leak for allocation event numbers 165 - 180.

Error created using :-
MEMENTO_FAILAT=181 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/pjparse.c


2018-01-10 21:10:43 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
30ca563d890a503fe4411a404d09c36839120114

Bug 697545 : Fix new_font_envir memory leak.

Fix memory leak for allocation event numbers 146 - 161.

Error created using :-
MEMENTO_FAILAT=162 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/pjparse.c


2018-01-11 17:43:44 +0000
Robin Watts <robin.watts@artifex.com>
6a706f687ae99626ef5b16b71e5df6a05c202e33

ROP fix: Correctly set scolors/tcolors S and T data case.

We weren't setting S and T colors in this particular case of
the code, which would have shown errors if we'd ever called
it with S and T being 1 bit data arrays to choose between
scolors[0] and [1] etc.

It appears that no code in our entire regression suite actually
calls the S and D both being data case anyway, as proved by
cluster testing this code with an "abort();" line inserted!

base/gdevmr8n.c


2018-01-11 17:40:41 +0000
Robin Watts <robin.watts@artifex.com>
aa8accce0a3f3d323dc45f6bf510a3ddfa76d10d

ROP code: Correction

Don't look for transparency when depth is 1 (it shouldn't be
used anyway).

Correct transparency handling in 8 bit (it was using 0xffffff
as the color to check for in this mode). Oddly this wasn't
producing diffs, which suggests that nothing is exercising
this code in 8 bit.

base/gsroprun.c


2018-01-10 20:52:35 -0800
Ray Johnston <ray.johnston@artifex.com>
eb59c64085552ef0f98c1afdaae3c39ad4e5d421

Fix stale pointer de-reference during GC due to restore.

If a CIEBasedDEF or DEFG colorspace was set in a save level, a restore
would free the Table memory, but the pgs->icc_profile_cache still had
a (stale) pointer to that area. Fix by copying the Table to memory that
is not subject to save/restore (stable_memory). Rely on the GC to free
up the previous table data since we have no idea what allocator was
used for it (from PostScript it would be local or global VM). Seen with:
-Z:?@$ -r300 -sDEVICE=psdcmyk -o x.psd tests_private/comparefiles/Bug688308.ps

psi/zcie.c


2018-01-11 12:03:30 +0000
Robin Watts <robin.watts@artifex.com>
9b3b93ca92f8b9370d4cb5a4e6176df1a06afeda

ROP optimisation: Map more rops onto one another.

Establish an ordering on rops ("unused" < "constant" <
"bitmap" < "1 bit bitmap") and swap orders such that S
is always >= T.

This cuts the number of cases down a bit more.

base/gsroprun.c


2018-01-02 08:48:33 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
c56dff6dea636c89b7c24bbec7b28f15171d7810

Bug 697545 : Fix pjl_envir memory leak.

Fix memory leak for allocation event numbers 89 - 143.

Error created using :-
MEMENTO_FAILAT=144 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/pjparse.c


2017-12-31 14:57:30 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
411530608129ad6dd2078557a7f3d0a3425a9db8

Bug 697545 : Fix new_pjl_defaults memory leak.

Fix memory leak for allocation event numbers 32 - 89.

Error created using :-
MEMENTO_FAILAT=90 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/pjparse.c


2018-01-10 17:15:38 +0000
Robin Watts <robin.watts@artifex.com>
623d2ceee814622b5a75e13120165d8a2f4a2d35

ROP transparency optimisation.

If a transparent ROP uses a constant input that is
transparent, then it's a NOP.

base/gsroprun.c


2018-01-08 19:10:01 +0000
Robin Watts <robin.watts@artifex.com>
151cb32d94b5790fae44f48763e19c519ac742cb

Miscellaneous fixes to roprun code.

Fold some more rops down to simpler ones.

Remove some functions that are no longer required. Allow
for NOP ROPs to short circuit all the work.

Also, fix what looks like a problem in the setup for 1bit ROPs.
(Doesn't actually seem to have caused a problem but the new
code is more readable).

Avoid intermixing rop_operand * and gx_color_index *'s.

base/gdevm1.c
base/gdevmr8n.c
base/gsroprun.c
base/gsroprun24.h
base/gsroprun8.h
base/gsropt.h


2018-01-09 16:38:04 +0000
Robin Watts <robin.watts@artifex.com>
3927036c14c12857be7dbf98dc777631a365977e

Fix problem with bitrgbtags and ROPs.

With bitrgbtags, we can get called to do 24 bit rop operations
with transparency, with colors like 0x01ffffff.

The transparency rop code is supposed to spot 0xffffff as meaning
"be transparent", but the tag in the top byte confuses it.

Accordingly, mask off stray bits in the colors before using them.

The same potentially happens for an 8 bit + tags device so we cope
with that too.

base/gdevmr8n.c


2018-01-09 07:19:35 -0800
Ray Johnston <ray.johnston@artifex.com>
a8612bfd86f7753fceb738364b2808a4ad9d3bdf

Fix SEGV DEBUG build with -ZA (tests_private/comparefiles/Bug688308.ps)

base/gsalloc.c


2018-01-08 12:04:57 +0000
Robin Watts <robin.watts@artifex.com>
9b38e9780bf5cbb9dbf41131efa80887826c59b4

Enable the use of the RUN_ROP code.

I thought this had been done years ago :(

Fix a typo that was causing cluster differences, squash some
warnings, and fix the scolors/tcolors cases to index as
gx_color_index *'s rather than byte *'s.

Presumably these are the reasons this didn't get enabled before.
Cluster shows no differences now.

Tests with running 600dpi grashopp.pcl to ppm show this saves
~5.5%.

base/gdevmr8n.c
base/gsroprun.c
base/gsroprun24.h
base/gsropt.h
base/lib.mak


2017-12-11 19:11:04 +0100
David Kaspar [Dee'Kej] <dkaspar@redhat.com>
731559c56907f223c9f0763d512fae7e4d13e1a0

Bug 698814: use --docdir= configure parameter

Previously, the Ghostscript was using custom path to the documentation
(as docdir=$(gsdatadir)/doc). This was causing that value of --docdir=
parameter of ./configure was accepted, but not used at all.

This commit fixes this issue, by using docdir=@docdir@@VERSIONED_PATH@
instead. However, as a side effect this results in default path for
documentation to changed to this (with --prefix=/usr):

/usr/share/doc/ghostscript/<version>/

To stay backward compatible, a symlink is automatically created to
point from the old location (/usr/share/ghostscript/<version>/doc) to
the new location.

NOTE: Trying to fix this issue with the location of documentation
staying as it was would require some hacking inside the Autoconf
itself, which is not desirable.

Makefile.in
base/unixinst.mak


2017-12-11 17:27:39 +0100
David Kaspar [Dee'Kej] <dkaspar@redhat.com>
0da8eed54f24cf3dcb5f950c742a8072b7c7e01a

Bug 698813: do not install examples/ by default anymore

Those files in the examples/ folder are for testing purposes,
and not really good examples for people trying to learn PostScript.

However, we are keeping the 'make install-examples' target for people
who still wishes to use those files for some reason.

base/unixinst.mak


2017-11-29 16:42:45 +0100
David Kaspar [Dee'Kej] <dkaspar@redhat.com>
eb3f2ab6f3c5c1d113a8314c0251ca1e50b1196b

Bug 698795: --without-versioned-path option introduced

Using this option will result in Ghostscript being installed into a
paths which do not contain its version in them, which can be useful
on some distributions.

As a result of using this option, the Ghostscript's search path will
be updated as well, to include correct files locations.

This option is disabled by default, and configure's help page states
that using this option is dangerous, risky and unsupported.

Makefile.in
configure.ac


2018-01-06 18:27:24 +0000
Robin Watts <robin.watts@artifex.com>
3c120a33a91c9251c9a9e409680e92d9625a92da

Back out stray change in last commit.

windows/GhostPDL.sln


2018-01-05 17:04:59 +0000
Robin Watts <robin.watts@artifex.com>
47d4d0779563983ab79362acbf3522758ce7a09c

Optimise some image_render_mono cases.

Split a case within image_render_mono into separate portrait
and landscape cases. Use fill rectangle rather than fill_trap
to save time, and avoid halftoning where possible.

This saves us about 15% runtime in 1000pages.pcl.

base/gximono.c
windows/GhostPDL.sln


2018-01-04 17:53:56 +0000
Robin Watts <robin.watts@artifex.com>
d356025602f3f9f9a1e656bd14430cd95c059548

Tiny additional tweaks to compose groups.

Measurable differences, but only just.

base/gxblend.c


2018-01-04 15:56:55 +0000
Robin Watts <robin.watts@artifex.com>
75f389e6b8a2f2bf15ab3044ae4e1ef185061e8d

pdf14 compose group (masked group) optimisation.

The common case is for the mask (if there is one) to entirely
cover the group we are masking. We can avoid needless
checking in this case.

This is the case the apple airprint performance test file
hits and saves > 4% pam, 5% ppm, and 9% pgm.

base/gxblend.c


2017-12-29 17:43:01 +0000
Robin Watts <robin.watts@artifex.com>
193e3b87bc711d30be0c2c41f6b3e61f49c92b22

Fix problem with parsing non 8 bit arguments.

A problem was reported on IRC, pointing out that we fail to
correctly parse single char switches when we are using
GS_ARG_ENCODING_UTF16LE.

This is because arg_next was failing to convert non-indirected
arguments correctly.

Fixed here.

base/gsargs.c


2017-12-29 13:17:49 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
5907bf4f455cca68cbb405116e3c98d14a5a59d6

Bug 697545 : Fix pjl_state line buffer memory leak.

Fix memory leak for allocation event number 30.

Error created using :-
MEMENTO_FAILAT=31 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/pjparse.c


2017-12-29 14:37:20 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
9ba8351735da67a3064710136499340810c120c1

Bug 697545 : Fix pl_main_languages_init interp memory leak.

Fix memory leak for allocation event number 28, the interp_client_data is
not set so this memory will not be recovered via the normal route of
pl_deallocate_interp_instance.

Error created using :-
MEMENTO_FAILAT=29 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/plmain.c


2017-12-29 15:34:32 +0000
Robin Watts <robin.watts@artifex.com>
2b940da204752545813c475488a0a7afd7b55fc7

Fix LCMS2 optimisation bug

Found this while importing the optimisations here into the MuPDF
version of LCMS. When copying for identity transformations,
allow for extra bytes too.

GS clearly doesn't exercise this routine in this way.

lcms2/src/cmsxform.c


2017-12-23 10:50:11 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
906314509273578d4fb5382a8d922ccb2b7adb10

Bug 697545 : Fix gs_fapi_init memory leak.

Fix memory leak for allocation event number 13.

Error created using :-
MEMENTO_FAILAT=14 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/plmain.c


2017-12-13 17:28:11 -0800
Michael Vrhel <michael.vrhel@artifex.com>
9a089895193d71ad6ad70a91cbf9fe02a121261c

Introduce ColorAccuracy setting

Set the level of accuracy that should be used. A setting of 0 will result in less accurate
color rendering compared to a setting of 2. However, the creation of a transformation
will be faster at a setting of 0 compared to a setting of 2. Default setting is 2.

base/gsdparam.c
base/gsicc_cms.h
base/gsicc_lcms2.c
base/gsicc_manage.c
base/gsicc_manage.h
base/gslibctx.c
base/gslibctx.h
doc/Use.htm


2017-12-28 13:56:37 +0000
Ken Sharp <ken.sharp@artifex.com>
4fb32aef42d267948d97243e7f5512a2b37431b0

XPS interpreter - when discarding an ICC profile for an image, NULL hte pointer

Possibly Bug #698834 " xps dump"

Its not at all clear what the bug reporter sees as a problem, but when
I run the file to the display the XPS interpreter warns that it is
discarding an ICC profile because it has the wrong number of
components (profile has 4 in, 3 out components, image claims to be
RGB).

This counts the profile reference down by 1 but doesn't set the pointer
to the profile, saved in the image structure, to NULL leading to us
trying to free a garbage pointer later.

Setting the pointer to NULL solves the problem, and may fix the bug
report, if that's what the reporter is complaining about.

xps/xpsimage.c


2017-12-21 19:41:20 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
32cc4f267175dcc7a0dac0219e8e042ec9918cd9

Bug 697545 : Fix main instance memory leak.

Fix memory leak for allocation event number 12.

Error created using :-
MEMENTO_FAILAT=13 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

pcl/pl/plmain.c


2017-12-20 14:20:13 +0000
Ken Sharp <ken.sharp@artifex.com>
3b24fd02b2bbeaef3d2e0374023fa330a9cddeac

Add 'gs_restrict' to function prototypes to match functions

Also add gs_restrict to some functions, because they are assigned to
function pointers that expect gs_restrict pointers.

base/gxblend.c
base/gxblend.h


2017-12-19 16:15:17 +0000
Robin Watts <robin.watts@artifex.com>
ac7e8dfb78a2b3ae2875f64e6feb6f4dce5300b4

More tweaking to pdf14_fill_rect cases.

Ensure that the gray/rgb/cmyk cases for AirPrint all go through
routines that have been hand tweaked.

base/gxblend.c


2017-12-19 18:22:28 +0000
Robin Watts <robin.watts@artifex.com>
f00a08ec0a7f2fedbc2a7d14c603ec22758ed81c

Avoid shadowing a variable in mark_fill_rect_add3_common.

base/gxblend.c


2017-12-19 15:21:55 +0000
Chris Liddell <chris.liddell@artifex.com>
28c4beb74e779da37c4e7aa7f149750a98c09a73

Remove obsolete font files:

NimbusSans-BoldOblique (replaced with NimbusSans-BoldItalic)
NimbusSans-Oblique (replaced with NimbusSans-Italic)

Resource/Font/NimbusSans-BoldOblique
Resource/Font/NimbusSans-Oblique


2017-12-19 13:23:42 +0000
Robin Watts <robin.watts@artifex.com>
9d1e45d36064249220ca2f51280770aaaab3a971

Common up optimised cases of group blending.

Additive and Subtractive make no difference (modulo rounding) when
dealing with normal mode blends. As such we can halve the number
of optimised routines required.

base/gxblend.c


2017-12-19 10:16:16 +0000
Ken Sharp <ken.sharp@artifex.com>
1143a7aba79e6316ccfb5fc2b0943dcd7a64a48f

pdfwrite - drop unusable Matte from SMask when doing colour conversion

Bug #698817 "ColorConversionStrategy=Gray breaks image with smask"

SMask images can have a Matte entry which is a preblended colour. It
must have the same number of components as the parent image. If we are
doing colour conversion then we can't unconditionally use the existing
Matte value, as it may have the wrong number of components for the
converted image.

In fact Matte values are optional and rare. Even rarer are Matte entires
which have any actual effect. We can't use the value (unless the parent
image was already in the target colour space, and we can't realistically
convert the Matte to another space.

So here we test the color conversion strategy, if the image colour space
is not the same as the target, then we simply discard the Matte entry.
This isn't 'correct', but then nothing will be, and this stops Acrobat
from whinging and refusing to render the image at all.

devices/vector/gdevpdfi.c


2017-12-19 09:05:22 +0000
Ken Sharp <ken.sharp@artifex.com>
6e77c8f647fecaa1a31116fbcd59ad26fb650905

pdfimage - eliminate a compiler warning

Check a return code to eliminate a compiler warning.

devices/gdevpdfimg.c


2017-12-18 20:59:39 +0000
Robin Watts <robin.watts@artifex.com>
fbf0e1c9f7014b602f9dd94e8fac37b21dffc798

Add CMYK optimised core to image rendering.

Add irii_inner_32bpp_4spp_1abs to go along with others. This one
is hit in the AirPrint test file when going to CMYK.

base/gxiscale.c


2017-12-13 15:37:53 +0000
Robin Watts <robin.watts@artifex.com>
f34cae2ebb2c85c13787fd828eb6194e32cb19d2

Optimise image_render_interpolate_icc.

Split out the core of the routine into a function call. The
guts of the original routine go into irii_inner_template,
which can be static instantiated as required.

I had hoped that merely instantiating this 3 times would be
enough to optimise the routines, but in the end I had to
manually cut the core down for the 2 cases that the AirPrint
test file hits.

base/gxiscale.c
windows/GhostPDL.sln


2017-12-18 16:38:31 +0000
Ken Sharp <ken.sharp@artifex.com>
9fb23615725e8a2d6a722814a348094a48a41c36

pdfimage - support the '%d' output format specifier

It hadn't occurred to me that anyone would want to do this, so I hadn't
implemented it. On reflection its probably useful, and it should
(finally) solve the all devices regression report problem.

At the same time, add the file to the Windows solution so that we get
debug information in it.

devices/gdevpdfimg.c
windows/ghostscript.vcproj


2017-12-18 15:09:02 +0000
Robin Watts <robin.watts@artifex.com>
561327c559cd8fa6cb5840a80806cff38ef9aa0b

Manual optimisation of AirPrint hotspot.

compose_group_nonknockout_nonblend_add_isolated_mask_common_solid
takes a significant amount of time in the AirPrint test file.
Unroll it manually and optimise to avoid needless planar -> chunky
-> planar copying.

base/gxblend.c


2017-12-18 11:27:32 +0000
Ken Sharp <ken.sharp@artifex.com>
51f279ece4f34c17119a543725c5aee3ca4f8d1d

Fix pattern code for devices handling patterns by subclassing new device

The pattern code permits for us to use an 'internal' accumulator or for
a device to declare it can handle patterns itself. When a device handles
patterns we pass spec_ops to the device to delineate the pattern
operations.

It can happen that when the pattern terminates we (g)restore back to a
point before the internal pattern accumulator device was pushed into
the graphics state. To handle that possibility we push a pointer to the
device onto the exec stack and use that stored pointer to tell the
pattern accumulator device when the pattern terminates, even if it is
no longer the current device at that time.

Unfortunately this conflicts with the ability for other devices to
handle patterns. The code uses that same stored device pointer to
indicate whether we are using the internal accumulator or not. If the
stored pointer is NULL then we are not using the internal accumulator.

But this assumed that, if we aren't using the internal accumulator, that
the current device is the one which declared it could handle the pattern.
This is dangerous anyway, because there's not restriction on how fat
back we might have restored, and its possible (if unlikely) that the
device now in the graphics state isn't the one that can handle
patterns. In addition, if the underlying device handles patterns by
subclassing itself with a new pattern handling device, then when we
restore back, even though the device is the one which stated it could
handle patterns, its not the one we want to inform of the pattern
termination.

We handle this simply by getting the current device after the 'start'
notification. I think its reasonable to assume that the device now in
place is the one which expects to receive the 'close' message. We
then store that device on the exec stack. When we get to the cleanup
routine, if we decide we are not using the internal accumulator, then
we call the new stored device to handle it.

I think ideally we should store a flag for whether we are using the
internal accumulator, but it wouldn't be any more efficient.

psi/zpcolor.c


2017-12-18 09:11:05 +0000
Ken Sharp <ken.sharp@artifex.com>
15d80a143b71b9b61d007e2abb67a74a5f753cea

pdfimage - change the way files are closed

The 'all devices' regression test persists in throwing errors and
seg faulting with these devices when closing. I can't reproduce the
problem on Linux.

So instead of preventing the gdevprn code from closing the file, prevent
the stream code from closing the file instead, and allow the gdevprn
code to perform normally.

Hopefully this will solve the problem.....

devices/gdevpdfimg.c


2017-12-18 09:08:58 +0000
Ken Sharp <ken.sharp@artifex.com>
9de2f57c80bc9e6a25e3fd570a5c1df3321404eb

Check for the existence of _MSV_VER before testing its value

On Linux _MSC_VER is not defined, and so leads to a warning everywhere
that stdpre.h is included.

This just eliminates the warning.

base/stdpre.h


2017-12-16 11:01:40 +0000
Ken Sharp <ken.sharp@artifex.com>
8af42f2da3425a634ec78d8a0add1658778e2226

Define gs_restrict as a synonym for the compiler 'restrict' definition

Using the 'restrict' tag tells the compiler that it can safely assume
no aliasing of pointers is involved, allowing for even higher levels
of optimisation. However since this is a non-standard extension
(though widely supported) the exact definition varies.

We know of 'restrict', '__restrict', '__restrict__' and 'cdecl(restrict)'

The Visual Studio cdecl causes problems with us simply using 'restrict'
and #defining it in stdpre.h because stdlib.h includes the cdecl. If
we include stdpre.h before stdlib.h then the compiler tries to expand
'cdecl(resgister)' to 'cdecl(__register)' and that fails.

The only way to accommodate all the various options is to use something
other than the 'restrict' keyword, and to #define that as required for
the different compilers.

This commit introduces the 'gs_restrict' keyword and that is #defined
in stdpre.h to be appropriate for whatever compiler is in use (the
default is to define it to nothing). This means that wherever we want
to use the restrict capability, we must include stdpre.h.

base/claptrap-planar.c
base/claptrap.c
base/claptrap.h
base/ets.c
base/ets.h
base/gxblend.c
base/gxblend1.c
base/gxscanc.c
base/gxscanc.h
base/siscale.c
base/stdpre.h


2017-12-15 21:01:31 +0000
Robin Watts <Robin.Watts@artifex.com>
b35aa4c4e4a8e77395b45051ca2621e6823c5623

Add optimised LCMS transform operations.

Add a full set of optimised functions for {1,3,4} -> {1,3,4}
channels in either 1 or 2 byte form. This should cover all
the cases we'll hit in gs until we start using spots.

lcms2/src/cmsxform.c


2017-12-16 16:10:48 -0800
Ray Johnston <ray.johnston@artifex.com>
e8e7034a9714191315313daa4a45ce626a9f6cf7

Fix bug 698816: Performance with transparency due to commit 3a9d6eb

Tracked this down to the push_transparency_group logic not skipping the
allocation of the buffer when "idle" was set. This reduced 32-bit Windows
9.22 from 45.9 seconds to 19.9 seconds.

Even more good news, HEAD (SHA 3f9c130f 32-bit Windows) from 37.5 seconds to
11.9 seconds.

base/gdevp14.c


2017-12-15 19:07:07 +0000
Robin Watts <Robin.Watts@artifex.com>
3f9c130f778167b2f0486bef1c3a2d027433ec57

Optimise pdf14_fill_rectangle for CMYK

Add optimised CMYK case.

base/gxblend.c


2017-12-15 11:50:32 +0000
Robin Watts <Robin.Watts@artifex.com>
0333c58af9a48a14a0e9323732332104e577dc85

Optimise pdf14_fill_rectangle.

Optimisations for the common case as seen in Airprint
test file.

base/gxblend.c


2017-12-15 09:54:15 +0000
Robin Watts <Robin.Watts@artifex.com>
9b35281f914bb77f5e68070fb6ce4e32e955dcc8

Add new optimised case for pdf14_fill_rect

mark_fill_rect_additive_nospots_common_no_alpha_g.

For the Airprint test case.

base/gxblend.c


2017-12-14 20:06:37 +0000
Robin Watts <robin.watts@artifex.com>
3dfca86e11ea2143525758325ea0feff06e42a52

Further optimisations to image_render_color_icc.

Split it into 3 routines; portrait, landscape and skew.

base/gxicolor.c


2017-12-14 18:42:14 +0000
Robin Watts <robin.watts@artifex.com>
e0ebcde1ce879cf74fb9d8b53670478d5d03717b

Optimise image_render_color_icc.

Avoid using the color_samples hack, as this merely results in us
first copying bytes into a new buffer, only to effectively
memcmp it. Just use the bytes directly.

We lose potential problems with strict aliasing here, and gain
the benefit of only having to check n bytes rather than
GS_IMAGE_MAX_COLOR_COMPONENTS bytes each time.

This gives us a noticable speedup on the Airprint test file.

base/gxicolor.c


2017-12-15 15:08:40 +0000
Ken Sharp <ken.sharp@artifex.com>
2655f09c04ee2678df98c58764390e9e79bfc254

PCLm fixes

rename the device to 'pclm' because none of our devices use capital
letters.

Mirror the fix for sclose in the PCLm device (didn't realise this was
a separate function to the pdfimage devices)

remove the unused writehex function

devices/gdevpdfimg.c


2017-12-15 13:06:47 +0000
Ken Sharp <ken.sharp@artifex.com>
3cdca3a2c6cfe74a62797d486ce6c69afd9eacd0

pdfimage devices - remove UUID code

The uuid was a holdover from an early incarnation of the code, it
was dropped later but the code lingered....

devices/gdevpdfimg.c


2017-12-15 11:21:49 +0000
Ken Sharp <ken.sharp@artifex.com>
44d4d979c25eaea76c2d08aceec058f92ee3ed83

Make pdfimage devices work on Linux

Because the devices usurp the FILE * created by the gdevprn code and
turn it into a stream, we must set the stored pointer to NULL after
closing or freeing the stream in order to avoid gdev_prn_close()
attempting to close the underlying file again, which causes an error
on Linux.

Also remove some routines we no longer use.

devices/gdevpdfimg.c


2017-12-13 14:19:43 +0000
Robin Watts <robin.watts@artifex.com>
86322b1ccb1e67cf99672945f1d77925b2902872

Tweak gx_build_blended_image_row.

Move from an array index based scheme to a pointer arithmetic
based scheme. Saves us lots of multiplications per pixel.

This may not make much difference on x86, but on ARM, where
pointer arithmetic is largely free, this should help more.

base/gdevp14.c
base/gxblend.h
base/gxblend1.c


2017-12-14 15:27:11 +0000
Robin Watts <robin.watts@artifex.com>
899255deef5a92bf36269d0ef3fa355401fe170f

Further optimisations to bitmap scaler.

Use hand unrolled loops rather than static inline optimised ones.
Fix some debugging. Add CMYK case. Add some restricts. Make the
zoom_y case explicit in it's reuse of values.

base/siscale.c


2017-12-14 12:45:08 +0000
Robin Watts <robin.watts@artifex.com>
16eb526bc113a9c783f824ea6940857e302acc3d

Add restrict qualifier to stdpre.h header.

Sprinkle it through the blending code. This should never hurt
and may well help. We should be using it as a matter of course,
especially in performance critical routines.

base/gxblend.c
base/gxblend.h
base/stdpre.h


2017-12-14 12:00:51 +0000
Ken Sharp <ken.sharp@artifex.com>
34286be72308b7cba275bbf423e589997e9e683e

Fix compiler warnings after pdfimage device commit

devices/devs.mak
devices/gdevpdfimg.c


2017-11-02 08:24:59 +0000
Ken Sharp <ken.sharp@artifex.com>
7a13371ec8dc077c4a3b28f6935206fe06fc534e

New devices - pdfimage and PCLm

These devices render input to a bitmap (or in the case of PCLm
multiple bitmaps) then wraps the bitmap(s) up as the content of
a PDF file. For PCLm there are some additional rules regarding
headers, extra content and the order in which the content is
written in the PDF file.

The aim is to support the PCLm mobile printing standard, and
to permit production of PDF files from input where the graphics
model differs significantly from PDF (eg PCL and RasterOPs).

Devices are named pdfimage8, pdfimage24, pdfimage32 and PCLm.

Currently produce valid PDF files with a colour depth of 8 (Gray),
24 (RGB) or 32 (CMYK), the PCLm device only supports 24-bit RGB.

Devices supports the DownScaleFactor switch to implement
page level anti-aliasing

-sCompression can be set to None, LZW, Flate, JPEG or RLE (LZW
is not supported on PCLm, None is only available on PCLm for
debugging purposes).

The PCLm device supports -dStripHeight to set the vertical height
of the strips of image content, as required by the specification.

For JPEG compression the devices support both the JPEGQ and
QFactor controls, exactly as per the jpeg and jpeggray devices.

base/unixansi.mak
configure.ac
devices/devs.mak
devices/gdevpdfimg.c
devices/vector/gdevpdfe.c
doc/Devices.htm
psi/msvc.mak
psi/os2.mak


2017-12-13 17:55:16 +0000
Robin Watts <robin.watts@artifex.com>
099ba1f50e2af5d43a9f007575e78e3605d008be

LCMS2 tweak: Spot identity transformations

Spot identity transformations and handle them as efficiently as
possible. (i.e. avoid unpack/null transform/repack).

lcms2/src/cmsopt.c
lcms2/src/cmsxform.c
lcms2/src/lcms2_internal.h


2017-12-13 09:25:09 +0000
Robin Watts <robin.watts@artifex.com>
92f0c389ebddf4125dc770f71f4d74187275fd7f

Add 2 more optimised blend cases for Airprint test case.

The Airprint Presentation test file hits the
compose_group_nonknockout_nonblend_add_isolated_mask_common case
hardest. Add 2 more specialisations of this that cope with
shape = 255 and alpha == shape == 255.

This saves us just over half a second (of 13.2) on my desktop PC.

base/gxblend.c


2017-12-11 19:52:43 +0000
Robin Watts <robin.watts@artifex.com>
b5189a84ddf0ca1454b10bb4a9926cd4f8c4f0eb

Add PWGDecode filter.

And lib/viewpwg.ps to use it.

Makefile.in
base/lib.mak
base/spwgd.c
base/spwgx.h
base/unix-gcc.mak
lib/viewpwg.ps
psi/int.mak
psi/msvc.mak
psi/zfilter.c
windows/ghostscript.vcproj


2017-12-12 17:57:05 +0000
Robin Watts <robin.watts@artifex.com>
0bdb35346b5a9636bc6c1ca629401ba21232d9bb

Bug 698808: Fix stack overflow in new scan converter.

Remove some code to split lines. This is no longer needed
due to the fix for bug 698805, and avoids us getting into the
stack overflow situation.

base/gxscanc.c


2017-12-12 01:37:14 -0800
Michael Vrhel <michael.vrhel@artifex.com>
2eb66278cb71b4f97b09300d7c405b8228ebeaf6

Segv fix for XPS files with trans out to sep device

When going out to a separation device, PCL and XPS should set
PageSpotColors to 0. For PCL this lets the sep device know
that there are not any spot colors on the page.

For XPS the situation is a bit more complex. XPS files with named colors
are very rare. I have never seen one in the wild. Supporting
the separation of them will require work in the XPS interpreter
to keep track of the colorants (the names of which are in the colorant
tags of the ICC profile) and make sure that the values are properly
mapped to the colorant positions on the output device. We will also
want to do a pre-parser to count the number of independent colorants
on the page to ensure proper set up of the device. This is needed
especially if the page has transparency as the pdf14 device expects to
have this information. Again running into them in the wild is not going to
occur. If for some reason it does become an issue in the future,
we can invest the time in doing the above. In the meantime if they
are encountered they will be remapped to equivalent CMYK colors instead
of causing a segv.

pcl/pl/plmain.c


2017-12-12 18:31:00 +0000
Robin Watts <robin.watts@artifex.com>
ac1fb2a0580fac884cbf8e07aba4834498a5927a

Fix typo in bug fix for 698805.

base/gxscanc.c


2017-12-12 09:19:41 +0000
Chris Liddell <chris.liddell@artifex.com>
0aa901ed39ae5c2a8fbf1107dbbd7d3813cab2ee

Check for gdevcups.c before including the cups device

Previously, we were checking for the cups directory, which won't work reliably
if the build machine also has the cups libraries installed.

configure.ac


2017-12-12 16:58:00 +0000
Robin Watts <robin.watts@artifex.com>
ed2c6957a2ed53aac51e0b7d4209e62f096b8d73

Bug 698805: Fix NULL pointer dereference in new scan converter.

Again caused by an integer overflow.

signed sy, ey can differ by more than 0x80000000, which means
when we subtract them, we can end up with a result with a different
sign.

Fix by using a safer test.

base/gxscanc.c


2017-12-01 14:43:43 -0800
Ray Johnston <ray.johnston@artifex.com>
ac241e31c931858e562dc0a4cd88db31e012c2cf

Fix bug 698662. Elements shifted horizontally when clist is used.

The scurveto clist path reading logic assumed that if the first value
A, was 0, the previous curve entry was vertical, but the writing logic
checked for B == 0 and decided to use h*curveto, so if A was also 0,
the reading logic would assume vertical.

base/gxclpath.c


2017-12-08 13:43:36 -0800
Michael Vrhel <michael.vrhel@artifex.com>
43a84c5d99d14881773b78b58892e9b049b938d9

Bug 698794 detect alpha data in PNG image

We were making the decision as to the presence/absence of
the alpha data in the PNG image a little early. There
was one more step related to png_set_tRNS_to_alpha

xps/xpspng.c


2017-11-30 18:41:42 -0500
Robin Watts <Robin.Watts@artifex.com>
4ee9656472805dc39a6ed3a8bd097dd04e497c19

Fix PCL init routines to return error code.

And fix calling loop to honour error code. Interestingly
this calling routine was already set up to do most of the
hard work here. I wonder if this was once done already?

pcl/pcl/pccolor.c
pcl/pcl/pccprint.c
pcl/pcl/pcfont.c
pcl/pcl/pcfrgrnd.c
pcl/pcl/pcjob.c
pcl/pcl/pcmacros.c
pcl/pcl/pcmisc.c
pcl/pcl/pcommand.c
pcl/pcl/pcommand.h
pcl/pcl/pcpage.c
pcl/pcl/pcpalet.c
pcl/pcl/pcparse.c
pcl/pcl/pcparse.h
pcl/pcl/pcpatrn.c
pcl/pcl/pcrect.c
pcl/pcl/pcsfont.c
pcl/pcl/pcstatus.c
pcl/pcl/pcsymbol.c
pcl/pcl/pctext.c
pcl/pcl/pcuptrn.c
pcl/pcl/pcursor.c
pcl/pcl/pgchar.c
pcl/pcl/pginit.c
pcl/pcl/pginit.h
pcl/pcl/rtgmode.c
pcl/pcl/rtmisc.c
pcl/pcl/rtraster.c


2017-12-05 13:31:25 +0000
Ken Sharp <ken.sharp@artifex.com>
5c851a410c3469860a171420240eb92331dcda9e

pdfwrite - colour conversion changes

Bug #698723 "convert rgb pdf to cmyk with icc profile yields wrong black"

When converting to a base space colour, and applying the transfer
function, don't use the old-fashioned colour conversion routines but
instead use the ICC profile colour management.

With this change in place, the CMYK components in the output file are
the same as those when rendering to TIFF CMYK output.

I am convinced there is more work to do in this area.

devices/vector/gdevpdfg.c


2017-12-05 13:27:27 +0000
Ken Sharp <ken.sharp@artifex.com>
775e9d28f78b4b0b5b41a24f4c9fc7f19a9326e3

pdfwrite - correct a device method

Correct the CMYK colour mapping method to use CMYK and not RGB....

devices/vector/gdevpdf.c


2017-12-01 17:05:07 -0500
Robin Watts <Robin.Watts@artifex.com>
6edda68e00965c0794fdd408cbc02c1729c374ff

Rejig gs_fapi_ft_ensure_open to avoid error cleanup SEGV.

Also, aesthetics.

base/fapi_ft.c


2017-12-01 14:06:12 -0500
Robin Watts <Robin.Watts@artifex.com>
3d6009573b3562d97f03c0fb6b1463ed0e4d133f

Memory squeezing fix in pl_load_tt_font.

Fix SEGVs due to memory failures while loading a tt font.

Error created using :-
MEMENTO_FAILAT=1402 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null
./pcl/examples/owl.pcl

Tweaked version of a commit from Shelley.

pcl/pl/plfont.c


2017-11-30 18:40:42 -0500
Robin Watts <Robin.Watts@artifex.com>
cc5b750951ee94b2d7e0615dde0122af973f49bb

Memento: Fix type of signal handler function.

base/memento.c


2017-12-02 13:11:42 +0000
Ken Sharp <ken.sharp@artifex.com>
7d9b9cc6ff0fafed282257fd1bf1ba815726a50e

PDF interpreter - another case of incorrect ICCBased profiles

More cases like those tackled in commit
df5b3426d31f79c13a735dff9118e9798ce97af9 for bugs #696690 and 696120

Again we have an ICCBased colour space where the /N alue does not match
the actual number of components in the ICC profile. Previously we had
only seen this with images, the customer file uses a 'cs' operator
which we weren't catching.

No differences expected.

Resource/Init/pdf_ops.ps


2017-11-16 16:41:22 +0100
David Kaspar [Dee'Kej] <dkaspar@redhat.com>
615b31526d06fcdac7abb9e37deac3ce5fb214b6

man/de - all man pages converted to UTF-8 (from ISO-8859-1)

man/de/dvipdf.1
man/de/gsnd.1
man/de/pdf2ps.1
man/de/printafm.1
man/de/ps2ascii.1
man/de/ps2ps.1


2017-12-01 15:16:19 +0000
Chris Liddell <chris.liddell@artifex.com>
69f4ea2d9d86b9eccf5e3477e4dc9d7d51e1d2d8

Remove obsolete check_source.py tool....

and its configuration file (testing.cfg.example).

Bug 698780 (related)

toolbin/tests/check_source.py
toolbin/tests/testing.cfg.example


2017-11-27 10:30:52 +0100
David Kaspar [Dee'Kej] <dkaspar@redhat.com>
efc24229b0ba4b2f6a39fe89a4c9c576dbe7e124

Bug 698784: Fix the alias for Helvetica-Narrow-Bold-Oblique

Init/Fontmap.GS:

There was a misalignment between the filename of the
NimbusSansNarrow-BdOblique and its /Fontname in the T1 font itself.

Filename: NimbusSansNarrow-BdOblique
/Fontname: /NimbusSansNarrow-BoldOblique

This worked correctly if the fonts were located directly in
/usr/share/ghostcript/Resources/Font folder on the filesystem.

However, on Fedora we are using /usr/share/fonts/urw-base35/ folder,
which is part of Ghostscript's Search Path. In this case it was
causing the Ghostscript being unable to locate the correct font, thus
crashing while opening any document containing Helvetica Narrow Bold
Oblique font...

*In addition*, rename the font file so it matches.

Resource/Font/NimbusSansNarrow-BoldOblique
Resource/Init/Fontmap.GS
psi/psromfs.mak


2017-12-01 13:54:02 +0000
Chris Liddell <chris.liddell@artifex.com>
8d0ca41749ec3070c6a5c660ab0225b42bcb9eb3

Bug 698741: where the comment says "decrement", actually decrement

The comment stated we'd move to the end of the row, and work backwards, but
the code was still working forwards, leading to a buffer overrun.

base/gxicolor.c


2017-11-24 22:26:59 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
caa10a82fcf313dab7426250f59517936fa34964

Bug 697545 : Memory squeezing fix for double freeing of ToneCurve.

Avoid SEGV by removing unnecessary freeing of ToneCurve.

Error created using :-
MEMENTO_FAILAT=751 ./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null ./pcl/examples/owl.pcl

lcms2/src/cmsio1.c


2017-11-25 19:08:28 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
346f1d67dc363195885dd041ede2abb0422c4455

Bug 697545 : Memory squeezing fix for gs_enumerate_files_next.

Prevent SEGV by checking for NULL pointer before attempting to
use it.

base/gsiodev.c


2017-11-24 19:27:50 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
d2977a7891f5c84526eefdd25b2167e052fa9c90

Bug 697545 : Memory squeezing fix for pjl resources.

Prevent SEGV by checking for NULL pointer before attempting to
free it.

pcl/pl/pjparse.c


2017-11-24 15:45:16 +0000
Robin Watts <robin.watts@artifex.com>
96030033df28fb89732f58ae4df463f7fc06be5b

Add '-DCLUSTER' mechanism to builds.

For autobuild use --enable-cluster option to configure/autogen.sh.

For windows builds, use CLUSTER=1.

This nobbles pdfwrite to use a '0' time in the produced files.
This enables us to md5sum intermediate files.

Thanks to Chris for his help with the configure minefield.

Makefile.in
configure.ac
devices/vector/gdevpdf.c
psi/msvc.mak


2017-11-24 19:06:41 +0000
Robin Watts <robin.watts@artifex.com>
949ce4cf61f2ccf1ff39dd2c854aec9f9dad5068

Tiny stylistic tweak.

pcl/pl/plmain.c


2017-11-24 19:06:26 +0000
Robin Watts <robin.watts@artifex.com>
33babeb40a9e73e0cfb1d3b30574e305fa6ee7c7

Squash warning.

pcl/pl/plmain.h


2017-11-23 22:21:15 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
8b82d6f99ffda116b328e3ae65c58ee5e056e490

Bug 697545 : Memory squeezing fix for mutex in cms code

Prevent SEGV by checking for NULL mutex pointer before attempting
to use or destroy it.

lcms2/src/cmserr.c


2017-11-23 22:17:55 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
a46d319b6edc2bc07b14fbf155b5101bf884fe27

Bug 697545 : Memory squeezing fix in pl_main_delete_instance

Prevent SEGV by checking for NULL value before dereferencing.

pcl/pl/plmain.c


2017-11-23 17:00:06 +0000
Ken Sharp <ken.sharp@artifex.com>
adfedfa4de0457ecacf5814d4a315fcaee00561d

OpenType fonts - regard fonts with multiple GSUB tables as invalid

Bug #697627 "IO in gs_notify_all function"

The bug title is a misnomer; the actual problem is that we have a badly
corrupted font which appears to have 2 GSUB tables. This causes us to
allocate two chunks of memory to hold the tables, losing the original
reference when we allocate the second, and also to register the font
to have the GSUB table released twice.

Trying to release the same memory twice leads to us trying to access
invalid memory, and therefore to a seg fault.

So if we find we have a GSUB, and we've already allocated memory for a
GSUB table, just throw an error.

Chris thinks it may be possible to legally have multiple GSUB tables, if
we ever find such a thing we'll have to rethink this.

base/gstype42.c


2017-11-23 09:40:36 +0000
Chris Liddell <chris.liddell@artifex.com>
3ad236df1e509d0326a1fa31c98e068b5712fd75

Bug 698773: Cope with "charstring" of invalid type

This file has a font whose CharStrings dictionary contains:
/space 3 def

Ideally, when we hit such a case, we should fallback to the .notdef glyph,
unfortunately, it also has:
/.notdef 0 def

We *should* throw an error since this is clearly totally invalid, but other
interpreters *appear* to simply ignore the problem. So, we opt to return an
empty charstring.

psi/zfapi.c


2017-11-23 13:32:26 +0000
Ken Sharp <ken.sharp@artifex.com>
f32c03a2daad2d2e0e859bd6fc7547b68bd8bed9

Do not ignore errors from the device's fill_rectangle_hl_color method

Spotted by Robin while fixing indeterminisms, we currently ignore any
error return from this method in pattern_accum_fill_rectangle_hl_color()
when it calls its target device. Adding a check and error propagation is
simple enough, but that then reveals problems with the high level
devices.

There are, in fact, several problems here. Firstly, the mem* devices
which are used to render pattern tiles (amongst other things) are
based on forwarding devices. When we send a spec_op we forward this to
the 'underlying' device. This is a problem if the spec_op is querying
whether the device can handle hl_color, because if it can then the
caller may proceed to use hl_color methods. But the mem* devices cannot
handle these methods and obviously can't forward them to the underlying
device, resulting in an error. Fixed this one by using the default
spec_op method instead of the forwarding one. In future this may require
further attention.

The NULL device doesn't implement fill_rectangle_hl_color. In fact, with
the changes elsewhere it doesn't need to, but really we should simply
handle this in the same way as fill_rectangle and return, all the null
device does is bit bucket all operations. For completeness, implement
such a method.

gx_erase_colored_pattern() didn't do a restore (to match its save) if
an error occurred. Again, with the other changes this is no longer
triggered, but it does seem wrong so lets fix it.

In gx_pattern_load() and pattern_paint_prepare(), avoid erasing the
background of the tile if the pattern instance is for a device which
handles patterns itself (eg pdfwrite). Once again, not really required
now that the mem* devices don't pass on the spec_op to the underlying
device, but it saves us bothering with erasing a rectangle which we are
going to throw away anyway.

Finally, the point of the whole exercise, in
pattern_accum_fill_rectangle_hl_color(), check the return code from the
target device's fill_rectangle_hl_color and if its an error, return it.

base/gdevmem.c
base/gdevnfwd.c
base/gxpcmap.c
psi/zpcolor.c


2017-11-22 21:29:04 +0000
Robin Watts <robin.watts@artifex.com>
1cfc56251773304fb102237ff8a63c5576f08fe7

Rewritten version of squeeze2html.pl

This works with the latest memento, and gives nicer results in
the browser.

Invoke using something like:

MEMENTO_SQUEEZEAT=1 membin/gs -sDEVICE=ppmraw -o /dev/null
in.pdf |& perl toolbin/squeeze2html.pl -q | gzip -9c > out.html.gz

toolbin/squeeze2html.pl


2017-11-22 17:57:23 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
276a386da36926cf36942528146b4294a5ff9d6d

Coverity IDs 127198, 127199

Check return values and handle errors accordingly.

pcl/pcl/pctext.c


2017-11-22 18:02:26 +0000
Robin Watts <robin.watts@artifex.com>
dd35e58feccf543129bc108857b16fd43d627d02

Fix indeterminism caused by buffer overrun in thresholding.

Running:

gs -sOutputFile=out%d.pbm -dMaxBitmap=400000000 -sDEVICE=pbmraw -r300
-sDEFAULTPAPERSIZE=letter -dNOPAUSE -dBATCH -K2000000 -dClusterJob
-dJOBSERVER /home/marcos/cluster/tests_private/pdf/uploads/Bug698519.pdf

then catting out{1,2,3,4,5}.pbm together and md5summing it gives a
different result to running the above job direct to out.pbm.

After much nightmarish debugging, it transpires that this is because
the special case in the SSE thresholding code that spots the 200%
scale case is being triggered incorrectly.

The image is 1753 pixels wide, which would be 3506 pixels at 200%.
We actually display it at 3507 pixels. The code was triggering the
200% case by calculating a scale_factor value of fixed_half (128).

The rounding here was causing a false positive.

Instead, we skip the calculation and check by directly comparing
source and dest sizes.

base/gxicolor.c
base/gximono.c


2017-11-21 12:48:54 -0800
Ray Johnston <ray.johnston@artifex.com>
362ec9daadb9992b0def3520cd1dc6fa52edd1c4

Fix bug 697459 Buffer overflow in fill_threshold_buffer

There was an overflow check for ht_buffer size, but none for the larger
threshold_buffer. Note that this file didn't fail on Windows because the
combination of the ht_buffer and the size of the (miscalculated due to
overflow) threshold_buffer would have exceeded the 2Gb limit.

base/gxht_thresh.c
base/gxipixel.c


2017-11-21 19:27:19 +0000
Robin Watts <robin.watts@artifex.com>
68fa913b5bc06a4250115f52835cadc5493aab12

Avoid warning.

base/gdevp14.c


2017-11-21 19:24:04 +0000
Robin Watts <robin.watts@artifex.com>
853737363b7b7cd1eab4da68ba8f83b7dfb5f453

clist tweak: Pass &var to macros if the value of var is updated.

Otherwise it's hard for someone unfamiliar with the macros to see
what is going on.

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


2017-11-21 17:40:53 +0000
Robin Watts <robin.watts@artifex.com>
ce5c3f42d8bd062da65d592abdaaeea90b901970

Ensure that single component planar devices can cope with hl_color.

As part of tracking down indeterminisms in the cluster, I found that:

gs -sBandListStorage=file -sOutputFile=out%d.psd -dMaxBitmap=10000
-sDEVICE=psdcmyk -r300 -Z: -sDEFAULTPAPERSIZE=letter -dNOPAUSE
-dBATCH -K2000000 -dClusterJob -dJOBSERVER -ZL
tests_private/pdf/sumatra/586_-_missing_images_gs_SMask_not_applied.pdf

was hitting a case where we were writing a pattern tile into the
clist that hadn't been initialised at all. This was because all
the writes to the pattern accumulator went through
pattern_accum_fill_rectangle_hl_color. This passes the hl_color
data to the memory devices fill_rectangle_hl_color function, and
fills the mask with 1s.

The mask was being entirely filled with 1s and so was being discarded
as unnecessary. Unfortunately the devices fill_rectangle_hl_color
entrypoint was left as the default which does nothing by raise an
error.

The fix here is to ensure that when we open a planar device, we
always add in a suitable fill_rectangle_hl_color function, even
when the device is superficially the same as a chunky one.

Thanks are due to Michael and Ray for their help with tracking this
down.

base/gdevmpla.c


2017-11-21 16:46:18 +0000
Ken Sharp <ken.sharp@artifex.com>
19ebb5f1f497b6f2d50fe13d17d3e627dfb6c868

PS interpreter - restore the flushpage operator

Michael Katzmann, working at the Library of Congress, is using
Ghostscript in a custom application, which also involves a barcode
reader and an SQL database.

Currently this resides in an RPM at:

http://engineering.nlsbph.org/repo/fedora/fedora/updates/27/SRPMS/AddressCard-3.17-LoC.fc27.src.rpm

but its not usable without the barcode reader and SQL database....
For reasons which are not completely clear to me, he wants to use
flushpage to update the display part way through the operation.

We suspect that it would be possible to avoid this, but it would
probably require some programming effort on the users part, and since
flushpage doesn't look like a likely candidate for abuse, we've decided
just to restore it.

Resource/Init/gs_init.ps


2017-11-21 14:13:21 +0000
Ken Sharp <ken.sharp@artifex.com>
37a9d25214efcabe0f36ed4cf6e91c58fcdbfa2d

PDF interpreter - move a default value to be compatible with all xref types

The commit df5b3426d31f79c13a735dff9118e9798ce97af9 which works around
PDF files where the /N value and the actual ICC profile colour space
number of components do not match.

Unfortunately, I made a minor error when creating this, which wasn't
exposed by the test files on hand at the time. I set the default value
of ICCProfileNError to false when processing an xref of type 'orig'
(ie not an xref stream) which means that for PDF files which use xref
streams the value was not defined, leading to an error.

Move the initial declaration to pdfopenfile instead so that it works
no matter what type of xref we have,.

Resource/Init/pdf_main.ps


2017-11-05 16:16:46 -0800
Ray Johnston <ray.johnston@artifex.com>
1d7893955cf4231c092045affc32e26ad2b6de32

Fix bug 696845 SEGV with --saved-pages-test and transparency

When a file pushes a pdf14devicefilter (or other compositor) it will
still be the currentdevice after the filter is popped when the saved
pages printing occurs. We need to check if the device is a forwarding
device (as compositors will be when deactivated) and use the target
device to print the saved pages.

Also, if a device uses the gx_default_dev_spec_op, it will return 0
from the supports_saved_pages call even when it is a printer device.
In gdev_prn_forwarding_dev_spec_op, check for a zero return and return
true (1). A device that is a printer device that doesn't support saved
page printing needs to return < 0 to prevent this.

Add a finalize method for gx_device_printer so we can free up the saved-
pages-list when the device is freed, but not when the device is closed
which can happen if it needs to close due to put_params. Also the
return code from the output_page in gx_saved_page_params_process was
ignored. Both seen with the file Bug687111.ps and the psdcmyk device.

Also for devn devices, such as psdcmyk, we need to save the separation
(spot color) names collected during the execution of setcolorspace in
the gx_saved_page and set them in the devn_params when rendering. These
are not handled by the paramlist.

Disable --saved-pages= and --saved-pages-test with PCL and XPS since it
was never completely implemented and the partial implementation causes
many errors when tested with --saved-pages-test. Note that while the
--saved-pages-test option is still accepted as a parameter, it is ignored
so that regression testing with --saved-pages-test can run.

Regression shows 3343 "diffs", but bmpcmp doesn't show any diffs.

base/gdevp14.c
base/gdevprn.c
base/gdevprn.h
base/gxclist.h
base/gxclpage.c
base/lib.mak
examples/transparency_example.ps
pcl/pl/plmain.c
psi/imain.c
psi/imainarg.c


2017-11-20 14:33:03 +0000
Robin Watts <robin.watts@artifex.com>
1b64014143a8a571e5dbff3346c6ad902603dda1

Fix release/debug difference.

In searching for the indeterminism in 11-14.PS, I found that I could
run the same command line in release and debug builds on peeved, and
get different results:

touch out1.pgm ref1.pgm && rm out*.pgm ref*.pgm &&
bin/gs -sOutputFile=ref%d.pgm -dMaxBitmap=10000 -sDEVICE=pgmraw -r300
-Z: -sDEFAULTPAPERSIZE=letter -dNOPAUSE -dBATCH -K2000000 -dClusterJob
-dJOBSERVER %rom%Resource/Init/gs_cet.ps cutdown >& ~/log &&
debugbin/gs -sOutputFile=out%d.pgm -dMaxBitmap=10000 -sDEVICE=pgmraw
-r300 -Z: -sDEFAULTPAPERSIZE=letter -dNOPAUSE -dBATCH -K2000000
-dClusterJob -dJOBSERVER %rom%Resource/Init/gs_cet.ps cutdown
>& ~/log2 && md5sum ref*.pgm out*.pgm && less ~/log ~/log2

After cutting down the file as much as I could, Chris reduced it
simply to:

3E9 3E9 moveto 1 1 lineto stroke showpage

Thanks for this!

Tracing through the code, I discovered that the difference came down
to check_diff_overflow, where the release build was assuming that if
v1 > v0, v0 - v1 < 0, which is acceptable because v0 - v1 has
overflown, at which point C says the value is unpredictable.

The fix is to detect the overflow before it happens.

base/gxpflat.c


2017-11-20 13:51:16 +0000
Ken Sharp <ken.sharp@artifex.com>
cea5d8a72dab953fe84ab8f7280003d377559fff

pdfwrite - Fix typo in on=-page checks for annotations with PDF/X

Bug #698765 "PDF/X Compliance Check Fails with Ghostscript generated PDF"

The upper-right y bound check was incorrect, leading to an incorrect
decision that an annotation was off the page.

devices/vector/gdevpdfm.c


2017-11-20 09:51:27 +0000
Ken Sharp <ken.sharp@artifex.com>
f9d41654ff0f52b6f42e5eff3215cf183261cffa

Coverity ID 203245 - remove redundant NULL check

The changes which fixed the device method API mean that its no longer
required to check that dev is not NULL in this routine.

base/gdevsclass.c


2017-11-17 15:42:17 +0000
Robin Watts <Robin.Watts@artifex.com>
7b04e4d7b85769169db94f1b0ed72474211ba27a

Add another PACIFY_VALGRIND section

Avoid warnings in 586_-_missing_images_gs_SMask_not_applied.pdf

base/gxclist.c


2017-11-17 15:26:10 +0000
Ken Sharp <ken.sharp@artifex.com>
c5f770b5c64cf7a2f3a0f3c447c089a089a695d1

Documentation - Restore the documentation on DELAYBIND and friends

Since we've reinstated DELAYBIND, reinstate the documentation to go
with it. Also include the helpers .bind and .bindnow.

doc/Language.htm
doc/Use.htm


2017-11-16 20:37:41 +0000
Robin Watts <Robin.Watts@artifex.com>
d9c9bea4ecf31e06bcf52d433b632ce0b6b1b239

Fix buffer overrun in gp_enumerate_files_next.

If pattern="*" and patlength = 1, then pathead = 1.

When we look for any following subdirectory, the code attempts
to look for the next subdirectory name. To do this it starts
searching from the byte after the position of the current '/'.
Unfortunately, if the string ends at the current wildcard, we
don't have a '/', we have a NUL terminator. This means the
current code starts looking just after that.

In code terms this means the current code accesses at
pattern + pathead + 1, without checking pattern[patthead] first.
This is a simple fix.

We also take this opportunity to simplify a couple of while loop
conditions. The extra negation is too much for my tiny brain to
cope with.

base/gp_unifs.c


2017-11-16 20:01:57 +0000
Robin Watts <Robin.Watts@artifex.com>
f27b751a1662c3ca8ef64c164cf3f9a400dd416b

Add SINGLE_OBJECT_MEMORY_BLOCKS_ONLY logic.

If SINGLE_OBJECT_MEMORY_BLOCKS_ONLY is defined at
build time, then we restrict every clump/chunk to
have just a single object in it. This makes
valgrind debugging easier as the allocation given
for when 'undefined' values were created is far
more likely to be correct.

base/gsalloc.c
base/gsmchunk.c


2017-11-16 20:00:01 +0000
Robin Watts <Robin.Watts@artifex.com>
1e1b4dc73087212abd1c6c9bee3192a1fc6bf630

Add some PACIFY_VALGRIND to quash some warnings.

11-14.PS trips some valgrind warnings where we
write structures into the clist without having
cleared the padding in the structures.

base/gsptype1.c
base/gxclimag.c
base/gxclist.c
base/gxpcmap.c


2017-11-16 21:51:13 +0000
Ken Sharp <ken.sharp@artifex.com>
e93a58466a78aab89e065bdae2d6b77db5620692

pdfwrite - fix instance UUID

Bug #698757 "Instance UUID truncated"

Should have spotted and fixed this at the same time as Bug #697977
but missed it. As noted in the bug report its practically the same code
and had the exact same problem.

devices/vector/gdevpdfe.c


2017-11-16 13:38:59 +0000
Ken Sharp <ken.sharp@artifex.com>
b76dc2d704fcc00edc8c1fd8ae19d01a36e22c49

ps2write - fix string splitting for output formatting

Bug #698708 "Ghostscript loops"

When writing output for ps2write, we limit the output width to 255
characters. If a string is longer than that we try to split it on
PostScript tokens. If we can't do that then we just break at 255
characters and stick in a newline.

The logic in here however was flawed however, it failed to update the
pointer 'p' which points to the character currently being processed
and did not reset the width count to 0 when the string was output.

This could lead to us in an infinite loop.

devices/vector/gdevpdfu.c


2017-11-16 11:29:47 +0000
Ken Sharp <ken.sharp@artifex.com>
01ce294445f7988f51f63108d53a89df003f2b1e

Fix tiffsep1 device after device API repair

commit dd820be was over-enthusiastic with the tiffsep1 device, and tried
to use the device procs accessor on a device struct member other than
'procs' with predictably unfortunate effects.

devices/gdevtsep.c


2017-11-16 10:28:28 +0000
Ken Sharp <ken.sharp@artifex.com>
fa499a5809aab45b2891b5c8b2363d1bca890757

PS interpreter - add warnings for DELAYBIND and WRITESYSTEMDICT

We've seen people using these options in an inappropriate fashion
and with SAFER set as well. Clearly there is confusion about how to use
these.

If the user selects SAFER, and selects an option which is liable to
make it possible for PostScript to evade the SAFER file system access
restrictions, then emit a warning reminding the user to 'lock' the
unsafe option down.

Also restore the old behaviour of DELAYBIND and remove the
REALLYDELAYBIND switch. We have heard from the 'pstoedit' maintainer
and that tool requires the use of both DELAYBIND and WRIESYSTEMDICT.

Resource/Init/gs_init.ps


2017-11-15 16:49:41 +0000
Ken Sharp <ken.sharp@artifex.com>
dd820bbe7f53e051add94dbcdc779dae1820e0d6

Device method repair - use accessors throughout

A lot of places accessed device methods directly, instead of using the
accessor macros. Update all the code to use the accessors.

base/gdevdflt.c
base/gdevmpla.c
base/gdevnfwd.c
base/gdevp14.c
base/gdevprn.c
base/gdevsclass.c
base/gdevvec.c
base/gsdevice.c
base/gsdparam.c
base/gsicc_manage.c
base/gxclist.c
base/gxclrect.c
base/gxcmap.c
base/gxdevice.h
base/gxfapi.c
base/gxfill.c
base/gxp1fill.c
base/gxpcmap.c
devices/gdevdsp.c
devices/gdevplib.c
devices/gdevtifs.c
devices/gdevtsep.c
devices/gdevwpr2.c


2017-11-12 11:10:49 +0000
Ken Sharp <ken.sharp@artifex.com>
c9951359bde5c4e72a20624788a47a97872db090

Repair the device API - device methods should never be NULL

The original intention of the device API was that device methods (with
the odd exception of fill_rectangle) must not be NULL. That appears
to have been broken with the introduction of the transparency
compositor, with the result that the code now:

1) has to check for methods being NULL sometimes, because that causes
crashes.

2) Uses a device method being NULL to determine code paths.

We want to return the device method design, because having to check for
NULL methods before calling is wasteful.

In this commit:

define default methods for all the methods that previously did not have
one.

Modify gx_device_fill_in_procs to include those defaults in the device
methods which it checks for NULL and replaces.

Finding all the places where the code path differs if a device method
is NULL, alter to check against the default method instead.

Remove NULL checks where they are no longer required. Device whose
'procs' get copied directly (clist) must have defaults for all methods.

Fix gx_copy_device_procs so that we only special case (don't replace
the method) for those few methods where it matters that the subclassing
device must have the default method if the subclassed device does. Long
term we should change the code not to rely on this!

Remove a couple of macros that were not required or plain dumb.

base/gdevdflt.c
base/gdevmem.c
base/gdevnfwd.c
base/gdevp14.c
base/gdevprn.c
base/gdevsclass.c
base/gdevvec.c
base/gscspace.c
base/gsdevice.c
base/gsdparam.c
base/gsicc_manage.c
base/gsovrc.c
base/gspaint.c
base/gstrans.c
base/gxblend1.c
base/gxclist.c
base/gxclrect.c
base/gxdevice.h
base/gxfapi.c
base/gxiscale.c
base/gxp1fill.c


2017-11-14 20:27:07 +0000
Robin Watts <robin.watts@artifex.com>
e2565e030eb37a25459671cfa9119715f3a0aae4

New "planr" device. 1 bit per component, RGB, planar device.

base/gdevmem.c
base/unix-gcc.mak
devices/devs.mak
devices/gdevplan.c
psi/msvc.mak


2017-11-15 19:17:05 +0000
Robin Watts <robin.watts@artifex.com>
a8b1611e7613781cd5c2c7defa2c5315254d9d1d

Fix operation of 1bpc, 3 component halftones.

In the chunky world, it makes no sense to deal with 3 bit rgb as
this doesn't pack neatly into a byte. You'd do it by handling
4 bit chunks.

Accordingly, parts of Ghostscript are written to assume that you'd
not do anything this crazy.

Unfortunately, in the planar world, a 1 bpc, 3 component device
does make (some) sense. Sadly, stuff like the halftone generation
gets deeply confused by this.

Here we fix 2 specific instances of this problem. In the halftone
generation, we generate 3bit chunky halftones as 4 bit ones, and in
the planar_copy_color routines, we assume that 3 bit data is
actually 4 bit (as a) it probably comes from these routines, and
b) if it doesn't it'd be packed as 4 bit in any sane world).

base/gdevmpla.c
base/gxcht.c


2017-11-15 17:08:58 +0000
Robin Watts <robin.watts@artifex.com>
fac14b8c25422529acded1e9e920eb20190db340

clusterpush.pl: Add smoke option

toolbin/localcluster/clusterpush.pl


2017-11-15 17:26:35 +0000
Robin Watts <robin.watts@artifex.com>
ae6f20152ab1e0860952dbeee979ef2c0f195269

Fix st_device_vector_max_ptrs.

This should be +4, not +3, but this value appears to be pretty
much unused, so nothing matters at the moment. It is used by
st_device_psdf_max_ptrs, but nothing uses that either.

We may remove both of these definitions in future.

base/gdevvec.h


2017-11-15 17:12:09 +0000
Robin Watts <robin.watts@artifex.com>
bb5726a74bbfbbd2e17b344eb4bc0385d514d4c1

Memento: Add Memento_sequence

base/memento.c
base/memento.h


2017-11-15 09:03:27 +0000
Ken Sharp <ken.sharp@artifex.com>
d046e24bd2894cf80785bede733006dd53746a07

PostScript interpreter - silence compiler warning

Prototype a function to silence a compiler warning. Also, make the
function static since it isn't used elsewhere.

psi/zarith.c


2017-11-13 11:05:04 +0000
Robin Watts <robin.watts@artifex.com>
143a892226b79676f5f8853f63532f9e6f4e8f5e

Avoid buffer overflow in GraphicsAlphaBits cdoe with planar device.

In GraphicsAlphaBits, we get the pixels from the underlying device
(in chunky format). The buffer we get that data into was sized
according to get_device_raster(dev, false), which (for a planar
device) returns the size for line of planar data. We want the
size for one line of chunky data, so use get_device_raster_chunky
instead.

base/gdevdbit.c


2017-11-13 09:07:03 +0000
Ken Sharp <ken.sharp@artifex.com>
5fe97ce30de048027da19a85bc574a8adfcf2116

pdfwrite - fix an error handling problem

Bug 698735 "Ghostscript: SEGV in pdfwrite with -Z@"

This was, unfortunately, caused by the shift to cleaning up memory
instead of relying on the garbage collector.

When an error occurred writing the metadata, the code simply exited
back to the caller, it did not close the temporary stream it was
writing the metadata to.

Due to the way that 'asides' are handled this led to the wrong stream
being closed, and a pointer retained to a closed stream. The result
was the seg fault.

There may well be other conditions like this still present.

devices/vector/gdevpdfe.c


2017-11-11 19:28:10 +0000
Chris Liddell <chris.liddell@artifex.com>
db2415d2b117946e5ec1d46936a134940f99c21d

Bug 698733: make vector device memory stable

The pcl/xl device (gdevpx.c) was using "normal" Postscript global memory for
its own use, and the vector base device on which it is based. That means the
memory it allocated could disappear with the end-of-job restore in the
Postscript interpreter.

Change it so it uses stable memory which is still garbage collected, and still
subject to relocation, but is *not* subject to Postscript save/restore
operation.

devices/vector/gdevpx.c


2017-11-03 08:52:50 -0700
Ray Johnston <ray.johnston@artifex.com>
c535ebb24602ff14a375a1590a9df6bd8bb7e9c4

Fix bug 695877: SEGV when display callback not set.

Change most of the device procs to return gs_error_Fatal when the callback
hasn't been set. The open is allowed to be called before it is set, but any
operations other than fill_rect (allowed for due to fillpage) and close will
now return Fatal errors. This allows the device to be "fake opened" by gs_init
before the parameters are processed and the display callback is set and the
device is opened for actual use.

devices/gdevdsp.c


2017-11-08 14:04:42 +0000
Ken Sharp <ken.sharp@artifex.com>
ea81364fdda57ce2c82007a150add5949a1c5788

PS interpreter - fix detection of overflow on 64-bit integer multiply

Bug 698722 "Erroneous Range-Check causes wrong arithmetic results"

The work here was actually done by Robin Watts, ably assisted by
Paul Gardiner.

The previous code failed to properly detect an overflow condition,
because the cast of MAX_PS_INT to a double reduces the precision to
only 52 bits for the integer portion, meaning it was possible for
very large numbers not to be detected as > MAX_PS_INT.

psi/zarith.c


2017-11-08 10:04:03 +0000
Ken Sharp <ken.sharp@artifex.com>
e1aead165e05e98ae765d6569f39ced839d4298e

Guard against divide-by-zero exceptions in the halftone code

Bug #697663 "FPE in gx_compute_cell_values()"
Bug #698332 "FPE (Division by zero) in pick_cell_size()"

These have the same root cause, in pick_cell_size() we can end up with
halftone cell parameters which are (I think) improperly initialised.

Certainly its possible to get to the point where we divide using one
of the parameters, and if its 0 we get an error. I suspect that the
halftone may be badly broken even when its not 0, but both these files
are the result of fuzzing, so I doubt its possible to have a real
working file get to this point.

Guard against the divide-by-zero errors by checking that both the
parameters are non-zero (its permissible for one to be 0 I believe)

base/gshtscr.c


2017-11-06 13:27:19 +0000
Robin Watts <robin.watts@artifex.com>
1fb022758a35502b8e299248dd37207c1abc3ffe

Optimise pdf14_copy_planes

Call code derived from pdf14_compose_group rather than
breaking everything down to rectangles.

base/gdevp14.c
base/gxblend.c
base/gxblend.h


2017-11-06 18:37:39 +0000
Robin Watts <robin.watts@artifex.com>
25d1c5f42b748af8d4d331a7b40ce9863e302332

Fix misalignment in pdf14_copy_planes.

In the case where x/y get clipped, we can fail to account for
this.

base/gdevp14.c


2017-11-03 18:53:27 -0700
Ray Johnston <ray.johnston@artifex.com>
8f36ee7a64c9ec95eb6657d06c602d0e4bb6f232

Fix -Z? vs. -Zv output for pattern transparency debug.

base/gdevp14.c
base/gsptype1.c
base/gxpcmap.c


2017-11-03 17:42:52 +0000
Robin Watts <robin.watts@artifex.com>
ee863835be136e21d3a4c4bcbe28e6e050e1bc1a

Check for a failed allocation before using the buffer.

base/gdevp14.c


2017-11-03 17:42:21 +0000
Robin Watts <robin.watts@artifex.com>
cc95eea7e6e5b5efb53446c8bcb482b748e9072e

Squash a warning in pdf14.

base/gdevp14.c


2017-11-03 17:41:33 +0000
Robin Watts <robin.watts@artifex.com>
a953768a82d685e575c17feeebf3ea4468a319f3

Fix bad free pdf14 (wrong gs_memory_t)

Michael spotted that:

gs -sDEVICE=tiff24nc -Z$?@ -r300 -o out%d.tif -f .
./MyTests/Advertising-PowerPoint-A4.pdf

gave a warning saying that a trans pattern being freed from
the cache wasn't owned by the supplied memory pointer.

Indeed the free should have been using memory->stable_memory.
Here we commit the nice fix whereby the buffer keeps a pointer
to the memory with which it was allocated.

This simplifies the pdf14_buf_free calls too.

Credit to Ray for finding the cause/identifying the fix.

base/gdevp14.c
base/gdevp14.h


2017-11-03 15:27:50 +0000
Robin Watts <robin.watts@artifex.com>
3c9f8491ecb5cfa382608c47f5a35ad2bce00edc

Bug 694918: Fix buffer overrun in image_simple_expand.

If truly crazy values of x_extent are used, the fixed point
representation can wrap around and we can start accessing out
of the buffer.

Check for such stupid values and nobble us to do no harm.

base/gxifast.c


2017-11-02 12:07:16 -0700
Ray Johnston <ray.johnston@artifex.com>
1ea664170c68539a035279425447f7ce10e130ff

Add support to viewpbm.ps for GRAYSCALE and RGB_ALPHA and fix logic for FITPAGE

The RAW_DUMP with RAW_DUMP_AS_PAM emits RGB_ALPHA and GRAYSCALE but these
were not supported. Display RGB_ALPHA as CMYK for now.

Also if SCALE was specified, the ifelse for FITPAGE was inverted.

lib/viewpbm.ps


2017-11-02 11:51:48 -0700
Ray Johnston <ray.johnston@artifex.com>
4c1f9b28eab25b519d0a14401ec6bbcf01813e12

Fix RAW_DUMP (minor omissions/typos when blending was refactored.

Resource/Init/pdf_main.ps
base/gxblend.c
base/gxblend.h
base/gxblend1.c


2017-10-27 08:03:36 -0700
Ray Johnston <ray.johnston@artifex.com>
8200f59f1b5aab852e23322587dda7c182fc195b

Fix Bug696372: Transparency with DeviceN not coping with bad PDF's

When a PDF with transparency stops interpretation due to an error, the
grestore may have popped the pgs so that the pdf14 compositor is no
longer the currentdevice. The logic in pad14_spot_get_color_comp_index
assumed that the device was a pdf14_device and got a bogus pointer to
devn_params. Instead, use the device's ret_devn_params function to get
the actual pointer.

Also, the poppdf14devicefilter would execute without the pdf14 device
as the currentdevice. Save the annots_gstate explicitly in pdf_main
showpagecontents so it can be set back before doing annots and the
poppdf14devicefilter.

This also required gs_setgstate to always do gs_do_set_overprint since
the setgstate may have skipped over states with the overprint compositor.
This caused "drawn_comps" to not be set correctly for the pdf14
compose_group.

Fixups for 696372 fix commit (also ne->be last line of commit msg)

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


2017-11-02 17:54:57 +0000
Robin Watts <robin.watts@artifex.com>
1626f36c9b6ae68abad7818be7cfb2a95f4ecffe

Bug 698713: Further graphicsAlphaBits + new scan converter fix.

Previous I ensured that when using graphicsAlphaBits, the new scan
converter would restrict its output rectangles/traps to fit
within y % max_fill_band pixels at a time as required.

I forgot that the base 'y' value taken for this was not necessarily
aligned to a max_fill_band multiple. Fixed here.

base/gxscanc.c


2017-11-01 20:08:13 +0000
Robin Watts <robin.watts@artifex.com>
30ba3e3a163f729f2d05561e688dc54df6afa2e1

LCMS2: Add optimised 3x16bit -> 1x16bit cached transform.

lcms2/src/cmsxform.c


2017-11-01 21:15:42 +0000
Robin Watts <robin.watts@artifex.com>
d68b31cc315e7e687d0b55a5068b7514d7f73f5f

LCMS2: Refind transform routine on buffer change.

lcms2/src/cmsxform.c
lcms2/src/lcms2_internal.h


2017-11-01 17:23:17 +0000
Robin Watts <robin.watts@artifex.com>
4ef5c30e68bbb33b952db1b70508e7412bf79f0f

Reintroduce and update LCMS optimisations.

lcms2/src/cmsxform.c
lcms2/src/extra_xform.h
windows/ghostscript.vcproj


2017-10-31 19:37:10 +0000
Robin Watts <robin.watts@artifex.com>
1ab17bc53362ea34b61050429c51c575539bf2b9

Avoid clearing cm_comps arrays in cmap functions.

This goes against commit 99c48263b9 by Ray (dating from Nov 1 2009)
to fix Bug 690713 and solve some indeterminisms.

My belief is that this SHOULD be fixed in the devices, not in the
callers. Accordingly I have backed that out, and changed the
cmyk_cs_to_psdcmyk_cm function (the only one I can find that does
not set everything to be 0).

The cluster now shows this running with no diffs.

base/gxcmap.c
devices/gdevpsd.c


2017-11-01 12:07:53 +0000
Robin Watts <robin.watts@artifex.com>
b3c0fafa490932cc43009c53c7f8a17598fe78d7

Tweak map_XXXX_subclass functions.

To cope with subclassed devices, we no longer simply call:

pprocs = dev_proc(dev, get_color_mapping_procs);
pprocs->map_cmyk(dev, ...)

etc. The 'done thing' is to run up the the dev->parent pointers
as far as we can, and to get the color mapping procedures from
that. These color mapping procedures then need to be called
using the dev pointer from which they were fetched.

To do this, we provide get_color_mapping_procs_subclass
and map_XXX_subclass functions that pickle the dev search.

The only downside to this is that we end up doing the search
up the tree twice (or more than twice in the case where we
make several mapping calls).

Here we therefore tweak these functions so that
get_color_mapping_procs_subclass returns both the procs AND
the dev to use when calling them in a structure, and the
map_XXX_subclass functions now take that structure.

Broadly, this change shouldn't actually alter any operation,
other than being slightly more efficient.

There are a few wrinkles:

1) in gsicc_replacecm.c, we were fetching the procs using the
dev chasing function, but calling them using the unchased dev
value. Fixed here to use the matching dev value in both cases.

2) In a couple of places, we have special handling for forwarding
devices. I am not convinced that we handle subclassed forwarding
devices correctly (or devices that forward to subclassed devices).
I have marked these areas with FIXMEs, but they are no worse
now than they were before.

base/gdevdflt.c
base/gdevdgbr.c
base/gdevnfwd.c
base/gscspace.c
base/gsicc_replacecm.c
base/gsovrc.c
base/gspaint.c
base/gxcmap.c
base/gxdcolor.c
base/gxdevcli.h


2017-10-31 17:52:12 +0000
Robin Watts <robin.watts@artifex.com>
961b14dd7e686a1543541070a1ba943590ef2bf9

Optimise handle_colors in gxiscale.c

Avoid per-pixel work by doing as much as possible up front.

base/gxiscale.c


2017-10-31 15:52:49 +0000
Robin Watts <robin.watts@artifex.com>
de645ba2116ecfc71d0fdcea84944735736d0278

Avoid looking up the profile for every pixel of an image.

base/gxiscale.c


2017-10-31 13:07:23 +0000
Robin Watts <robin.watts@artifex.com>
f7b61e0cc56206b6811eee85c4cfd6a0963194e0

Pass device_profile into color concretizing functions.

base/gdevp14.c
base/gscdevn.c
base/gscms.h
base/gscolor2.c
base/gscpixel.c
base/gscsepr.c
base/gscspace.h
base/gsicc.c
base/gsicc_cache.c
base/gsicc_cache.h
base/gxcmap.c
base/gxcspace.h
base/gxiscale.c
devices/vector/gdevpdfg.c


2017-10-27 20:24:32 +0100
Robin Watts <robin.watts@artifex.com>
31cb4cf7aa88784219f6fc2be362a66df2f67289

Tweak cmap functions for speed.

In looking at the Advertising-PowerPoint-A4.pdf file, I noted that
cmap_gray_direct and cmap_gray_halftoned were taking a noticable
amount of time. This commit attempts to alleviate that.

Various observations:

1) Avoid unnecessary loop in cmap_gray_halftoned (and similar functions).

In some of the code, we do:

for (i = 0; i < n; i++)
if (i == k)
do_something_with(i)

why not just use:

if (k < n)
do_something_with(k)

2) Typically functions like cmap_gray_direct do a load of work,
culminating in trying to encode a color value. If that encoding fails,
it would fallback to trying to use a cmap_gray_halftoned, which would
do all the work a second time.

Tweak the code to avoid the call, and hence the repetition.

The downside to this is that the work is typically of the form:

for (i = 0; i < n; i++)
cv[i] = frac2cv(some_calculation_involving(cm_comps[i]));

and in order to be able to avoid the call to cmap_gray_halftoned, we
need to make it:

for (i = 0; i < n; i++) {
cm_comps[i] = some_calculation_involving(cm_comps[i]);
cv[i] = frac2cv(cm_comps[i]);
}

i.e. we have to do more stores than before. This can hurt us in some
cases, but it seems like a worthwhile win, especially in light of 3).

3) A lot of the work in these functions involves mapping colors through
the effective_transfer functions. This happens in code of the form:

for (i = 0; i < n; i++) {
cm_comps[i] = gx_map_color_frac(pgs, cm_comps[i], effective_transfer[i]);
}

If effective_transfer[i] is identity (as it almost always is), then
this whole loop is a nop.

We make some steps to optimise for this case by having the
gx_map_color_frac macro check for effective_transfer[i] being
gs_identity_transfer before calling it, but this doesn't help us
avoid the loop/load/store.

We therefore extend pgs with a count of the number of
'effective_transfer's that are non identity (essentially a flag
that enables us to know if we can skip this loop or not),
and use that to optimise our work.

base/gsht.c
base/gxcmap.c
base/gxgstate.h


2017-10-30 19:31:47 +0000
Robin Watts <robin.watts@artifex.com>
de651aaa531a7eb6fa99c1ef97682ebe22a3cda7

Further optimisations in pdf14_mark_fill_rectangle.

Normal blend mode case is always worth optimising.

base/gxblend.c
base/gxblend.h


2017-10-31 14:11:24 +0000
Robin Watts <robin.watts@artifex.com>
fda23c007c3acb96198648c3f4a65438ce449b63

Squash warnings.

psi/zcolor.c
psi/ztrans.c


2017-10-30 11:08:09 +0000
Ken Sharp <ken.sharp@artifex.com>
76b922b5d3071288edbf8f0cccdbbd2b0ae34742

PDF interpreter - try and catch yet more cases of circular references

No bug report for this one, the customer requested destruction of the
PDF file after analysis, and there was no way to reduce the file to the
point where nothing sensitive remained.

The problem is that a Form XObject referenced a number of Image XObjects
one of which contained a DecodeParms array, where the second element
referenced the original Form XObject. This circular reference leads to
an error.

Here we maintain a dictionary (initially empty) on the stack which we
populate with object numbers as we recursively dereference objects.
When we start a new composite object we copy the array into a new array
which we discard on completion. This is to prevent false detection of
circular references if we dereference multiple composite objects at the
same level (eg if we deal with multiple images, each of which perhaps
contained a reference to the same colour space).

We now issue an error quoting the object number being circularly
referenced, replace the object with a null object and continue.

No differences expected.

Resource/Init/pdf_base.ps


2017-10-27 18:08:34 +0100
Robin Watts <robin.watts@artifex.com>
ecb0181ae2c6c64f876f741ef1da2980324442ca

Use integer maths for bitmap interpolation internals.

We calculate the weights using doubles still, but store them as
integers. This means all the inner loops avoid FP.

base/siscale.c


2017-10-27 16:53:51 +0100
Robin Watts <robin.watts@artifex.com>
b62bfe2c7d166bfe8f3743e122abc755d96bec9c

Unpack/Unroll the inner loops of Mitchell scaler.

base/lib.mak
base/siscale.c


2017-10-26 12:53:29 +0100
Robin Watts <robin.watts@artifex.com>
81561e6e04f49a4b3b9599cc09ba2cde4407e936

Optimise clip_fill_rectangle and family.

Avoid testing for transpose each time, and cope with the common
single rectangle case more efficiently.

This gives a 20% speedup in testing with my cutdown
Advertising-Powerpoint-A4.pdf file going to 1200dpi, 1bpc cmyk.

The only one called here is clip_fill_rectangle, but push the
same optimisations through clip_fill_rectangle_hl_color,
clip_copy_mono, clip_copy_planes etc to help other devices.

base/gxclip.c


2017-10-26 16:00:18 +0100
Ken Sharp <ken.sharp@artifex.com>
0d2177ac781235aa67cde3b6fc9d85030c50a8a9

pdfwrite - take action on an error.

Don't ignore the potential error return from gx_path_current_point()

devices/vector/gdevpdte.c


2017-10-25 15:04:28 +0100
Ken Sharp <ken.sharp@artifex.com>
f13a659f9700fac0a0f47007c1eaacddd5c7f208

improve commit d9d74def0095641f20b46716c929bc6f88154490

There were a couple of places that returned 0 which, after the goto
change, return code. Its just barely possible that code might not be
0, so set it to 0 first.

devices/vector/gdevpdte.c


2017-10-25 14:57:12 +0100
Ken Sharp <ken.sharp@artifex.com>
d9d74def0095641f20b46716c929bc6f88154490

pdfwrite - revisit clipped text and commit 46ef6bc80bd7388883a00aa866af38fe8f05d45b

Bug #698693 "clipped text is selectable in pdf"

Commit 46ef6bc80bd7388883a00aa866af38fe8f05d45b fixed bug 697442, in
that case we needed to completely process text which had been
deliberately placed off the page (and tehrefore outside the clip).

In that bug the text used glyphshow, which meant that it could not use
stringwidth to measure the width of the string, and perform accurate
positioning. So instead it placed the current point off the page,
used glyphshow to draw the text, and then currentpoint to find the
displacement.

By not fully processing the text we did not correctly update currentpoint
and so the text was misplaced. This was fixed by fully processing
the text, but altering a copy of the text enumerator's 'operation'
field so that the text was not added to the page (clearing TEXT_DO_DRAW)

However, there are still places (process_text_modify_width) which can
add the text in, and those look directly at the text enumerator
operation flags.

So here we still copy the operation flags, but we then modify the copy
held in the text enumerator, so that any subsequent processor will
be able to see that the text should not be drawn. At the end of the
function we restore the flags in the enumerator. This has meant a few
places executing a 'goto' in order to reset the flags, instead of simply
returning as previously.

A few test files show extremely minor (1 pixel) positioning differences.

devices/vector/gdevpdte.c


2017-10-24 07:19:39 -0600
Henry Stiles <henry.stiles@artifex.com>
140e1cb28a6ad42e2ded8381af8b53421923e0e1

Fix bug #694630 - Fuzzing Segmentation Fault.

Along with soft fonts, the built in fonts should not be restored when
a macro call completes. The segmentation fault in the report was
caused by a dangling reference to a deleted font after restoring the
built in font dictionary. Also, removes a stale comment.

pcl/pcl/pcsfont.c


2017-10-24 12:13:23 +0100
Chris Liddell <chris.liddell@artifex.com>
434234ef22fd28217045c6485672c93a9685a607

Have configure set memory manager alignment.

For certain Unix derivatives (HP-UX, Solaris, and AIX) we have to use 64 bit
memory alignment - configure will now spot if we are building on and for those
platforms, and set the alignment appropriately.

Cross compiling still defaults to 32 bit, and if 64 bit alignment is required,
it must set explicitly.

configure.ac


2017-10-21 11:01:12 +0100
Ken Sharp <ken.sharp@artifex.com>
5889736af797dcba1d46af11a84b765340f6c3c4

PDF interpreter - improve commit 9e8d2e

We should use .endtransparencytextgroup to close the group started by
.begintransparencytextgroup, not .endtransparencygroup

Oddly this doesn't actually seem to cause any problems, but its not
right.

Resource/Init/pdf_draw.ps


2017-10-20 14:40:21 -0700
Ray Johnston <ray.johnston@artifex.com>
6495e38f2dbaeedcaedf84f15c96e78aab6773c4

Remove useless test in PDF interpreter transparency code

This test was always true since we always have .begintransparencygroup
It was changed in 2008 from a check for .inittransparencymask which was
created back in 2006. It was probably a test in case the PDF interpreter
was running on a system that may not include the pdf14 compositor, but
that is only a guess.

Resource/Init/pdf_ops.ps


2017-10-20 16:14:41 +0100
Ken Sharp <ken.sharp@artifex.com>
9e8d2e156aa3ea039f531e6ea378add4ea6e268c

PDF interpreter - fix annotations with transparency and text

Since the introduction of '.begintransparencytextgroup' the synthesis
of missing Appearances for annotations involving text has been broken.

Approximately since January 2017.

Introducing '.begintransparencytextgroup' fixes the problem.

Resource/Init/pdf_draw.ps


2017-10-20 14:16:44 +0100
Chris Liddell <chris.liddell@artifex.com>
2fc463d0efbd044a8232611f0898eeb12b72a970

Bug 698676: have filenameforall permission check use "reduced" path

Prevents working around SAFER file access permissions.

CVE-2017-15652

psi/zfile.c


2017-10-19 13:01:46 +0100
Robin Watts <robin.watts@artifex.com>
684f73e8deefacb2aa5d2277f3154b68809b2ab7

Bug 698672: Fix new scanconverter/alphabits interaction.

The alphabits mechanism relies on the scan converter not
writing trapezoids so tall as to cause its line buffers
to flush too early.

This is achieved by honoring the max_band_height field in
the device header. Previously the new scan converter was
ignoring this. Here we alter the code to pay attention to
it.

base/gxscanc.c


2017-10-17 12:19:19 -0700
Ray Johnston <ray.johnston@artifex.com>
cc9a66978c56fdfff61bc3b1166955e5506470a9

Fix bug 693304. Restore with pdf14 can cause SEGV

The pdf14 compositor device is retained but the mask_stack (and other
elements of the pdf14_ctx need to be in stable memory to prevent
dangling references after a restore.

base/gdevp14.c


2017-10-18 17:01:01 +0100
Chris Liddell <chris.liddell@artifex.com>
6d048c85f5c75e7539e8b5fc42f5fd856986cc6e

Bug 698669: remove reference to removed example file

Some time ago, we removed the example file chess.ps due to questions over the
license for the font it used.

But the makefile gubbins to "install" the example files wasn't changed to suit,
and on HP-UX (but so far, nothing else!) caused "make install" to error out.

base/unixinst.mak


2017-10-18 14:14:11 +0100
Chris Liddell <chris.liddell@artifex.com>
7da09aaf701bd4ff2acea55aacce84a22455aead

Bug 698647: pdfwrite: avoid cached glyphs for Type 3 font input only

The original fix in 8360852efab5643d93cc3b040832075e199cd205 wrongly assumed
that the changed code only came into effect for Type 3 font *input* where,
in reality, it's for any font for which we have to create a Type 3 in the
output.

The change to disable the use of the cache should only apply to Type 3 input
where we want to force the execution of the BuildGlyph/BuildChar proc so
pdfwrite can capture it.

In all other cases, we need to leave the cache in play.

devices/vector/gdevpdtt.c


2017-10-17 10:16:51 +0100
Ken Sharp <ken.sharp@artifex.com>
9219b1e5febd646f6d87bc424b41237a50529d0d

Page selection device - fix overprint compositor usage

Bug #698568 "Ghostscript segmentation fault when doing page selection"

The PostScript interpreter uses the current device in the graphics
state, and calls the create_compositor() method when overprint is
set to true.

This may or may not insert a new compositor device into the graphics
state, and whether it does or not is controlled by the return from
the method. If the device is the same as the one in the graphics state
then we don't set a new device, if its different then we set the
returned device.

The page selection device wasn't initialising this parameter, and if
we were skipping the page we didn't call the child device method,
which meant we returned an uninitialised pointer to the caller. Since
this was unlikely to be the same as the current device, we ended up
trying to set the device in the graphics state to an uninitialised
pointer, with predictably disastrous results.

The simple fix is to initialise the pointer to the current device in
the graphics state. If we call the child method, and it wants a new
compositor then it will overwrite it, if it doesn't, or we are skipping
the page, then we return the current device and nothing changes.

No differences expected.

base/gdevflp.c


2017-10-13 11:16:40 +0100
Ken Sharp <ken.sharp@artifex.com>
05432a551f887d7526b2bf3c65f3f1740cb3cc48

PDF interpreter - Improve annotation appearance generation

Bug #698627 "PDF 2.0 tests Polygon annotation"
Bug #698629 "PDF 2.0 tests Polyline annotation"
Bug #698630 "PDF 2.0 tests Ink annotation"

This commit refactors the code previously committed for Circle and
Square annotations to make it more general. Adds support for the Polygon,
PolyLine and Ink with /Path array (new to PDF 2.0). Adds support for
transparency in Annotations (some limited support was available before).
Adds the /Line annotation type and implements the Line Ending (/LE)
array, but not other aspects of the Line annotation (these may be added
at a later date).

Bug #698628 "PDF 2.0 tests Redact annotation"

We specifically don't generate an Appearance for Redact annotations, but
will render one if supplied. This annotation is really an interactive
feature, not relevant to print.

Predictably this commit causes differences as we now generate substitute
appearances for more annotation types when the appearance is missing.

Resource/Init/pdf_draw.ps
Resource/Init/pdf_main.ps


2017-10-12 14:16:40 +0000
Chris Liddell <chris.liddell@artifex.com>
9196c7ff8c41f1b256d58696158cd6b99e238459

Always force unsigned chars for Luratech

configure.ac


2017-10-09 13:14:23 +0100
Robin Watts <robin.watts@artifex.com>
6b076c380d4479aa64375baaad59dba6729e2c8f

Fix problems caused by pdf14_compose_group tuning.

It seems that has_mask == 0 does not equate to maskbuf != NULL.

Assuming that mask_mask == 0 => maskbuf == NULL causes problems in
tests_private/pdf/sumatra/fireworks_with_radial_shading.pdf (300dpi
clist renderings in particular) and in
tests_private/pdf/uploads/Bug697212.pdf (all renderings).

base/gxblend.c


2017-10-10 10:14:04 +0100
Ken Sharp <ken.sharp@artifex.com>
f64fa48dc792230244f20f115b8dbe3545f484da

Documentation - remove references to .runandhide

We removed a number of PostScript operators from accessibility after
the interpreter is running as part of the security overhaul. One of
these was .runandhide but we accidentally left a couple of references
in the documentation (the main part of the documentation was correctly
updated).

So remove the references here, and update the documentation to note the
potential risks in using -dNOSAFER with a save object on the exec
stack.

doc/Language.htm
doc/Use.htm


2017-09-12 10:32:51 +0100
Chris Liddell <chris.liddell@artifex.com>
dab8018a344409710b989c31575e6e0e4eb243ce

Bring master up to date with gs922 branch

Update docs dates etc for release

Changelog and news

Update dates/product for 9.22rc2

Changelog for 9.22rc2

Dates, product, changelog for 9.22 release

base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
psi/int.mak
psi/msvc.mak


2017-10-09 11:08:07 +0100
Ken Sharp <ken.sharp@artifex.com>
11f058b7fea07b2a5d2677be3f057cc5ee3e9023

PDF Interpreter - support the /Circle annotation type without an appearance

Bug #698626 "PDF 2.0 tests Circle annotation"

We didn't synthesise an appearance for annotations of type /Circle
when they had no appearance stream. This commit adds that support.

Rather surprisingly, there do not appear to be any files in our test
suite which exercise this. Doubly surprising since I thought all the
release 2 PDF 2.0 FTS files were included and its one of these that
is quoted in the bug report.

Resource/Init/pdf_draw.ps


2017-10-07 13:33:03 +0100
Ken Sharp <ken.sharp@artifex.com>
6db482c183959dbccdc865d8a27cb53b054d3dc1

PDF Interpreter - support the /Square annotation type with no /Appearance

Bug #698625 "PDF 2.0 tests Square annotation type"

We didn't synthesise an appearance for annotations of type /Square
when they had no appearance stream. This commit adds that support.

Rather surprisingly, there do not appear to be any files in our test
suite which exercise this. Doubly surprising since I thought all the
release 2 PDF 2.0 FTS files were included and its one of these that
is quoted in the bug report.

Resource/Init/pdf_draw.ps


2017-10-06 17:23:59 +0100
Ken Sharp <ken.sharp@artifex.com>
83ef35dce760f68019afd1b07bac8118cd9837a2

PDF and PS Interprters and ps2write - fix type 6 halftones & transfers

Bug698621 "PDF 2.0 tests not applying transfer function from halftone"

The halftones in question are defined (by the PDF interpreter) as type
6 halftones, ie file-based threshold arrays.

Rather to my surprise, the reason this didn't work turns out to be
because the PostScript interpreter has never supported transfer functions
with type 6 halftones.

So; add support for transfer functions in type 6 halftones. This exposed
a problem with ps2write (and potentially pdfwrite) when emitting these
transfer functions, instead of simply specifying the object number of
the function, we were writing it out decorated with "/TransferFunction"
which caused ps2write output to fail. So fix that here too.

Remove the 'OBSELETE' comment from the halftone structure, I don't know
who thought this was obselete, but it really does not seem to be.

base/gsht1.c
base/gxht.h
devices/vector/gdevpdfg.c
psi/zht2.c


2017-10-06 14:52:03 +0100
Robin Watts <robin.watts@artifex.com>
45a826638bfc6309a829b38ecf14ff9c21f438ca

Tune pdf14_compose_group inlining.

Pick specific inlinings based upon examination of the data
from the TRACK_COMPOSE_GROUPS defines.

base/gxblend.c


2017-10-05 19:25:41 +0100
Robin Watts <robin.watts@artifex.com>
7b6bce45b1a85266a40844436ea386c4129515f4

Add TRACK_COMPOSE_GROUPS development code.

This enables us to track which combinations of options
are used, and how frequently.

base/gxblend.c


2017-10-05 19:28:23 +0100
Robin Watts <robin.watts@artifex.com>
5e1675e95b0574f9a5f469458e849e1837c33983

Further tweaks to pdf14_mark_fill_rectangle

Avoid having to check for src_alpha == 0 every time around
the loop.

base/gxblend.c


2017-10-05 19:29:07 +0100
Robin Watts <robin.watts@artifex.com>
8c72c12c30553b76b4e2b23261529ec4c6d49b43

Further tweaks to pdf14_preserve_backdrop

Attempt to avoid blanking tag plane when we're about to copy
into it.

base/gxblend1.c


2017-10-05 19:26:15 +0100
Robin Watts <robin.watts@artifex.com>
affab3b5889ce7b8bcb38d0c7c938b907d1e8253

Fix typo.

base/gxblend.c


2017-10-05 14:37:37 +0100
Robin Watts <robin.watts@artifex.com>
882e0bfed09e839d53287164ebf4aa99ca5f116a

Optimise pdf14_mark_fill_rectangle using inlining.

Same tricks as used for pdf14_compose_group.

base/gdevp14.c
base/gxblend.c
base/gxblend.h
base/lib.mak


2017-10-04 17:01:24 +0100
Robin Watts <robin.watts@artifex.com>
77cdf72595643da5d17e84fb72d8f58ccfe3d038

Avoid duplicating code in art_pdf_composite_pixel_alpha8_inline.

We can spot that blend_mode == BLEND_MODE_Normal in the caller,
and set first_spot to 0 in that case. Then we always drop
straight through to the code at the end, and omit the complex
blend call. Reduces code, doesn't change the speed.

base/gxblend.c


2017-10-04 16:54:59 +0100
Robin Watts <robin.watts@artifex.com>
aaccd9b5942aae6738ac02874e627b9e8677f965

Instantiate some more 'optimised' routines for pdf14_group_compose.

The last one of these is the one that gets hammered in the
normal_blend_test.pdf file.

base/gxblend.c


2017-10-04 16:54:23 +0100
Robin Watts <robin.watts@artifex.com>
3dba9682de0b69a8822507a1c11d9f782c33b4c9

Tweak art_pdf_composite_pixel_alpha_8_inline.

Normal blending allows us to not only skip the art_blend_pixel_8_inline
call, but also to simplify the calculations.

base/gxblend.c


2017-10-04 16:52:03 +0100
Robin Watts <robin.watts@artifex.com>
67bae85a6f46190262cf8a6ad6c37c7aff2e6cc5

Introduce forceinline define.

It seems MSVC thinks it knows best about what to inline and what not to.

Use new 'forceinline' define to persuade it to actually do what it is
told. On all non-MSVC compilers this just maps to inline.

base/gxblend.c
base/stdpre.h


2017-10-04 00:39:53 +0100
Robin Watts <robin.watts@artifex.com>
a9f06af39ced9a69f5841ceef3f5e921c34ea5a7

Further optimisation in pdf14_compose_group.

Avoid memcpy's when unnecessary in some of the subfunctions,
by having a 'dst' pointer that points to the results. If
the results are supposed to be the same as the src, don't
copy the source, just reset the dst pointer.

If the dst pointer is set to NULL, then don't copy the results
at all, as it'll be the current values unchanged.

base/gxblend.c


2017-10-03 19:50:33 +0100
Robin Watts <robin.watts@artifex.com>
29e07d407e997a596f682cffa2069e5cea9e3fb4

Use inlining on pdf14_compose_group functions.

We move pdf14_compose_group into gxblend.c to enable us to
make the constituent functions static inlines.

base/gxblend.c
base/gxblend.h
base/gxblend1.c
base/lib.mak


2017-10-03 19:09:00 +0100
Robin Watts <robin.watts@artifex.com>
65c442f7b2c1a91816f9026553004d66dde147ec

Tweak art_pdf_composite_knockout_group_8.

Another case where we can avoid a memcpy by corrupting the source
data we are passed.

base/gxblend.c
base/gxblend.h


2017-10-03 18:45:30 +0100
Robin Watts <robin.watts@artifex.com>
7ef1126569bbdd405f7ef38eb5cd7e4928321f4f

Further optimisations to compose_group.

compose_group calls both art_pdf_recomposite_group_8 and
art_pdf_composite_group_8 next to one another. Both end
(in most cases) by doing an identical call to
art_pdf_composite_pixel_alpha_8.

Tweak the code so that this call happens from the calling
routine (and thus we only have a single call to the routine).
This makes no difference now, but potentially saves when
we start inlining.

The tweaks here to art_pdf_recomposite_group_8 to avoid
using a temporary array, *do* avoid a copy in the common case.

base/gxblend.c
base/gxblend.h
base/gxblend1.c


2017-10-03 18:09:05 +0100
Robin Watts <robin.watts@artifex.com>
8d2a3a5b0f8280449d75ea99ddcadb69259370b6

Tweak art_pdf_recomposite_group_8.

Avoid having to memcpy the input components in the common case,
at the expense of corrupting src[n_chan] in the difficult
case. This is fine, because our only caller never accesses
src[n_chan] again.

base/gxblend.c
base/gxblend.h
base/gxblend1.c


2017-10-03 15:05:38 +0100
Robin Watts <robin.watts@artifex.com>
ab6acb21bfc42194650ff90243e0737b43d81919

Start inlining optimisation of compose_group.

base/gxblend1.c


2017-10-03 13:41:20 +0100
Robin Watts <robin.watts@artifex.com>
8f2d625c260f174d2daa54508f0ff0147c4ad334

Tweak art_pdf_composite_knockout_group_8.

This function has 2 branches, both of which end up with the same
call to art_pdf_knockout_composite_pixel_alpha_8. Tweak the
code so that we only need do one.

No speedup expected, but this paces the way for inlining later.

base/gxblend.c


2017-10-02 20:32:46 +0100
Robin Watts <robin.watts@artifex.com>
83cd299b98510dc87cd3aa27f57a060b268e05ee

Do not overcopy bytes for pdf14 blending.

base/gxblend.c


2017-10-03 16:56:43 +0100
Robin Watts <robin.watts@artifex.com>
88152e5c620bda7d25cd351c765751c619019a58

Tweak art_pdf_composite_pixel_alpha_8.

art_pdf_composite_pixel_alpha_8 is used to blend src and
destination pixels together with a given blend mode.

In the general case, we have n colour compoents, of which the
first n-s are process ones, and the next s are spots (followed
by alpha).

In some cases, we need to blend the first n-s with the given blend
mode, and the remaining s in Normal mode.

This is currently achieved in the code by making 2 different calls
down to art_pdf_composite_pixel_8 for each section of the pixel
(with different 'n' values).

Unfortunately, due to alpha being assumed to be held as the nth
component, this means we need to do a dance where we stash away
a components value, copy the alpha in, call the routine, then
restore the alpha afterwards.

To avoid this, we modify art_pdf_composite_pixel_alpha_8 to take
another int parameter, specifying the position of the first
component that needs to be blended with the Normal mode.

This enables us to simplify the outer routines that call this so
that we have a single call, rather than 3. It also means we don't
recaulate 'scale' etc twice.

I am not expecting any significant speedups from this alone, but
it simplifies the code so that hopefully we might get some in
later commits.

base/gdevp14.c
base/gxblend.c
base/gxblend.h
base/gxblend1.c
base/gxp1fill.c


2017-10-03 16:55:59 +0100
Robin Watts <robin.watts@artifex.com>
5cc958e9c318ffd51223d6794df389b3c19d1aa1

Tweak pdf14 compose group function towards optimisation.

The plan here is to move towards optimised inner loops. The
initial version of these inner loops will be done using
static inline templating. This initial commit won't give
much (if any) improvement, but starts us on the road.

base/gxblend1.c


2017-10-02 17:42:34 +0100
Robin Watts <robin.watts@artifex.com>
b26279df55a77fe2252de803a0e23ff4f703d609

Tweak art_pdf_composite_group_8.

Avoid 2 different calls down to art_pdf_composite_pixel_alpha_8
when 1 will suffice. No expected speed benefit yet.

base/gxblend.c


2017-10-02 14:48:54 +0100
Robin Watts <robin.watts@artifex.com>
463928c19de23164ec61e0fdea119195fa1450f4

Inline versions of art_pdf_union_mul_8 and art_blend_pixel_8.

base/gxblend.c
base/gxblend.h


2017-08-01 12:40:53 +0100
Robin Watts <robin.watts@artifex.com>
4505a7fa04bc89a3f9463b0bcf069210771a8a42

Fix psd spot color handling in bmpcmp.

toolbin/bmpcmp.c


2017-10-05 11:21:40 +0100
Ken Sharp <ken.sharp@artifex.com>
4f830ad24611ea8c88f78e77dd3b250ee3c55251

PDF interpreter - remove accidental debugging

Left some debugging in the SpotFunction array commit, remove it.

Resource/Init/pdf_draw.ps


2017-10-05 11:11:06 +0100
Ken Sharp <ken.sharp@artifex.com>
75463b045f4ea314f1d22b1b63be5e3709ec59aa

PDF Interpreter - support PDF 2.0 SpotFunction arrays

Bug #698620 "PDF 2.0 tests invalid halftones"

This was an oversight on my part, I missed new functionality when
reading the PDF 2.0 specification.

The SpotFunction in a type 1 Halftone can now be a name, function or (new)
an array of names. If its an array we are supposed to check the entries
in turn selecting the first one we recognise. If we don't recognise any
then we should use the default.

Resource/Init/pdf_draw.ps


2017-10-04 15:48:07 +0100
Robin Watts <robin.watts@artifex.com>
3d6168d9bdfe60f77bc60a270945c67e36ac02a3

Tweak pdf14_preserve_backdrop (for speed).

First the current code clears the backdrop, then we copy into it.

In many cases we overwrite exactly the area we just cleared. Spot
this, and avoid it.

We *could* optimise this further in cases where we aren't overwriting
exactly the same region. Wait to see if this is justified.

base/gxblend1.c


2017-10-04 20:07:06 +0100
Robin Watts <robin.watts@artifex.com>
a2532236a8f85101c3d0377dde163071745c53bf

Tweak pdf14_preserve_backdrop (for clarity).

Reduce duplicated code.

Also, ensure that the debugging code that dumps planes actually
dumps the plane that the file modifies.

base/gxblend1.c


2017-10-04 17:15:10 +0100
Ken Sharp <ken.sharp@artifex.com>
df32585f91bb6b1023fef42545cae2419b0e10db

PDF interpreter - permit 0 size font scaling, render nothing

Bug #698619 "PDF 2.0 tests 'zero sized text'"

The PDF 2.0 specification permits font scale of 0 (!), but nothing
should be rendered....

We can't have a font scale of 0, because it breaks our arithmetic, so
we set it to a tiny value, unfortunately this still means that stroking
text rendering modes printed some small garbage.

After a lot of effort with the PDF interpreter, I concluded that there
was no reasonable way to address this in PostScript, as we didn't
retain the font size anywhere and had no reasonable, non-volatile,
place to store it (it needs to respect gsave and grestore).

So in the end I added it to the graphics state and created two new
operators to read and write it (and undefined them after startup).
Its an unfortunately brute-force approach, but it has the benefit of
actually working.

Resource/Init/gs_init.ps
Resource/Init/pdf_ops.ps
base/gsstate.c
base/gsstate.h
base/gxgstate.h
psi/int.mak
psi/zgstate.c


2017-10-04 14:07:11 +0100
Chris Liddell <chris.liddell@artifex.com>
3ea417610c5f0526251ed391bfd117a81c9801e1

Version and dates for jbig2dec release

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


2017-10-03 16:50:56 +0100
Robin Watts <robin.watts@artifex.com>
4a7815f3b929a05ec8b5aaac965d62d5d370dcbe

Fix incorrect group alpha calculation.

In pdf14_compose_group, in the tos_isolated case, for simple
blends, we call art_pdf_composite_group_8 to apply blend_mode
to both process and spots. A side effect of this call is to
update the contents of nos_alpha_g_ptr.

In more complex blends, we split the process and spots into
2 different calls to the same function. The current code
however passes nos_alpha_g_ptr to both however, resulting in
it being updated twice.

Fixed here by making one of them take NULL.

base/gxblend1.c


2017-10-03 10:01:14 +0100
Chris Liddell <chris.liddell@artifex.com>
71e8599455a7befc7a14f6cd1353c9231fb93d48

Bug 698615: pdf_add_ToUnicode() correct size of buffer

We allocate a buffer to store the Unicode value, but failing to account for
the fact that the Unicode value is two bytes, rather than a byte

devices/vector/gdevpdte.c


2017-10-02 16:32:25 +0100
Ken Sharp <ken.sharp@artifex.com>
a015666f7b532c1d9266c4cdef3427e0b50fea90

PDF interpreter - fix default /Decode for Lab images

When we get an image with no /Decode array we create a default one for
it by looking at the image colour space.

For Lab we use the /Range array, but unfortunately this only covers the
a and b channels, not the L. However, L always ranges from 0 - 100 so
here we just pull the Range array apart, add in that range, and create
a new array for the /Decode.

Resource/Init/pdf_draw.ps


2017-09-28 18:04:20 -0600
Henry Stiles <henry.stiles@artifex.com>
9e01cbd5e2d5ce41ae98ea20722ec9a7d452b9e9

Fix buffer overflow regression.

The commit to address 694653 (3749bc274) was incorrect, the
font_data_size variable is not necessarily the size of the buffer.

pcl/pcl/pcsfont.c


2017-09-28 10:08:16 +0100
Ken Sharp <ken.sharp@artifex.com>
eb24ad936776bf69f987e90aad8c7fca78fc2b14

Documentation - spruce up WhatIsGS.htm

Remove references to the obselete GhostSVG

Remove references to MuPDF and MuXPS, MuPDF can easily stand alone now
and its not really part of the Ghostscript family.

doc/WhatIsGS.htm


2017-09-27 08:34:10 -0700
Ray Johnston <ray.johnston@artifex.com>
7e342b5978eb9df875a91980554835362412200d

Revert commit a5a2862d

Even though the commit fixed bug 695280, we noticed that it caused PS
and PDF clist image logic to sometimes take the slow "default" handling
instead of the high-level image path.

To restore the fix for PCL, we could remove the rop3_uses_T altogether,
but we don't know if this will impact PCL performance.

Re-opening bug 695280.

base/gxclimag.c


2017-09-27 16:35:18 +0100
Ken Sharp <ken.sharp@artifex.com>
40deeb89508e1072a4e93441ea58d6332d10fe4c

Documentation - remove reference to obselete switch

Missed this when removing the implementation, PDFDontUseObjectNum is no
longer supported, so remove it from the documentation.

doc/VectorDevices.htm


2017-09-26 13:30:16 -0700
Ray Johnston <ray.johnston@artifex.com>
9bc74fe17f4699ae160564ba3fb281344d53dba6

Fix bug 698560. Transparent pattern-clist playback affected target device

If a transparent pattern was stored as a pattern-clist, changes to the
pdf14_device during playback were applied to the upper level device, but
not restored after the playback. This fixes a long standing problem with
Bug692217.pdf (ELEMENTARY card was to light gray).

base/gdevp14.c


2017-09-22 16:06:18 +0100
Ken Sharp <ken.sharp@artifex.com>
8dd5ae8b9ea8dcae7775edb879f2949e2ee55be5

PDF interpreter - clamp Box to MediaBox, even when MediaBox is negative

When applying the various 'Box' values from a PDF file, we need to clamp
them to the MediaBox values, so that we don't try and extend the final
output to be larger than the Media (this appears to be Acotbat's
behaviour).

But we also need to account for the fact that the media (and therefore
the content) may not lie up and right. Its possible for the media to
be defined with negative height or width.

We deal with that by scaling/translating the CTM, but we weren't
taking it into account when calculating the actual media size, which led
to us calculating the wrong size.

This is more complicated, but we only do it once per page, so the
performance penalty is insignificant.

Resource/Init/pdf_main.ps


2017-09-22 12:36:22 +0100
Chris Liddell <chris.liddell@artifex.com>
819b79e75d8198d16b13c631d6842953f2c6ab81

Bug 698581: Pscript5Idiom: add missing conditional (and bind)

One of the procedures which Pscript5Idiom "patches" was missing an ifelse
meaning, when that idiom was hit, an unexecuted procedure was left on
the stack.

For efficiency and consistency, also bind the entire procedure.

Resource/IdiomSet/Pscript5Idiom


2017-09-22 10:55:10 +0100
Chris Liddell <chris.liddell@artifex.com>
4a0b2e60e3ed23ec1f7f7e0390ce449bef03b8e4

Simpify confusing stack manipulations

The existing code was not wrong, but did several unnecessary stack manipulations
that made it less efficient but, more importantly, confusing.

Also, remove trailing whitespace.

Resource/Init/pdf_ops.ps


2017-09-21 11:27:37 +0100
Chris Liddell <chris.liddell@artifex.com>
000915310197a25ff4acc97f0fa476085698d8fd

Remove pointless free

In an error condition, we were freeing the object that had failed to allocate.

Not a problem with our memory manager, but might cause confusion reading the
code (it did for me!).

base/gdevp14.c


2017-09-21 18:34:32 +0100
Chris Liddell <chris.liddell@artifex.com>
6f9ba1282eeb2537248fea11b686eefffc5b86fc

Fix errors with 6b06b8c854

The stack manipulations with the previous commit were not quite right.

Resource/Init/pdf_ops.ps


2017-09-19 10:41:21 -0700
Michael Vrhel <michael.vrhel@artifex.com>
6b06b8c85451bdf022f1684f633a85980e7c62ee

Bug 698559 avoid double alpha application

When we have a softmask present in the graphic state, we
wrap up the fill or stroke with an isolated transparency
group in the interpreter. After the group is pushed we
should set the opacityalpha and the shapealpha to 1 to
avoid a double application of alpha at the rect-fill level and
the group composition level.

Resource/Init/pdf_ops.ps
base/gxblend1.c


2017-09-21 10:13:16 +0100
Ken Sharp <ken.sharp@artifex.com>
8d57c8c54bd4fe8b5582a31dca69d034743eeacb

pdfwrite - fix compiler warnign

Cast a pointer correctly to avoid a compiler warning.

devices/vector/gdevpdfe.c


2017-09-20 16:48:27 +0100
Robin Watts <robin.watts@artifex.com>
c1ba880345f3c17f828e28d4c42f38798eab73c2

Fix stroke/fill mismatches in 09-37.PS

When 'accurate curves' are requested, ensure we use the same
curve -> line decomposition for both strokes and fills.

base/gxfill.c


2017-09-20 18:33:52 +0100
Robin Watts <robin.watts@artifex.com>
d9f068ae6d612f09dd37915edd56381c6a9167b7

Fix new scan converter glitch with CATX4547.pdf

Page 11 of this file contains details on the revolvers cylinder
rendered by filling zero width vertical lines. For example:

0.165 0.068 0 0.187 scn
506.47 162.99 m
506.47 167.99 l
506.47 162.99 l
f

The new scan converter was incorrectly eliding this. Fixed by
tweaking the edgebuffer filtering logic for any-part-of-a-pixel
mode.

base/gxscanc.c


2017-09-19 18:01:27 +0100
Robin Watts <robin.watts@artifex.com>
fb95f670d3e54befca541dd35c2d7c2fe690ffbd

Fix in*fill etc test files.

The new scan converter has been assuming that anything with an
x coord < 0 is off screen. While this is true for almost every
device I can think of, it need not be true for the hit detection
device used for infill/instroke operations.

Fixed to use INT_MIN here.

base/gxscanc.c


2017-09-20 15:37:19 +0100
Ken Sharp <ken.sharp@artifex.com>
29d1b0b1152324699f63ecf411bf7d590085c403

pdfwrite - fix UTF16 to UTF8 conversion

There was a signed/unsigned error in the arguments to this routine,
which meant that bytes with the top bit set caused the whole UTF16
short to become negative as well.

Fixed here.

devices/vector/gdevpdfe.c


2017-09-19 17:43:25 +0100
Chris Liddell <chris.liddell@artifex.com>
c49536553df8eef02c6b0fbf1a46eeb2d086859d

Write initial device error to stderr

As the "Unable to open the initial device, quitting." occurs outside the
Postscript error handling auspices, and causes Ghostscript to quit in a
possibly unexpected way, write it to stderr rather than stdout.

Resource/Init/gs_init.ps


2017-09-19 13:59:56 +0100
Ken Sharp <ken.sharp@artifex.com>
085fc4933e5169176124922925f6cc6b454ac03e

PS interpreter - set EPSCrop when EPSFitPage is set

Bug #698555 "using DEVICE[WIDTH|HEIGHT]POINTS results in blank image"

The reporter had not set -dEPSCrop which resulted in no PageSize
request being sent to the interpreter (because EPS files are note
permitted to set PageSize). Which defeats the use of PageSize Policy
13 to scale the page.

Since anyone using EPSFitPage clearly wants to scale the page to the EPS
BoundingBox, we may as well set EPSCrop in case they don't.

NB the original reporter had not set -dFIXEDMEDIA either...

Resource/Init/gs_init.ps


2017-09-17 18:34:59 +0100
Ken Sharp <ken.sharp@artifex.com>
fc08a2810b1594ce865190763a7831704c00846d

pdfwrite - properly process Octal 134 '\' in pdfmark UTF16 string

Bug #698552 "Some PDF outline UTF-16 text is broken"

The escape processing wasn't catering for an escaped escape '\\' which
led to us writing the escaped escape direclty and corrupted the remainder
of the string. We normaly don't use short escapes but write ocral,
because some versions of Acrobat can't handle the short escapes.

This commit just processes the '\\' properly, as per the other
escapes.

devices/vector/gdevpdfm.c


2017-09-17 11:46:03 +0100
Ken Sharp <ken.sharp@artifex.com>
275d9547b89aa17dc3a3d9441f712dfdfd344201

Coverity ID 172798

We hadn't assigned the return value to the variable 'code' but were
using it (asigned earlier in the code) to action a return.

Fixed by actually assigning the value to the variable.

base/gxshade1.c


2017-09-16 23:34:04 +0100
Ken Sharp <ken.sharp@artifex.com>
ce4bbbde09d087fe3af7036c1fc3f0a38f30c19e

PDF interpreter - more work on images with invalid /Mask

Commit 119ec77d4e44e3861a376323ed14466b28b2f4bf fixed one case of a
/Mask array with invalid values by treating DeviceGray the same as
/Indexed. However, while that worked for the particular file in question
(Bug #697919) it caused a regression with Bug689717 which I somehow
missed at the time.

This commit treats DeviceGray differently to Indexed spaces and
clamps the value to either 0 or 1 for 1 BPC images. This seems to work
as per Acrobat for both files.

Resource/Init/pdf_draw.ps


2017-09-15 18:24:44 -0500
Robin Watts <Robin.Watts@artifex.com>
7914df697a40314e35847f4e1faca5c964c19e84

Bug 696399: Fix buffer overflow in image scaling.

Patch calculation that overflows when x_extent is very
negative.

base/gxifast.c


2017-09-15 14:28:28 -0700
Robin Watts <Robin.Watts@artifex.com>
176f0c2f9632b2167cbdd3a3ab44435af3b0bb64

Remove stray memsets left in from previous commit.

The "Bug 698427: Fix ignoring errors that lead to division by
zero." commit contained stray memsets.

base/gxshade1.c


2017-09-15 13:04:06 -0700
Robin Watts <Robin.Watts@artifex.com>
11a0bc253157ff84be1ef8d065d3ccbf8d377280

Bug 698427: Fix ignoring errors that lead to division by zero.

By ignoring error return values, we continue running with
uninitialised data, leading to division by zero.

base/gxshade1.c


2017-09-15 10:58:11 -0500
Robin Watts <Robin.Watts@artifex.com>
887026173a2200dba9cb5eed39200f8f1e44cc7a

Coverity #135034: Simplify code.

The while loop is not strictly required (but it does match
the other cases). Simplified here.

base/gxscanc.c


2017-09-15 10:47:54 -0500
Robin Watts <Robin.Watts@artifex.com>
d7804bfc4d6bdd863137073bdc4f935c960a8f1d

Coverity #135037: Fix unused variable.

Don't read a value we don't use.

base/gxscanc.c


2017-09-05 14:52:07 +0100
Chris Liddell <chris.liddell@artifex.com>
e289916162ce817275e05c536525954028e7d2bc

Coverity ID# 135035

Remove pointless "upgraded_copypage" code properly.

The previous commit for this removed code that it should not have done

base/gdevprn.c


2017-09-15 13:42:00 +0100
Chris Liddell <chris.liddell@artifex.com>
b3de06e71037a6abcf4546fa7d53a00a3ce47cc3

Revert "Coverity ID# 135035"

This reverts commit 05c3de8915fafb65b96ba0860523a7a79e2577e2.

base/gdevprn.c


2017-09-14 22:40:30 +0100
Chris Liddell <chris.liddell@artifex.com>
b76a38bc57de9085474474fc3de5ec295c9aec21

Remove man pages for removed (obsolete) tools

(Reported against 9.22 rc1)

doc/gs-vms.hlp
man/de/font2c.1
man/de/wftopfa.1
man/font2c.1
man/gs.1
man/wftopfa.1


2017-09-14 07:01:32 +0100
Chris Liddell <chris.liddell@artifex.com>
6bf33a5d01518dcba8e957299a91a68d871f2b0b

White space issues reported against 9.22 rc1

It seems newer gcc versions (6.4.x and later) report indentation "problems".

Also, add a cast to ensure bitshift op is done on an unsigned value.

base/gsbitops.c
base/gsicc_create.c
base/gxclread.c
contrib/gdevbjca.c
contrib/gdevdj9.c
devices/gdevepsc.c
pcl/pxl/pxpaint.c
psi/dscparse.c
psi/zcrd.c


2017-09-14 06:41:33 +0100
Chris Liddell <chris.liddell@artifex.com>
d26d2bb23f2d8867d99d5f1fa08a37d3f131e1ad

Bug 698532: replace ijs/ltmain.sh symlink with file

ijs/ltmain.sh


2017-09-13 08:43:38 +0100
Chris Liddell <chris.liddell@artifex.com>
cadd9e5faede555fade5e7e8f447de8f40e5c5e9

Remove reference to old wisc site in Readme.htm
S

doc/Readme.htm


2017-09-12 10:27:23 +0100
Chris Liddell <chris.liddell@artifex.com>
67b24cbd748db9d96061f476f42c87bd452a496e

Bump version number for release

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


2017-09-12 11:17:15 +0100
Ken Sharp <ken.sharp@artifex.com>
95cb9ab7b4ef15bf60bd074220906f9eda145916

Remove unused variable 'pdev' to silence compiler warning

base/gdevp14.c


2017-10-04 09:50:33 +0100
Chris Liddell <chris.liddell@artifex.com>
ba50b3c6061d35275b7067204da6f032fb46cf62

Dates, product, changelog for 9.22 release

base/gscdef.c
base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2017-10-03 10:01:14 +0100
Chris Liddell <chris.liddell@artifex.com>
dcba89978e3cd6e8e55b44e0830594a385a8e07e

Bug 698615: pdf_add_ToUnicode() correct size of buffer

We allocate a buffer to store the Unicode value, but failing to account for
the fact that the Unicode value is two bytes, rather than a byte

devices/vector/gdevpdte.c


2017-10-02 16:32:25 +0100
Ken Sharp <ken.sharp@artifex.com>
5751e508f72238c1fcaad1a4c284aa875542dd70

PDF interpreter - fix default /Decode for Lab images

When we get an image with no /Decode array we create a default one for
it by looking at the image colour space.

For Lab we use the /Range array, but unfortunately this only covers the
a and b channels, not the L. However, L always ranges from 0 - 100 so
here we just pull the Range array apart, add in that range, and create
a new array for the /Decode.

Resource/Init/pdf_draw.ps


2017-09-28 18:04:20 -0600
Henry Stiles <henry.stiles@artifex.com>
3c2974bcd2e638be13c0ec814342a1a35ca0872b

Fix buffer overflow regression.

The commit to address 694653 (3749bc274) was incorrect, the
font_data_size variable is not necessarily the size of the buffer.

pcl/pcl/pcsfont.c


2017-09-28 11:37:57 +0100
Chris Liddell <chris.liddell@artifex.com>
f1d39c92bff2de2d7b270a419a907c935ea626a6

Changelog for 9.22rc2

doc/History9.htm


2017-09-28 11:35:58 +0100
Chris Liddell <chris.liddell@artifex.com>
b1eda05a9fa7327e76b9a4af980d05da9e926e7f

Update dates/product for 9.22rc2

base/gscdef.c
base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2017-09-28 10:08:16 +0100
Ken Sharp <ken.sharp@artifex.com>
d59e4b57e1807e934ed1dde51e628f84dfb8caa7

Documentation - spruce up WhatIsGS.htm

Remove references to the obselete GhostSVG

Remove references to MuPDF and MuXPS, MuPDF can easily stand alone now
and its not really part of the Ghostscript family.

doc/WhatIsGS.htm


2017-09-27 08:34:10 -0700
Ray Johnston <ray.johnston@artifex.com>
a6830a293f9a69caf50777bb6ee7b553589c0a08

Revert commit a5a2862d

Even though the commit fixed bug 695280, we noticed that it caused PS
and PDF clist image logic to sometimes take the slow "default" handling
instead of the high-level image path.

To restore the fix for PCL, we could remove the rop3_uses_T altogether,
but we don't know if this will impact PCL performance.

Re-opening bug 695280.

base/gxclimag.c


2017-09-27 16:35:18 +0100
Ken Sharp <ken.sharp@artifex.com>
c10d5ada53245dac13436d663d3dbe265bc9e11a

Documentation - remove reference to obselete switch

Missed this when removing the implementation, PDFDontUseObjectNum is no
longer supported, so remove it from the documentation.

doc/VectorDevices.htm


2017-09-26 13:30:16 -0700
Ray Johnston <ray.johnston@artifex.com>
ccaaa1fd02f1cedf221bd6a34e5eb0ef64ef8f3f

Fix bug 698560. Transparent pattern-clist playback affected target device

If a transparent pattern was stored as a pattern-clist, changes to the
pdf14_device during playback were applied to the upper level device, but
not restored after the playback. This fixes a long standing problem with
Bug692217.pdf (ELEMENTARY card was to light gray).

base/gdevp14.c


2017-09-22 16:06:18 +0100
Ken Sharp <ken.sharp@artifex.com>
c470609a95c3ba5d531da463df7a98da01998452

PDF interpreter - clamp Box to MediaBox, even when MediaBox is negative

When applying the various 'Box' values from a PDF file, we need to clamp
them to the MediaBox values, so that we don't try and extend the final
output to be larger than the Media (this appears to be Acotbat's
behaviour).

But we also need to account for the fact that the media (and therefore
the content) may not lie up and right. Its possible for the media to
be defined with negative height or width.

We deal with that by scaling/translating the CTM, but we weren't
taking it into account when calculating the actual media size, which led
to us calculating the wrong size.

This is more complicated, but we only do it once per page, so the
performance penalty is insignificant.

Resource/Init/pdf_main.ps


2017-09-22 12:36:22 +0100
Chris Liddell <chris.liddell@artifex.com>
ad87c56e9e88907854d4c37f1a80d8f5d06fb8a7

Bug 698581: Pscript5Idiom: add missing conditional (and bind)

One of the procedures which Pscript5Idiom "patches" was missing an ifelse
meaning, when that idiom was hit, an unexecuted procedure was left on
the stack.

For efficiency and consistency, also bind the entire procedure.

Resource/IdiomSet/Pscript5Idiom


2017-09-22 10:55:10 +0100
Chris Liddell <chris.liddell@artifex.com>
9ae11d7a06c216eae554bcc7696028e69c4bc7ee

Simpify confusing stack manipulations

The existing code was not wrong, but did several unnecessary stack manipulations
that made it less efficient but, more importantly, confusing.

Also, remove trailing whitespace.

Resource/Init/pdf_ops.ps


2017-09-21 11:27:37 +0100
Chris Liddell <chris.liddell@artifex.com>
d644437adb7833a2c511d143c13e757383106378

Remove pointless free

In an error condition, we were freeing the object that had failed to allocate.

Not a problem with our memory manager, but might cause confusion reading the
code (it did for me!).

base/gdevp14.c


2017-09-21 18:34:32 +0100
Chris Liddell <chris.liddell@artifex.com>
8760a38e4ca49ce403cb362ecb4d6b4d247587f1

Fix errors with 6b06b8c854

The stack manipulations with the previous commit were not quite right.

Resource/Init/pdf_ops.ps


2017-09-19 10:41:21 -0700
Michael Vrhel <michael.vrhel@artifex.com>
cc966e7f9029c27abc896431a3c4910b40d915ef

Bug 698559 avoid double alpha application

When we have a softmask present in the graphic state, we
wrap up the fill or stroke with an isolated transparency
group in the interpreter. After the group is pushed we
should set the opacityalpha and the shapealpha to 1 to
avoid a double application of alpha at the rect-fill level and
the group composition level.

Resource/Init/pdf_ops.ps
base/gxblend1.c


2017-09-21 10:13:16 +0100
Ken Sharp <ken.sharp@artifex.com>
c03add9e9caaa4958928f74a6ca4f2b71915063c

pdfwrite - fix compiler warnign

Cast a pointer correctly to avoid a compiler warning.

devices/vector/gdevpdfe.c


2017-09-20 16:48:27 +0100
Robin Watts <robin.watts@artifex.com>
2285580852e74940a4596b754739ba45a03b40d0

Fix stroke/fill mismatches in 09-37.PS

When 'accurate curves' are requested, ensure we use the same
curve -> line decomposition for both strokes and fills.

base/gxfill.c


2017-09-20 18:33:52 +0100
Robin Watts <robin.watts@artifex.com>
0803369908a0b4b24b215881e4c4a4ecc5de61c2

Fix new scan converter glitch with CATX4547.pdf

Page 11 of this file contains details on the revolvers cylinder
rendered by filling zero width vertical lines. For example:

0.165 0.068 0 0.187 scn
506.47 162.99 m
506.47 167.99 l
506.47 162.99 l
f

The new scan converter was incorrectly eliding this. Fixed by
tweaking the edgebuffer filtering logic for any-part-of-a-pixel
mode.

base/gxscanc.c


2017-09-19 18:01:27 +0100
Robin Watts <robin.watts@artifex.com>
03ac50df18eb12d40de1615d18730fdd077f605b

Fix in*fill etc test files.

The new scan converter has been assuming that anything with an
x coord < 0 is off screen. While this is true for almost every
device I can think of, it need not be true for the hit detection
device used for infill/instroke operations.

Fixed to use INT_MIN here.

base/gxscanc.c


2017-09-20 15:37:19 +0100
Ken Sharp <ken.sharp@artifex.com>
4bb7249ce9320c566da5dac3901c41c7965d37d8

pdfwrite - fix UTF16 to UTF8 conversion

There was a signed/unsigned error in the arguments to this routine,
which meant that bytes with the top bit set caused the whole UTF16
short to become negative as well.

Fixed here.

devices/vector/gdevpdfe.c


2017-09-19 17:43:25 +0100
Chris Liddell <chris.liddell@artifex.com>
f2f9ed2897a4cf166c1df50422b2e82ad2422947

Write initial device error to stderr

As the "Unable to open the initial device, quitting." occurs outside the
Postscript error handling auspices, and causes Ghostscript to quit in a
possibly unexpected way, write it to stderr rather than stdout.

Resource/Init/gs_init.ps


2017-09-19 13:59:56 +0100
Ken Sharp <ken.sharp@artifex.com>
5fc5b64a6cd3917326479d3d3a0546dca0feef3c

PS interpreter - set EPSCrop when EPSFitPage is set

Bug #698555 "using DEVICE[WIDTH|HEIGHT]POINTS results in blank image"

The reporter had not set -dEPSCrop which resulted in no PageSize
request being sent to the interpreter (because EPS files are note
permitted to set PageSize). Which defeats the use of PageSize Policy
13 to scale the page.

Since anyone using EPSFitPage clearly wants to scale the page to the EPS
BoundingBox, we may as well set EPSCrop in case they don't.

NB the original reporter had not set -dFIXEDMEDIA either...

Resource/Init/gs_init.ps


2017-09-17 18:34:59 +0100
Ken Sharp <ken.sharp@artifex.com>
6e317f178c7fe7c81b573598f848acf8487e4e45

pdfwrite - properly process Octal 134 '\' in pdfmark UTF16 string

Bug #698552 "Some PDF outline UTF-16 text is broken"

The escape processing wasn't catering for an escaped escape '\\' which
led to us writing the escaped escape direclty and corrupted the remainder
of the string. We normaly don't use short escapes but write ocral,
because some versions of Acrobat can't handle the short escapes.

This commit just processes the '\\' properly, as per the other
escapes.

devices/vector/gdevpdfm.c


2017-09-17 11:46:03 +0100
Ken Sharp <ken.sharp@artifex.com>
122808aa46118d483c2fe431d5382c88cdd6e735

Coverity ID 172798

We hadn't assigned the return value to the variable 'code' but were
using it (asigned earlier in the code) to action a return.

Fixed by actually assigning the value to the variable.

base/gxshade1.c


2017-09-16 23:34:04 +0100
Ken Sharp <ken.sharp@artifex.com>
087abbc55390499ca27823afbe7d1b62b4ff4f8e

PDF interpreter - more work on images with invalid /Mask

Commit 119ec77d4e44e3861a376323ed14466b28b2f4bf fixed one case of a
/Mask array with invalid values by treating DeviceGray the same as
/Indexed. However, while that worked for the particular file in question
(Bug #697919) it caused a regression with Bug689717 which I somehow
missed at the time.

This commit treats DeviceGray differently to Indexed spaces and
clamps the value to either 0 or 1 for 1 BPC images. This seems to work
as per Acrobat for both files.

Resource/Init/pdf_draw.ps


2017-09-15 18:24:44 -0500
Robin Watts <Robin.Watts@artifex.com>
f1ccd5e2c82eb137abb7af000e93447653093a4d

Bug 696399: Fix buffer overflow in image scaling.

Patch calculation that overflows when x_extent is very
negative.

base/gxifast.c


2017-09-15 14:28:28 -0700
Robin Watts <Robin.Watts@artifex.com>
a768ec17b12e44b20d555f3c2fc2c5dcde3d9f0b

Remove stray memsets left in from previous commit.

The "Bug 698427: Fix ignoring errors that lead to division by
zero." commit contained stray memsets.

base/gxshade1.c


2017-09-15 13:04:06 -0700
Robin Watts <Robin.Watts@artifex.com>
45e4bcf4992c6c22e942730f5df393fc6b4cab63

Bug 698427: Fix ignoring errors that lead to division by zero.

By ignoring error return values, we continue running with
uninitialised data, leading to division by zero.

base/gxshade1.c


2017-09-15 10:58:11 -0500
Robin Watts <Robin.Watts@artifex.com>
1b18e15f10532d584c6fc2191e1b2a3f8e5ba7e5

Coverity #135034: Simplify code.

The while loop is not strictly required (but it does match
the other cases). Simplified here.

base/gxscanc.c


2017-09-15 10:47:54 -0500
Robin Watts <Robin.Watts@artifex.com>
6fb9174c1517143158781ed37e0c6d6eb9321808

Coverity #135037: Fix unused variable.

Don't read a value we don't use.

base/gxscanc.c


2017-09-05 14:52:07 +0100
Chris Liddell <chris.liddell@artifex.com>
228ac64b768ac3df1bcd5f63e3f353f8fd01e372

Coverity ID# 135035

Remove pointless "upgraded_copypage" code properly.

The previous commit for this removed code that it should not have done

base/gdevprn.c


2017-09-15 13:42:00 +0100
Chris Liddell <chris.liddell@artifex.com>
3f9d3e1392236fef4658c8dcad15385670d6831e

Revert "Coverity ID# 135035"

This reverts commit 05c3de8915fafb65b96ba0860523a7a79e2577e2.

base/gdevprn.c


2017-09-14 22:40:30 +0100
Chris Liddell <chris.liddell@artifex.com>
12ff84c1ff077c737b0a194761a370de079943fd

Remove man pages for removed (obsolete) tools

(Reported against 9.22 rc1)

doc/gs-vms.hlp
man/de/font2c.1
man/de/wftopfa.1
man/font2c.1
man/gs.1
man/wftopfa.1


2017-09-14 07:01:32 +0100
Chris Liddell <chris.liddell@artifex.com>
7df9b3d9b0dabd9854731fab796d5d458cf743f7

White space issues reported against 9.22 rc1

It seems newer gcc versions (6.4.x and later) report indentation "problems".

Also, add a cast to ensure bitshift op is done on an unsigned value.

base/gsbitops.c
base/gsicc_create.c
base/gxclread.c
contrib/gdevbjca.c
contrib/gdevdj9.c
devices/gdevepsc.c
pcl/pxl/pxpaint.c
psi/dscparse.c
psi/zcrd.c


2017-09-14 06:41:33 +0100
Chris Liddell <chris.liddell@artifex.com>
9e56aafaf2fc8fe3ffeefc0d13fa8c1b033ddec8

Bug 698532: replace ijs/ltmain.sh symlink with file

ijs/ltmain.sh


2017-09-13 08:43:38 +0100
Chris Liddell <chris.liddell@artifex.com>
98e115748ec4b16c610396b9444c1d82d263a30c

Remove reference to old wisc site in Readme.htm
S

doc/Readme.htm


2017-09-12 11:17:15 +0100
Ken Sharp <ken.sharp@artifex.com>
4241a4b3a7099cddac36d13f6c67054483eb7511

Remove unused variable 'pdev' to silence compiler warning

base/gdevp14.c


2017-09-12 11:16:30 +0100
Chris Liddell <chris.liddell@artifex.com>
29be703c9762714a47f67947d6dfb9efd6c6bc29

Changelog and news

doc/History9.htm
doc/News.htm


2017-09-12 10:32:51 +0100
Chris Liddell <chris.liddell@artifex.com>
85e04afbc2c80c8c6b129aff2741cbdf4d41ff67

Update docs dates etc for release

doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/font2c.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
man/wftopfa.1
psi/int.mak
psi/msvc.mak


2017-09-12 10:30:01 +0100
Chris Liddell <chris.liddell@artifex.com>
43561187cdb501ac1c6184082065647253d9336c

Product string and date for release

base/gscdef.c
base/version.mak



Version 9.22 (2017-10-04)

This is the sixteeth full release in the stable 9.x series.

Highlights in this release include:

  • Ghostscript can now consume and produce (via the pdfwrite device) PDF 2.0 compliant files.

  • The main focus of this release has been security and code cleanliness. Hence many AddressSanitizer, Valgrind and Coverity issues have been addressed.

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

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

Incompatible changes

  • The planned device API tidy (still!) did not happen for this release, due to time pressures, but we still intend to undertake the following: We plan to somewhat tidy up the device API. We intend to remove deprecated device procs (methods/function pointers) and change the device API so every device proc takes a graphics state parameter (rather than the current scheme where only a very few procs take an imager state parameter). This should serve as notice to anyone maintaining a Ghostscript device outside the canonical source tree that you may (probably will) need to update your device(s) when these changes happen. Devices using only the non-deprecated procs should be trivial to update.

Changelog

2017-10-03 10:01:14 +0100
Chris Liddell <chris.liddell@artifex.com>
dcba89978e3cd6e8e55b44e0830594a385a8e07e

Bug 698615: pdf_add_ToUnicode() correct size of buffer

We allocate a buffer to store the Unicode value, but failing to account for
the fact that the Unicode value is two bytes, rather than a byte

devices/vector/gdevpdte.c


2017-10-02 16:32:25 +0100
Ken Sharp <ken.sharp@artifex.com>
5751e508f72238c1fcaad1a4c284aa875542dd70

PDF interpreter - fix default /Decode for Lab images

When we get an image with no /Decode array we create a default one for
it by looking at the image colour space.

For Lab we use the /Range array, but unfortunately this only covers the
a and b channels, not the L. However, L always ranges from 0 - 100 so
here we just pull the Range array apart, add in that range, and create
a new array for the /Decode.

Resource/Init/pdf_draw.ps


2017-09-28 18:04:20 -0600
Henry Stiles <henry.stiles@artifex.com>
3c2974bcd2e638be13c0ec814342a1a35ca0872b

Fix buffer overflow regression.

The commit to address 694653 (3749bc274) was incorrect, the
font_data_size variable is not necessarily the size of the buffer.

pcl/pcl/pcsfont.c


2017-09-28 11:35:58 +0100
Chris Liddell <chris.liddell@artifex.com>
b1eda05a9fa7327e76b9a4af980d05da9e926e7f

Update dates/product for 9.22rc2

base/gscdef.c
base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1


2017-09-28 10:08:16 +0100
Ken Sharp <ken.sharp@artifex.com>
d59e4b57e1807e934ed1dde51e628f84dfb8caa7

Documentation - spruce up WhatIsGS.htm

Remove references to the obselete GhostSVG

Remove references to MuPDF and MuXPS, MuPDF can easily stand alone now
and its not really part of the Ghostscript family.

doc/WhatIsGS.htm


2017-09-27 08:34:10 -0700
Ray Johnston <ray.johnston@artifex.com>
a6830a293f9a69caf50777bb6ee7b553589c0a08

Revert commit a5a2862d

Even though the commit fixed bug 695280, we noticed that it caused PS
and PDF clist image logic to sometimes take the slow "default" handling
instead of the high-level image path.

To restore the fix for PCL, we could remove the rop3_uses_T altogether,
but we don't know if this will impact PCL performance.

Re-opening bug 695280.

base/gxclimag.c


2017-09-27 16:35:18 +0100
Ken Sharp <ken.sharp@artifex.com>
c10d5ada53245dac13436d663d3dbe265bc9e11a

Documentation - remove reference to obselete switch

Missed this when removing the implementation, PDFDontUseObjectNum is no
longer supported, so remove it from the documentation.

doc/VectorDevices.htm


2017-09-26 13:30:16 -0700
Ray Johnston <ray.johnston@artifex.com>
ccaaa1fd02f1cedf221bd6a34e5eb0ef64ef8f3f

Fix bug 698560. Transparent pattern-clist playback affected target device

If a transparent pattern was stored as a pattern-clist, changes to the
pdf14_device during playback were applied to the upper level device, but
not restored after the playback. This fixes a long standing problem with
Bug692217.pdf (ELEMENTARY card was to light gray).

base/gdevp14.c


2017-09-22 16:06:18 +0100
Ken Sharp <ken.sharp@artifex.com>
c470609a95c3ba5d531da463df7a98da01998452

PDF interpreter - clamp Box to MediaBox, even when MediaBox is negative

When applying the various 'Box' values from a PDF file, we need to clamp
them to the MediaBox values, so that we don't try and extend the final
output to be larger than the Media (this appears to be Acotbat's
behaviour).

But we also need to account for the fact that the media (and therefore
the content) may not lie up and right. Its possible for the media to
be defined with negative height or width.

We deal with that by scaling/translating the CTM, but we weren't
taking it into account when calculating the actual media size, which led
to us calculating the wrong size.

This is more complicated, but we only do it once per page, so the
performance penalty is insignificant.

Resource/Init/pdf_main.ps


2017-09-22 12:36:22 +0100
Chris Liddell <chris.liddell@artifex.com>
ad87c56e9e88907854d4c37f1a80d8f5d06fb8a7

Bug 698581: Pscript5Idiom: add missing conditional (and bind)

One of the procedures which Pscript5Idiom "patches" was missing an ifelse
meaning, when that idiom was hit, an unexecuted procedure was left on
the stack.

For efficiency and consistency, also bind the entire procedure.

Resource/IdiomSet/Pscript5Idiom


2017-09-22 10:55:10 +0100
Chris Liddell <chris.liddell@artifex.com>
9ae11d7a06c216eae554bcc7696028e69c4bc7ee

Simpify confusing stack manipulations

The existing code was not wrong, but did several unnecessary stack manipulations
that made it less efficient but, more importantly, confusing.

Also, remove trailing whitespace.

Resource/Init/pdf_ops.ps


2017-09-21 11:27:37 +0100
Chris Liddell <chris.liddell@artifex.com>
d644437adb7833a2c511d143c13e757383106378

Remove pointless free

In an error condition, we were freeing the object that had failed to allocate.

Not a problem with our memory manager, but might cause confusion reading the
code (it did for me!).

base/gdevp14.c


2017-09-21 18:34:32 +0100
Chris Liddell <chris.liddell@artifex.com>
8760a38e4ca49ce403cb362ecb4d6b4d247587f1

Fix errors with 6b06b8c854

The stack manipulations with the previous commit were not quite right.

Resource/Init/pdf_ops.ps


2017-09-19 10:41:21 -0700
Michael Vrhel <michael.vrhel@artifex.com>
cc966e7f9029c27abc896431a3c4910b40d915ef

Bug 698559 avoid double alpha application

When we have a softmask present in the graphic state, we
wrap up the fill or stroke with an isolated transparency
group in the interpreter. After the group is pushed we
should set the opacityalpha and the shapealpha to 1 to
avoid a double application of alpha at the rect-fill level and
the group composition level.

Resource/Init/pdf_ops.ps
base/gxblend1.c


2017-09-21 10:13:16 +0100
Ken Sharp <ken.sharp@artifex.com>
c03add9e9caaa4958928f74a6ca4f2b71915063c

pdfwrite - fix compiler warnign

Cast a pointer correctly to avoid a compiler warning.

devices/vector/gdevpdfe.c


2017-09-20 16:48:27 +0100
Robin Watts <robin.watts@artifex.com>
2285580852e74940a4596b754739ba45a03b40d0

Fix stroke/fill mismatches in 09-37.PS

When 'accurate curves' are requested, ensure we use the same
curve -> line decomposition for both strokes and fills.

base/gxfill.c


2017-09-20 18:33:52 +0100
Robin Watts <robin.watts@artifex.com>
0803369908a0b4b24b215881e4c4a4ecc5de61c2

Fix new scan converter glitch with CATX4547.pdf

Page 11 of this file contains details on the revolvers cylinder
rendered by filling zero width vertical lines. For example:

0.165 0.068 0 0.187 scn
506.47 162.99 m
506.47 167.99 l
506.47 162.99 l
f

The new scan converter was incorrectly eliding this. Fixed by
tweaking the edgebuffer filtering logic for any-part-of-a-pixel
mode.

base/gxscanc.c


2017-09-19 18:01:27 +0100
Robin Watts <robin.watts@artifex.com>
03ac50df18eb12d40de1615d18730fdd077f605b

Fix in*fill etc test files.

The new scan converter has been assuming that anything with an
x coord < 0 is off screen. While this is true for almost every
device I can think of, it need not be true for the hit detection
device used for infill/instroke operations.

Fixed to use INT_MIN here.

base/gxscanc.c


2017-09-20 15:37:19 +0100
Ken Sharp <ken.sharp@artifex.com>
4bb7249ce9320c566da5dac3901c41c7965d37d8

pdfwrite - fix UTF16 to UTF8 conversion

There was a signed/unsigned error in the arguments to this routine,
which meant that bytes with the top bit set caused the whole UTF16
short to become negative as well.

Fixed here.

devices/vector/gdevpdfe.c


2017-09-19 17:43:25 +0100
Chris Liddell <chris.liddell@artifex.com>
f2f9ed2897a4cf166c1df50422b2e82ad2422947

Write initial device error to stderr

As the "Unable to open the initial device, quitting." occurs outside the
Postscript error handling auspices, and causes Ghostscript to quit in a
possibly unexpected way, write it to stderr rather than stdout.

Resource/Init/gs_init.ps


2017-09-19 13:59:56 +0100
Ken Sharp <ken.sharp@artifex.com>
5fc5b64a6cd3917326479d3d3a0546dca0feef3c

PS interpreter - set EPSCrop when EPSFitPage is set

Bug #698555 "using DEVICE[WIDTH|HEIGHT]POINTS results in blank image"

The reporter had not set -dEPSCrop which resulted in no PageSize
request being sent to the interpreter (because EPS files are note
permitted to set PageSize). Which defeats the use of PageSize Policy
13 to scale the page.

Since anyone using EPSFitPage clearly wants to scale the page to the EPS
BoundingBox, we may as well set EPSCrop in case they don't.

NB the original reporter had not set -dFIXEDMEDIA either...

Resource/Init/gs_init.ps


2017-09-17 18:34:59 +0100
Ken Sharp <ken.sharp@artifex.com>
6e317f178c7fe7c81b573598f848acf8487e4e45

pdfwrite - properly process Octal 134 '\' in pdfmark UTF16 string

Bug #698552 "Some PDF outline UTF-16 text is broken"

The escape processing wasn't catering for an escaped escape '\\' which
led to us writing the escaped escape direclty and corrupted the remainder
of the string. We normaly don't use short escapes but write ocral,
because some versions of Acrobat can't handle the short escapes.

This commit just processes the '\\' properly, as per the other
escapes.

devices/vector/gdevpdfm.c


2017-09-17 11:46:03 +0100
Ken Sharp <ken.sharp@artifex.com>
122808aa46118d483c2fe431d5382c88cdd6e735

Coverity ID 172798

We hadn't assigned the return value to the variable 'code' but were
using it (asigned earlier in the code) to action a return.

Fixed by actually assigning the value to the variable.

base/gxshade1.c


2017-09-16 23:34:04 +0100
Ken Sharp <ken.sharp@artifex.com>
087abbc55390499ca27823afbe7d1b62b4ff4f8e

PDF interpreter - more work on images with invalid /Mask

Commit 119ec77d4e44e3861a376323ed14466b28b2f4bf fixed one case of a
/Mask array with invalid values by treating DeviceGray the same as
/Indexed. However, while that worked for the particular file in question
(Bug #697919) it caused a regression with Bug689717 which I somehow
missed at the time.

This commit treats DeviceGray differently to Indexed spaces and
clamps the value to either 0 or 1 for 1 BPC images. This seems to work
as per Acrobat for both files.

Resource/Init/pdf_draw.ps


2017-09-15 18:24:44 -0500
Robin Watts <Robin.Watts@artifex.com>
f1ccd5e2c82eb137abb7af000e93447653093a4d

Bug 696399: Fix buffer overflow in image scaling.

Patch calculation that overflows when x_extent is very
negative.

base/gxifast.c


2017-09-15 14:28:28 -0700
Robin Watts <Robin.Watts@artifex.com>
a768ec17b12e44b20d555f3c2fc2c5dcde3d9f0b

Remove stray memsets left in from previous commit.

The "Bug 698427: Fix ignoring errors that lead to division by
zero." commit contained stray memsets.

base/gxshade1.c


2017-09-15 13:04:06 -0700
Robin Watts <Robin.Watts@artifex.com>
45e4bcf4992c6c22e942730f5df393fc6b4cab63

Bug 698427: Fix ignoring errors that lead to division by zero.

By ignoring error return values, we continue running with
uninitialised data, leading to division by zero.

base/gxshade1.c


2017-09-15 10:58:11 -0500
Robin Watts <Robin.Watts@artifex.com>
1b18e15f10532d584c6fc2191e1b2a3f8e5ba7e5

Coverity #135034: Simplify code.

The while loop is not strictly required (but it does match
the other cases). Simplified here.

base/gxscanc.c


2017-09-15 10:47:54 -0500
Robin Watts <Robin.Watts@artifex.com>
6fb9174c1517143158781ed37e0c6d6eb9321808

Coverity #135037: Fix unused variable.

Don't read a value we don't use.

base/gxscanc.c


2017-09-05 14:52:07 +0100
Chris Liddell <chris.liddell@artifex.com>
228ac64b768ac3df1bcd5f63e3f353f8fd01e372

Coverity ID# 135035

Remove pointless "upgraded_copypage" code properly.

The previous commit for this removed code that it should not have done

base/gdevprn.c


2017-09-15 13:42:00 +0100
Chris Liddell <chris.liddell@artifex.com>
3f9d3e1392236fef4658c8dcad15385670d6831e

Revert "Coverity ID# 135035"

This reverts commit 05c3de8915fafb65b96ba0860523a7a79e2577e2.

base/gdevprn.c


2017-09-14 22:40:30 +0100
Chris Liddell <chris.liddell@artifex.com>
12ff84c1ff077c737b0a194761a370de079943fd

Remove man pages for removed (obsolete) tools

(Reported against 9.22 rc1)

doc/gs-vms.hlp
man/de/font2c.1
man/de/wftopfa.1
man/font2c.1
man/gs.1
man/wftopfa.1


2017-09-14 07:01:32 +0100
Chris Liddell <chris.liddell@artifex.com>
7df9b3d9b0dabd9854731fab796d5d458cf743f7

White space issues reported against 9.22 rc1

It seems newer gcc versions (6.4.x and later) report indentation "problems".

Also, add a cast to ensure bitshift op is done on an unsigned value.

base/gsbitops.c
base/gsicc_create.c
base/gxclread.c
contrib/gdevbjca.c
contrib/gdevdj9.c
devices/gdevepsc.c
pcl/pxl/pxpaint.c
psi/dscparse.c
psi/zcrd.c


2017-09-14 06:41:33 +0100
Chris Liddell <chris.liddell@artifex.com>
9e56aafaf2fc8fe3ffeefc0d13fa8c1b033ddec8

Bug 698532: replace ijs/ltmain.sh symlink with file

ijs/ltmain.sh


2017-09-13 08:43:38 +0100
Chris Liddell <chris.liddell@artifex.com>
98e115748ec4b16c610396b9444c1d82d263a30c

Remove reference to old wisc site in Readme.htm
S

doc/Readme.htm


2017-09-12 11:17:15 +0100
Ken Sharp <ken.sharp@artifex.com>
4241a4b3a7099cddac36d13f6c67054483eb7511

Remove unused variable 'pdev' to silence compiler warning

base/gdevp14.c


2017-09-12 10:32:51 +0100
Chris Liddell <chris.liddell@artifex.com>
85e04afbc2c80c8c6b129aff2741cbdf4d41ff67

Update docs dates etc for release

doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/font2c.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
man/wftopfa.1
psi/int.mak
psi/msvc.mak


2017-09-12 10:30:01 +0100
Chris Liddell <chris.liddell@artifex.com>
43561187cdb501ac1c6184082065647253d9336c

Product string and date for release

base/gscdef.c
base/version.mak


2017-09-12 10:14:45 +0100
Ken Sharp <ken.sharp@artifex.com>
56ca27c9a95d7917baebd42b04cb08be872d1e39

PDF interpreter - handle invalid XRefStm in hybrid PDF file

Bug #698519 "Invalid XRefStm exits with error"

Just wrap the 'readpdf15xref pop' in a stopped if the user has not set
PDFSTOPONERROR, also add mark/cleartomark to clean up the stack.

Resource/Init/pdf_main.ps


2017-09-11 09:30:59 -0700
Ray Johnston <ray.johnston@artifex.com>
a1cd439519aa07b5f70b1b044342d90377c1188e

Coverity ID 94477 and 158386

94477 suggests a potential access (as an array pcc[i]) past the singelton
address which could occur if pgs->color_component_map.num_components > 1
Copy the "all" value to an array to prevent the issue.

158386 was a mistake, fixed. Two differences show up with bitrgbtags, but
they look the same to me.
tests_private/comparefiles/Altona_Technical_v20_x4.pdf
tests_private/comparefiles/eci_altona-test-suite-v2_technical2_x4.pdf

base/gdevp14.c


2017-09-11 16:22:29 +0100
Ken Sharp <ken.sharp@artifex.com>
9e92e379d04979de614bbdb89a0af5f4aff187cb

Coverity ID 107344 and 107345, again....

When testing the return value from ftell() don't assign it to an
unsigned int....

Warning from clang this time

devices/gdevgprf.c


2017-09-11 09:31:52 +0100
Ken Sharp <ken.sharp@artifex.com>
49d8d66c80d04bd7bfcae0c50e31b18355408e71

Coverity ID 94485 revisited

another place to check that fw is not negative. Missed the fact there
were two instances with the first commit.

devices/minftrsz.c


2017-09-11 09:31:01 +0100
Ken Sharp <ken.sharp@artifex.com>
954ed1df4b60bd9b3fc57b56cb7503cb950e05b9

Coverity IDs 107344, 107345 revisited

Check return values from ftell() as well as fseek()

devices/gdevgprf.c


2017-09-11 08:22:41 +0100
Ken Sharp <ken.sharp@artifex.com>
988e56308515118b723d868e50e8b5836d43f803

Coverity ID 171512

Check return values from seek and propagate errors if encountered.

pcl/pl/plparams.c


2017-09-11 08:20:27 +0100
Ken Sharp <ken.sharp@artifex.com>
c35b385f02e007fe1edf086d8b5175af4a9836f9

Coverity IDs 171513 and 171514

prevent potential divide by zero errors. Instead, propagate error
return codes.

base/gen_ordered.c


2017-09-10 12:40:14 -0700
Ray Johnston <ray.johnston@artifex.com>
d94fd9bd9cb69a998c812eb2f04fdc0083895ae5

Adjust .genordered 50% gray level to be on an desirable boundary

Customer needs 50% gray level with 45 degree Angle and DotShape 8
to be a checkerboard pattern with no stray dots. Add a check to force
the step at 50% to be an even number of dots. Tested for Frequency
from 30 to 150 (at 600 dpi).

psi/zht2.c


2017-09-07 15:38:19 +0100
Ken Sharp <ken.sharp@artifex.com>
dc8eb2a822bda44aab546e0bf7a0e35e3115696b

Coverity ID 94999

I don't believe its actually possible to end up at the if (swap)
without setting run, because the few cases in the switch where we
don't set run, we go back to the top, swap the source and texture,
and then do the switch again, so somehow we will end up setting run

But its cheap to initialise it, and it will silence Coverity, and it
guards against any possible future problem.

base/gsroprun.c


2017-09-05 16:53:52 +0100
Chris Liddell <chris.liddell@artifex.com>
ff5828a537fbf8b58095f5147b2acd59a6330941

Compiler warning: discaring const

The fix for coverity ID# 127201 introduced a compiler warning due to an
accessor macro (ctm_only) implicitly adding const. Make the local variable
const, too.

base/gxipixel.c


2017-09-05 15:46:03 +0100
Chris Liddell <chris.liddell@artifex.com>
6846f1d5d8c7f5512fc385b3b9e2fa95cc720c53

Coverity ID# 94891

Add a cast to make integer division explicit.

base/gsdparam.c


2017-09-07 13:35:35 +0100
Ken Sharp <ken.sharp@artifex.com>
534257c41de66f040fa548b47f2bf5950cb5a3cb

Coverity ID 94819

No structural changes, just change a couple of pointer type declarations
I think this should satisfy Coverity and there doesn't seem to be any
actual problem here.

base/gxclthrd.c


2017-09-07 12:11:47 +0100
Ken Sharp <ken.sharp@artifex.com>
f12500705c692b0ad51156081901fcd3457a5601

Coverity ID 158370

Again we shouldn't be able to get to the flagged code with 'raster'
being uninitialised, because 'data', which is initialised to 0 would
have to be updated, and that would mean raster was updated as well.

But since we already initialise data its cheap to initialise raster too.

base/gximag3x.c


2017-09-07 11:36:59 +0100
Ken Sharp <ken.sharp@artifex.com>
627b0c8a1228830917bb2420edb4613550dd4ef1

Coverity ID 94819

The comments on clist_end_page() state that it returns negative for an
error, 0 for success and positive for success with a low memory warning.

In fact it always returns 0.

This means we don't conform to the comments, and discard any errors that
occur.

This commit reformats the code to reduce the number of tests and to
store the error codes, as well as adding the potential to return
something other than 0.

base/gxclist.c


2017-09-07 10:09:04 +0100
Ken Sharp <ken.sharp@artifex.com>
be04e2ac2389e6fcc2ccf7b50434678c7aefa19d

Coverity ID 94571

Its not obvious whether raster can ever be 0 here, it clearly never is
during our tests, and I think it should not be possible, but just in
case we'll guard the division with a check.

base/gsimage.c


2017-09-07 08:51:31 +0100
Ken Sharp <ken.sharp@artifex.com>
24bbc1ed3d0553964dd5086b08062442071e4ef5

Fix memory leak

An error exit would leave 'filter' and 'screen_blur' allocated, and
therefore a memory leak.

base/gen_ordered.c


2017-09-06 15:51:33 -0700
Ray Johnston <ray.johnston@artifex.com>
30e336aee9812ca3610931f86ea641d82022c8ca

Second fix for missing FULL_FILE_NAME_LENGTH

Previous commit fixed the RAW_SCREEN_DUMP=1 case, but broke the normal
case. Also added #ifndef RAW_SCREEN_DUMP around the setting in gen_odrered.h
so that the preprocesor flag could be set via the command line.

Lastly, add base/gen_ordered.h to the Headers section of the .vcproj

base/gen_ordered.h
toolbin/halftone/gen_ordered/gen_ordered.vcproj


2017-09-06 14:23:05 -0700
Ray Johnston <ray.johnston@artifex.com>
a92188b76f30c5840ce8b0716e5c70e9791fb6eb

Fix RAW_SCREEN_DUMP for gen_ordered standalone

In refactoring, I missed that FUL_FILE_NAME_LENGTH was needed if
RAW_SCREEN_DUMP was > 0 (RAW_SCREEN_DUMP is #define'd in genordered.h,
so put the definition there.).

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


2017-09-06 19:08:24 +0100
Ken Sharp <ken.sharp@artifex.com>
6b085aa479bcf0c8cb426c0b51fe7f98faba72ff

Coverity ID 94886

Remove a NULL pointer check, there's no possible way the pointer
can be NULL at this point. Or if there is, its because a NULL
pointer was passed in as an argument, and we will seg fault earlier
in this function anyway, so no point in checking it here.

base/gxfill.c


2017-09-06 19:06:22 +0100
Ken Sharp <ken.sharp@artifex.com>
754e99239371ec4aa06a9728ae65028ac22c440c

Coverity ID 94627

Guard the dereference of pdht with a NULL pointer test, to avoid a
potential seg fault.

base/gxdevndi.c


2017-09-06 16:31:48 +0100
Ken Sharp <ken.sharp@artifex.com>
6857ef647312daa24eb47417b09d823e8b59831d

Coverity ID 141334

Add some error checking

base/gxclip.c


2017-09-06 15:58:28 +0100
Ken Sharp <ken.sharp@artifex.com>
198924f4c94c561543f5838900e21ed761a886a5

Coverity ID 95001

We can only get back here by jumping to the label 'top'. ymax is not
used between this point and the last 'goto top', and it is then
recalculated before being used.

So the assignment is indeed pointless.

base/gxacpath.c


2017-09-06 15:11:56 +0100
Ken Sharp <ken.sharp@artifex.com>
0808c9eec2a92db3176b3eac0520f48a2119ddf9

Coverity IDs 164020, 164022, 164025

We don't need to check if dot_grid.data is NULL.

Testing a == 0 && b == 0 after testing a nd b individually can't be
correct. Test for both being zero first.

In the case of an error, we could attempt to free memory that had not
been allocated. Prevent this by checking dot_level_pos is non-NULL.

base/gen_ordered.c


2017-09-06 14:37:21 +0100
Ken Sharp <ken.sharp@artifex.com>
05768db75e90f56c6fda33c9c14515a3e0b6aeaa

Addition to commit 18f009a08f1eac4708188b516d375356a502a3b1

Forgot to initialise the pointer to NULL before starting.

base/gdevp14.c


2017-09-06 10:03:40 +0100
Ken Sharp <ken.sharp@artifex.com>
18f009a08f1eac4708188b516d375356a502a3b1

Coverity IDs 138751, 141130, 141131, 158373

138751 - The code assumes that a separating device has an ICC profile
but doesn't check. Add a check and return an error if it doesn't.

141130 - initialise a structure member

141131 - check and action return codes

158373 put #if DEBUG round some code that's only present to provide a
breakpoint location in debuggers. (and told Coverity to ignore this)

base/gdevp14.c


2017-09-05 15:28:19 +0100
Chris Liddell <chris.liddell@artifex.com>
61856e04852124491a47fa6379f1c3ad296f3366

Coverity ID# 122660

NULL pointer check - the code branch above already does so, looks like a simple
ommission

base/gxiscale.c


2017-09-05 15:21:23 +0100
Chris Liddell <chris.liddell@artifex.com>
1b9ea22b3456a24e356d3f5a68036cecbb28af56

Coverity ID# 126580

Explicitly promote an unsigned char value to a long.

base/gxclrect.c


2017-09-05 15:12:09 +0100
Chris Liddell <chris.liddell@artifex.com>
28e95004b508a3f4cd73552d92f7f4cd699c645b

Coverity ID# 127201

Fix potential NULL pgs (graphics state) pointer dereference. I suspect this can
never occur, but it's cheap and should silence coverity

base/gxipixel.c


2017-09-05 14:52:07 +0100
Chris Liddell <chris.liddell@artifex.com>
05c3de8915fafb65b96ba0860523a7a79e2577e2

Coverity ID# 135035

Remove pointless "upgraded_copypage" code.

base/gdevprn.c


2017-09-05 14:18:10 +0100
Ken Sharp <ken.sharp@artifex.com>
9a6045cc4c7843ee8608c1d4a2fb76e8a10a6581

Coverity ID 95054

Explicitly initialise a member of the new 'order' structure.

base/gxdhtserial.c


2017-09-05 13:36:45 +0100
Chris Liddell <chris.liddell@artifex.com>
7dd033589ce40649ab602fba4c0473aa40c48439

Bug 698471: apply vertical substitute glyphs in TTF fonts

We weren't applying vertical glyph substition (from the gsub table).

base/gstype42.c
psi/zfapi.c


2017-09-05 13:23:24 +0100
Chris Liddell <chris.liddell@artifex.com>
f753769041467a1c88084d6d26c2755d7174691d

Bug 698486: memory leaks from fontconfig calls

Address most of the memory leaks stemming from the use of fontconfig.

In this case, just destroying the fontconfig context.

base/gp_unix.c


2017-09-04 09:39:18 +0100
Chris Liddell <chris.liddell@artifex.com>
8b249d3ebd8058f2961770e21c72e1ac703cc12f

Coverity ID 139142: etc.c modulo by zero

Only calculate tmline when it will actually be used. The calculation uses
y % tmheight, but only the ETS_RSTYLE_THRESHOLD case is called with
tmheight != 0

base/ets.c


2017-09-05 12:16:38 +0100
Ken Sharp <ken.sharp@artifex.com>
463854833474dc3ae642e17707e50c451ada1fec

Coverity ID 94994

Check a return value and action it.

base/gxp1fill.c


2017-09-05 11:41:38 +0100
Ken Sharp <ken.sharp@artifex.com>
aa75f905024bdf13882c30e543d64e285e22aad1

Coverity ID 158395

I think its not currently possible to trigger this, as it would require
setting up the device pointer incorrectly before entering this routine.
However Coverity is correct that it appears possible to end up doing
a NULL pointer dereference, so add a guard to maek sure that can't
happen.

base/gzspotan.c


2017-09-05 10:45:14 +0100
Ken Sharp <ken.sharp@artifex.com>
06b5a54361525363bdc163b88f965f0d1a295087

Coverity ID 94914

Remove an unnecessary copy of a variable, its unconditionally
overwritten immediately after. Comment that.

base/sfilter2.c


2017-09-05 09:58:24 +0100
Ken Sharp <ken.sharp@artifex.com>
3f40707f85296c0abf798c9c32c79db33affbddc

Coverity IDs 94554 and 94551

We weren't checking the return values from gp_fseek_64 or fstat() and
in a couple of places weren't even able to return an error anyway
(void function).

So check the error returns from the C run-time and add error handling
as required in order too report these.

base/sfxcommon.c
base/sfxstdio.c
base/stream.h


2017-09-04 19:02:39 +0100
Ken Sharp <ken.sharp@artifex.com>
ac6c349f54b09df7b2f8cf606b8fe7e62291c2e0

Coverity ID 94959

We were failing to free a couple of allocated buffers in the event of an
error. The other error test all free both buffers properly.

devices/rinkj/rinkj-epson870.c


2017-09-04 17:26:45 +0100
Ken Sharp <ken.sharp@artifex.com>
a11bd1f982f8a8491a4c1ab45aa5535426d01dca

Coverity IDs 94868, 94936, 158371

Initialise some arrays, these are sparsely populated by the code and
potentially possible to access uninitialised data.

devices/rinkj/evenbetter-rll.c


2017-09-04 17:01:14 +0100
Ken Sharp <ken.sharp@artifex.com>
538f12d7bdd292c4798161a5d49ba2f3bcfebbe3

Alter the fix for Coverity ID 94726

Ray objected to my original change, because the debug output would not
be a valid file. So instead we choose to lose the information that
logbits2 is non-zero and drop the if clause.

devices/gdevplib.c


2017-09-04 16:57:32 +0100
Ken Sharp <ken.sharp@artifex.com>
e0d49f799157f2d0ba1ea4969cc225a15d108cf7

Coverity IDs 94478 and 94485

The first is a clear typo, the code below this point is the same as the
code modified in this commit.

The second one is less clear, but I think its reasonable, if there is
no '0' (-1 return from next_zero()) then we can't make the feature
larger by darkening to the right, so darken to the left.

devices/minftrsz.c


2017-09-04 16:27:32 +0100
Ken Sharp <ken.sharp@artifex.com>
f7d9662c5737d42942dbe1f5d4e74a9d00838b56

Coverity ID 94479

The macro used here says it shouldn't be used for run-time calculations.
However this code does use it, I'm not certain for what purpose. Since
it clearly is possible to get a negative shift, add a guard to the
values to make sure that can't happen.

Since this code is conditionally compiled out, anyone who compiled it
in and finds a problem can easily fix it.

devices/gdevxcmp.c


2017-09-04 15:56:29 +0100
Ken Sharp <ken.sharp@artifex.com>
0462b654d8a57688c1b811a4e04ad8a7aaf0dab9

Coverity ID 127202

Check the stored graphics state and if its 0, use the default method.

Remove the now redundant later check on pgs being 0 before use.

devices/gdevx.c


2017-09-04 15:16:42 +0100
Ken Sharp <ken.sharp@artifex.com>
2c5d0e0970e60d9d4c61865d61fb39629dfd6623

Coverity IDs 94503, 94506, 94523, 94536

A number of pointless comparisons, checking that a signed 32-bit variable
had a value less than the maximum for a signed 32-bit integer.

Remove them all.

devices/gdevupd.c


2017-09-04 14:32:22 +0100
Ken Sharp <ken.sharp@artifex.com>
ae7f71a161803d10f263585e8b2e5087835f51b8

Coverity IDs 94719, 94889, 94912, 94967, 95088, 101187

Return an error instead of storing it (where it gets lost)

As per gdevpsd.c and gdevprf.c refactor the #if conditional compiled
code to remove a variable and get rid of Coverity warning.

In the 'build_cmyk_raster_line_fromplanar* routines, pass the params as
a pointer instead of copying the whole 500+ byte structure around.

Finally, not a Coverity warning but a compiler warning; remove an unused
variable.

devices/gdevtsep.c


2017-09-04 13:47:16 +0100
Ken Sharp <ken.sharp@artifex.com>
413cefabb9888c0810e1c4c23e603fa4e69c7c1d

Coverity IDs 94856 and 94719

If we get an error from param_read_name, then just return it.

The AddLut lookup is less obvious. Clearly the size of the LUT read from
the config file should not be less than 0, but there's no clear upper
limit (other than an unsigned integer). However a 4Gb config file seems
unlikely. The only example we have has ~23 values for each plane, so a
limit of 256 entries seems reasonable. If anyone complains its easy to
increase and we can ask the user what a reasonable limit should be.

devices/gdevrinkj.c


2017-09-04 13:12:27 +0100
Ken Sharp <ken.sharp@artifex.com>
1cf6a2a71851e507716bd5c82c8c991239ac04e0

Coverity ID 94728

As with gdevgprf.c, refactor the #if conditional compilation so that we
don't need a variable, and remove the Coverity warning.

devices/gdevpsd.c


2017-09-04 12:12:06 +0100
Ken Sharp <ken.sharp@artifex.com>
cdceb9e93516264fcdae965e5eeb0e733bad76ee

Coverity IDs 94596, 94726

A debug print was identical in both the if and else clauses. Not really
important since its debug, but change the else to match others of the
same type.

line_ptrs was calculated and altered in the loop invocation, but its
then immediately overwritten in the loop body, making it pointless.

devices/gdevplib.c


2017-09-04 11:29:50 +0100
Ken Sharp <ken.sharp@artifex.com>
11e90b8945a54e4e16c702a4ba4ed19cef47f4a2

Coverity ID 158390

Since line is recalculated inside the loop on every iteration, there's
no point in calculating it in the loop definition.

devices/gdevphex.c


2017-09-04 10:47:04 +0100
Ken Sharp <ken.sharp@artifex.com>
615d7caf21e957fe3716ef9264def280df20beb7

Coverity IDs 121444, 121445, 121449

More problems with intermediate promotion to int, probably caused when
gx_color_index went from 32 to 64 bits.

devices/gdevpbm.c


2017-09-04 10:29:55 +0100
Ken Sharp <ken.sharp@artifex.com>
65ef52484c9a973f5fcb72b258cf1bf5a4653a75

Coverity ID 158391

Initialise 'backtable'. The code does later fill in some entries in
backtable, but it doesn't fill all of them and I can see no coherence
between the filling in code and the code that reads data from it. It
really does look like its possible to read uninitialised data here.

devices/gdevmgr.c


2017-09-03 17:14:41 +0100
Ken Sharp <ken.sharp@artifex.com>
5f73a2c82f0cbd0d0965709066ebdf13cc0b9c9d

Coverity ID 94489

The spec says that it must be 3 bytes, and uses a 16 bit shift example
(suggesting it is stored in the Brother driver as 24 bits).

For us its a short, so rather than copy the brother code, set it to 0 to
avoid any confusion over whether shifting a short right by 16 results in
all 0 or all 1.

devices/gdevhl7x.c


2017-09-03 11:48:54 +0100
Ken Sharp <ken.sharp@artifex.com>
4e122728ecf07941e15f75fc7feaec57eeb54e90

Coverity IDs 107340, 107341, 107343, 107344, 107345, 121455

Considerable rework of error checking in this device.

Firstly add error return checks on fseek and fwrite. Alter functions to
return those errors. Alter the parent functions to check the errors,
repeat until we bubble up to the top level.

Coverity claims that ftell() can return a negative value, which as far
as I can see is not true. However, by casting the return value to an
unsigned type, and altering the variable types appropriately, I think
we should eliminate this warning.

Refactor conditionally compiled code to eliminate a variable and get
rid of a dead code warning.

devices/gdevgprf.c


2017-09-02 18:31:11 +0100
Ken Sharp <ken.sharp@artifex.com>
18d430f97d95d5919fb9ea06b63423c8367548b9

Coverity ID 94722

Change the way memory allocation and free'ing is done so that we no
longer check row_first, which is always 0. THis should mean that we
don't need to check min_feature_data before passing it to
min_feature_size_process(), it is allocated in min_feature_size_init()
and we do actually now check the return value from there to ensure
there are no errors which could leave min_feature_data uninitialised.

devices/gdevfax.c


2017-09-02 17:19:00 +0100
Ken Sharp <ken.sharp@artifex.com>
4b07f41941f75fc54cd6937ff18426402ab9af36

Coverity IDs 94575 and 94722

Remove some dead code, refactor and add error checking to avoid a NULL
pointer dereference

devices/gdevdjtc.c


2017-09-02 16:33:06 +0100
Ken Sharp <ken.sharp@artifex.com>
6a4506040593416d23930049e41e806336335e67

Coverity ID 94526

Add some error checking on file handling, and report ioerrors if they
fail.

devices/gdevdfax.c


2017-09-02 15:09:25 +0100
Ken Sharp <ken.sharp@artifex.com>
998dd6a53f17104decc8533d5978023fdd008c21

Coverity ID 94814 and 94980

I wasn't able to find a way to reproduce this, because it relies on
a particular sequence of lines/points. We must fill the data buffer to
the point where another line or curve will not fit, and then the next
curve or line must be a 'POINTS_NONE'.

In this case we will not flush the accumulated points, which means we
will not reset the counter, but we will then still go on to save the
current co-ordinates in the data buffer, which will cause an overflow.

Fixed by reducing the 'full' check slightly, so that we still have one
line/curve slot open in the data buffer. If we get a POINTS_NONE then
we check to see if we have already gone past the slop. If we have, simply
reduce the counter by one which will cause us to overwrite the previous
points. Since this must have also been a POINTS_NONE, this just means
in effect that we have combined consecutive ones.

I'm not certain its even possible to get consecutive POINTS_NONE, but
its best to be safe.

This should silence Coverity, and fixes the genuine (if hard to
reproduce) potential problem.

devices/vector/gdevpx.c


2017-09-02 11:02:23 +0100
Ken Sharp <ken.sharp@artifex.com>
3a98b6855660c84b2fa5529cc25bdbdc4b2b9d7a

Coverity ID 94943

I think this code is incorrect, because this routine *always* maps
CMYK to CMYK, so there's no need to test the colour depth.

Also, it always gets provided with a CMYK buffer, not an RGB one so it
actually can't write off the end of the buffer. But the declaration
was wrong, so fix that here to avoid the warning.

devices/gdevcdj.c


2017-09-02 10:55:51 +0100
Ken Sharp <ken.sharp@artifex.com>
065b5cc15cea365c3fa5a1f3133416a0db228082

Coverity ID 95019

This code was unreachable, its even commented as such. So lets just
remove it.

devices/gdevcdj.c


2017-09-02 10:54:06 +0100
Ken Sharp <ken.sharp@artifex.com>
a48211dc97ef345261e7e9a08818dd274b07040e

Coverity ID 94736

Guard against a NULL pointer dereference. If we didn't recognise the
pritner type, then it was possible to attempt to use a NULL pointer.

devices/gdevcdj.c


2017-09-02 10:50:34 +0100
Ken Sharp <ken.sharp@artifex.com>
77fae933e126cb3b3aad9faa30a659294ed8a44a

Coverity ID 94708

The original code in here was correctly noted by Coverity as being
dead, because the division by BJC_RESOLUTION_BASE meant that we were
always comparing 0 with 0.

In addition, the use of bit shifting meant that the resolution wasn't
tested against a simple multiple of 90 dpi, but against powers of 2
times 90 dpi, which rapidly led to ridiculous values.

I'm not certain what the original limits should have been here, and
I don't have a bjc device to test against, but the code as it stood was
clearly incorrect, and this at least stands some chance or working.

devices/gdevcdj.c


2017-09-02 10:28:44 +0100
Ken Sharp <ken.sharp@artifex.com>
1e6e40715f9038b177cf4649945af38b4b21e83c

Coverity ID 121443

This was supposed to be in the earlier commit but somehow fell off...

devices/vector/gdevpx.c


2017-09-02 09:59:30 +0100
Ken Sharp <ken.sharp@artifex.com>
f2a4735118b9558a76adf46e7bb6f814a74ffb38

Coverity ID 94703

param_string_from_string cannot return an error so don't try to
check it.

devices/vector/gdevpx.c


2017-09-02 09:51:33 +0100
Ken Sharp <ken.sharp@artifex.com>
ca09b00d27d7a855c0e7cbf55c26b5e287262cca

Coverity IDs 121437, 121438 and 121443

Not certain if these are really a potential problem, but a type cast
safely resolves any potential for error.

I suspect this is a hang over from when gs_color_index was a 32-bit
value instead of 64.

devices/vector/gdevpx.c


2017-09-02 09:40:14 +0100
Ken Sharp <ken.sharp@artifex.com>
34ac92ae1741e4d8573162efbd25520bc8796424

pdfwrite - remove unused code

This code was left over from transfer function the /Apply work, but is
no longer used. It was also raising warnings with scan-build and
didn't work properly anyway (which is why its unused).

So remove it.

devices/vector/gdevpsdf.h
devices/vector/gdevpsdi.c
devices/vector/gdevpsds.c
devices/vector/gdevpsds.h


2017-08-31 16:11:15 +0100
Ken Sharp <ken.sharp@artifex.com>
4129543f9f51ccaf97d8429a9e66e348394e95b0

PDF interpreter - add support for Choice fields in Widget annotations

Bug 698461 "PDF files with filled forms are not rendered correctly if they have drop-down lists"

We didn't support Choice fields in either AcroForms or Widget annotations
which leads to these not being rendered if they have no Appearance (in
the case of widget annotations) or not rendered at all in the case of
AcroForms.

This commit adds simple support for single selection Choice fields, we
may want to improve this later.

Resource/Init/pdf_draw.ps
devices/vector/gdevpsds.c


2017-08-30 16:36:20 +0100
Chris Liddell <chris.liddell@artifex.com>
e547f2490aa40a4f8e35bb15e6815e7d6f1be22a

clang warning in color mapping code

We were bit shifting -1 (i.e. -1 << x) which is, strictly speaking undefined.

Where what was meant was meant was -(1 << x).

base/gxcmap.c


2017-08-30 16:28:08 +0100
Chris Liddell <chris.liddell@artifex.com>
dafd08a54332f66760b8d667a4b59f42bd4edf1f

clang warnings in the TTF code.

There was a type mismatch: we were using a boolean to track if an error had
occurred, but in most places we were treating it as a gs error code (int type).

Change the type to int, and tweak the couple of places where it was treated as
a bool.

base/gxttfb.c
base/gxttfb.h


2017-08-25 10:54:42 +0100
Chris Liddell <chris.liddell@artifex.com>
ff70cedd80fd037414abb8a17cd1988d92da2ad6

This is a combination of 7 commits.

from the openjpeg-2.2.0-update branch

1) OpenJPEG 2.2.0 initial commit
0b5fc7368721af148d85ef8dac2e018de10cfe91

2) Zap the openjpeg stuff we don't need
e90bbccd19cb266b55de28ebfd16d024b6e67373

3) Add predefined openjpeg headers.
71242c9a04bb76b8b17fc489d62a91d04c1ad60c

4) Import patches from Sumatra's tree.
8b89e4b5750069172522ecf85e69d094b5e567e7

5) update makefiles, interface and vcproj files for new openjpeg version
456cbe1c76659b0ab022f6ca3f67cc63b253b05f

6) Avoid getenv call in openjpeg
202a0318a7b3a397fcd5d015dcad4293474f464c

7) Bug 698135: Import security fix for OpenJPEG
8057698a5f7833499fdf8d2529162841920e354a

base/openjpeg.mak
base/sjpx_openjpeg.c
openjpeg/.gitignore
openjpeg/.travis.yml
openjpeg/CHANGELOG.md
openjpeg/NEWS.md
openjpeg/THANKS.md
openjpeg/src/CMakeLists.txt
openjpeg/src/lib/openjp2/CMakeLists.txt
openjpeg/src/lib/openjp2/bench_dwt.c
openjpeg/src/lib/openjp2/bio.c
openjpeg/src/lib/openjp2/bio.h
openjpeg/src/lib/openjp2/cidx_manager.c
openjpeg/src/lib/openjp2/cidx_manager.h
openjpeg/src/lib/openjp2/cio.c
openjpeg/src/lib/openjp2/cio.h
openjpeg/src/lib/openjp2/dwt.c
openjpeg/src/lib/openjp2/dwt.h
openjpeg/src/lib/openjp2/event.c
openjpeg/src/lib/openjp2/event.h
openjpeg/src/lib/openjp2/function_list.c
openjpeg/src/lib/openjp2/function_list.h
openjpeg/src/lib/openjp2/image.c
openjpeg/src/lib/openjp2/image.h
openjpeg/src/lib/openjp2/indexbox_manager.h
openjpeg/src/lib/openjp2/invert.c
openjpeg/src/lib/openjp2/invert.h
openjpeg/src/lib/openjp2/j2k.c
openjpeg/src/lib/openjp2/j2k.h
openjpeg/src/lib/openjp2/jp2.c
openjpeg/src/lib/openjp2/jp2.h
openjpeg/src/lib/openjp2/libopenjp2.pc.cmake.in
openjpeg/src/lib/openjp2/mct.c
openjpeg/src/lib/openjp2/mct.h
openjpeg/src/lib/openjp2/mqc.c
openjpeg/src/lib/openjp2/mqc.h
openjpeg/src/lib/openjp2/mqc_inl.h
openjpeg/src/lib/openjp2/openjpeg.c
openjpeg/src/lib/openjp2/openjpeg.h
openjpeg/src/lib/openjp2/opj_clock.c
openjpeg/src/lib/openjp2/opj_clock.h
openjpeg/src/lib/openjp2/opj_codec.h
openjpeg/src/lib/openjp2/opj_common.h
openjpeg/src/lib/openjp2/opj_config.h
openjpeg/src/lib/openjp2/opj_config.h.cmake.in
openjpeg/src/lib/openjp2/opj_config_private.h
openjpeg/src/lib/openjp2/opj_config_private.h.cmake.in
openjpeg/src/lib/openjp2/opj_includes.h
openjpeg/src/lib/openjp2/opj_intmath.h
openjpeg/src/lib/openjp2/opj_inttypes.h
openjpeg/src/lib/openjp2/opj_malloc.c
openjpeg/src/lib/openjp2/opj_malloc.h
openjpeg/src/lib/openjp2/opj_stdint.h
openjpeg/src/lib/openjp2/phix_manager.c
openjpeg/src/lib/openjp2/pi.c
openjpeg/src/lib/openjp2/pi.h
openjpeg/src/lib/openjp2/ppix_manager.c
openjpeg/src/lib/openjp2/raw.h
openjpeg/src/lib/openjp2/t1.c
openjpeg/src/lib/openjp2/t1.h
openjpeg/src/lib/openjp2/t1_generate_luts.c
openjpeg/src/lib/openjp2/t1_luts.h
openjpeg/src/lib/openjp2/t2.c
openjpeg/src/lib/openjp2/t2.h
openjpeg/src/lib/openjp2/tcd.c
openjpeg/src/lib/openjp2/tcd.h
openjpeg/src/lib/openjp2/tgt.c
openjpeg/src/lib/openjp2/tgt.h
openjpeg/src/lib/openjp2/thix_manager.c
openjpeg/src/lib/openjp2/thread.c
openjpeg/src/lib/openjp2/thread.h
openjpeg/src/lib/openjp2/tls_keys.h
openjpeg/src/lib/openjp2/tpix_manager.c
windows/ghostscript.vcproj


2017-08-31 09:40:51 +0100
Ken Sharp <ken.sharp@artifex.com>
d1dbe825e2fefed1156d0f5e02e6b4d5f20a7781

pdfwrite - address compiler warnings

A couple of benign compiler warnings, assigning to an unused variable

Also add some white space because the construction seems to confuse
scan-build.

devices/vector/gdevpdfg.c
devices/vector/gdevpsds.c


2017-08-30 15:36:10 +0100
Ken Sharp <ken.sharp@artifex.com>
794c559e34192d96b772950f854600add9c86651

PDF interpreter - make sure Stamp appearance synthesis cannot have 0 scale

One of the new PDF 2.0 Quality Logic files exhibited a problem with
synthesising a missing Appearance for some Stamp annotations; the
scale factor could be calculated as 0.

This commit makes the minimum scale value 1

Resource/Init/pdf_draw.ps


2017-08-30 10:18:19 +0100
Ken Sharp <ken.sharp@artifex.com>
782ca576c8582457b063481a4315f7b767ec4546

PDF interpreter - fix implementation of HTO

I implemented HTO by using the existing sethalftonephase without an
example to look at. It turns out that sethalftonephase uses
.setscreenphase which expects three integers while HTO consists of
an array of 2 reals.

We already manufacture the third integer (the texture) and use aload to
extract the two reals. This commit uses transform to apply the CTM and
then cvi to convert the HTO numbers to something that makes a difference
and is legal.

Fixes the error and the resulting file (rendered at 1bpp) does show a
difference in the halftone at 300 dpi or better.

Resource/Init/pdf_draw.ps


2017-08-29 14:04:28 +0100
Ken Sharp <ken.sharp@artifex.com>
050f12a7c1c9b6e17fd6253924ce5929861cd99f

PDF interpreter - Properly clamp real arguments for /Indexed spaces

Bug #698434 "real operands to /Indexed spaces not properly limited (PDF 2.0)"

The quality Logic PDF 2.0 test file fts_14_1422.pdf tests /Indexed
colour spaces with real value to see if the notes in Section 8.6.6.3
regarding real values are adhered to. Previously we simply set such
values to the lowest integer (truncated the fractional part) which is
wrong according to both the PDF and PostScript specifications.

The PDF specification specifically states that 0.5 rounds *up* while
the PostScript Language Reference Manual (unusually) doesn't state
exactly what 'nearest' means.

Since it was wrong for both before I've chosen to apply the same rules
for both PDF and PostScript, 0.5 and above rounds up, other reals round
down. Values outside the range 0->hival are clamped to either 0 or
hival whichever is nearer (this was already done in fact).

psi/zcolor.c


2017-08-29 10:37:23 +0100
Ken Sharp <ken.sharp@artifex.com>
ed962af64e86887b0c2ca614c877bb743315d414

PDF Interpreter - Paint one pixel for Patterns with BBox width/height of 0

Bug #698431 "PDF 2.0 - Patterns with BBox where width or height = 0 should paint 1 pixel"

The ISO32000-2:2017 specification explicitly states (See section 8.7.3.1
Table 74 and section 8.7.4.3 Table 77) that a Pattern with a BBox where
the width or height is 0 should still paint one pixel.

We achieve this here by detecting the condition where width or height in
a Pattern BBox is exactly 0, and add a tiny amount to the urx or ury
to ensure that one pixels is touched, and therefore painted.

Resource/Init/pdf_draw.ps


2017-08-28 15:28:01 +0100
Ken Sharp <ken.sharp@artifex.com>
93b7c164f969787767da98ea3cb4b3efdb6ffc32

fix previous commit

Commit e239afa0924503e131b0445bf2624da90f7c93d1 accidentally broke
ps2write for files with a halftone, but no transfer function. We do need
to check to see if the transfer function is present before trying to
emit it!

For safety, set the character array to NULLs before we start.

devices/vector/gdevpdfg.c


2017-08-28 14:38:02 +0100
Ken Sharp <ken.sharp@artifex.com>
e239afa0924503e131b0445bf2624da90f7c93d1

pdfwrite - fix 2 scan-build warnings

devices/vector/gdevpdfg.c


2017-08-28 14:31:37 +0100
Ken Sharp <ken.sharp@artifex.com>
f06cb1ba2d51c44cd27cbf12e2011d15e49cd3ad

PDF Interpreter - Handle recursive /Prev entries in trailer dictionaries

Bug #698409 "PDF xref loop causes denial of service"

This commit creates an array and stores the offset of each /Prev as it
is encountered while processing xrefs. Each Prev is also compared
against every preceding offset already stored in the array. If we get
a match then we have recursion and we break out. The file may not render
correctly, and we issue the usual warning.

For complex reasons it was necessary to create the array and store it in
the current dictionary rather than simply leave it on the stack, so we
undef it again after use.

Resource/Init/pdf_main.ps


2017-08-26 10:39:51 +0100
Ken Sharp <ken.sharp@artifex.com>
347f334e934356746f7cc63e478fee41a2c4a8dd

pdfwrite - fix a couple of compiler warnings

Nothing serious, but the code wasn't checking some error returns. We
should do that so fixed here.

devices/vector/gdevpdfg.c


2017-08-26 10:03:00 +0100
Ken Sharp <ken.sharp@artifex.com>
56aa7b23cbb3cea465ba962ce57157e3a6101e3a

pdfwrite - add code to apply transfer functions instead of preserving

With the release of the PDF 2.0 specification transfer functions have
been deprecated in graphics states. This means we can no longer simply
preserve transfer functions as we have done in the past, and removing
them can lead to unexpected results (Quark XPress is notorious for
using transfer functions inadvisably). So this commit alters the colour
handling code fairly extensively in order to allow transfer functions
to be applied.

In order to achieve this there are conditions under which we are forced
to convert colour spaces, as its not possible to apply the transfer
function reasonably to the base space (CIEBased colour spaces are an
example of this). In this case we will use the ProcessColorModel in
effect at the time as the space to convert to.

Its also (unfortunately) the case that when the input is a PDF file,
the PDF file uses transparency and the PDF file has transfer functions
set in the graphics state, that some kinds of operation (soft mask
groups for example) cannot have the transfer function simply applied.
This can result in surprising output. In these (admittedly rare) cases
removing the transfer function causes differently incorrect output.
There is no realistic way for us to take a PDF file like this and
produce an equivalent PDF file which does not contain transfer function.
Worse, we can't even detect this condition in advance.

This concludes the work required to support PDF 2.0 creation, and
Ghostscript should now be able to create and consume PDF 2.0 files
though additional work may be required, and we may choose to add
more functionality (eg Document Parts processing) in the future.

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


2017-08-23 16:41:14 -0700
Ray Johnston <ray.johnston@artifex.com>
bd8b456c088516e622659fb58c1079ef0d4aa21f

Fixes for .genordered

The zgenordered function created the "THRESH_STRING" length string
which would be rejected by sethalftone since the Width * Height was
not equal to the length of the Thresholds string.

Rather than a compile time switch, the .genordered param dict now
has /OutputType, one of /Type3, /ThreshString, or /TOSArray.

The supercell code still had a "realloc". This was replaced by the
simple ALLOC, memcpy, FREE equivalent.

There were still several places that used naked printf. Changed to
respect the "verbose" value or to use EPRINTF* macros. This required
a couple of new macros.

Lastly, add DITHERSC (SuperCellSize) and DITHERLEVELS (Levels) as
options in the gen_ordered_example.ps

base/gen_ordered.c
doc/Language.htm
psi/int.mak
psi/zht2.c
toolbin/halftone/gen_ordered/gen_ordered_example.ps


2017-08-22 11:27:38 -0700
Ray Johnston <ray.johnston@artifex.com>
1a9c68e70e338c31a1fbfce6c3750123c6dda319

Move gen_ordered.c from toolbin to base.

Modify to strip non LIB_BUILD functions from gen_ordered.c and
move gen_ordered.[ch] to base. Main now in gen_ordered_main.c with
project file referencing ../../../base/ for gen_ordered.[ch].
Modify the project file appropriately and add a simple Makefile for
unix.

base/gen_ordered.c
base/gen_ordered.h
base/lib.mak
base/msvclib.mak
base/openvms.mak
base/ugcclib.mak
base/unix-gcc.mak
base/unixansi.mak
psi/int.mak
psi/msvc.mak
psi/os2.mak
toolbin/halftone/gen_ordered/Makefile
toolbin/halftone/gen_ordered/README
toolbin/halftone/gen_ordered/gen_ordered.vcproj
toolbin/halftone/gen_ordered/gen_ordered_main.c


2017-08-19 14:36:59 -0600
Henry Stiles <henry.stiles@artifex.com>
37c454cb7f70fd27f14dd2c1b9c63528b3a237ab

Fix debug -dNOCACHE command line option.

In the last PL API change the code to disbable the cache was
accidentally removed.

xps/xpstop.c


2017-08-22 13:43:00 +0100
Chris Liddell <chris.liddell@artifex.com>
3d3fbafe4a8d1a74a3edb3acbe844da66e1176a2

Bug 698392: add a type check to transparency enum_param()

We were using a ref parameter as a name object without checking its type first

psi/ztrans.c


2017-08-22 13:32:02 +0100
Chris Liddell <chris.liddell@artifex.com>
e61805f2b5559647c0a9122cde508e278f331071

Bug 698391: check base_space pointer before de-referencing

in gs_pattern1_remap_color()

base/gxpcmap.c


2017-08-22 13:38:26 +0100
Ken Sharp <ken.sharp@artifex.com>
a8621022595d5af20f14e87f6ced620dbca43bad

pdfwrite - don't attempt to use the image-to-mask device unless its present

Bug #698390 "gswin32/64 crashes during PDF conversion"

This looks like a simple oversight, other places where we attempt to
use methods from the mask device we first check to see if we have a
mask device present, which we do not in this case. This commit simply
checks the presence of the mask device and doesn't attempt to use it
if we have not installed one.

No differences expected

devices/vector/gdevpdfd.c


2017-08-18 16:10:45 +0100
Chris Liddell <chris.liddell@artifex.com>
e0a921ea3457ae4fea740c4af532e9c103ee9366

Fix FAPI memory leaks.

Noticed while chasing down other memory issues.

Two issues, as it turns out:

Firstly, descendants of a composite font were not having the notify method set, so
we can free the FAPI related memory for the font.

Secondly, the Freetype incremental interface object created for each font was not
freed along with the font object.

base/fapi_ft.c
base/gxfapi.c


2017-08-21 17:05:09 +0100
Ken Sharp <ken.sharp@artifex.com>
7a9d86b5ed28862b671bfb65d3a4d0622ec745c1

XPS Interpreter - fix a formatting mistake

No impact, but it silences a compiler warning. Accidentally introduced
in commit 6162bbb7b804a0c70a35f218e59fa6c3118cd6a2

xps/xpszip.c


2017-08-21 09:46:42 +0100
Ken Sharp <ken.sharp@artifex.com>
6162bbb7b804a0c70a35f218e59fa6c3118cd6a2

Coverity IDs 158378, 158393

Add some limit checks to see if they silence Coverity. Also revisit the
check added in commit c5bf24912f589c881be44408e110ebdbb2fcd5b9 to
correct the limit check.

Coverity complains about reading values from a file format and then
using them without validating them. Its hard to see how to validate
values which can legitimately range over the whole space available. If
we add checks for that, then Coverity complains that the checks are
pointless (which is true of course).

In these cases, however, we are reading unsigned shorts into signed
integers, so we can add a (pointless, really) test to ensure that the
integer value lies in the range of a short. This should satisfy the
'tainted scalar' complaints and also should silence the overflow
warnings when using the values to allocate memory.

Normally I wouldn't do this as is costs performance, but we only execute
this code once when we open the file, so its negligible.

xps/xpszip.c


2017-08-19 14:53:28 +0100
Ken Sharp <ken.sharp@artifex.com>
c5bf24912f589c881be44408e110ebdbb2fcd5b9

Coverity IDs 158372 - 4, 158384

This is an attempt to work-around Coverity complaining about a 'tainted
scalar' or 'tainted argument'. This is caused by reading a 16-bit value
from the Zip central directory and then using it without checking the
bounds. Since the legal bounds are 0 - 2^16 its rather hard to see how
we can bounds check this....

If this doesn't silence the warnings tomorrow, or creates new ones
complaining that the bounds check is pointless (this has happened with
Coverity before) then I'll undo this commit and just tell Coverity
to ignore the warning.

xps/xpszip.c


2017-08-19 10:54:59 +0100
Ken Sharp <ken.sharp@artifex.com>
c57ea7b20d39f0e56432c9cc7bbb7f59fcc544e9

Coverity ID 158375

The function xps_set_nocache() is pointless, it doesn't do anything at
all, it merely retrieves a value from the PCL state stored in the
current instance. I suspect the value retrieved is garbage, since this
is XPS, not PCL, but since we never even use it, its irrelevant.

Whatever the original thinking behind this function was, its not doing
anything useful, so simply remove it.

xps/xpstop.c


2017-08-19 10:28:25 +0100
Ken Sharp <ken.sharp@artifex.com>
c552209d54f69152332795bd833fb3d655e79c48

Coverity ID 158394

I don't actually think the Coverity warning is possible, but I cannot be
absolutely certain, so its simpler just to explicitly set the contents
of these two arrays to a fixed 0 before we start. Its a low overhead if
we do it at the start of the routine.

devices/vector/gdevpsf2.c


2017-08-18 16:08:53 +0100
Ken Sharp <ken.sharp@artifex.com>
57bb7d00e180439440ab1be775fad94e13d340ff

PDF interpreter - Cover some cases of illegal /Parent entries

Bug #698372

The PDF file has a Page with an invlalid /Parent (it references the Page
object). Attempting to use that Page object fails when tracking Resources.

This commit alters the object storage introduced with the PDF unique
font identification so that *any* dictionary with a /Type gets its
object number stored inside it. We can then compare the object and the
Parent when tracking resources and refuse to follow a self-referencing
object.

No differences expected

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


2017-08-17 15:46:17 +0100
Chris Liddell <chris.liddell@artifex.com>
39648c6aafbe7ff790dd4dddf577def1fa7b1f07

Bug 698363: bounds check against length of loca table

In the FAPI code retrieving the glyph data, we weren't checking that the glyph
index was inside the loca table (i.e. that it was less than or equal to the
number of glyphs available in the font).

psi/zfapi.c


2017-08-16 15:12:14 +0100
Chris Liddell <chris.liddell@artifex.com>
2b138093cf78d9f72596a764d4225b5022ed9d9c

Bug 698356: Add reference counting for SMask ICC profiles

Previously, we didn't properly reference count the ICC profiles for
soft masks because we simply swapped in the ones for the mask, and swapped out
the ones "in force" at the time into temporary storage, then swapped them back
when the SMask was complete.

That works fine *if* the PDF is well formed, and thus the SMask completes. But
it causes havoc if the PDF is invalid and causes an error during the processing
of the SMask.

We'll now properly reference count the profiles.

base/gdevp14.c


2017-08-12 16:24:54 -0700
Ray Johnston <ray.johnston@artifex.com>
f6cabb1a7264e81a4b80a515717f7cc8938f1145

Add .gen_ordered operator to PS and htsc_gen_ordered to gs lib

If GS_LIB_BUILD is #defined, gen_ordered.c API can be called from GS to
allow for addittion of a PS operator to make a HalftoneType 3 (threshold
array based halftone) controlled by parameters from a dictionary.

The result is can be used by sethalftone or as a HalftoneType 5 halftone.

Also some warnings cleaned up and add checks for ALLOC fail.

Add a gen_ordered parameter to control verbosity of printing The default
is 0, which is error messages only. Error messages are generated to
stderr (using the EPRINTF* macro).

Add documentation of these two new operators in doc/Lagnuage.htm

Add an example toolbin/halftone/gen_ordered/gen_ordered_example.ps
of usage of ,genordered and some related rendering options.

Other parsers (PCL or XPS) may call htsc_set_default_params and
htsc_gen_ordered as well to make ordered dither halftone generation
more flexible, but the integration into non-PS parsers is left for
later.

Makefile.in
base/lib.mak
base/msvclib.mak
base/openvms.mak
base/ugcclib.mak
base/unix-gcc.mak
base/unixansi.mak
doc/Language.htm
psi/int.mak
psi/msvc.mak
psi/os2.mak
psi/zht2.c
toolbin/halftone/gen_ordered/gen_ordered.c
toolbin/halftone/gen_ordered/gen_ordered.h
toolbin/halftone/gen_ordered/gen_ordered_example.ps


2017-08-11 10:43:52 -0700
Ray Johnston <ray.johnston@artifex.com>
e64f5a2eaeb5c667bfc6bf584f4d7655c8b6b959

Refactor gen_ordered to allow for use by an application (ghostscript).

Also Refactor htsc_save_tos to extract htsc_mask_to_tos to convert
final_mask.data to turn_on_sequence.

If GS_LIB_BUILD is #defined, the "main" and functions that write files
will not be included, and all but a few of the functions will be made
static. Exported functions are:
htsc_set_default_params
htsc_gen_ordered

Also ALLOC and FREE are used to allow the use of a memory allocator
(such as ghostscript's) and PRINTF and EPRINTF macros are used to
allow for redirection of messages.

toolbin/halftone/gen_ordered/gen_ordered.c
toolbin/halftone/gen_ordered/gen_ordered.h
toolbin/halftone/gen_ordered/gen_ordered.vcproj


2017-08-15 16:56:58 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
376e4a546024d9d5f22d1f0a76294d5605ad82be

Bug 694680: Prevent SEGV due to uninitialised structure.

Changing compression within an image is unimplemented but for
now we return an error.

However, changing to eNoCompression is allowed since no
uninitialised structures are encountered.

pcl/pxl/pximage.c


2017-08-15 09:20:34 +0100
Ken Sharp <ken.sharp@artifex.com>
5628bd182819bafe965cbf86649e678a6701f818

pdfwrite - remove obselete code

Originally included as part of the colour management rework, this was
never actually needed, so remove it.

devices/vector/gdevpsds.c
devices/vector/gdevpsds.h


2017-08-15 09:19:27 +0100
Ken Sharp <ken.sharp@artifex.com>
55e3ee85c171a0d7e563535c77d69a8773f17265

Fix some spurious code in the CUPS device, flagged by the compiler

Somehow a few lines of code were duplicated, fortunately this was
benign, but lets remove the nonsense lines anwyay.

cups/gdevcups.c


2017-08-11 08:30:24 -0700
Michael Vrhel <michael.vrhel@artifex.com>
ffa47bc975171d8839af1cf8fb9677c173cff0e6

Bug 696386 Fuzzing

Take slow path if we have a 16bit indexed image

base/gxi12bit.c


2017-08-10 17:39:05 -0700
Michael Vrhel <michael.vrhel@artifex.com>
fb37a099ccc86c2af63794167ccc1799c6fc06a0

Clean up warning in gen_ordered.c

The comment about what the levels of quantization
were when no size was given for the macro cell was
not correct

toolbin/halftone/gen_ordered/gen_ordered.c


2017-08-10 17:17:39 -0700
Michael Vrhel <michael.vrhel@artifex.com>
723d2a565e726cc6f29f4d32f202c29a995b4e37

Bug 698344 gen_ordered.c

Fix case for -r600 -l144 -a45 -q64 -s8
A problem where we only need to take
one dot location for our first quantization level (there were
not multiple dots set to get that level)

toolbin/halftone/gen_ordered/gen_ordered.c


2017-08-10 13:15:15 -0700
Michael Vrhel <michael.vrhel@artifex.com>
f08687ffb24f641f7ed788ccf152752cd502df88

Fix ambiguity in creation of turn on sequence

When dot profile values are the same due to tiling,
force decision as to which one to turn on next based
upon distance to center of dot mask.

toolbin/halftone/gen_ordered/gen_ordered.c


2017-08-09 14:58:02 -0700
Michael Vrhel <michael.vrhel@artifex.com>
a664e0d6601c80388cd8af765400ce071ee8f967

Fix minor offset issue in gen_ordered.c

toolbin/halftone/gen_ordered/gen_ordered.c


2017-08-07 17:12:54 +0100
Ken Sharp <ken.sharp@artifex.com>
913acc7c63921770e755a39fca3f768dda49be5d

PDF interpreter - PDF 2.0 - basic support for UTF-8 strings

I'm sure this will require more work in future, but for now this is at
least as good as our support for UTF-16 strings.

Resource/Init/pdf_draw.ps
Resource/Init/pdf_ops.ps


2017-08-07 13:44:06 +0100
Ken Sharp <ken.sharp@artifex.com>
2efe17a30ff9a72f0698add0bd8708f3ef1d3b99

PDF interpreter - fix typos

two typos in error messages, 'endjobj' should be 'endobj'

Resource/Init/pdf_base.ps


2017-08-07 13:37:59 +0100
Ken Sharp <ken.sharp@artifex.com>
9a5e5e3c396fb18bcd21158c4f44596eed69e5d0

PDF interpreter - PDF 2.0 support - per page OutputIntents

The only way previously to handle *any* OutputIntents array was to
specify UsePDFX3Profile and give the array index of the required
profile.

This is too inflexible as each page can have a different array, so the
indices may be different on each page. Add a new switch -dUseOutputIntent
which takes a string argument.

If we have set -dUseOutputIntent, then check teh document level and each
page for an array of OutputIntents. If found, check each OutputIntent
dictionary for a OutputConditionIdentifier and compare it with the
specified string. If the OutputConditionidentifier is 'Custom' then use
the value of the Info key instead.

Resource/Init/pdf_main.ps
doc/Use.htm


2017-08-07 10:07:06 +0100
Ken Sharp <ken.sharp@artifex.com>
04fd73cadbf91e7a9cf0dee0129384ce23aa3000

PDF interpreter - PDF 2.0 support add UseBlackPtComp

Michael already implemented the use of black point compensation, and
we have a PostScript operator to turn it on and off already (GS
defaults to on).

This just hooks up the PDF 2.0 graphics state entry to the existing
framework. Note that the PDF entry is a boolean whereas our existing
PostScript operator takes 0 or 1, so there's a little fiddling to get
that right.

Resource/Init/gs_init.ps
Resource/Init/pdf_draw.ps
Resource/Init/pdf_ops.ps
psi/zcolor3.c


2017-08-07 10:04:27 +0100
Ken Sharp <ken.sharp@artifex.com>
dcc9ea12638e99917b28b49c120a52c8e309d9fa

PDF interpreter - support for PDF 2.0 add HTO

I doubt we will ever see a Halftone Origin for real. According to the
specification its like a halftone phase but with a different co-ordinate
system.

For now simply treat its as a halftone phase, if anyone ever complains
we can address it, because they will be able to supply an example to
work from.

Resource/Init/pdf_draw.ps


2017-08-06 12:24:21 -0700
Ray Johnston <ray.johnston@artifex.com>
478a0a862d2593199bcae599e46bdc97b525bb12

Bug 698334: LeadingEdge parameter problems.

Because -dLeadingEdge=# sets the value in systemdict, we need to return
this parameter from gx_default_get_param and gx_default_get_params so that
the systemdict value will get sent to the device (putdeviceprops).

Also found that the JPEG device was using LeadingEdge, but not stripping
off the "LEADINGEDGE_SET" bit. Fix by anding with LEADINGEDGE_MASK.

Lastly, the cups device put_params needs to be able to accept a null
parameter type as the default put_params can.

base/gsdparam.c
cups/gdevcups.c
devices/gdevjpeg.c


2017-08-06 02:23:55 +0800
Sebastian Rasmussen <sebras@gmail.com>
d91d4273f38fb8a527ff342d360cee8aaf468896

Allow for symbol dictionary with 0 symbols.

jbig2dec/jbig2_symbol_dict.c


2017-05-14 17:50:32 +0800
Sebastian Rasmussen <sebras@gmail.com>
b5a27404ff64c427d8bcdbd16742ab15a4f6cda5

Plug leak of parameter info in command-line tool.

jbig2dec/jbig2dec.c


2017-05-14 17:44:45 +0800
Sebastian Rasmussen <sebras@gmail.com>
1d939952cc3262c8e7b31247046f4e7d9c2d7394

Do not grow page if page height is known.

Previously an encountered region segment could cause the page
height to be increased if the segment height/position occurred
outside of the page boundaries. This happened regardless of
whether the page height was previously known or unknown.

jbig2dec/jbig2_page.c


2017-08-05 11:23:25 +0100
Ken Sharp <ken.sharp@artifex.com>
22dca483140d23a73ab7db835e7d923a91745b6f

pdfwrite - begin support for PDF 2.0

Permit CompatibilityLevel to be 2.0 for production of PDF 2.0. We may
eventually make this the default.

Don't write ProcSet resources when creating PDF 2.0
Don't write a Producer etc in the Info dict when creating PDF 2.0
Don't write DOCINFO pdfmarks in the Info dict when creating PDF 2.0
Don't write CharSet key in font dictionaries when creating PDF 2.0
Write FontDescriptor, Widths, FirstChar and LastChar for base 14 fonts
when creating PDF 2.0

Don't write Transfer functions in graphics states when creating PDF 2.0.
We need to add the ability to 'apply' transfer functions for proper
support here.

Need to add support for BlackPointCompensation and (possibly) per-page
OutputIntents when the PDF itnerpreter has been upgraded to support
these.

devices/vector/gdevpdf.c
devices/vector/gdevpdfb.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfi.c
devices/vector/gdevpdfm.c
devices/vector/gdevpdfp.c
devices/vector/gdevpdft.c
devices/vector/gdevpdfv.c
devices/vector/gdevpdtd.c
devices/vector/gdevpdtt.c


2017-08-01 15:57:17 +0100
Chris Liddell <chris.liddell@artifex.com>
dcda07a31c90ff1ece5a92961eb83b58ffc44be4

Bug 697232: URW++ font update from 2017/07/27

Adds blue zones for the top features of numbers in:
NimbusSans-Italic
NimbusSans-Regular

Resource/Font/NimbusSans-Italic
Resource/Font/NimbusSans-Regular


2017-08-04 09:22:36 +0100
Ken Sharp <ken.sharp@artifex.com>
cd1c10382c868b8bd8dba9b52ea7fca970f95eaa

pdfwrite - initialise some new downscale parameters

Bug #698329 "Floating point exception in s_IScale_init()"

Commit a936cf76a33389610b558ffaf5de7389265fd657 to fix Bug #693684
"Add InterpolateControl parameter to limit image interpolation." added
a new parameter 'abs_interp_limit' but omittted to initialise the
variable in pdfwrite's use of the filter.

This led to an unuinitialised variable, which could eventually cause a
divide by zero fault.

It seems this parameter is only used when scaling up, so this commit
simply sets it to the minimum value of 1. At the same time initialise
a couple of other parameters too, these are probably unused and in any
event should be initialised by the filter code, but its best to be safe.

devices/vector/gdevpsdi.c


2017-08-02 13:41:59 +0100
Ken Sharp <ken.sharp@artifex.com>
ca1ec9b486ddba3f921355fd1d775f27f4871356

PDF interpreter - remove the PDFDontUseObjectNum switch

This was implemented to allow us to restore the default behaviour if
it caused problems. No real problems reported, so lets get rid of
(yet another) of our many, many command line switches.

Resource/Init/pdf_font.ps


2017-07-29 18:18:58 +0100
Robin Watts <robin.watts@artifex.com>
cdd2b1bcafdc9108f843183a22360ffbc65525a1

Bug 698034: Fix various problems with MFS downscaling to cmyk.

Firstly, the mfs buffer was not large enough.

Secondly, the downscaling logic in down_core4_mfs was broken - fixed
by copying it from down_core4.

Thirdly, the sense of the mfs was inverted (we had forced the white
spots to be zero).

All in all, my finest work. :(

Fixed here.

base/gxdownscale.c


2017-07-27 13:22:50 -0700
Ray Johnston <ray.johnston@artifex.com>
8321323b7c31828d79c0aa1b5c0312f156a53192

Fix Bug 695333: PDF 1.4 transparency did not support Spot Color clist devices

Not just the tiffsep device named in the bug, but the psdcmyk device would
also fail if the clist was used. This file needs to be in the regression suite.

Fix by adding a pdf14_clist_copy_planes proc that forwards to the underlying
clist device. NB: The pdf14 rendering device already had a copy_planes device
which is used in page mode or during clist playback.

base/gdevp14.c


2017-07-28 15:58:38 +0100
Ken Sharp <ken.sharp@artifex.com>
8b721623f5fee0150822f7ead66ca5820d74e568

Fix a couple of documentation typos

doc/Use.htm


2017-07-28 13:37:17 +0100
Ken Sharp <ken.sharp@artifex.com>
7454690eb64cb71c13e957fc47e9881463d01ba4

Coverity ID 158374 - cater for anerror return

This probably isn't possible, we're getting a repeat form so the original
form must be already stored, but its worth the error check.

devices/vector/gdevpdfi.c


2017-07-28 12:06:01 +0100
Ken Sharp <ken.sharp@artifex.com>
afa8fb82aea663e3da2d7e0e297ca9bc401a1912

Coverity ID 158379 identical branches

Coverity is obviously correct that the two branches are identical. I'm
no longer certain of how this works, but I did test it quite extensively
at the time so I'm going to assume that the code is correct and simply
remove the branch logic which seems to be pointless.

base/gxshade1.c


2017-07-28 11:37:14 +0100
Ken Sharp <ken.sharp@artifex.com>
f26ebc119717475bef5b6fd6068af5f0ab779dc9

Coverity ID 158388 - don't dereference a pointer before checking it is non-NULL

base/gdevdflt.c


2017-07-28 11:08:18 +0100
Ken Sharp <ken.sharp@artifex.com>
0947a042bab551b60f9004366bc06b098b8bdbf3

Coverity ID 158394 - uninitial;ised scalar variable subrs_count[j]

Unlike other instances of this, I can't be certain that its impossible
to read the data when its not been initialised, and in other places
we zero the memory when we change the current hint size, which suggets
that its at least potentially possible, so here we zero the array of
bits (flags).

No differences expected

devices/vector/gdevpsfx.c


2017-07-27 16:33:08 +0100
Ken Sharp <ken.sharp@artifex.com>
e5d24b703e5413732f2ef58d8fcd5b4803865d7c

pdfwrite - don't handle some kinds of x/yshow with TJ

Bug 698218 "Font matrix woes, also with PDF Reader/Writer"

In fact this is not a problem with the FontMatrix. The problem is
actually to do with the way the PDF interpreter executes certain kinds
of operation, basically Fonts where the /Widths array entries don't
match the actual glyph widths.

In this case we use an x/yshow operation with the modified width, and
this works perfectly well for rendering. However, for pdfwrite, we can
try to use the TJ operator, which works in a slightly different way...

xshow takes a displacement which is measured from the origin of the first
glyph to the origin of the following glyph, TJ by contrast adds a
displacement after the first glyph is rendered. Normally we essentially
subtract the width from the displacement to find the TJ value. However,
if the Widths array overrides the glyph width, and the actual glyph
width is significantly different (eg 0), then what happens is that
we apply the modified width after rendering the first glyph, and then
apply the TJ displacement. In effect applying it twice.

Detecting this condition turned out to be essentially impossible, there
are too many cases in PostScript files where similar trickery is pulled
to reliably determine that this occurs. It is, however, rare, especially
in PDF files, because very few fonts are neither horizontal nor vertical
in their FontMatrix (shearing is not uncommon but that's different)

So this commit adds a new boolean which we set false only when we have
a x/yshow operation, and the width and real width do not match (which
happens when we have a /Widths mismatch). This prevents the TJ being
applied and uses direct text positioning commands instead, which works.

devices/vector/gdevpdte.c
devices/vector/gdevpdts.c
devices/vector/gdevpdts.h


2017-07-25 13:55:19 -0600
Henry Stiles <henry.stiles@artifex.com>
44ccac6fb19ec0e3f42b2b51ec4b2b6a4438af71

Add an upper bound for pattern and bitmap source heights.

pcl/pxl/pxptable.c


2017-07-21 13:03:54 -0600
Henry Stiles <henry.stiles@artifex.com>
92e2f00d88d664e5249792458c276b6be89b37fa

Remove unnecessary padding.

pcl/pxl/pximage.c


2017-07-21 10:59:35 -0600
Henry Stiles <henry.stiles@artifex.com>
bcae781b1f4ef69a67c287f187cf871cd5db60f0

Fix 694654 - fuzzing seg fault.

The clip path accumulator device (gxacpath.c) does not support raster
operations so don't install the device if the raster operation is not
default.

To support raster ops the device would need to add procs for get_bits,
get_bits_rectangle, strip_copy_rop, and copy_color (used by get_bits
potentially), then it would need to render the accumulated path using
the current raster operation (it uses "lop_default" now). The
optimization is not useful in real world PCL files so we choose to
bypass it.

base/gsimage.c
base/gximask.c
base/gximask.h


2017-07-18 13:50:33 -0600
Henry Stiles <henry.stiles@artifex.com>
dbb4ea0147655b70ee51c18f9963566057b05dc6

Fix 694643 fuzzing segfault.

It was possible to write past the end of the gs_debug array.

pcl/pcl/pgconfig.c


2017-07-21 09:38:13 -0700
Ray Johnston <ray.johnston@artifex.com>
be281458bc48aa20acd7d276fb1e1713f1966750

Fix bug 694654: Stale cdev->clip_path with image

base/gxclimag.c


2017-07-20 13:23:14 -0700
Ray Johnston <ray.johnston@artifex.com>
0d751be73cfa40e45bee50560873bf01884b9d92

Add ROUNDSPOT function and fix limit on lpi search.

ROUNDSPOT added as growing white circle transitioning to shrinking black
circle.

Also there was an arbitrary limit of lpi <= res/10.0 (y<11) that I changed
to allow things like -l30 -r600 to give more than 100 levels.

toolbin/halftone/gen_ordered/gen_ordered.c


2017-07-25 12:58:02 +0100
Ken Sharp <ken.sharp@artifex.com>
f816b092c1f69c0fed977aa8804dadd04f0296a5

PDF interpreter - cope with corrupted Pattern

Bug #696410 "Seg faults found by fuzzing in pattern_paint_finish (zpcolor.c:321)"

The file no longer seg faults, but it did enter an endless loop, caused
by the pattern code consuming the saved dictionary for the 'q' (gsave)
operation, but leaving another different dictionary on the dictionary
stack.

The code here 'ends' teh current dictionary if it has neither a /n or
/self key, otherwise it calls 'Q' which will end it anyway. This
prevents the loop being endless because countdictstack is greater
than the saved dict count, but the current dictionary isn't the
result of a gsave.

No differences expected

Resource/Init/pdf_draw.ps


2017-07-25 11:30:20 +0100
Chris Liddell <chris.liddell@artifex.com>
f0b4fc4f870ada5264c74c17094c982a66bcb42c

Bug 698287: fix out of bounds access in c_pdf14trans_write

In pdf14_clist_create_compositor() we create a temporary compositor command to
change the compositor procs and avoid creating subsequent compositors (rather
than enable/disable/reconfigure the already existing compositor).

The problem arises because we create and only copy the data defined by
the generic gs_composite_t type, rather than the pdf14 compositor specific
type (gs_pdf14trans_t).

Change so we use, and copy, the full pdf14 compositor command type.

base/gdevp14.c


2017-07-25 11:02:07 +0100
Chris Liddell <chris.liddell@artifex.com>
f98e88cabfa7161ec098e0aaf9d94df52923a212

Move the PCL/PXL/XPS example files into pcl/examples

instead of pcl/tools

pcl/examples/bitfont.pcl
pcl/examples/bitfonts.pxl
pcl/examples/fills.pcl
pcl/examples/fontpage.pcl
pcl/examples/fonts.pcl
pcl/examples/fonts.pxl
pcl/examples/frs96.pxl
pcl/examples/gl-chars.pcl
pcl/examples/grashopp.pcl
pcl/examples/grid.pcl
pcl/examples/label.tst
pcl/examples/lineprinter.pcl
pcl/examples/null.pxl
pcl/examples/opaque.pcl
pcl/examples/origins.pcl
pcl/examples/owl.pcl
pcl/examples/owl2.pcl
pcl/examples/pattern.pcl
pcl/examples/pattern.pxl
pcl/examples/tiger.px3
pcl/examples/tiger.xps
pcl/examples/vasarely.px3


2017-07-21 15:03:16 +0100
Chris Liddell <chris.liddell@artifex.com>
910927d86239c80cc5bc365445c1df7a6e5fa8da

Bug 696387: iccprofile ref counting in gdevp14 compositor

The transparency compositor does extensive swapping and creating of ICC
profiles but was less than well disciplined with the reference counting. This
moves *most* of the profile swapping to a consistent use of the reference
counting.

The one remaining exception is the handling of colors for soft masks, which are
still handled "specially".

base/gdevp14.c


2017-07-13 13:57:30 +0100
Chris Liddell <chris.liddell@artifex.com>
f060b1bffacca60b45b9be1b94a8944ca2608930

Bug 698188: (clist) prevent reading off the end of a bitmap buffer

In clist_copy_mono, when the bitmap is clipped (in the x-direction) we apply
gross clipping to the bitmap data - the "clip" the left edge of the bitmap
to the nearest byte.

The problem is that we then calculate the aligned bitmap raster from that
byte offset. Thus, in the uncompressed case, if we copy the aligned raster
bytes for each scanline, we *can* end up reading off the end of the buffer.

Instead, use width/8 bytes as the amount to copy for each scanline. Then, if
necessary, zero the padding bytes.

base/gxclbits.c


2017-07-06 14:54:02 +0100
Chris Liddell <chris.liddell@artifex.com>
671fd59eb657743aa86fbc1895cb15872a317caa

Bug 698158: prevent trying to reloc a freed object

In the token reader, we pass the scanner state structure around as a
t_struct ref on the Postscript operand stack.

But we explicitly free the scanner state when we're done, which leaves a
dangling reference on the operand stack and, unless that reference gets
overwritten before the next garbager run, we can end up with the garbager
trying to deal with an already freed object - that can cause a crash, or
memory corruption.

psi/ztoken.c


2017-07-13 13:36:19 +0100
Chris Liddell <chris.liddell@artifex.com>
18a2365b69cc43ed4dbe2bfd44f739622623821c

Update fonts to latest URW++ release (2017/05/01)

Plus 2017/07/20 update

Fixes bugs 696582, 697232 and 697058

Resource/Font/C059-BdIta
Resource/Font/C059-Bold
Resource/Font/C059-Italic
Resource/Font/C059-Roman
Resource/Font/NimbusMonoPS-Bold
Resource/Font/NimbusMonoPS-BoldItalic
Resource/Font/NimbusMonoPS-Italic
Resource/Font/NimbusMonoPS-Regular
Resource/Font/NimbusRoman-Bold
Resource/Font/NimbusRoman-BoldItalic
Resource/Font/NimbusRoman-Italic
Resource/Font/NimbusRoman-Regular
Resource/Font/NimbusSans-Bold
Resource/Font/NimbusSans-BoldItalic
Resource/Font/NimbusSans-BoldOblique
Resource/Font/NimbusSans-Italic
Resource/Font/NimbusSans-Oblique
Resource/Font/NimbusSans-Regular
Resource/Font/NimbusSansNarrow-BdOblique
Resource/Font/NimbusSansNarrow-Bold
Resource/Font/NimbusSansNarrow-Oblique
Resource/Font/NimbusSansNarrow-Regular
Resource/Font/P052-Bold
Resource/Font/P052-BoldItalic
Resource/Font/P052-Italic
Resource/Font/P052-Roman
Resource/Font/URWBookman-Demi
Resource/Font/URWBookman-DemiItalic
Resource/Font/URWBookman-Light
Resource/Font/URWBookman-LightItalic
Resource/Font/URWGothic-Book
Resource/Font/URWGothic-BookOblique
Resource/Font/URWGothic-Demi
Resource/Font/URWGothic-DemiOblique
Resource/Font/Z003-MediumItalic
Resource/Init/Fontmap.GS
psi/psromfs.mak


2017-07-24 15:54:41 +0100
Ken Sharp <ken.sharp@artifex.com>
bfed2aa2b1d854d4b63bc75957438e38fca361fc

PDF interpreter - permit Widths arrays to contain indirect objects (!)

Bug 698275 "GPL Ghostscript 9.21: Failed to interpret TT Instructions"

The actual problem is that the PDF file contains a Widths array where
one or more of the entries is an indirect object. Since this has no
useful purpose beyond making the PDF file larger I can't think why this
has been done.

Nevertheless, as usual 'Acrobat accepts it' so now we do too.

The complain about the TT instructions is because in addition the file
contains two TrueType fonts which are broken.

Resource/Init/pdf_font.ps


2017-07-19 22:05:33 -0700
Ray Johnston <ray.johnston@artifex.com>
983e56cb679768fe5a048fbb33a43259efb9afbf

Fix Bug 696398: Segfault with fuzzing file.

Oveflow of integer caused later failure even if allocation of the
ht_buffer succeeded. Detect overflow, return error.

base/gxht_thresh.c


2017-07-19 12:13:30 -0700
Ray Johnston <ray.johnston@artifex.com>
877cbdf0b279bb4bf5f3b74182ab6d0101095f99

Fix bug 696402: Segfault with fuzzed data caused by dda overflow.

The ty of the matrix in the fuzzed data was a very large value that
resulted in the Y for an image being near the limit for the dda,
so the first step (dda_next) overflowed from positive to negative
resulting is a large destination height calculation (vdi). Prevent
this by not stepping if it would cause an overflow. This will be
outside the clip limits, so will not affect the output.

base/gxidata.c


2017-07-20 13:36:46 +0100
Ken Sharp <ken.sharp@artifex.com>
91fd78617440c18288b6d4cd226fa3f77db91705

Update the nulldevice for DeviceN

Bug #696383 "Seg faults found by fuzzing in get_num_pdf14_spot_colors (gstrans.c:720)"

The problem here is really an example of our poorly maintained device
API. As stated previously the comments in the code seem to indicate
that all devices should either implement their own versions of all
the device methods, or use the graphics library default method. No
device method should be NULL, so it should never be necessary to check
this.

Sadly, many of our devices have NULL entries for some methods, and in
this case the nulldevice did not implement a method for
'ret_devn_params'. Presumably this was missed when the mthod was added.

In this commit, just up date the device to use the default method.

base/gdevnfwd.c


2017-07-18 16:36:15 +0100
Ken Sharp <ken.sharp@artifex.com>
64cb7a492292eb40a01de760be832b7d5425d8e9

PDF interpreter - detect and ignore recursive Form XObjects

Bug #698226 "Error: /rangecheck in --run--"

The PDF file supplied in the bug is broken, it has a Form XObject:

285 0 obj
<<
/BBox [ 294.572 797.586 306.188 793.466 ]
/Group 287 0 R
/Matrix [ 1 0 0 1 0 0 ]
/Resources <<
/ExtGState <<
/GS0 32 0 R
>>
/XObject <<
/Fm0 285 0 R
>>
>>
/Subtype /Form
/Length 58
>>
stream
q
0 Tc 0 Tw 0 Ts 100 Tz 0 Tr []0 d
/GS0 gs
0 TL/Fm0 Do
Q
endstream
endobj

The file throws an error in Acrobat, Ghostscript recurses the Form until
it hits an execstackoverflow, and is then unable to proceed. Testing
Acrobat we see that it can detect recursion even when its not a simple
self-reference, a child referencing a parent is also detected and
ignored.

In the PDF interpreter we normally push a dictionary on the operand
stack and record objects as we encounter them, checking each new one
against all the ones executed so far, and exit if we find reuse. This
approach doesn't quite work for Form XObjects, because we cannot be
certain of the operand stack shape when a Form is executed, and so we
cannot locate our dictionary.

Instead we now store the dictionary in the top level 'pdfdict' which is
always available. The technique is otherwise the same.

I'm not totally happy with this, but its the best compromise between
performance hit, memory use and code frailty I could come up with.

No differences expected.

Resource/Init/pdf_draw.ps
Resource/Init/pdf_main.ps


2017-07-13 16:02:16 -0600
Henry Stiles <henry.stiles@artifex.com>
cea2da4aae1edbf6aef128f44962cfe8baa5c728

Fixes Bug 697900 - No support for disk resident fonts.

Support added for using PCL font resources from the PJL file system.
Macros have always been supported and using a font wrapped in a macro
as a workaround works, but this isn't quite correct or convenient.
Also refactoring and better error handling for alphanumeric key support.

pcl/pcl/pcsfont.c


2017-07-12 08:53:21 -0600
Henry Stiles <henry.stiles@artifex.com>
8d195215c057f4df0c609828b5da65c7f3462588

Fix bug #697650 - RemoveFont opearator error handling.

The RemoveFont operator produced an error and stopped processing when
the font was not found, now we produce a warning and continue like HP.
Other areas of the code needed tidying up as well. The
px_widen_font() function did not NULL the font output parameter
according to its spec and RemoveFont did not check there wasn't an
error before attempting to remove the font from the font dictionary

pcl/pxl/pxffont.c
pcl/pxl/pxfont.c


2017-07-17 09:19:14 +0100
Ken Sharp <ken.sharp@artifex.com>
798bc40317ba4b552560f4ceede1607c561ef54c

pdfwrite - remove the 'deferred free' code

Now that the memory cleanup is completed, we can remove the 'hack'
that defers really freeing freed memory in the memory manager.

devices/vector/gdevpdf.c


2017-07-13 13:43:45 +0100
Ken Sharp <ken.sharp@artifex.com>
091b860bcde7fc610cff89b7711c59597dc06674

pdfwrite - memory management cleanup

Bug #696608 "Use after free error in PDF write"

As per the instructions in the original bug report, filling free memory
with 0x00 causes seg faults because of 'use after free' conditions in
the pdfwrite resource management.

There were a number of problems solved in order:

1) Move freeing of colour spaces until after shadings are freed, because
shadings can refer to colour spaces.

2) Colour space and function resources can reference other resources of
the same type. clear such references before freeing the resources.

3) 'Other' resources can potentially reference other resource types
(seen with Colorant dictionaries referencing colour spaces). We need to
clear these references before freeing the resource types. Also, move the
freeing of 'other' resources until nearer the end.

4) The 'Metadata' resource was previously added to the Catalog
dictionary after the 'Other' resources were freed, so the fact that it
was double referenced (once from resourceOther, once from 'global named
object' wasn't a problem. Now that we free 'other' resources later,
this could lead to double freeing. Explicitly remove the Metadata
reference from the 'other' resource chains to prevent this.

Running this on the cluster fixes all the pdfwrite problems, it does
however leave one file which still causes problems, just not with pdfwrite.

Bug688308.ps seg faults on the cluster with differing configurations,
it isn't stable, so I suspect garbage collection may be involved. Its a
rather complicated page from a yellow pages directory, and involves
numerous EPS files from varied sources. Unfortunately I can't reproduce
a problem locally.

However, its not a pdfwrite problem.

devices/vector/gdevpdf.c
devices/vector/gdevpdfe.c
devices/vector/gdevpdfo.h
devices/vector/gdevpdfu.c
devices/vector/gdevpdfx.h


2017-07-10 15:06:36 -0600
Henry Stiles <henry.stiles@artifex.com>
7276327a2f78290a7d526df493d92325947a834d

Bug 698147 - PXL "passthrough" initialization problem.

Don't let PCL clear the current page if XL has marked the page.
Thanks to Norbert Janssen for the patch.

pcl/pxl/pxpthr.c


2017-07-10 11:09:57 -0600
Henry Stiles <henry.stiles@artifex.com>
ec906d206f6ed044b6b7e1b1cc7551150b8db6d4

Bug 698125 - JPEG RGB not grayscaled.

Using the XL JPEG compression scheme it is possible to have a mismatch
between color space in the graphics state and image. This cannot
happen in any other PXL raster format except JPEG and we expect it
will rarely happen in the normal workflows. We detect the the
mismatch and convert the rgb triples to gray triples in advance of
rendering the scanline.

pcl/pxl/pximage.c


2017-06-28 17:14:14 -0600
Henry Stiles <henry.stiles@artifex.com>
df8ac78c06cc6093409142aaee839cd4bf953588

Renaming and refactoring, no functional differences.

In particular, we get rid of the "universe" structure and move its
members into the main instance.

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


2017-07-06 13:57:41 -0700
Ray Johnston <ray.johnston@artifex.com>
21e28148792158aba5cf2b93fad755455d0cc8ba

Fix viewpbm.ps FITPAGE SCALE option

lib/viewpbm.ps


2017-07-05 08:45:10 -0700
Ray Johnston <ray.johnston@artifex.com>
12cb9d16d69cd3430b86d0bdfea7f73fcbeeceb3

Fix regression from InterpolateControl change that affects pattern-clist

Seen with comparefiles/Bug689851.pdf as missing interpolation.

The clist_make_accum_device did not copy the interpolate_control value
from the target. Also copy the params for non-clist pattern accum
devices and forwarding devices along with graphics_type_tag.

base/gdevnfwd.c
base/gxclist.c
base/gxpcmap.c


2017-07-05 10:59:18 +0100
Robin Watts <robin.watts@artifex.com>
6b24e08b26bbd99082e36785fe742108ab705c23

Bug 698135: Import security fix for OpenJPEG

https://pdfium.googlesource.com/pdfium/+/463b77b4f1e4257cd89f3460b5a6fdb102f44265%5E%21/#F0

Patch doesn't apply cleanly, but requires some manual conflict
resolution.

openjpeg/src/lib/openjp2/dwt.c


2017-07-05 14:31:31 +0100
Ken Sharp <ken.sharp@artifex.com>
095a0c9e9c16b5c131709d2d831f97a77084f1bd

pdfwrite - prevent substitution of an SMask for an identical parent image

Bug #698128 "PDF created by gs generates "recursive /SMask" messages when run with gs"

When we have the (highly unusual) case where an image dictionary has an
SMask entry, and the SMask is an image which is identical to the parent
in every respect (dictionary contents, stream data) except for the
SMask key, it was possible for pdfwrite to decide to use the SMask
instead of the image.

This leads to a PDF which has an image which references an SMask in the
image dictionary, and the SMask is the same image XObject.

In this commit, when checking for an identical image, if the image we
find is the same as the 'current' softmask image, then do not treat it
as identical. This prevents us inadvertently detecting an image and its
SMask as being the same image.

devices/vector/gdevpdfj.c


2013-06-05 10:07:47 -0700
Ray Johnston <ray.johnston@artifex.com>
a936cf76a33389610b558ffaf5de7389265fd657

Bug 693684: Add InterpolateControl parameter to limit image interpolation.

Previously, we always interpolated to the full device resolution. This
parameter allows control of the resolution of the interploated image
which makes sense for devices that cannot render continuous tone at
the device resolution due to halftone cell size. This avoids the
overhead of interpolation beyond what the device can reproduce and
allows the user a quality/performance tradeoff.

The -dDOINTERPOLATE is equivalent to -dInterpolateControl=-1 and the
-dNOINTERPOLATE is equivalent to -dInterpolateControl=0. These options
still work for PS/PDF files, but are deprecated and may be removed in
the future.

Performance results vary, but using the -dInterpolateControl=4 is
4.5 times faster with files that have images that are scaled up and cover
a large portion of the page such as comparefiles/Bug695221.ps at 600dpi.

Resource/Init/gs_img.ps
Resource/Init/gs_init.ps
base/gsdparam.c
base/gxdevcli.h
base/gxdevice.h
base/gxht.c
base/gxiscale.c
base/lib.mak
base/siscale.c
base/sisparam.h
devices/devs.mak
devices/gdevbit.c
devices/vector/gdevpsdi.c
doc/Use.htm


2017-06-27 15:56:01 -0700
Ray Johnston <ray.johnston@artifex.com>
e56286167cad5a5fba3e0b8911d9a54b6a5a5400

Speed up image interpolation with UseFastColor

The check for dev_profile->usefastcolor was buried way down in the ICC
remap logic after getting a link, etc. then eventually returning the
is_identity that would skip transforming the color. Also check in the
image_class0_interpolate function to disable use_icc so that it uses
the faster image_render_interpolate rather than the interpolate_icc
versions.

base/gxiscale.c


2017-06-29 15:13:03 -0600
Henry Stiles <henry.stiles@artifex.com>
9ed740e848891de10af6f85bd234298ac2bbab7b

Fix fuzzing Bug 694668 - CCITT fuzzing.

Bounds check CCITT Columns.

pcl/pcl/pcl.mak
pcl/pcl/rtraster.c


2017-07-04 12:11:33 +0100
Ken Sharp <ken.sharp@artifex.com>
676ad40aed33815aea7bf65cb9f374b79b1d8518

pdfwrite - fix /Colorants when converting DeviceN colour spaces

Bug 698129 "Produced PDF that gives "Wrong operand type" in Acrobat for some pages"

The supplied example uses a Duotone witha CMYK alternate and a Colorants
array (for the Pantone colour only). When converting to a different
space we preserve the Spot colours (and therefore DeviceN) but we
convert the alternate space to the specified base space by sampling the
original space.

However, if the DeviceN space contained a Colorants array we were writing
the new colour space array with the Colorants inserted in the wrong
position, immediately after the ink array instead of at the end.

This commit moves the Colorants entry to the correct place, and also
adds the (previously missing) Subtype key to the Colorants dictionary.

devices/vector/gdevpdfg.c


2017-07-01 16:36:29 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f1cfdcd88da67bcab1efbed26191d27a0ce00a53

Bug 694626: Prevent SEGV due to division by zero.

Add bounds checking in ttfFont__Open to default nUnitsPerEm to 1024 as
precedented in ttfOutliner__Outline.

base/ttfmain.c


2017-06-29 11:20:09 +0100
Chris Liddell <chris.liddell@artifex.com>
0b7fa9293f43dce8aea028e4d2b32da1d8fc18c8

Add error checking for gs_colorspace_set_icc_equivalent()

base/gscdevn.c
base/gsciemap.c
base/gscolor2.c
base/gscsepr.c
base/gstrans.c
base/gxcmap.c
base/gxipixel.c
base/gxiscale.c
base/gxshade.c


2017-06-29 11:00:38 +0100
Chris Liddell <chris.liddell@artifex.com>
d592ee18a9168b1190bc7f7a1426b41fa6d508af

Bug 698151: XPS: bounds check selecting cmap table.

xps/xpsfont.c


2017-06-29 10:54:49 +0100
Chris Liddell <chris.liddell@artifex.com>
0c39ac5a0b8ca650101ac6322be34bd7504e7f63

Bug 698150: XPS: bounds check in format 6 and 10 cmap tables

xps/xpsfont.c


2017-06-29 12:07:29 +0100
Robin Watts <robin.watts@artifex.com>
ad0ac7883807331c1c9afb0b87585838bd3e63be

Bug 697981: Avoid integer overflow problems in scan converter.

Positions can be anywhere in the signed range 0x80000000..0x7fffffff,
therefore the difference between those positions can overflow a
signed 32bit representation.

base/gxscanc.c


2017-06-28 17:03:24 -0600
Henry Stiles <henry.stiles@artifex.com>
d4681a07410f96ee68479e0c39f1ca6f27168b8f

Fix Bug 694656, Seg faults found by fuzzing in hpgl_get_char_width

Along with checking that there is a valid font make sure there is a
current font selection, if not recompute the current font.

pcl/pcl/pglabel.c


2017-06-28 20:29:47 +0100
Robin Watts <robin.watts@artifex.com>
1d9dc902167802515d8ee86bf4e2205461486b50

Squash some warnings in gsmchunk.c

base/gsmchunk.c


2017-06-07 19:16:46 +0100
Robin Watts <robin.watts@artifex.com>
af4317bc527142dd0b8a6032799c4accf40bf835

MSVC: Squash double->float implicit cast warning.

devices/vector/gdevpdfv.c


2017-06-07 19:14:16 +0100
Robin Watts <robin.watts@artifex.com>
f204ddc13530f1bdb180eb38ebcf5a96caab8b74

MSVC: Fix some implicit casting warnings in ft_api.c

Simply make the castings explicit.

base/fapi_ft.c


2017-06-27 19:18:32 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
3a684e3dcc55c27506dc179723e8bcd85d121aa7

Bug 694670: Prevent buffer overrun.

Add bounds checking in pxSetHalftoneMethod to prevent a buffer
overrun.

pcl/pxl/pxink.c


2017-06-22 22:14:59 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
25d4e951e5290a34354f633f46d57cb6870fbd5d

Bug 694681: Prevent buffer overrun.

Move bounds checking earlier in pxReadRastPattern to prevent a buffer
overrun when StartLine attribute is set to non-zero.

pcl/pxl/pximage.c


2017-06-27 09:58:44 -0700
Michael Vrhel <michael.vrhel@artifex.com>
dc09d291658c1758fe2a0a02776e66355f56b09a

Bug 698134 Text knock with alphabits

The pdf14_copy_alpha operation was not updated
when fixes were made to properly handle non-isolated
knockout groups.

base/gdevp14.c


2017-06-27 15:33:22 +0100
Chris Liddell <chris.liddell@artifex.com>
6ce668c11ccbadde6d76430ba00205eca853879e

Bug 698130: check the icc profile data exists before accessing it

base/gscsepr.c


2017-06-26 10:04:02 +0100
Chris Liddell <chris.liddell@artifex.com>
74ce33d1fdb26af4e15a58e5df91dbb1403f66f9

Drop the now redundant check for zero length, staight contours

when degenerating the outline into moveto/lineto/curveto operations.

base/gxfapi.c


2017-06-26 09:58:11 +0100
Chris Liddell <chris.liddell@artifex.com>
6d17251a6c22673854bcd288d8562650361847e5

Bug 697983: (re-redux) Drop zero length contours from glyph outlines

Zero length contours cause issues (line-caps) when the outline is stroked.

Turns out the same problem can arise with arcs as with straight lines.

That complicates things where TTFs are concerned since we have to convert cubic
to conic splines, and the floating point errors make it dubious checking for
point equality after the conversion. As a result, the checking has to be done
in the scaler specific interface code, rather than in the scaler independant
FAPI code.

That just means if we ever integrate another scaler that can handle
downloadable fonts, we need to take care to include the same checks as are
now in the Freetype interface code.

base/fapi_ft.c


2017-06-20 06:50:49 -0600
Henry Stiles <henry.stiles@artifex.com>
793f93b08813e898aa0f1b316619e33568275fb0

Fix Bug 697926, processing jpeg embedded color parameters.

HP ignores the height, width and color components provided with the
raster commands and uses the values in the embedded JPEG.
Consequently, we have to defer beginning the image until the image
data arrives.

pcl/pxl/pximage.c


2017-06-21 01:07:17 +0800
Sebastian Rasmussen <sebras@gmail.com>
4942c650d9ab84671724e1f98541829ba8b6ff80

Adapt tools to use renamed gpcl6 binary.

pcl/tools/docov.pl
pcl/tools/pcl2pdfwr
pcl/tools/pcl2pdfwr.bat
pcl/tools/plot2pdf.sh
pcl/tools/smoke_check.sh
pcl/tools/smoke_update.sh


2017-06-21 16:01:39 +0100
Ken Sharp <ken.sharp@artifex.com>
3b6625b9f04daedf678a137475858ad35b991052

pdfwrite - don't arbitrarily alter the 'current' shape alpha

Bug 697472 "Transparent box appears lighter"

Whenever we opened a substream, if it was an XObject resource we would
set the blend mode and shape alpha to the default values.

This looks wrong to me, and it means that when using a complex ExtGState
which includes a SMask, if there was an alpha other than 1 in the
ExtGState then we would write the constant alpha out twice, once
in the page content, and once again in the resulting Group Form
XObject which we create. If the alpha was not 1, then this causes it
to be applied twice, resulting in rendered content which is too pale.

Both of these look incorrect, but removing the blend mode causes other
files to fail. Removing the shape alpha causes progressions in a number
of test suite files.

devices/vector/gdevpdti.c


2017-06-21 07:38:01 -0700
Ray Johnston <ray.johnston@artifex.com>
e178c1c3a45076fcffbe703c722b4f9bca0ac532

Fix typo in previous commit s/b PageUsesTransparency

examples/transparency_example.ps


2017-06-20 17:57:26 -0700
Ray Johnston <ray.johnston@artifex.com>
670840afcd100f4751b911cf4ac3bf0415ba55c2

Bug 698087: Heap buffer overflow with confused clist colorspace

The PDF14 transparency compositor changes the colorspace to Gray
(8-bit), but if a 1-bit deep device is the target device, and the
normal startup for transparent pages doesn't happen, the playback
would write 8-bit data to a 1-bit deep buffer

Also fix the transparency_example.ps so that it sets the device param
PageUsesTransparency which is expected.

examples/transparency_example.ps
psi/ztrans.c


2017-06-20 15:39:22 +0100
Chris Liddell <chris.liddell@artifex.com>
7258589eb5005d05c1499e717da8de804e1c35e1

Bug 698069: tighten up the out-of-data condition in spgetcc

base/stream.c


2017-06-20 10:06:51 +0100
Chris Liddell <chris.liddell@artifex.com>
8aaacf3f8d3837b471fc302de0a84c85ecb24307

Bug 698081: more bounds checking in xps_load_sfnt_name

xps/xpsfont.c


2017-06-19 13:26:02 +0100
Ken Sharp <ken.sharp@artifex.com>
605af24e8adcbc71bec1c5e1283dc20eabfbc515

Yet another check on raster memory for get_bits_rectangle

Bug #698073 "Potential null pointer dereference in mem_word_get_bits_rectangle"

Not the same reason, but still a potential use of dev->line_ptrs, which
can be NULL If you mangle makeimagedevice and copyscanlines.

base/gdevmem.c


2017-06-19 10:02:34 +0100
Ken Sharp <ken.sharp@artifex.com>
a5c6f7da872845b1d9bf2025c0cd5fc98b937d90

PS interpreter - remove 'STRICT' and remove from documentation

The 'STRICT' switch is documented as removing as many Ghostsctipt
extensions as possible. In reality it only removes some media size
definitions from statusdict.

This seems less than useful, so remove it to reduce clutter.

Resource/Init/gs_init.ps
Resource/Init/gs_statd.ps
doc/Use.htm


2017-06-19 09:46:21 +0100
Ken Sharp <ken.sharp@artifex.com>
2fa6beaa40144c592661a611bf35ff6f06d3354f

Tools - remove ps2ascii.ps, recode scripts to use txtwrite

ps2ascii.ps uses DELAYBIND, which we would like to get rid of, in
addition it doesn't do a terribly good job of actually extracting text.
The txtwrite device is more sophisticated, although it does not have the
added 'COMPLEX' feature of ps2ascii.ps which emits strokes and fills
as rectangles.

If the COMPLEX feature set should prove useful enough it would be easy
to add this functionality to a new device, but in reality I doubt
anyone is using this. The scripts specifically set -dSIMPLE.

This allows us to deprecate DELAYBIND and in future remove it.

lib/ps2ascii
lib/ps2ascii.bat
lib/ps2ascii.cmd
lib/ps2ascii.ps


2017-06-17 17:06:32 +0100
Ken Sharp <ken.sharp@artifex.com>
8f796773b5aae90362ec500d942dc38e6a1f0f6b

PS interpreter - deprecate DELAYBIND, remove from documentation

DELAYBIND seems like a bad idea, we suspect there is nothing it does
which cannot be achieved another way.

For now we will continue to allow it, but user will have to set
-dREALLYDELAYBIND instead, setting -dDELAYBIND will trigger a warning
message and an error.

Resource/Init/gs_init.ps
doc/Language.htm
doc/Use.htm


2017-06-17 16:13:57 +0100
Ken Sharp <ken.sharp@artifex.com>
0a41e707c2ca9a9243df640b32c5abe372be1f53

PS interpreter - remove NOBIND option and all references

This was only ever supposed to be a 'debugging aid' and its something
of a struggle to see why it would be useful.

Resource/Init/gs_dps1.ps
Resource/Init/gs_init.ps
Resource/Init/gs_ll3.ps
doc/Language.htm
doc/Use.htm


2017-06-17 14:27:06 +0100
Ken Sharp <ken.sharp@artifex.com>
c294b131ea270cea5d66c9b0a6ea61d3a69a20a0

PS interpreter - fix use of superexec with DELAYBIND

Commit 8556b698892e4706aa0b9d996bec82fed645eaa5 removed superexec from
systemdict, leaving it in internaldict, where it should be. However,
if we run with DELAYBIND then by the time we come to bind the procedures
which use superexec the definition in systemdict is gone.

Technically this shouldn't be a problem, as we should be using the version
in internaldict. But if we do that, without DELAYBIND the internaldict
definition isn't present, because we haven't copied it yet....

So now we look for the presence of superexec in systemdict and use that
one if its present, otherwise we assume its in internaldict and use
that instead.

Unfortunately the use of DELAYBIND interferes with the cluster testing
causing thousands of files to fail. I've run a random selection of them
locally in a normal setup and they work, I guess we'll just have to
hope for the best and fix any problems as they are reported.

Resource/Init/gs_dps1.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_ttf.ps
Resource/Init/gs_type1.ps


2017-06-17 11:17:52 +0100
Ken Sharp <ken.sharp@artifex.com>
971472c83a345a16dac9f90f91258bb22dd77f22

Make operator hiding work with DELAYBIND

Commit 1497d65039885a52b598b137dd8622bd4672f9be undefines as many operators
as possible once startup is completed, in order to prevent potantially
malicious PostScript or PDF files using them.

However, if DELAYBIND (itself a gaping security hole if used) is
specified, this leads to an endless loop. Instead we must undefine the
operators during .bindnow (after the deferred binding has occured).

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


2017-06-13 00:45:54 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
4bf1f491517c4d1f30f594a77ea4adbef263bfc9

Bug 694639: Prevent buffer overrun.

Add bounds checking in pxReadRastPattern to prevent a buffer overrun when
StartLine attribute is set to non-zero.

pcl/pxl/pximage.c


2017-06-16 15:40:33 +0100
Chris Liddell <chris.liddell@artifex.com>
824aa630e2d4ce5b53e78cf8b2686ee6acb7a5fe

Bug 698066: Ensure device has raster memory before using it

Same solution as Bug #697676

This is only possible by abusing/mis-using Ghostscript-specific
language extensions, so cannot happen in a general PostScript program.

Nevertheless, Ghostscript should not crash. So this commit checks the
memory device to see if raster memory has been allocated, before trying
to read from it.

base/gdevmpla.c


2017-06-16 09:03:14 +0100
Chris Liddell <chris.liddell@artifex.com>
260fefe6504653742a623d416fcf73f6b2559579

Bug 698065: xps: fix reading of idRangeOffset in cmap table

In format 4 cmap tables the idRangeOffset was being read as a signed value,
but it is unsigned.

xps/xpsfont.c


2017-06-16 08:50:43 +0100
Chris Liddell <chris.liddell@artifex.com>
961b10cdd71403072fb99401a45f3bef6ce53626

Bug 698064: bounds check xps_encode/decode_font_char_imp

xps/xpsfont.c


2017-06-16 08:29:25 +0100
Chris Liddell <chris.liddell@artifex.com>
c501a58f8d5650c8ba21d447c0d6f07eafcb0f15

Bug 698063: Bounds check Ins_JMPR

base/ttinterp.c


2017-06-15 09:05:20 +0100
Chris Liddell <chris.liddell@artifex.com>
937ccd17ac65935633b2ebc06cb7089b91e17e6b

Bug 698056: make bounds check in gx_ttfReader__Read more robust

base/gxttfb.c


2017-06-15 08:58:31 +0100
Chris Liddell <chris.liddell@artifex.com>
7755e67116e8973ee0e3b22d653df026a84fa01b

Bug 698055: bounds check zone pointer in Ins_MDRP

base/ttinterp.c


2017-06-14 22:00:52 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
f887813ad00d680e2ea5d81606fd21d1b68067af

Bug 694662: Bounds check formlines in pcl_vmi_default()

Added bounds checking to clamp value between a minimum of 5 and a
maximum of 128.

pcl/pcl/pcursor.c


2017-06-13 22:35:37 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
3749bc274be1ae5a2f9897447708e84418ccf7a4

Bug 694653: Prevent buffer overrun.

Add bounds checking to pcl_character_data to prevent a buffer overrun if
the continuation data total is greater than font_data_size.

pcl/pcl/pcsfont.c


2017-06-14 16:07:02 +0100
Chris Liddell <chris.liddell@artifex.com>
db85b2782543f6dc6397a2e87c6beefc00b25b54

Fix mistake introduced with the pcl glyph data bounds checking code

When I added the bounds checking for PCL glyph data, I changed slightly the
way offsets were calculated for the PXL 'error handler' bitmap font so
we could know the data length.

I messed up, and forgot to fully take account of the first byte being the
char code, and not part of the bitmap data.

pcl/pxl/pxerrors.c


2017-06-14 15:14:30 +0100
Chris Liddell <chris.liddell@artifex.com>
4992ef5bc283a6347737f1369ef3d7bd4efbdce1

Bug 697983: (redux) Drop zero length contours from glyph outlines

When a outline glyph has contours with only one point in it, we end up with
a moveto and a lineto the same point, thus resulting in a zero length line
segment. This causes problems when the outline is stroked (line caps).

We'll now drop these pointless lineto operations.

Resource/Init/pdf_ops.ps
base/gxfapi.c
base/lib.mak


2017-06-14 10:46:27 +0100
Chris Liddell <chris.liddell@artifex.com>
80f4cc558efdd73be26ede4057ac1750b0b34210

chunk allocator: on free, use original size for single object chunk

On allocation, we decide, based on the requested size (+ house keeping data)
if an object should be in a chunk on its own. But the size recorded can be
larger than that if the chunk was recovered from the free list (because the
free list can contain merged free chunks). In such a case, we also record the
padding bytes.

On freeing, we have to use the object size minus the object padding to
identify single object chunks - to mirror the decision making in the allocation
code.

Fixes the cluster segfault with C410.bin and bitrgbtags

base/gsmchunk.c


2017-06-14 10:14:51 +0100
Chris Liddell <chris.liddell@artifex.com>
3ee55637480d5e319a5de0481b01c3346855cbc9

Bug 698050: xps: bounds check offset for requested cmap table

xps/ghostxps.h
xps/xpsfont.c
xps/xpsglyphs.c


2017-06-14 09:30:45 +0100
Chris Liddell <chris.liddell@artifex.com>
3c2aebbedd37fab054e80f2e315de07d7e9b5bdb

Bug 698044: restrict font name length to the buffer size.

xps/ghostxps.h
xps/xpsfont.c
xps/xpsttf.c


2017-06-14 09:16:02 +0100
Chris Liddell <chris.liddell@artifex.com>
c53183d4e7103e87368b7cfa15367a47d559e323

Bug 698042: xps: fix glyph index and index bounds check.

If a gs_glyph has the GS_MIN_GLYPH_INDEX offset, we need to remove the offset
before we try to use it.

Secondly, using a unsigned variable for a value from which we subtract 1, and
which can be zero doesn't work well. Switch to a signed value.

xps/xpsttf.c


2017-06-14 09:28:34 +0100
Ken Sharp <ken.sharp@artifex.com>
6cf7a8c45517d5857aa81cf59a82a2cc5c7d021c

PDF interpreter - fix a problem with AcroForm interpretation

No bug for this, noticed in passing while working on a customer bug.

If we turn on AcroForm processing, and we have an AcroFOrm where a /Tx
field has a /V entry, then we would not write the value to the string we
are accumulating. We would only write the value if we had no /V but a
/DV.

Instead the string was left on the stack, leading to an error. This
appears to be due to a logical error when writing the V/DV handling
where the write== was placed inside the if clause, when it should be
outside the clause.

Resource/Init/pdf_draw.ps


2017-06-13 06:58:32 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
fe61712d5157066212d0fcee79b129d6ddcbd251

Bug 694657: Prevent SEGV due to missing font.

Updated pcl_reselect_font to check for missing font.

Updated hpgl_select_stick_font to initialise font->storage before it is
used in pcl_downloaded_and_bound.

pcl/pcl/pcfsel.c
pcl/pcl/pglabel.c


2017-06-12 18:05:14 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
8e1acddeb57e9cbb105ec9ff9e65d35005cac44f

Bug 694648: Prevent buffer overrun.

Add bounds checking to pl_tt_string_proc to prevent a buffer overrun if
the incoming offset value is greater than the header size.

pcl/pl/plchar.c


2017-06-12 17:50:58 +0100
Chris Liddell <chris.liddell@artifex.com>
284f5fe121d8eb0a0f50a6f2465ee2f99a061018

mkromfs needs linked to zlib when using shared zlib

Ensure the compiler/linker command line parameter gets propagated from configure
to the mkromfs build.

Makefile.in


2017-06-12 13:15:17 +0100
Chris Liddell <chris.liddell@artifex.com>
98f6da60b9d463c617e631fc254cf6d66f2e8e3c

Bug 698026: bounds check zone pointers in Ins_IP()

base/ttinterp.c


2017-06-12 13:08:40 +0100
Chris Liddell <chris.liddell@artifex.com>
c7c55972758a93350882c32147801a3485b010fe

Bug 698024: bounds check zone pointer in Ins_MIRP()

base/ttinterp.c


2017-06-12 12:59:38 +0100
Chris Liddell <chris.liddell@artifex.com>
d2ab84732936b6e7e5a461dc94344902965e9a06

Bug 698025: validate offsets reading TTF name table in xps

xps/xpsfont.c


2017-06-10 14:06:49 +0100
Ken Sharp <ken.sharp@artifex.com>
f6507e828ddfe1f60645bc925bff9bedfdb306ce

graphics library - fix memory leak regression

Bug # 698005 "regression: commit 70cfc6afc42b9c299e9c05359f12455055105fac with Bug692720.pdf"

Commit 70cfc6 created a path from a list of rectangles early in a clip,
in order to minimise the number of times the path was created (creating
it later caused it to be discarded and re-created multiple times)

Unfortunately, as I feared at the time, this introduced a memory leak
under certain conditions. When the clip_path is discarded we weren't
counting down the reference to the path_list.

With this commit Bug697270.pdf uses approximately the same amount of
memory as it did before commit 70cfc6, but runs approximately 20%
faster.

The regular cluster run also seems to exhibit a further ~20% improvement
in performance, presumably in addition to the existing 10% from the initial
commit. Note, this *only* affects configurations where the clist is
used.

base/gxcpath.c


2017-06-08 16:57:25 +0100
Ken Sharp <ken.sharp@artifex.com>
a4f2cd23893cabe466d977668975987f925278d2

pdfwrite - keep using /Subsample for /Indexed images when downsampling

Bug #698000 "Inappropriate choice of downsampling filter for Indexed images"

For Bug #693917 we checked the downsampling factor for the Subsample and
Average downsampling filters and, if it was not an integer or nearly so,
we forced the Bicubic filter instead.

Unfortunately, this doesn't work well for image data in a /Indexed colour
space.

Instead this commit checks the colour space and, if its a /Indexed space,
forces the downsampling factor to the nearest integer, and preserves the
Subsample or Average filter.

devices/vector/gdevpsdi.c


2017-06-08 15:43:42 +0100
Chris Liddell <chris.liddell@artifex.com>
2a9d6adb5239e797eec3358518950e49565730b0

Bug 697983: avoid marking zero length glyph contours

The file contains many glyphs with stray zero length contours dotted around the
'main body' of the glyph outline. When a text rendering mode involving stroke
was used, these were resulting in the linecaps being drawn, and showing as
extra dots around the gylphs.

Force linecap to 'butt' when using a stroking text rendering mode to avoid this.

Resource/Init/pdf_ops.ps


2017-06-07 14:55:12 +0100
Chris Liddell <chris.liddell@artifex.com>
cfde94be1d4286bc47633c6e6eaf4e659bd78066

Bug 697985: bounds check the array allocations methods

The clump allocator has four allocation functions that use 'number of elements'
and 'size of elements' parameters (rather than a simple 'number of bytes').

Those need specific bounds checking.

base/gsalloc.c


2017-06-07 14:27:51 +0100
Robin Watts <robin.watts@artifex.com>
70cfc6afc42b9c299e9c05359f12455055105fac

Bug 697679: Ensure clist playback correctly creates clip paths.

Ghostscript clip paths consist of 3 parts:

1) A list of scan converted rectangles that union together to give
the clipping region.
2) (Optionally) a path that represents the clipping region.
3) A path_list structure (a list of paths that when intersected
together give the required clipping region).

3 is required for high level devices like pdfwrite (and the opvp
device).

Most of the code is at pains to preserve path_list as gx_cpaths are
manipulated. The exception to this appears to be the clist code.
The rectangle list is sent through the clist, but the path is not.

Accordingly, the code to intersect a gx_cpath with another path
checks to see if the path_list is valid on entry. If not, it
synthesizes one from the rectangle list.

This bug is caused by the fact that we end up intersecting a
clip path 120000 times in a pattern clist playback. Each of those
synthesizes a path from the rectangle list.

The fix here is to make the pattern clist playback create the
path_list each time it is replayed, meaning we have < 100 such
operations.

Thanks to Ken for his work on this, and for coming up with the
initial version of this patch.

base/gxclrast.c
base/gxcpath.c
base/gxpath.h


2017-06-03 18:50:05 +0100
Ken Sharp <ken.sharp@artifex.com>
0af88bdacdd8962244ac0a538c78b56bd5cc9376

pdfwrite - fix customised doumentUUID

Bug #697977 "document UUID gets truncated"

The code writing out a user-specified documentUUID had an error, failing
to account for the 'uuid:' prefix.

Credit to Axel Holewa for finding the preoblem and suggesting the fix.

devices/vector/gdevpdfe.c


2017-05-19 18:12:00 +0100
Robin Watts <robin.watts@artifex.com>
9c94340cd251ead99b4ae9121d1138c83be9a5df

PXL: Optimise 1 pixel wide image handling.

If we are given a 1xH image, we'd rather reflect it to be
an Hx1 image so that it gets passed through the image code
as a single scanline. This allows things like collation of
runs of matching pixels to work far better.

In particular this improves page mode performance for j11.prn.

pcl/pxl/pximage.c


2017-05-29 16:19:39 +0100
Chris Liddell <chris.liddell@artifex.com>
5f53dbc3e917d44e92619f831ba06be7944b5471

Bounds check buffers for downloaded glyphs in PCL.

For downloaded fonts, there were several buffer overreads reported by valgrind
when interpreting Intellifont glyph descriptions.

This adds using the (already existing) length field to bounds check when we
interpret the glyph.

pcl/pcl/pcsfont.c
pcl/pl/plchar.c
pcl/pl/plfont.c
pcl/pl/plfont.h
pcl/pl/pllfont.c
pcl/pl/plulfont.c
pcl/pxl/pxerrors.c
pcl/pxl/pxfont.c


2017-05-29 16:22:19 +0100
Chris Liddell <chris.liddell@artifex.com>
fe6ed9f54a02357e01c1f8c517b6af831e5f59ae

Ensure a FAPI instance is attached to a cloned font

It was possible for a cloned font to be missing the FAPI server attached to the
'parent' font. Add in a pl_fapi_passfont() call so it's guaranteed to be
available.

pcl/pcl/pcsfont.c


2017-05-31 20:51:00 +0100
Robin Watts <robin.watts@artifex.com>
bc12dc36623f3eb3c553ea1455cf1fd84d10b114

Avoid needless clip path recalculations.

While investigating Bug 697679, I spotted that clip_call_fill_path
was being called with a non NULL pcpath, thus triggering a 'slow'
rebuild of the clipping path.

In at least some of these cases, pcpath pointed to an invalid
clipping path. I believe this means we might as well have used
the fast route!

base/gxclip.c


2017-05-31 20:14:55 +0100
Robin Watts <robin.watts@artifex.com>
9ee2adefdfc9a12bf71acd1e08e88b8cc8af0502

Avoid calling the same function twice.

Not really expecting any huge speed benefit from this, but
it's silly to call it twice with the same args.

base/gxcpath.c


2017-05-31 21:44:41 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
2cebfeb7c91d5bcf916bc2c51d32a213f0ca776d

Bug 694646: Fix SEGV due to missing FontName attribute.

pxSetFont allowed for an optional FontName attribute which meant it tried
to set a font using NULL. This function has been updated to check that
FontName, CharSize and SymbolSet are not NULL before trying to use them.

pcl/pxl/pxfont.c


2017-05-31 12:28:43 +0100
Robin Watts <robin.watts@artifex.com>
e57b2aafe5bf09bb7e7df5f4608a4910145553b2

Bug 697970: Solve underflow/overflow problems in new scan converter.

The test file asks us to fill a line with one end at 0x7fffffff,
using 'any part of a pixel'. In order to calculate the index table
the existing code 'expands' this vertical area by 0x7f to allow
for rounding within a pixel. This leads to 0x8000007e, which
is of a different sign.

Correspondingly the vertical ranges touched by the lines appear
different in the indexing and marking phases.

To fix this we rejig the line calculations to avoid this
difference by more carefully doing the expansion.

Thanks to Kamil Frankowicz for doing the fuzz testing that lead
to this bug/fix.

base/gxscanc.c


2017-05-31 13:50:32 +0100
Ken Sharp <ken.sharp@artifex.com>
9e621d6ffb0e29c5de8331bf2c95003c8cf85941

PDF interpreter - apply Optional Content /Usage dictionaries

Bug #696076 "Ghost script 9.16/9.15 print PDF layer even if print state is "Never Print""

We currently only apply the /OFF (or /ON) entries from the Optional
Content Properties (/OCProperties) which is quite a high level and hence
low granularity control.

This commit adds processing of the /Usage dictionary; any ordinary
Optional Content (not OCMD) which is not set to /OFF in the OCProperties
is checked for the existence of a /Usage dictionary. We then check for
either a /Print or /View key in the dictionary depending on the setting
of the -dPrinted command line switch. If the relevant key is present
then we check for a ViewState key and use that to determine whether the
Optional Content should be rendered or not.

Note that if -dPrinted is not set on the command line then the interpreter
will attempt to guess. If the current device has OutputFile set then
the interpreter will assume that it should consider 'Print' keys. If it
is not present in the device, then the interpreter will assume that it
should consider 'View' keys.

This causes the PDF file Bug690364.pdf to render radically differently.
This is because much of the content is set to not print, and a small
amount of extra data is set to render only when printed. Because the
cluster uses an OutputFile, we assume that we should behave as if
printing.

Resource/Init/pdf_draw.ps


2017-05-31 11:24:40 +0100
Robin Watts <robin.watts@artifex.com>
33cf871a82e0fd9a0ebfed14317a2fa0f40e1e9d

Bug 697748: Fix misspelled alignment attribute in SSE code.

The SSE thresholding code relies on a buffer being 16 byte aligned.
To achieve this we use a compiler attribute to force alignment
to 16 bytes.

MSVC uses "align(16)", but gcc etc uses "aligned(16)".

We were using "align(16)" for both. Fix this in the macro here.

Thanks to Timo Teras for spotting the problem and suggesting the
fix.

base/gxht_thresh.c


2017-05-30 10:30:05 +0100
Ken Sharp <ken.sharp@artifex.com>
b883b8fc62ec6bc630d5f88abef0d7799efa6687

pdfwrite - Don't assume param list strings are NULL-terminated

Bug #697948 "(Add an ID to memory allocations.) breaks PDF/A output"

The bug description is misleading; in fact the problem is that the code
for reading a flag numeric value from a string parameter was assuming
the parameter was NULL_terminated, when in fact it is not.

Depending on exactly how the memory layout happened to be, the bytes
following the parameter may or may not be NULLs, or ASCII digits. If it
so happened that the trailing bytes were ASCII digits, it was possible
for an incorrect Flag value to be parsed, which could lead to an error
being flagged.

This commit just copies the actual number of bytes in the parameter
string to a temporary stack-based character buffer, NULL terminates the
buffer and reads the Flag value from there.

devices/vector/gdevpdfm.c


2017-05-28 21:46:26 -0600
Henry Stiles <henry.stiles@artifex.com>
4226202adec2a3f3a416e1986e8630bf7ca3bdc7

Fix Bug 694633 fuzzing segmentation fault.

Return an error if the GL/2 parser runs out of data while processing
a macro. If within a macro, unlike the normal data stream, the GL/2
commands already have access to all of the data.

pcl/pcl/pgparse.c


2016-07-04 09:28:06 +0100
Ken Sharp <ken.sharp@artifex.com>
7918a01dd37bc383e61ae0b237341e69286dc83c

PDF interpreter - Move ExtGState parameters into the regular graphics state

Bug #696511 - "Move ExtGState parameters into the regular graphics state"

A long time ago a decision was made not to replicate the PDF ExtGstate
parameters in the graphics state. This has had long term painful consequences
because we were unable to do a gsave/grestore to simply preserve
parameters but had to jump throuhg a lot of hoops. Amongst other problems
has been confusion over when exactly a change in colour has taken place.
With this commit the ExtGState parameters are moved into the graphics state
and obey gsave and grestore.

This extensive commit was worked on in the PDF_gstate branch and the history
is preserved in that branch.

This does introduce a few differences in the test suite;

There are a few cases where broken files (recursive SMasks) now render
slightly differently.

Some files now exhibit progressions, especially with CMYK or DeviceN output
devices, this is because the 'default' colour space was incorrect, the code
was using DeviceGray instead of the device's colour space, and this makes
a difference for some types of transparency blending when the Group does
not specify a Blending space.

A few other files demonstrate progressions because a change in colour now
takes place before an error occurs.

Resource/Init/pdf_draw.ps
Resource/Init/pdf_font.ps
Resource/Init/pdf_main.ps
Resource/Init/pdf_ops.ps
base/gsstate.c
base/gsstate.h
base/gstrans.c
base/gstrans.h
base/gxgstate.h
psi/igstate.h
psi/int.mak
psi/zcolor.c
psi/zcssepr.c
psi/zgstate.c
psi/zmatrix.c
psi/ztrans.c
psi/ztype.c


2017-05-29 11:22:34 +0100
Ken Sharp <ken.sharp@artifex.com>
2e2a9d851c73192739c9227ef0030f3ba3e7b6fd

PDF interpreter - Don't render closed Popup annotations, synthesise missing Popup Appearances

Bug #697951 "MuPDF - Arguably incorrect annotation"

Although this is a MuPDF bug, it showed a couple of problems in Ghostscript

Firstly; Popup annotations which have /Open false should not be rendered

Secondly; Popup annotations with no /Open should be treated as ?open False

Finally, Popup annotations with no /Appearance were not rendered, unlike
other annotation types we were not synthesising an Appearance.

This commit addresses all 3 of these, and shows progressions with:

tests_private/pdf/PDF_1.7_FTS/fts_32_3232.pdf
tests_private/pdf/sumatra/1312_-_comments_not_displayed.pdf
tests_private/pdf/sumatra/1571_-_popup_annotations.pdf
tests_private/pdf/sumatra/embedded_go-to_actions.pdf

Resource/Init/pdf_draw.ps


2017-05-28 21:27:41 -0600
Henry Stiles <henry.stiles@artifex.com>
3ded6c3b28a1b183a492ada2f2a3970953f3d060

Increment the PJL stream pointer for illegal characters.

When an illegal character is encountered within a PJL command we exit
with end of job. With recent changes it is necessary to increment the
stream pointer as well because the PJL interpreter is reinvoked upon
UEL resulting in an infinite loop.

pcl/pl/pjparse.c


2017-05-24 19:29:57 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
3ebffb1d96ba0cacec23016eccb4047dab365853

Bug 697934: Fix SEGV due to error code being ignored.

The return code from jbig2_decode_text_region was being ignored so the
code continued to try and parse the invalid file using incomplete/empty
structures.

jbig2dec/jbig2_symbol_dict.c


2017-05-26 17:05:29 +0100
Ken Sharp <ken.sharp@artifex.com>
5cf06167c248f345a1042c421cc2f5f741bf281d

pdfwrite - correctly set the BPC for the image downsampling filter

Bug #697944 "Segmentation fault with -sDEVICE=pdfwrite"

The code to call the downsampling filter resizes the input to the filter
to 8BPC, and then resizes the output from the filter back to whatever
the required depth was.

But the stream state for the downsampling filter was left with the
original BPC. This led to the Mitchell filter calculating two parameters
sizeofPixelIn and sizeofPixelOut incorrectly as 0 (4/8 is 0 in integer
arithmetic). Later the code used sizeofPixelOut being 1 to write 1 byte
output data, but if the value was not 1 it wrote 2 bytes of output.

This causes a buffer overflow in the callers buffer, leading to memory
corruption and an eventual seg fault.

This commit simply sets the BPC in the stream state correctly to reflect
the fact that the intermediate data is always 8 bits.

devices/vector/gdevpsdi.c


2017-05-26 13:13:16 +0100
Ken Sharp <ken.sharp@artifex.com>
6cae884b66944318c34e17992c628a246dda18aa

Vector devices - work around TrueType subsetting bug corrupting metrics tables

Bug #697376 "Adobe Distiller can't handle EPS files created with eps2write - limitcheck error"

The TrueType writing code for the vector devices continues to produce
problems. We should rewrite this code but realistically that is still
some way off.

In this case the code was attempting to minimise the size of the VMTX
and HMTX tables by only writing out the metrics for the glyphs we were
actually including in the font (unused glyphs remain as references in the
font, but have no outlines).

This is not valid in TrueType, the metrics tables must contain an entry
for each glyph. Looking at the code it should have been clear that this
was nonsense, but apparently it was missed.

We can save a minimal amount of space by writing out the metrics for all
the glyphs up to the last used one, and then writing just a 0 side
bearing for each remaining glyph, but the space saving is small. So I've
chosen simply to disable the subsetting of metrics and copy the entire
table.

devices/vector/gdevpsft.c


2017-05-26 11:27:44 +0100
Chris Liddell <chris.liddell@artifex.com>
bf949eaff89ac71b30d4a93638716e2c63090b0a

Bug 697949: check parameters for .setuseciecolor

psi/zcolor3.c


2017-05-24 08:54:25 -0700
Ray Johnston <ray.johnston@artifex.com>
d57e9332127baa82fa8083c0927498f412aa48d8

Fix tags with transparency.

Only change the tag if the alpha_s (source alpha) is > 0. If it is 100%
and the BlendMode is Normal, then we use the object's tag, if not, we
combine with the existing tag (in the backdrop/destination) by OR'ing
the bits together. Note that for some Blend modes, the pixel may only
have contributions from the source or from the destination, but we don't
use that because it could change the tag within an object (e.g, gradient
or image) depending on the color value causing unexpected shifts in the
tag value.

base/gdevp14.c


2017-05-24 16:26:55 +0100
Ken Sharp <ken.sharp@artifex.com>
2e3ca2386ae8045a084dc862e7e22f3df1341d0e

device subclassing fix reference counting and stype patching

We patch the memory manager's 'stype' on the original device's memory
when we subclass the device, but had missed resetting that when we
unsubclass the device, restoring the child device. This left the memory
manager stype set incorrectly.

Secondly it transpires that we can alter the reference count of the
parent, so that it differs from the child, and we hadn't accounted for
that. If the reference count of the child (subclassed) device differs
from the parent (subclassing) device at the point where we unsubclass
the device, we need to make sure we retain the correct reference
count. Otherwise we can end up with saved gstates pointing to a device
which has been freed.

base/gdevdflt.c


2017-05-23 13:05:42 +0100
Ken Sharp <ken.sharp@artifex.com>
b13ef3074dd164d2317cd5d03331b8de96ea98d0

pdfwrite - unescape specially escaped names in pdfmark operations

Bug #697885 "Commented pdf-file converting with 9.21 comments are omitted but not with <= 9.20 versions"

We now preserve (where possible) annotations from input PDF files
into the output file, where previously these were effectively 'folded into'
the page content stream.

In order to do this for Appearances, we need to create a separate Form
XObjet which we reference from the annotation. Doing this requires
some underhandedness in the PDF interpreter, where me make use of
a non-standard 'escape' consisting of tow NULL (0x00) bytes before the
name of the Form XObject, and one NULL after.

This works well, but ended up copying the NULL bytes into the output
PDF file. This is actually legal, but it seriously confused the
Linearisation code when it tried to alter the object numbers in order
to write them in the correct xref table.

Since these NULLs are not required and confuse the code, we now take
extra action to remove them from the string we create working from the
pdfmark data.

devices/vector/gdevpdfr.c


2017-05-22 10:18:56 +0100
Chris Liddell <chris.liddell@artifex.com>
b914c5de71fcc7675f40d8557975ec87cd46fced

Bug 697910: handle Type 1 fonts with 'embedded' Type 1 fonts

The test file for this bug has a Type 1 font stream (for an oblique version of
a font) which 'contains' a second (non-oblique) Type 1 font, from which the
'outer' font pulls the CharStrings (the oblique version contains its own
subrs to make the regular font into the oblique font).

A previous fix for a broken Type 1 font broke support for the above (valid)
form of Type 1 font. The broken Type 1 ends up putting various required keys
in the current dictionary, rather than in the font dictionary.

The previous fix pushes a sacrificial "top dictionary" before executing the font
stream. It identifies the broken font by spotting that required keys exist in
a dictionary on the dictionary stack (rather than in the font dictionary on the
operand stack on the call to definefont). When it encounters the broken font
layout, it copies the required keys into that sacrificial top dictionary, and
uses that as the font dictionary.

The Type 1 inside another Type confuses that code, and ends up creating one font
from the "inner" Type 1.

This commit reverses the logic: it checks for required keys missing from the
font dictionary, and if any are missing, it tries to find them on the
dictionary stack.

This is slightly less robust than the original solution, since it assumes that
the font has created a font dictionary, but has defined required keys before
pushing it onto the dictionary stack. A font that fails entirely to create
a font dictionary will fail.

Obviously, a solution for broken fonts that causes (admittedly strange) but
valid fonts to fail is unacceptable. If we find a case of a font that is broken
as described above, we can revisit this fix.

Resource/Init/pdf_font.ps


2017-05-17 15:27:23 -0600
Henry Stiles <henry.stiles@artifex.com>
d7cade08ad36382a0ed5dfa72fcb9a0e9a822417

Remove shared device psi implementation and improve documentation.

The experimental gpdl build now only supports running PostScript and
PDF in a seperate context with it's own device using the normal API.
At this time it only runs files detected as PostScript or PDF in the
default device with no arguments. The previous setup did not work
properly and if we are to have a shared device it should be
implemented anew anyway.

Also improve the documentation for how languages plug into the
language switching system.

gpdl/psi/psitop.c
pcl/pcl/pctop.c
pcl/pl/plimpl.c
pcl/pl/plmain.c
pcl/pl/pltop.h
psi/imain.c
psi/zdevice.c


2017-05-11 13:56:04 -0600
Henry Stiles <henry.stiles@artifex.com>
00d5670774e9c56cb8bf6e9f877756c82d10536e

Clean up documentation and simplify language implementation procs.

pcl/pcl/pctop.c
pcl/pl/pltop.h
pcl/pxl/pxtop.c
xps/xpstop.c


2017-05-08 17:16:56 -0600
Henry Stiles <henry.stiles@artifex.com>
d585f6b8b2150c70a4fdc8d2b4d582012411f586

PL API: Remove separate interpreter instances.

The previous design was complicated by supporting multiple instances
of each language which will never be used, so we can remove the
interpreter instance type and access each language through the
implementation pointer.

gpdl/psi/psitop.c
pcl/pcl/pcimpl.c
pcl/pcl/pcstate.h
pcl/pcl/pctop.c
pcl/pcl/pctop.h
pcl/pl/pjparse.c
pcl/pl/pjparse.h
pcl/pl/pjparsei.c
pcl/pl/pjtop.c
pcl/pl/pjtop.h
pcl/pl/plapi.c
pcl/pl/plimpl.c
pcl/pl/plmain.c
pcl/pl/plmain.h
pcl/pl/pltop.c
pcl/pl/pltop.h
pcl/pl/realmain.c
pcl/pxl/pxstate.h
pcl/pxl/pxtop.c
xps/xpstop.c


2017-02-21 20:42:15 -0700
Henry Stiles <henry.stiles@artifex.com>
b6689161cc0dcbbb0f029a91708ac2724570a63d

PL API: make PJL an implementation and several miscellaneous improvements.

It is simpler to have PJL selected as an implementation upon seeing
the @PJL identifier or detecting a UEL in the input stream.
Previously we always entered the PJL interpreter after exiting another
language. Also, added stubs for the "run_string" api.

pcl/pl/pjparsei.c
pcl/pl/pl.mak
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plcursor.c
pcl/pl/plmain.c
pcl/pl/plmain.h
pcl/pl/realmain.c


2017-02-03 13:04:53 -0700
Henry Stiles <henry.stiles@artifex.com>
611289048a343ec07eb3ec1dd19aa922211f200d

Remove cursor renewal.

This hack was used so the languages could return without consuming
data which is wrong. The underlying problem was the XL interpreter
returning 0 when it should have been returning an exit code.

pcl/pl/plcursor.c
pcl/pl/plcursor.h
pcl/pl/plmain.c
pcl/pxl/pxtop.c


2017-01-30 17:10:50 -0700
Henry Stiles <henry.stiles@artifex.com>
3eb111d09610e72106af19b28a90982b14dc55dc

PL API: cleanup unused functions replace by API calls.

pcl/pl/gpcl6dll32.def
pcl/pl/gpcl6dll64.def
pcl/pl/gpdldll32.def
pcl/pl/gpdldll64.def
pcl/pl/gxpsdll32.def
pcl/pl/gxpsdll64.def
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/plwmainc.c


2017-01-29 08:08:56 -0700
Henry Stiles <henry.stiles@artifex.com>
87af13a97cc6868dd31379e446f089b1dd9e101a

PLAPI: Use api for windows display program.

pcl/pl/pl.mak
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/plwmainc.c


2017-01-02 10:20:58 -0700
Henry Stiles <henry.stiles@artifex.com>
761bf52f3591219b8262549d9a337d0a3d71fd61

PL API: add plapi implementation.

Fills out the plapi implementation and changes the default command line
program to use the new api.

pcl/pl/pl.mak
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/plmain.h
pcl/pl/realmain.c


2016-12-29 08:55:44 -0700
Henry Stiles <henry.stiles@artifex.com>
47d3e1e7ec973fcead1f88cf24e4bdc430123592

Memory leak check.

pcl/pl/plmain.c


2016-12-29 08:38:42 -0700
Henry Stiles <henry.stiles@artifex.com>
0877d850a63fe57ad60fac065ae7675817ba7a4f

Rename pltoputl to plcursor.

Only the cursor code remained in pltoputl.

pcl/pl/pl.mak
pcl/pl/plcursor.c
pcl/pl/plcursor.h
pcl/pl/plmain.c


2016-12-23 11:10:31 -0700
Henry Stiles <henry.stiles@artifex.com>
ebd2e51a648e0657eb9bd2464be01ad09f9b01e0

Move all cursor code to single module.

Not sure why this was spread out in plmain.c and pltoputl.c.

pcl/pl/pl.mak
pcl/pl/plmain.c
pcl/pl/pltoputl.c
pcl/pl/pltoputl.h


2016-12-22 15:09:31 -0700
Henry Stiles <henry.stiles@artifex.com>
2ec6f74df2fa14776182a75d306f3028170f5715

Make the main instance opaque.

Needed to reduce spreading dependencies resulting from including
plmain.h.

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


2016-12-21 12:03:57 -0700
Henry Stiles <henry.stiles@artifex.com>
6850869002f40634a2af0e6a1c939d3ed385f217

Factor out common icc code into 1 pl procedure.

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


2016-12-21 10:17:40 -0700
Henry Stiles <henry.stiles@artifex.com>
5c663ee7cf06f0887404709aae45141fb3049817

Remove unused vmspaces and nogc references.

pcl/pcl/pcl.mak
pcl/pcl/pcpage.c
pcl/pl/plmain.c
pcl/pl/plmain.h
pcl/pl/pltop.c
pcl/pxl/pxl.mak
pcl/pxl/pxtop.c


2016-12-19 21:43:08 -0700
Henry Stiles <henry.stiles@artifex.com>
6a20606c8f5ce3f8c0ce80c84a831ed4a98f2156

PL API: functions to exit and delete the main instance, like gs.

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


2016-12-18 14:50:20 -0700
Henry Stiles <henry.stiles@artifex.com>
2a3bc2153fd93542914b83df5d94dbafdbe257ec

Fix the gpdl build, PCL and XPS language switching for testing.

This uncovered a problem with the PJL state and the command line. PJL
should not be initialized for each file (pl_main_run_file()) if PJL
was issued on the command line (-J switch) otherwise it should be
initialized.

pcl/pl/plimpl.c
pcl/pl/plmain.c
pcl/pl/plmain.h


2016-12-17 20:47:14 -0700
Henry Stiles <henry.stiles@artifex.com>
37d1286a66bd80a471aa9ac0a166bc291a8318db

PL API - Reorganizing main procedure.

Splits out routines for running a file and inializing with arguments,
consistent with gs API. The allocator module was removed, the
procedures were to simple to be separated out. Lots of trivial clean
up as well.

pcl/pl/pl.mak
pcl/pl/plalloc.h
pcl/pl/plmain.c
pcl/pl/plmain.h


2016-12-15 11:11:13 -0700
Henry Stiles <henry.stiles@artifex.com>
f1dd6db9f969d0a6d23baeb781f5082f8d0f78e4

PL API: deprecate error string buffers which were never used.

pcl/pl/plmain.c


2016-12-15 10:32:49 -0700
Henry Stiles <henry.stiles@artifex.com>
bd95aa0cf7a5eef3e37c4bfa29ec32debd6b954d

PL API: continues previous commit removing pre and post page operations.

pcl/pl/plmain.c


2016-12-14 13:01:07 -0700
Henry Stiles <henry.stiles@artifex.com>
e9ff0dcf1892086276872e868a254d012ab48702

PL API: continue previous commit, purge pre and post page closures.

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


2016-12-14 12:34:40 -0700
Henry Stiles <henry.stiles@artifex.com>
97f9904dc5d8f45cbca93b02098eac077bca7f5c

PL API: remove instance page count and refactor output page.

The page count is no longer needed in the main instance, it is now
available in the device. The output page closures were convoluted and
never used, factor out a common procedure to output the page,
pl_finish_page(), to be used by PCL, PXL and XPS.

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


2016-12-13 16:38:10 -0700
Henry Stiles <henry.stiles@artifex.com>
23d85c19be2700d098d133f87a40e24031a9c64e

Remove set client instance procedure.

Unnecessary complexity between the main program and the individual languages.

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


2016-12-09 10:34:42 -0700
Henry Stiles <henry.stiles@artifex.com>
e14474ba4eff1cf7c42ff8888a3daa6dc6c83aaa

PL API Remove device_memory main instance member.

This was only needed for the language switch build with PS and PDF
which is no longer supported.

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


2016-12-08 17:33:41 -0700
Henry Stiles <henry.stiles@artifex.com>
3e026d15093a2a7279c3c4e46b3e24cb5ee11370

PL API: Add PJL instance to PDL array.

Previously the PJL interpreter was separated out from the other
interpreters now it is simply known to be the 0'th entry in the array
of languages. Having it separate would yet another member in the main
instance with the new API.

pcl/pl/pjparsei.c
pcl/pl/plimpl.c
pcl/pl/plmain.c


2016-12-08 08:40:56 -0700
Henry Stiles <henry.stiles@artifex.com>
ce20a5af6c0d72ae1d0198f3c44e2b0a0d0a09d6

PL API: remove pdl implementation array references.

A copy of a reference to the array was used in varous places, yet it
is a global constant, so reference the global directly.

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


2016-12-08 07:34:26 -0700
Henry Stiles <henry.stiles@artifex.com>
a3ad76f1872b46390328c31102c9b6e6bf25d776

PL API: remove plplatf module.

This makes the startup more consistent with gs.

pcl/pl/pl.mak
pcl/pl/plmain.c
pcl/pl/plplatf.c
pcl/pl/plplatf.h
pcl/pl/plplatfps.c


2016-12-07 18:30:04 -0700
Henry Stiles <henry.stiles@artifex.com>
587bfc08b8e833c2aa45284fe558a8d9b7116f4e

PL API: move argument state to the main instance.

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


2016-12-07 16:53:00 -0700
Henry Stiles <henry.stiles@artifex.com>
7f856d0f9de2145e7533ad239de618506ae145e6

PL API: move device parameter list to the main instance.

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


2016-12-07 13:40:09 -0700
Henry Stiles <henry.stiles@artifex.com>
5ce6334ed0996ccd2d52ac81d273a78293487bfd

PL API: access main instance parameters directly.

pcl/pcl/pctop.c
pcl/pl/plmain.c
pcl/pl/plmain.h
pcl/pl/pltop.h
pcl/pxl/pxtop.c
xps/xpstop.c


2016-12-07 09:38:45 -0700
Henry Stiles <henry.stiles@artifex.com>
6ab1d85eef2b821dcb08f8b82622fa92be1be1af

PL API: make main instance the "top of the system"

pcl/pl/plmain.c


2016-11-30 19:52:57 -0700
Henry Stiles <henry.stiles@artifex.com>
9a7d93d3f71ec4a92a726998f1acac85489c277e

PL API Make language read buffer a member of the language instance.

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


2016-11-29 17:26:55 -0700
Henry Stiles <henry.stiles@artifex.com>
1130f6ac765de4c6d202281496e1ad62b8370460

PL API: refactor initialization to be more like gs.

pcl/pl/plmain.c


2016-11-28 11:56:01 -0700
Henry Stiles <henry.stiles@artifex.com>
6cf194e23355ed75ddd248bde3e4849c8ad1bfcf

SVG is no longer supported, remove test file.

Also adds an xps tiger created by xpswrite.

pcl/tools/tiger.svg
pcl/tools/tiger.xps


2016-11-27 15:35:38 -0700
Henry Stiles <henry.stiles@artifex.com>
46a472c247dd33d53124b79204594c707c99e134

PL API - remove PJL memory allocator.

pcl/pl/plmain.c


2016-11-18 13:47:46 -0700
Henry Stiles <henry.stiles@artifex.com>
c672305a6e45a39c446918b5c4899c9763fc8f5b

PL API - make "universe" part of instance.

The "universe" is soon to be deprecated but for now include it in the
instance so it is available to all api functions.

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


2016-11-17 16:43:19 -0700
Henry Stiles <henry.stiles@artifex.com>
c5b13ee9953a4d482ab3bce112c61f19cf758a62

PL API - Dynamically allocate main instance.

pcl/pl/plmain.c


2017-05-19 11:08:38 +0100
Ken Sharp <ken.sharp@artifex.com>
119ec77d4e44e3861a376323ed14466b28b2f4bf

PDF interpreter - better match the behaviour of Acrobat with invalid /Mask

Bug #697919 "Invalid Mask values cause content to not render"

The sample file has a 1 bit per component image with a Mask, the values
in the mask array are [204 255]. Since this is a 1 bit image, clearly the
only valid values are 0 or 1.

Previously (bug #692852) we have specifically treated /Indexed spaces
with an invalid Mask specially, so that if the initial value is out
of range we ignore the Mask array, otherwise we use the initial value
and set the second to 1.

Also previously we have bug #689717 which is, in fact, an identical
case to this one. In that case we have code which clamps the two values
to 'max - 1' which works for that case. In fact, it works too well for
that case, and produces content which is almost certainly desired by
the author, but which Acrobat does not render.

In this commit we make the DeviceGray case match the /Indexed case, I
rather suspect that for 1 bit images Acrobat *never* uses the /Mask
array values, but I don't have an example in any other colour space. So
for now we'll leave them alone.

This causes the file for Bug 689717 to render with content 'missing',
however it does now match Acrobat. I do not think we can reasonably match
Acrobat's result for this bug without also matching it for the prior bug.

Resource/Init/pdf_draw.ps


2017-05-15 14:34:17 +0100
Robin Watts <robin.watts@artifex.com>
5501c28dbb1814aa869cb5132e52d5bcf090ec6e

New chunk memory manager.

Based off the original chunk heap managers code, this uses splay
trees for free blocks to speed searching. (Dual, top-down,
semi-splaying trees, one ordered on size, and another on location).

Adding this memory manager runs into a problem with pdfwrite.
Because pdfwrite is not entirely behaved with memory freeing, it
can free the same blocks more than once. This primarily happens
in pdf_close.

The existing chunk memory manager seems to get away with this by
luck, whereas this revised version sees SEGVs in some {pcl,xps} ->
pdfwrite tests.

Accordingly, we add a special fudge; if we call gs_defer_frees(1)
then the memory manager defers freeing blocks by putting them
onto a linked list (but only once). When we then call
gs_defer_frees(0), the manager finalizes all the blocks on the
list (which may in turn add new blocks to the list!). Once
all the blocks have been finalized, they are then freed.

"All" the pdfwrite double frees come from inside pdf_close (or
all the ones I have seen at least). Accordingly we bracket
pdf_close with gs_defer_frees(1) and gs_defer_frees(0).

base/gsalloc.c
base/gsmalloc.c
base/gsmchunk.c
base/gsmchunk.h
base/gsmemory.h
base/gsmemret.c
devices/vector/gdevpdf.c


2017-05-18 16:18:25 +0100
Robin Watts <robin.watts@artifex.com>
b69d68995d065d61b2defe919c038cf9cf60b598

Fix buffer overrun in xpspath.c

Seen with tests_private/xps/sumatra/buffer_overflow_in_path_handling.xps

Specifically:

bin/gxps -sOutputFile=out.pdf -sDEVICE=pdfwrite -r72 -Z: -dNOPAUSE
-dBATCH -dClusterJob
tests_private/xps/sumatra/buffer_overflow_in_path_handling.xps

xps/xpspath.c


2017-05-18 15:59:22 +0100
Ken Sharp <ken.sharp@artifex.com>
1e0088aa8d8e65ad7455d35e9280fe978163534b

Bug 696412 - Fix seg fault in pdf_end_transparency_mask

Bug #696412 "Seg faults found by fuzzing in pdf_end_transparency_mask"

The file is (of course) badly corrupted, leading to us receiving a
'end' for a transparency mask when we did not previously receive a
'begin'.

The code in pdf_end_transparency_mask assumed that the prior begin would
have created a soft mask dictionary, but of course if we didn't see the
begin then we don't have one.

Check for this and simply return an error instead of trying to
dereference the NULL pointer.

devices/vector/gdevpdft.c


2017-05-18 14:10:56 +0100
Ken Sharp <ken.sharp@artifex.com>
58aeac2fbd1489c797351a9b53134e40729b661c

Bug 696377 - Fix a seg fault in subclassing

Bug #696377 "Seg faults found by fuzzing in default_subclass_create_compositor"

With a sufficiently corrupted file it was possible to reach this point
with a mismatch of transparency group begin/end. This could lead to
us having the compositor device being NULL which we would then try to
dereference.

Simply check the compositor device and don't try to dereference it if
its NULL.

This was only reproducible on the commit mentioned in the bug report,
after fixing it the file continued on to seg fault in a completely
different place. However I believe this is due to the fact that the
corrupted file leads to a mismatch of push/pop groups for transparency
and Michael has addressed that with later commits. The file runs to
completion (with *many* errors) on current code.

base/gdevsclass.c


2017-05-14 03:34:57 +0800
Sebastian Rasmussen <sebras@gmail.com>
56c26790af78f94c08a595e0c9da527418c47614

Bug 697866: Do bounds checking of read data.

Credit to Ken for suggesting what bounds to check.

jbig2dec/jbig2_text.c


2017-05-14 03:37:11 +0800
Sebastian Rasmussen <sebras@gmail.com>
d39d31168cec8a08ac1e5c44c95925fecb087173

Make clipping in image compositing handle underflow.

jbig2dec/jbig2_image.c


2017-05-14 12:36:28 +0800
Sebastian Rasmussen <sebras@gmail.com>
a328d6377bac5268d3a8c071fbbf54c66e07de3a

Fix memory leak in case of error.

jbig2dec/jbig2_text.c


2017-05-14 03:31:50 +0800
Sebastian Rasmussen <sebras@gmail.com>
dbdcc8158d59960abfa5241b55ed76cbd40e12f3

Fix double free in error case.

jbig2dec/jbig2_symbol_dict.c


2017-05-16 20:53:27 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
8e466b1468df6afd91eac6266a417160540d8789

Bug 694632: Fix SEGV due to invalid proportional_spacing value.

Updated pcl_font_header to correctly handle fonts where the
proportional_spacing is greater than 1.

pcl/pcl/pcsfont.c


2017-05-17 14:38:45 +0100
Robin Watts <robin.watts@artifex.com>
bc8190c4e8050364c10bb3545ca6c705bfb3d38c

Squash warning.

Don't implicitly lose 'const'.

pcl/pcl/pcstate.h
pcl/pcl/pctext.c


2017-05-17 13:03:07 +0100
Robin Watts <robin.watts@artifex.com>
24781094295489cafe562239a251300c6cfbd6ca

Remove superfluous gsmemlok files.

Use it or lose it.

base/gsmalloc.c
base/gsmemlok.c
base/gsmemlok.h
base/gxclread.c
base/gxclthrd.c
base/lib.mak
windows/ghostscript.vcproj


2017-05-17 09:58:44 +0100
Chris Liddell <chris.liddell@artifex.com>
79fd8d7466f51c74bd0c14dc1fd33cfaba0e7b83

Bug 697909: Handle PDF T3 glyph streams with unmatched 'q'

We have to handle the case where a glyph description stream from a PDF Type 3
font has an unmatched 'q'. We can track this in the PDF interpreter by checking
the depth of the dictionary stack, and unwinding with 'Q' operations until the
dictionary stack is back to where we started.

Resource/Init/pdf_font.ps


2017-05-17 12:45:20 +0100
Robin Watts <robin.watts@artifex.com>
b38ed8a40e013ea79c89c6561eedf1841caa9801

Add gs_set_object_type function to gs_memory_t interface.

The subclassing code uses a horribly unsafe hack to reset
the type of a device object. This fails when the device
object is not of the expected type (in this case, when it's
not from the i_alloc manager).

Add a new access function to the API to allow this to happen
safely regardless of manager type.

base/gdevdflt.c
base/gsalloc.c
base/gsmalloc.c
base/gsmchunk.c
base/gsmemlok.c
base/gsmemory.h
base/gsmemret.c


2017-05-15 14:32:47 +0100
Robin Watts <robin.watts@artifex.com>
b5fd7b3473fc7cd02a2575f47b38d07f0e1e4222

Squash warning in ETS code

Missing 'restrict' in a prototype.

base/ets.h


2017-05-14 11:53:42 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
b9c9f25d2cf43835d3d563e6012968b253e7faf1

Bug 694628: Fix SEGV due to invalid bits_per_index value.

Updated check_cid_hdr to correctly handle indexed colour
spaces where the bits_per_index is greater than 8.

pcl/pcl/pccid.c


2017-05-15 13:42:23 +0100
Chris Liddell <chris.liddell@artifex.com>
9468f852a09232d1f4200d252ffb665bc4d86f51

Bug 696416: clean up pdfwrite form stack after error.

In pdfwrite, when we start accumulating a form (whether a 'real' form, or a
transparency group), we save a load of 'state' in stack form, so we can then
unroll it when the form execution completes.

If we begin a form, and the form content throws an error, we can reach the end
of the page whilst still having not unrolled the state from the form level back
to the page level, leaving the form stream object as the 'current' stream
rather than the page stream.

This results in the form not being marked as used, and potentially freed,
resulting in a seg fault when we try to flush the current stream (expecting it
to be the page stream, not the form stream).

Before we proceed to complete the page, ensure that we've unrolled any errant
form states.

devices/vector/gdevpdf.c


2017-05-15 13:26:22 +0100
Chris Liddell <chris.liddell@artifex.com>
050d101bda8a73a6da44c379b20156f1ce49c948

Remove spurious extra definition of RAMFS_APPEND

Spotted by Robin

base/ramfs.h


2017-05-12 11:21:51 +0100
Chris Liddell <chris.liddell@artifex.com>
969bef004730b3feb8cc01cf99d12f152807b24e

Bug 696397: further validate TTF glyph "end point" values

In a TTF glyph, we have to read the index of last point for each contour. We
already validated the value to ensure that the value for index "i + 1" was
always larger than that for "i". But we didn't check the values are positive.

base/ttfmain.c


2017-05-12 11:19:00 +0100
Chris Liddell <chris.liddell@artifex.com>
7de3003abd8a66ec312ebed4146bd56ec4649d8f

Bug 696390: bounds check Type 2 charstring "registry"

We emulate a "Registry" construct for Type 2 charstrings, but only with a single
entry. Bounds check accesses to it to avoid overrun.

base/gstype2.c


2017-05-13 10:48:56 +0100
Ken Sharp <ken.sharp@artifex.com>
98fca6146085dc2cf60effb0596e79fe12b3e69f

pdfwrite - make sure an EP pdfmark is not an orphan

Bug #696375 "Seg faults found by fuzzing in cos_object_memory (gdevpdfo.c:189)"

The fault is caused because the initial /BP pdfmark is corrupted. This
means that a substream and resource for the 'Picture' has not been
created, leading to us trying to dereference a NULL pointer.

If the resource is NULL< throw an 'undefined' error instead.

devices/vector/gdevpdfm.c


2017-05-12 13:15:06 +0100
Ken Sharp <ken.sharp@artifex.com>
7df7d8b6c37ca2d42ffcf1eb5bc795e741241259

Remove descriptions of operators which have been hidden

doc/Language.htm


2017-05-12 11:54:24 +0100
Ken Sharp <ken.sharp@artifex.com>
35a0ead22c8f1f459a4466b435b2486d53e75836

Update documentation to reflect recent utility file removal

doc/Psfiles.htm


2017-05-12 11:20:13 +0100
Ken Sharp <ken.sharp@artifex.com>
a0753746c3b6dd0ee01f37ebf9f3903450e9e832

remove deleted file references from unixinst.mak

base/unixinst.mak


2017-05-12 08:42:31 +0100
Ken Sharp <ken.sharp@artifex.com>
e8750a73313d6083aa949bc5223a26ae55ef02dd

Renove or modify many files from lib and toolbin that are no longer useful

Remove unused packfile.ps and gs_pfile.ps file from lib
--------------------------------------------------------
The PostScript claims to 'Pack groups of files together, with
compression, for use in storage-scarce environments.'

It also states that it 'must be kept consistent with gs_pfile.ps' which
says it is 'Runtime support for minimum-space fonts and packed files'

I've never heard of either of these being used, they aren't used in the
ROM file system and it seems unlikely these days that there is a great
deal of call for minimising file sizes.

If these should need to be reinstated, note that they use .setglobal
.currentglobal and .computecodes. At the time of this commit these
operators were being deprecated and hidden though the C support is
retained. If the C code is later removed then these library files
will not work.

Remove font2c.ps
-----------------
If we want to build a font into C and link it, we have the ROM file
system in place to do so. This no longer seems useful.

remove font2c

Remove impath.ps
-----------------
The apparent purpose of this code is to take a bitmap (scan ?) of a
glyph and turn it into a PostScript type 1 font form, presumably in
order to make a font.

This doesn't seem hugely useful, and seems to me at least borderline
illegal depending on jurisdiction.

We also want to remove, or at least disable, the .imagepath operator
which this program (and only this program) relies upon. If we ever
need to re-instate this program, we will also need to reinstate
.imagepath

Remove pdfinflt.ps and pdfwrite.ps
-----------------------------------
pdfwrite is only (as far as I can see) used by pdfinflt.ps which says:

% It is not yet ready for prime time, but it is available for anyone wants
% to fix it.
%
% The main problem is:
%
% 1. Sometimes the PDF files that are written are broken. When they are
% broken, GS gets an xref problem.
%
% This problem is actually due to lib/pdfwrite.ps since even
% when no conversion is done, the file is may be bad.

Since it doesn't work, and we can use MuPDF (which does work) for the
same task, I've chosen to delete both these files.

Remove unprot.ps wrfont.ps
---------------------------
unprot.ps 'disables access checks' according to the comments in order
to print out eexec-encrypted type 1 fonts. Since this could, presumably
be used to read a noaccess dictionary and dump type 1 font outlines it
is of dubious legality. (see the comments in wrfont.ps)

wrfont.ps is used to decode a type 1 font, we have better tools for
decoding fonts so this file seems mostly useless.

By the same reasoning we don't need type1ops.ps or type1enc.ps

Remove addxchar.ps
-------------------
This was used to add extended Latin characters to a font. Our fonts
now contain all the standard glyphs that Adobe fonts do, we don't want
to go back down the route of adding (and maintaining) poor quality
additional glyphs to the fonts.

Remove decrypt.ps
------------------
Yet another way to decrypt a type 1 font. In addition to dubious
legality we have better ways to do this.

Remove pcharstr.ps
-------------------
Again, we have better tools for doing this job and the legality of
this tool is debatable.

Remove markhint.ps
-------------------
We believe we now have better tools for dealing with fonts than this.

Delete level1.ps
-----------------
A fairly pointless file.

Remove smoke.ps from toolbin
-----------------------------
Our current testing method is much more thorough.

Remove bughunt.sh
------------------
A 'user contributed file that has not been kept current', since 1995
apparently. I can't believe this is still useful.

Remove pstogsf.bat
-------------------
I'm fairly certain this is long defunct.

Remove showchar.ps
-------------------
another font-related utility, we've deleted the programs it reliee on,
so....

Remove wftopfa
---------------
Wadalab fonts, given these were uploaded by Werner Lemberg I'm as sure
as possible that we don't need these utilities to work with these
fonts.

Remove markpath.sh
-------------------
seems like a moderately pointless file; since it uses flushpage,
which I want to hide, remove it.

Remove quit.ps
---------------
Seriously ? A file which just contains 'quit' ?

Modify various of our utilities to not use Ghostscript extension ops
---------------------------------------------------------------------
We want to hide various of our extension operators, these files used
.devicename, .rectappend, .currentglobal, .setglobal and .namestring

Replaced .currentglobal/.setglobal with currenglobal/setglobal

Replaced .rectappend with a simple PostScript path

Replaced .devicename with currentdevice /Name get

Replaced .namestring with 1024 string cvs

Remove EndOfTask.ps
--------------------
Just a Ctrl-D

Remove gs_rdlin.ps
-------------------
Linux 'readline' support, just sets prompt to nothing

Remove showpage.ps
-------------------
just contains 'showpage'!

lib/EndOfTask.ps
lib/addxchar.ps
lib/decrypt.ps
lib/font2c
lib/font2c.bat
lib/font2c.cmd
lib/font2c.ps
lib/font2pcl.ps
lib/gs_pfile.ps
lib/gs_rdlin.ps
lib/impath.ps
lib/level1.ps
lib/markhint.ps
lib/markpath.ps
lib/packfile.ps
lib/pcharstr.ps
lib/pdfwrite.ps
lib/pftogsf.bat
lib/ps2ascii.ps
lib/quit.ps
lib/showchar.ps
lib/showpage.ps
lib/traceop.ps
lib/type1enc.ps
lib/type1ops.ps
lib/unprot.ps
lib/viewmiff.ps
lib/wftopfa
lib/wftopfa.ps
lib/wrfont.ps
toolbin/bughunt.sh
toolbin/pdf_info.ps
toolbin/pdfinflt.ps
toolbin/smoke.ps


2017-05-11 13:09:29 +0100
Ken Sharp <ken.sharp@artifex.com>
1497d65039885a52b598b137dd8622bd4672f9be

Remove as many non-standard operators as possible

Remove all the Display PostScript operators and all the NeXT extensions

Remove all the operators which do not appear to be used in our code

Remove all the operators which are only used in bound procedures defined
at startup and which can therefore subsequently be removed.

The operators to be undefined are stored in arrays in PostScript and
the C support code is untouched. This means that it is relatively
simple for an end user to restore an operator if required.

Operators which are used in our test suite files are listed in the
arrays but commented out.

Operators which are used (by our own code) in a way which requires them
to be present are also listed in the arrays, but commented out.

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


2017-05-12 13:47:34 +0100
Ken Sharp <ken.sharp@artifex.com>
0072619f46f89e0c7406160d4829bccda314b37d

ps2epsi - reapply fix

Bug #697890 "Bug 689832 still unresolved in master"

The fix for this was applied (contrary to the report in 697890) but it
was later removed as part of the fix for bug #688500.

I presume this was accidental, since 688500 predates 689832, but the
fix was applied later. I don' know how this happened and after 8 years
I don't propose to worry about it.

Just reapply the fix for 689832

lib/ps2epsi.ps


2017-05-12 11:22:55 +0100
Joseph Heenan <joseph@emobix.co.uk>
0feca09fccfa3b45b095f85a9627a89954b03d58

Update URLs in jbig2dec README

jbig2dec/README


2017-05-11 18:23:55 +0100
Robin Watts <robin.watts@artifex.com>
fdd5bef4c19dcc653b07c5cfd3cea4de13aab0f7

Tweak MSVC build flags for profile builds.

Always build with frame pointers enabled, otherwise we get no
stacktraces, which makes the profiles much less useful.

base/msvccmd.mak


2017-05-11 13:30:45 -0600
Henry Stiles <henry.stiles@artifex.com>
ce0dd3907f01e93cc42c1b5e5d18c996cf7822e9

XPS and PXL did not set the scan converter option.

pcl/pxl/pxtop.c
xps/xps.mak
xps/xpstop.c


2017-04-17 16:23:41 -0600
Henry Stiles <henry.stiles@artifex.com>
9cbd475a13e5b0992bb7f8e33d75eb246c1a622d

There is no reason to flush the cache when writing mode changes.

pcl/pxl/pxgstate.c


2017-05-11 16:42:34 +0100
Ken Sharp <ken.sharp@artifex.com>
181ebf1c8c07c5411e98d50cbac86511e0098e4d

PDF interpreter don't warn about Decode for ImaegMasks

An imagemask could result in a warning about Decode arrays being the
wrong length if the current colour space was not DeviceGray.

This commit properly checks to see if the image is an ImageMask and
checks the Decode length is 2.

Resource/Init/pdf_draw.ps


2017-05-11 14:07:48 +0100
Chris Liddell <chris.liddell@artifex.com>
ccfd2c75ac9be4cbd369e4cbdd40ba11a0c7bdad

Bug 697892: fix check for op stack underflow.

In the original fix, I used the wrong method to check for stack underflow, this
is using the correct method.

psi/zfrsd.c
psi/zmisc3.c


2017-05-11 09:57:48 +0100
Chris Liddell <chris.liddell@artifex.com>
31f9fddb4a330c21ea8268fc9e8ae0ead23296bf

Bug 696417: fully initialise TTF bytecode context.

Although the font and CVT programs aren't supposed to use certain opcodes,
specifically, in this case, the opcodes that reference the contents of the
zone pointers. But this font contains programs that do. Since other interpreters
handle this, just ensure we initialize the context fully (so the zone pointers
are valid) before executing the context.

base/ttobjs.c


2017-05-10 18:43:25 +0100
Chris Liddell <chris.liddell@artifex.com>
6839638079bab4dc6f1e9e87e340e98b2e39ba7c

Bug 696421: check for infinite recursion in TTF composite glyph

This font contains a composite glyph that references itself, resulting in
infinite recursion when we try to retrieve the metrics for the glyph.

Add a check for this (trivial) case.

base/gstype42.c


2017-05-10 18:20:38 +0100
Chris Liddell <chris.liddell@artifex.com>
496ebe4757eb630d09589a577738891c1e803707

Bug 696422: bounds check number of points in TTF glyph

There was already a bounds check for the number of points in a TTF glyph
outline contour, to avoid buffer overflow, but it failed to check that the value
was positive. In this case, the value is negative, which caused loops to fail
to exit. This is sufficiently broken, we can only give up and return an error

base/ttfmain.c


2017-05-10 16:33:34 +0100
Chris Liddell <chris.liddell@artifex.com>
85cd173e3ceeb638a2b035e057a0497f10547978

Bug 694150(2): Ensure lzw state is fully intialized.

valgrind identified an issue where the OldTiff flag in the lzw state wasn't
initialized. Although not evident in this case, it was possible for other fields
to also not be set. So, initialize the state fully before using it.

psi/zfdecode.c


2017-05-10 17:50:39 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
ed6c5133a1004ce8d38f1b44de85a7186feda95e

Bug 697683: Bounds check before reading from image source data.

Add extra check to prevent reading off the end of the image source
data buffer.

Thank you to Dai Ge for finding this issue and suggesting a patch.

jbig2dec/jbig2_image.c


2017-05-10 15:34:35 +0100
Robin Watts <robin.watts@artifex.com>
1a624d1bfa1e63ceab87f5e4e22c3daffa2d0f01

Bug 697811 (continued): Fix the other 3 equivalent cases.

Followup from the previous commit, applying the same fix to the
other 3 cases.

base/gxscanc.c


2017-05-10 15:18:34 +0100
Robin Watts <robin.watts@artifex.com>
210893fb2b271717957fcca4e6c049494024cc9d

Bug 697847: Fix SEGV seen in scan converter.

Previously the scan converter had had problems with extremely
large/small values over/underflowing during bezier subdivision.

We'd fixed this by calling into a "_big" variant of the
subdivision routine that sacrificed accuracy in the bottom bit.

Unfortunately, this can cause 'jitter' in the low bits of the
subdivided curves, which can cause scanlines to be crossed
repeatedly. Once a single curve can cross a given scanline
more times than expected, our buffer allocation is too small
and we get crashes such as the one seen here.

The fix is to move to using 64bit accuracy in the _big variant
and thus not introduce the jitter.

base/gxscanc.c


2017-05-10 11:13:04 +0100
Robin Watts <Robin.Watts@artifex.com>
b38f2cb37b7bf469b36ac52b62c4aab6ccf55b6b

Bug 697813: Fix integer overflow leading to buffer overflow.

When calculating the amount of space required for a buffer, we
were using an int. This would overflow, meaning we'd allocate
less than we needed, and then segmentation fault when we overran
the end.

Fix is to count the space required in an int64_t, and check that
that actually fits into a uint (the type passed to the allocation
function) before allocating.

Side note: Surely gs should be using size_t's rather than uints
for its allocation calls?

Also, our error cleanup was freeing the wrong thing. Fix that too.

base/gxscanc.c


2017-05-05 13:25:08 -0700
Michael Vrhel <michael.vrhel@artifex.com>
0bccbb7bc00ffaeee7785544aa796c315f4b579f

Bug 697861 Avoid push of text transparency group when no text is drawn

The text can be handed to the pdf14 device text_begin operation with a graphic
state that has a null device. This occurs when the text state was
set to do no stroke or fill, only movements. In such a case we
don't want to do the text group push until we actually have some
text to draw.

base/gdevp14.c


2017-05-08 16:08:46 +0100
Ken Sharp <ken.sharp@artifex.com>
ab78fab575a8d699aeec7ca37fecff66413cb93b

Ensure FAPI server is present in base font in .FAPIBuildChar

The code used 'I', the FAPI server retrieved from the font dictionary,
without checking to see if it was NULL.

Prevents a seg fault

psi/zfapi.c


2017-05-08 12:16:16 +0100
Ken Sharp <ken.sharp@artifex.com>
24133e312b7824ad1b5bc7701039b34b800b7062

remove #if TEST sections

This code seems to be no longer used, it wasn't compiled and
I can't see a justification to retain it.

base/gscencs.c
psi/zfdcte.c
psi/zfunc.c


2017-05-08 11:48:42 +0100
Ken Sharp <ken.sharp@artifex.com>
2ef1ae95e0b0c7f24a246868dd26339bb5db7160

remove smtf.c, zrop.c, zdosio.c and zfilterx.c from all builds

Some of these were included in some builds, none of the content is
believed to be still useful.

Update the Windows projects to reflect the file deletions

Update develop.htm to also reflect the file removal

Makefile.in
base/smtf.c
base/unix-gcc.mak
doc/Develop.htm
psi/int.mak
psi/os2.mak
psi/zcidtest.c
psi/zdosio.c
psi/zfilterx.c
psi/zrop.c
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2017-05-06 09:26:16 +0100
Ken Sharp <ken.sharp@artifex.com>
f11cb093563ace8c4b831bcb97caff951474e380

Remove some old colour test code and associated operators

psi/zcolor.c


2017-05-06 09:09:54 +0100
Ken Sharp <ken.sharp@artifex.com>
4ee490955006dda75797468ba1a69a71867c8cdb

Delete the unused source file zcsdevn.c from the PostScript interpreter

Remove the reference from the Windows VS projects

Remove the reference in develop.htm

doc/Develop.htm
psi/zcsdevn.c
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2017-05-05 15:38:19 +0100
Ken Sharp <ken.sharp@artifex.com>
ff2243aae6d34e395f0d5cbac93689df7069c09c

Bug 697859 - unchecked operand in .repeatform can cause seg fault

Check that the second operand is a dictionary before we try to use it.

psi/zform.c


2017-05-03 22:06:01 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
b184e783702246e154294326d03d9abda669fcfa

Bug 697703: Prevent integer overflow vulnerability.

Add extra check for the offset being greater than the size
of the image and hence reading off the end of the buffer.

Thank you to Dai Ge for finding this issue and suggesting a patch.

jbig2dec/jbig2_symbol_dict.c


2017-05-04 15:50:46 +0100
Ken Sharp <ken.sharp@artifex.com>
e24e6194ca59d7b556116451490f71d2d85f4642

Bug 697854 - unchecked operand in .seticcspace can cause seg fault

This operator hasn't been used since (I think) the release of 9.0. To
prevent this problem, remove it totally.

psi/zicc.c


2017-05-04 15:13:10 +0100
Ken Sharp <ken.sharp@artifex.com>
956becf97c69ccb2542a37c9a6421159dfe58e4e

Bug 697853 - unchecked operands in .begintransparencymaskgroup

The operator .begintransparencymaskgroup didn't check the type (or
indeed existence) of its 5th parameter. Because this a boolean it
wouldn't have caused an actual problem, but nor would it have correctly
signalled a stackunderflow or typecheck error. Also, we should always
validate the operands.

psi/ztrans.c


2017-05-04 14:16:09 +0100
Chris Liddell <chris.liddell@artifex.com>
59ef159e4c42c84c72130c14825f9517ef53cc16

Extend annotation type control for pdfwrite

The original solution to control the drawing of annotations based on the
annotation type only worked for output devices that do not preserve things
like annotations (i.e. only non-pdfwrite devices).

This applies the filtering to also work with pdfwrite.

Resource/Init/pdf_draw.ps


2017-05-04 14:26:25 +0100
Ken Sharp <ken.sharp@artifex.com>
88667cf67d3a435bc3ba727ab173c77666c8a1bb

Bug 697850 - .getdeviceparms doesn't check operands

This is actually benign because the unchecked parameter is used as an
argument to stack_param_list_write() which simply ignores it if the
type is incorrect. However, its possible we might change this at some
point, I think its best to check the type.

psi/zdevice.c


2017-05-04 13:42:37 +0100
Ken Sharp <ken.sharp@artifex.com>
37f9ba12dad303edca41ef166dd5b8815fb31763

Bug 697848 - .type42execchar doesn't validate parameters

The code made quite a has of parameter validation, it did validate some
parameters, but not very coherently.

psi/zchar42.c


2017-05-04 12:08:02 +0100
Ken Sharp <ken.sharp@artifex.com>
478800857dfc06b0d2d363dd1ef916dbdda061ed

Correct function /Domain array checks

Bug #697858 "Function Domain validation incorrect"

The PDF and PostScript specifications state that the entries in a Domain
array for a function must be such that Domain2i <= Domain2i+1

However the code in fn_build_sub_function() inverted the sense by
checking if Domain2i >= Domain2i+1 and throwing an error if so. This is
of course incorrect for the case where Domain2i == Domain2i+1, this
should not be an error, but the code treated it as an error.

psi/zfunc.c


2017-05-03 12:05:45 +0100
Chris Liddell <chris.liddell@artifex.com>
57f20719e1cfaea77b67cb26e26de7fe4d7f9b2e

Bug 697846: revision to commit 4f83478c88 (.eqproc)

When using the "DELAYBIND" feature, it turns out that .eqproc can be called with
parameters that are not both procedures. In this case, it turns out, the
expectation is for the operator to return 'false', rather than throw an error.

psi/zmisc3.c


2017-05-03 11:47:35 +0100
Chris Liddell <chris.liddell@artifex.com>
2a619d16d86348805b1732fb1e21c88dd00374fd

Add finer control of PDF annotation drawing.

Add the ability to define an array of annotation types that gs should draw,
and ignore the others. On the command line, you'd add:
-c "/ShowAnnotTypes [.....]" -f <input file>

Where the array can contain one or more of:
/Stamp
/Squiggly
/Underline
/Link
/Text
/Highlight
/Ink
/FreeText
/StrikeOut
/stamp_dict

Resource/Init/pdf_draw.ps
doc/Use.htm


2017-04-26 22:12:14 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
5e57e483298dae8b8d4ec9aab37a526736ac2e97

Bug 697693: Prevent SEGV due to integer overflow.

While building a Huffman table, the start and end points were susceptible
to integer overflow.

Thank you to Jiaqi for finding this issue and suggesting a patch.

jbig2dec/jbig2_huffman.c


2017-04-27 13:21:31 +0100
Chris Liddell <chris.liddell@artifex.com>
04b37bbce174eed24edec7ad5b920eb93db4d47d

Bug 697799: have .rsdparams check its parameters

The Ghostscript internal operator .rsdparams wasn't checking the number or
type of the operands it was being passed. Do so.

psi/zfrsd.c


2017-04-27 13:03:33 +0100
Chris Liddell <chris.liddell@artifex.com>
4f83478c88c2e05d6e8d79ca4557eb039354d2f3

Bug 697799: have .eqproc check its parameters

The Ghostscript custom operator .eqproc was not check the number or type of
the parameters it was given.

psi/zmisc3.c


2017-04-27 12:34:19 +0100
Chris Liddell <chris.liddell@artifex.com>
5603e8fc3e59c435318877efe627967ee6baebb8

Bug 697769: cmap tab for symbolic fonts, and format 4 cmap parsing

This involved two problems:
Firstly, the logic of whether to treat a font flagged as symbolic *really*
as symbolic was missing a condition. It appears that as well as checking for
a symbolic (3.0) cmap table, we also need to check for a UCS-2 (3.1) cmap
table.

As noted before, this area is poorly documented in the spec, so it is possible
further issues may arise.

Secondly, the fonts in the test file are, in fact, invalid. Each using a format
4 segmented cmap table with only one, non-terminal, segment. According to the
TTF spec, a format 4 table should have a terminating segment whose start and
end codes are 0xffff. These fonts do not have such a segment. As it happens,
we ignore the terminal segment anyway, so by simply tweaking the loop
condition, we can parse the one segment, and retrieve a usable cmap.

Resource/Init/gs_ttf.ps


2017-04-27 12:28:42 +0100
Chris Liddell <chris.liddell@artifex.com>
05d0bbc50ad453990520ed2d2ded3ace538bcb1d

Change TTF cmap procedure name and tidy up

The procedure for parsing the TTF cmap table was called "cmaparray", but it
has returned a dictionary rather than an array for a *long* time. So change
the procedure name to "cmapdict".

In the format 4 cmap parsing, left over from when we did return an array, we
looped over the codes, counting as we go, so we could allocate an array large
enough to hold all the mappings, then looped over them again to fill in the
array.

As we now use a dictionary, there is no need to pre-count, so the first
loop was redundant - remove it.

Resource/Init/gs_ttf.ps


2017-04-20 09:54:44 +0100
Chris Liddell <chris.liddell@artifex.com>
e589d67461e7e522c8af6cb9cc61064018b6a4fc

Bug 696379: Handle error correctly in font with CDevProc

In event of a Type 1 charstring font throwing an error setting up for a
CDevProc, ensure we use the correct path to exit the function, doing the
required cleanup along the way.

psi/zchar.c


2017-04-19 16:20:49 +0100
Chris Liddell <chris.liddell@artifex.com>
7e78f3a285bb41a6d3a33d608c6ba9d00b9cd107

Ensure gs is sufficiently inited before using PS memory

Spotted by accident: having "-o" first in the command line can cause a
segfault

psi/imainarg.c


2017-04-06 22:10:30 +0100
Chris Liddell <chris.liddell@artifex.com>
88fc69e9bf5bfc73ce906c038b09bc8055dabe96

Bug 697722: Skip glyph cache with vertical substitution

The way PXL implements vertical glyph substitution means it defeats our glyph
cache logic - the cache doesn't have the information to differentiate between
a vertical substitute and a regular glyph.

As this is a very rarely used feature, the simplest solution is to disable use
of the cache when vertical substitutes are in force - it will neither lookup
existing, nor add new glyph instances to the cache.

If we start seeing more jobs using vertical glyph substitution, and this proves
to be a performance bottleneck, we can revisit this and add the required data
for the cache to handle these (and possibly other) cases.

pcl/pxl/pxfont.c


2017-04-25 21:05:27 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
7f5fb63f7f2ef5ff3f234e0653412d8f4a439c0d

Bug 694150 : Fix SEGV in s_LZWD_process.

Prevent using prev_code < 0 which would make an entry before the table.
This in turn means that when a length of 4 is decoded, the decoder fails
to find the eod and continues to write off the end of the memory segment.

base/slzwd.c


2017-04-26 16:12:10 +0100
Ken Sharp <ken.sharp@artifex.com>
1d2ba380aaa4df253bb6a1237f136ab4984657bd

PDF interpreter - Apply /Widths to illegal (empty) type 3 CharProcs

Bug #697805 "Incorrect spacing between text"

The file (created by the Skia graphics library) embeds all the fonts as
type 3, the CharProc for the space glyph is embedded as an empty stream:

17 0 obj
<<
/Length 0
>>
stream
endstream
endobj

The specification does not say what should happen if the /Width entry
is not the same as the actual width in the glyph description, but we
choose to use the /Width, because from prior experience we know that's
what Acrobat does.

However, this glyph is illegal, because it contains neither a d0 nor a d1
operator. We apply the Widths override when executing d0 or d1, so if
the (required) operator is not present in the glyph description we
cannot override it.

In this commit we detect a 0 length stream and treat it the same as a
missing stream; we execute a dummy d1 which enables us to do the
Widths override.

Resource/Init/pdf_font.ps


2017-04-26 10:20:12 +0100
Ken Sharp <ken.sharp@artifex.com>
d648ec8c6935387d485b1d9be56e2d147109616f

(e)ps2write - add definition of MacRoman Encoding

Bug #697733, follow on from commit c90836f3782ce8e8f3076cb8b50503cfe91dabcf

The previous commit altered to using MacRoman Encoding for embedded,
subset TrueType fonts, because we prefer the 1,0 CMAP subtable from
such fonts. However, MacRoman is not a standard Encoding for PostScript
interpreters. Add it here.

devices/vector/opdfread.ps


2017-04-25 17:08:26 +0100
Ken Sharp <ken.sharp@artifex.com>
8556b698892e4706aa0b9d996bec82fed645eaa5

PS interpreter - remove superexec from systemdict

This looks like bit rot, superexec was meant to have been undefined from
systemdict, and moved to internaldict, but the code only executed if
superexec was defined in the current dictionary. It seems that at some
time in the past the order of execution was changed in such a way that
the current dictionary at that point was no longer systemdict.

So instead of checking currentdict, explicitly check systemdict.

This means changing our gs_cet.ps file which we use for the Quality
Logic CET (Command Emulation Test) suite so that it can find superexec
and use it to set up our environment in a specific fashion, to prevent
spurious differences when running the tests.

If sueperexec isn't available when we run the CET tests we'll get an
error, which sounds like a good idea, hopefully we'll notice that.

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


2017-04-25 13:38:33 +0100
Ken Sharp <ken.sharp@artifex.com>
31cb597dbbff0a6aebe48469568837e2844cdfdc

A better DSC Parser fix for bug #697800

Commit 06d283c4a20fe7ec727bebb56404242734ea2d70 checked the number of
operands, but this is a better fix, since it also correctly checks the
type of the dictionary operand, which the previous fix didn't do.

psi/zdscpars.c


2017-04-25 13:03:22 +0100
Ken Sharp <ken.sharp@artifex.com>
06d283c4a20fe7ec727bebb56404242734ea2d70

DSC parser - check number of operands supplied

Bug 697800 "Null pointer dereference in zparse_dsc_comments()"

The custom operator .parse_dsc_comments wasn't checking the number of
operands supplied, before attempting to validate them. If not enough
were supplied it ended up falling off the bottom of the operand stack.

Generate a stackunderflow error when this happens.

psi/zdscpars.c


2017-04-24 12:01:53 +0100
Ken Sharp <ken.sharp@artifex.com>
db4cb499fbc3c87b2b0182e550c82eb3c93fc1b4

PS interpreter - restore correct error behaviour for invalid /Decode arrays

PDF interpreter - trim excessively long Decode arrays to the correct length

Bug #697787 " regression, several EPS figures which work fine with gs <= 9.07 throw Error with gs > 9.08"

commit 89c224b029357002c48660dae98de2d1e560d4e0 was applied to fix
bug #694276, and the fix was, I'm afraid, incorrect.

The bug in question was a PDF file where the /Decode array was too long
(by 1 entry) for the actual colour space. This caused the PostScript
interpreter to (correctly) throw an error. Ray fixed this by altering
the PostScript interpreter so that it did not throw an error when the
Decode array was too long, but instead used the requisite number of
elements.

This is not correct, the PostScirpt interpreter should throw an error.

The file attached to this report is an EPS file which relies (horribly)
on getting an error when the Deocde array is too long for an image, and
uses that to call colorimage instead.

By not throwing an error we treat the image as being in DeviceGray and,
since the data is actually RGB, only read 1/3 of the image data. We then
attempt to carry on from that point and throw real errors due to reading
from the middle of a data string.

This commit reverts (significant) the changes in commit
89c224b029357002c48660dae98de2d1e560d4e0. It also addresses the 'bug'
in report #694726 by shifting the checking to the PDF interpreter and
having that correctly set the decode array.

Resource/Init/pdf_draw.ps
psi/idparam.c
psi/zimage.c


2017-03-28 09:22:23 -0700
Ray Johnston <ray.johnston@artifex.com>
5fa7596d8d467e98fbc069d11b7a3769f7d024f0

More fixes for tag plane problems.

tests_private/comparefiles/Altona_Technical_v20_x4.pdf Page 7 had a
problem in blending when nos_knockout was true that ignored the tag.

This also showed up cases where the alt_dev_color was not updated with
the tag (e.g. tests_private/comparefiles/0000728-simpleNG.pdf).

Another difference that tests_private/comparefiles/Bug689761.pdf shows
is that "gsave fill grestore stroke" reverts the dev_color with grestore,
but doesn't change the dev->graphics_type_tag. Keep the tag in the
dev_color structure so that we know if the dev_color needs unset.

Fix the ensure_tag_is_set inline function to make sure BOTH the device's
graphics_type_tag AND the dev_color.tag are set correctly.

We need to write and read the pattern tag plane for raster patterns with
transparency. Seen with tests_private/comparefiles/Bug689422.pdf

Lastly, the ensure_tag_is_set in gs_shfill needs to happen before the
remap_color (since it may unset the dev_color if the tag was different).

base/gdevdsha.c
base/gdevp14.c
base/gscolor3.c
base/gsdcolor.h
base/gsdevice.c
base/gsht.c
base/gsptype1.c
base/gxblend1.c
base/gxdcolor.h
base/gxgstate.h
base/gxp1fill.c
base/gxpcmap.c
base/gxpcolor.h
base/lib.mak


2017-04-18 09:38:17 -0700
Ray Johnston <ray.johnston@artifex.com>
35a5977484afecae01afc92f5018709feba6bc91

gs_fillpage should set the tag to UNTOUCHED, not PATH.

This produces tag plane differences in areas that have transparency
that are painted (touched) in a transparency group since the page level
buffer will now have tag UNTOUCHED == 0 instead of PATH, so areas that
were PATH+TEXT or PATH+IMAGE can become just TEXT or IMAGE (which is
correct).

base/gspaint.c


2017-04-10 12:23:00 -0700
Ray Johnston <ray.johnston@artifex.com>
82ec3b5eef0a530666044dc94b6ba94ed9aa15b6

Set color_info separable_and_linear for bitrgbtags device.

Since this device is separable and linear, we can skip the testing in
check_device_separable and check_device_compatible_encoding. We can
safely set GX_CINFO_SEP_LIN_STANDARD since the low (color) bits are
compatible with the pdf14_encode_color_tag.

This shows up many shading differences since the device was being
(incorrectly) classified as SEP_LIN_UNKNOWN which would then flatten
color patches and use fill_trapezoid rather than the preferred
fill_linear_color_trapezoid (the latter writes less data to the
clist).

devices/gdevbit.c


2017-04-20 14:34:43 -0400
Steve Phillips <steve.phillips@artifex.com>
59c7840aea41253d274d9037b637e60c38359f9f

Auto-generate opdfread.h from opdfread.ps during the build using packps tool

This commit implements a new packps tool which converts PostScript files
to packed arrays of C strings, providing a method to compile PostScript
code directly into the executable. Using this tool, the opdfread.h
file is now derived from devices/vector/opdfread.ps.

- The packps utility is built from the new file base/pack_ps.c.
- opdfread.ps has been moved from lib to /devices/vector. This is
now the reference file for the opdfread header procset code.
- opdfread.h has been removed from /devices/vector and is now built
within the DEVGEN directory as part of the make process.
- For Windows builds, a stale file reference to Resource\Init\opdfread.ps
has been removed from the project file. Additionally, a file reference
to opdfread.ps has been added to the /devices/vector source list, and
the reference to opdfread.h has been removed from the header file list.

base/gs.mak
base/msvctail.mak
base/pack_ps.c
base/unix-aux.mak
base/unix-end.mak
devices/devs.mak
devices/vector/opdfread.h
devices/vector/opdfread.ps
windows/ghostscript.vcproj


2017-04-20 13:42:31 -0400
Steve Phillips <steve.phillips@artifex.com>
7daa44b70e213e704e0da53032a89bf56ff07e0a

Reconcile differences between opdfread.h and opdfread.ps

This change reconciles all differences between devices/vector/opdfread.h
and lib/opdfread.ps so that they contain exactly the same PostScript code,
other than whitespace differences and comments. The opdfread.h file was
originally created through a one-time conversion of opdfread.ps to an array
of C strings, and opdfread.h is currently used as the reference code for
source builds. These two files have diverged slightly over time, so the
unused code in opdfread.ps was no longer up-to-date.

In this commit, all differences between these two files have been reconciled
so that either the header file or the PostScript version can be used as the
reference copy. A subsequent commit will add a tool to derive opdfread.h
from opdfread.ps during the build process, which will use opdfread.ps as
the master copy instead. This commit ensures that this tool change will
not introduce any functional differences in the generated header file.

For ease of comparison, all whitespace-only changes (removing spaces and
moving code to different lines) have been made in opdfread.h, so there are
no functional changes to this module.

The changes to opdfread.ps resolve all remaining functional differences,
with opdfread.h used as the reference source for any changes.

With these changes, the new packps tool converts opdfread.ps to a C
file which matches opdfread.h exactly, other than the header comments
at the top of the file.

devices/vector/opdfread.h
lib/opdfread.ps


2017-04-20 13:57:21 +0100
Robin Watts <robin.watts@artifex.com>
18174668ea815c7830841a511f1dc850557772a9

Scan converter: Remove 2 outdated asserts.

base/gxscanc.c


2017-04-20 12:31:22 +0100
Robin Watts <robin.watts@artifex.com>
53c1849dabf14941bc191506b6feaf2d6f7817cb

Add missing braces in scan converter code.

The lack of these could cause memory overwrites when
DEBUG_SCAN_CONVERTER was enabled.

base/gxscanc.c


2017-04-20 11:57:14 +0100
Ken Sharp <ken.sharp@artifex.com>
13b97d2c1b4c8a819e0682047d044f9308a56174

Initialise path bounding boxes.

Bug #697770 "Inconsistent behaviour"

The problem is that gx_path_init_bbox_accumulator() sets bbox_accurate
which is later used to signal that the attached bbox is valid and
accurate.

But we don't actually initialise the bbox member at all, in the bug in
question the glyph has no contours, so creates no path, leaving the
bbox uninitialised. But because we have set bbox_accurate we just
copy the values when determining the font bounding box, leading to
insane values.

Initialising the bbox gives more reasonable results.

base/gxpath.c


2017-04-19 12:06:39 +0100
Robin Watts <robin.watts@artifex.com>
8210a2864372723b49c526e2b102fdc00c9c4699

Bug 697762: Fix scan converter SEGVs.

The SEGVs are caused by the scan converter allowing less room
in the table than is actually required. This happens due to
the mark_curve subdivision overflowing.

For example, if we have a curve such as:

0 0x80000000 moveto
0 0x80000000 0 0x80000000 0 0x80000000 curveto

Then the current subdivision logic does:

fixed ay = (sy + c1y)>>1

For sy = c1y = 0x80000000 this gives ay = 0, when clearly
the average should be 0x80000000.

An alternative formulation of the splitting code:

fixed ay = (sy>>1) + (c1y>>1)

gives the required result, at the expense of dropping accuracy at
the low end.

This commit therefore has 2 formulations of the splitting code, one
for 'big' values (values that might overflow), and ones for normal
values (values that won't).

We select between the two pieces of code by comparing the top 2
bits of each value; if they differ, then we use the big variant.

Also, when calculating the size of the table required, we were
incorrectly closing the curve more often than we needed to. This
had no ill effect other than inflating the amount of memory we
needed.

base/gxscanc.c


2017-04-18 12:37:21 +0100
Ken Sharp <ken.sharp@artifex.com>
0f598a2c56f2ccec4ecf67f8f585a340b04057ef

PDF interpreter - detect missing 'endobj' on final object in file

Bug #697761 " Broken PDF (missing endobj on final object) causes error"

The sample file has the final two objects (Info and Catalog dictionaries)
written with missing 'endobj' Our normal processing catches that in the
body of the file, but if its the final object, then we carried on and
tried to process the entire trailer and xref.

Add 'xref' to the entries in resolveopdict and treat it as a missing
endobj. While we're here, add an error message for the case of detecting
an 'obj' when resolving an object. We already handle that, but we
weren't producing an error for it.

Resource/Init/pdf_base.ps


2017-04-17 15:41:11 +0100
Robin Watts <robin.watts@artifex.com>
3e7e5272faf866419473a7c8e0149028bdfb4add

MSVC: Fix x64 'All' configuration.

windows/GhostPDL.sln


2017-04-15 14:33:08 +0100
Ken Sharp <ken.sharp@artifex.com>
43ed8ae1ce7e254866d443176e48c9ca6787db35

subclassing devices - process the graphics_type_tag into all chained devices

The tag devices encode the type of operation into the device color, if
the devices graphics_type_tag has the GS_DEVICE_ENCODES_TAGS bit set.

The specific tag is maintained by altering the graphics_type_tag in the
device structure using a device method (set_graphics_type_tag). However,
when checking to see if the tag needs to change (for a different marking
operation type), the code does not, as might be expected, use a
symmetric device method such as get_graphics_type_tag. It was felt that
the performance impact would be unacceptable. Instead the
graphics_type_tag of the *current* device in the graphics state is
inspected directly from the structure.

This means that every device chaining method (and there are several,
see ghostpdl/doc/subclass.htm) needs to ensure that every device in
the chain sets its graphics_type_tag in the device structure, *and*
passes that on to any underlying devices.

Apparently the 'forwarding' devices already do this, I presume the clist
and transparency compositors do as well, I haven't checked. The obselete
'device filter chain' does not, the subclassing devices did not either.

Its also important (for pattern colour spaces) that we track the tag
even when we are not actually rendering.

So here we remove the code from the First/Last page device which skipped
tags on elided pages. This means the device can instead use the standard
subclassing default method.

In the standard subclassing default method we now update the tag on the
current device in the chain before passing it on to the next device.
This means that all devices in the chain now track the tag. An important
note for any subclassing devices which implement a set_graphics_type_tag
method is that it must set the tag in its device structure. So we document
that as well.

base/gdevflp.c
base/gdevsclass.c
doc/subclass.htm


2017-04-14 14:19:53 -0700
Michael Vrhel <michael.vrhel@artifex.com>
22d8a2653ae532c7c23aa9a441e6c120edd9bdef

Add back icc support for PNG output

When the png library was updated, the embedded ICC profile
was no longer getting written. This fixes the issue as
well as fixes a minor issue in our setting of D50 in the
resource ICC profiles which prompted a warning from the
PNG library.

devices/gdevpng.c
iccprofiles/default_cmyk.icc
iccprofiles/default_rgb.icc
iccprofiles/gray_to_k.icc
iccprofiles/lab.icc
iccprofiles/ps_cmyk.icc
iccprofiles/ps_gray.icc
iccprofiles/ps_rgb.icc
iccprofiles/srgb.icc


2017-04-13 16:01:02 +0100
Ken Sharp <ken.sharp@artifex.com>
6d65aaa8af3a9f56c1828e7943c6e1c8b93cf614

PCL - remove the 'bias' from glyph indices before use, if present

Bug #697744 "Accents not handled correctly"

In plfont.c, pl_glyph_name, we use the 'glyph' (which is of type
gs_glyph) as an index to retrieve a glyph name from a TrueType font.

However, as per the documentation in gsccode.h, if the glyph is truly
an index (as opposed to a name) then it is biased by GS_MIN_GLYPH_INDEX
which means that attempting to use it directly as an index into the font
fails, and returns no name.

This causes pdfwrite multiple problems; firstly it causes the original
glyph to be rendered as a bitmap. Then, because the glyph is a composite
glyph (its made up of two or more other glyphs) subsequent uses of the
same glyph cause it to become confused, and use the initail component
glyph.

This can be easily resolved simply by testing to see if the glyph is
biased by GS_MIN_GLYPH_INDEX and, if it is, removing the bias.

In addition to fixing the reported problem a number of test suite files
show progressions (accents now present) and small but useful quality
improvements (glyphs no longer rendered as bitmaps) as well as being
able to properly extract text from either the PCL or the output PDF file.

pcl/pl/plfont.c


2017-04-12 16:02:33 +0100
Ken Sharp <ken.sharp@artifex.com>
c90836f3782ce8e8f3076cb8b50503cfe91dabcf

(e)ps2write - use correct encoding for subset TrueType fonts

Bug #697733 "Character section is not handled with eps2write"

We carry around a 'base encoding' with fonts, which is generally the
encoding of the original font, potentially 'refined' to a more useful
encoding if its originally one we can't use.

For TrueType fonts, we would either Standard or ISOLatin1, and in fact
almost always StandardEncoding.

The problem is that if we are subsetting the font, then we *don't* embed
the original font's CMAP subtable, we generate a new pair, one of Windows
Unicode (3,1) and one of Mac Roman (1,0). Neither is suitable for use
with StandrdEncoding and in fact the opdfread code will always use the
MacRoman Encoding.

This can lead to a problem if the same glyph name is encoded in one or
other Encodings, and is either missing or in a in a different position
in the other.

When we encode the string we will use StandardEncoding, and the opdfread
code will read the character codes using MacRoman Encoding, so the
Charstrings dictionary will be incorrectly constructed and glyphs will
either become notdef or potentially use the wrong glyph.

To fix it; if we have a TrueType font, and are subsetting it, select
a Base Encoding of MacRoman. Update the refine_encoding procedure to
permit a TrueType fotn to have MacRoman encoding.

This shows a minor progression in one file in the test suite;
Bug691848.ps, surprisingly with Kanji text.....

devices/vector/gdevpdtt.c


2017-04-11 14:55:26 -0700
Ray Johnston <ray.johnston@artifex.com>
e90c8f5a93e274b02b7e25762ef83995455f8464

Yet another fix for tag handling that affects shading fills and pdf14

The comp_shift that is relied upon for color generation in fill_linear
color_scanline did not work because the comp_shift[num_components] was
not set for the pdf14 device when the device "has_tags".

Also fix a bunch of whitespace variances.

base/gdevp14.c


2017-04-07 18:39:58 +0100
Robin Watts <robin.watts@artifex.com>
ba92812e5a25c3c1f8d13c79e584398d2250b72a

Scan Converter: Speed tweak to sorting.

When sorting the intersects on a scanline, if the list is short
use inline sort code, rather than calling qsort. This is a big
saving in runtime, presumably due to function call overhead.

This reduces the bug 697678 time from 40 seconds to 35.

base/gxscanc.c


2017-04-10 18:10:32 +0100
Robin Watts <robin.watts@artifex.com>
31aefb5777a72c54363685498c07f2cd00867525

Scan converter: Simplify edgecmp comparison.

It *shouldn't* matter the order we treat up/down edges in,
therefore, it shouldn't matter if we alter our sort routine
to actually care about the bottom bits. This results in
simpler (and hence, hopefully, faster) code.

base/gxscanc.c


2017-04-07 18:15:21 +0100
Robin Watts <robin.watts@artifex.com>
9eb97696875fb97b08321aba009c14419a4feeba

Tweak make_table for speed.

base/gxscanc.c


2017-04-10 18:47:43 +0100
Robin Watts <robin.watts@artifex.com>
81385210e0d484050ee6ed7898b03ebcc5105ba1

Scan converter: Fix double written pixels

The any part of a pixel (non trap) code could occasionally double
write some pixels. Fixed here.

base/gxscanc.c


2017-04-10 18:09:07 +0100
Robin Watts <robin.watts@artifex.com>
bc739b046c0490e5ab941ef2942eadac37a2ce13

Squash a float <-> double warning.

base/gxiscale.c


2017-04-10 18:05:44 +0100
Robin Watts <robin.watts@artifex.com>
e16d0c760651b973d5a750524cf9e69df8601256

MSVC: Profile builds. Ensure linker optimisations are enabled

/DEBUG disables optimisations, so add /OPT:REF and /OPT:ICF to
reenable them.

base/msvccmd.mak


2017-04-07 18:06:15 +0100
Chris Liddell <chris.liddell@artifex.com>
74f9d86d60c8ded49d0df2c23bec2d68fea1f6b5

Revert "gs_malloc_memory_t: change type of limit/used/max_used"

This reverts commit 47417a5cbfbfa3d7bb9ee387909246cdd265d4ff.

Until I can debug the errors is causes on Windows.

base/gsalloc.c
base/gsmalloc.c
base/gsmalloc.h


2017-04-07 15:09:29 +0100
Robin Watts <robin.watts@artifex.com>
1cd00def041e82e66e2ea12a153801552b64246e

Squash warning.

./base/gsfont.c:1006:12: warning: overflow in implicit constant conversion [-Woverflow]

base/gsfont.c


2017-04-07 13:15:46 +0100
Robin Watts <robin.watts@artifex.com>
9eae07a45a76f8944d7fbfe1fb4546f473fcf400

Further scan converter work inspired by Bug 697678

This applies the same changes done for the any-part-of-a-pixel,
trapezoid case to the any-part-of-a-pixel non-trapezoid case.

base/gxscanc.c


2017-04-05 17:56:14 +0100
Robin Watts <robin.watts@artifex.com>
f158bfa0346833ac2181bc66709cfabff1a12afc

Further work inspired by Bug 697678

Apply the same speedups for vertically clipped paths as have already
been done for the any-part-of-a-pixel, trapezoid case to the
centre-of-a-pixel cases.

The any-part-of-a-pixel, non-trapezoid case remains to be done.

base/gxscanc.c


2017-04-06 08:46:20 -0700
Michael Vrhel <michael.vrhel@artifex.com>
ee57023920599a2209e5e0b7eded2ae9c2002e19

Fix error in color updating

Ray found an issue that would appear to cause problems when we have
transparency and spot colors for the separations devices.
The mask and shift values in color info were not getting set properly
for the spot colors in this case. It is not a real issue
due to the way that the separation device colors are
stored in the devn hl color (planar) but is good to fix
to avoid confusion.

base/gdevp14.c


2017-04-04 14:43:05 +0100
Chris Liddell <chris.liddell@artifex.com>
47417a5cbfbfa3d7bb9ee387909246cdd265d4ff

gs_malloc_memory_t: change type of limit/used/max_used

The limit, used and max_used values in gs_malloc_memory_t were type ulong,
giving rise to differences between LP64 systems (Unix-like) and LLP64 systems
(MS Windows).

So, make them uint64_t for consistency across platforms.

base/gsalloc.c
base/gsmalloc.c
base/gsmalloc.h


2017-04-06 16:44:54 +0100
Chris Liddell <chris.liddell@artifex.com>
bfa6b2ecbe48edc69a7d9d22a12419aed25960b8

Bug 697548: use the correct param list enumerator

When we encountered dictionary in a ref_param_list, we were using the enumerator
for the "parent" param_list, rather than the enumerator for the param_list
we just created for the dictionary. That parent was usually the stack
list enumerator, and caused a segfault.

Using the correct enumerator works better.

psi/iparam.c


2017-03-31 13:36:03 -0700
Ray Johnston <ray.johnston@artifex.com>
063416192c169889ef0b227aab5d912f71640590

Fix gx_default_fill_linear_color_scanline to handle tags.

The fill_linear_color_scanline would calculate linear and separable colors
based on the num_components, which does not include the tags, leaving the
tag value set to 0 (GS_UNTOUCHED_TAG). If the device does need tags
(GS_DEVICE_ENCODES_TAGS set) then set the tag value using the last comp_shift
to GS_PATH_TAG. Seen with Ghent_V5.0/GWG010_CMYK_OP_x3.pdf and the
bitrgbtags device in clist mode.

base/gdevdsha.c
base/gxdevcli.h
devices/gdevbit.c


2017-04-05 11:42:30 +0100
Robin Watts <robin.watts@artifex.com>
9c711b79f1230cbbd346d1cbf7e9bcaa701d2e4c

Scan converter optimisations

Optimise unneeded writes when updating the cursor.

base/gxscanc.c


2017-04-05 12:28:20 +0100
Robin Watts <robin.watts@artifex.com>
d90f7b0782b74201cbca8e40e02800453a48a873

Attempt to fix warning.

./base/gsccode.h:29:20: warning: overflow in implicit constant conversion

base/gsccode.h


2017-04-05 10:38:16 +0100
Robin Watts <robin.watts@artifex.com>
25c8f788cf15829adb5f1e3292f46f9ca9a1c329

Fix scan converter issues.

Commit edba51f ("Bug 697678: Scan converter performance (out of
range lines)." caused 3 SEGVs in the normal tests, but caused
many many more in the overnights.

This commit fixes those. The problems were due to edge effects
on the top/bottom of the edgebuffers, due to differences in
the logic for rising/falling lines.

base/gxscanc.c


2017-03-29 11:08:03 -0700
Ray Johnston <ray.johnston@artifex.com>
ac125ce3320aeb3888c18805cd12136d3e1ebfc7

Fix a problem with tags not being set in dev_color

When the tag is changed, we need to unset the dev_color so that the
device's encode_color gets called to apply the correct tag. Seen with
the bitrgbtags device and the file: tests/pdf/Bug691997.pdf

Also, fix a problem with the hit_detect device (infill PS operator).
If the dev_color is unset in the fill or stroke operation, it would
attempt to remap the dev_color which would fail because the hit detect
device doesn't have a device profile. This sets the grapchis_type_tag
to GS_PATH_TAG so that fill and stroke don't unset (and subsequently
remap in gx_set_dev_color) the dev_color.

base/gdevddrw.c
base/gdevnfwd.c
base/gdevp14.c
base/gscolor3.c
base/gsdps1.c
base/gsimage.c
base/gspaint.c
base/gstext.c
base/gxclrast.c
base/gxdevcli.h
base/gxgstate.h
base/gxpcmap.c
psi/zupath.c


2017-04-04 11:37:35 +0100
Ken Sharp <ken.sharp@artifex.com>
ddb63fcf10ce51416f0921dbb0f7b0dee3cf3849

PDF interpreter - don't remove Filters from streams declared as 0 Length

No bug number for this, the problem arose from a Stack Overflow
question here http://stackoverflow.com/questions/43149372/repairing-pdfs-with-damaged-xref-table/43154410?noredirect=1#comment73447166_43154410

The PDF file is multiply broken, it has invalid xref entries and each
page is an image XObject whose dictionary has an indirect object for
the /Length entry. In every case the Length is defined as 0.

For some obscure reason, sometime in the past someone added code to
remove the /Filter entry from the dictionary when a stream has a
declared Length of 0. I have no idea why, if the stream is compressed
or encoded then removing the Filter can have no useful effect. But
if the Filter is left in place we can still recover from an invalid
Length declaration, provided we properly decode the stream, which
obviously requires us to install the correct Filter(s).

So here we simply remove the code which undefines the Filter in the
stream dictionary.

cluster runs show no differences.

Resource/Init/pdf_base.ps


2017-03-30 14:18:11 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
ea5389d2ff12797df9a1fd932f499223460a3808

Bug 697545: Memory Squeezing fix font cache leak.

Fix font cache leak when memory squeezing:

gs -sDEVICE=bit -o /dev/null: examples/tiger.eps

base/gsfont.c
devices/vector/gdevpdf.c
pcl/pcl/pcfont.c


2017-03-28 22:56:18 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
9fbb9d8695deecfe937ffdd91b9bd69613c1c8df

Bug 697545: Memory Squeezing fix leaks in swproc.

Fix memory leaks in swproc when memory squeezing:

gs -sDEVICE=bit -o /dev/null: examples/tiger.eps

psi/imainarg.c


2017-03-29 20:31:49 -0700
Ray Johnston <ray.johnston@artifex.com>
5499169177746ec62d8440f193be418999f156d4

Change GS_UNTOUCHED_TAG to 0 and GS_UNKNOWN_TAG to 0x40

This is mostly arbitrary, but it sort of makes more sense that UNTOUCHED
be 0 so any marking operation can just OR tag bits into the tag plane or
color (e.g. gdevp14.c).

This will change ALL bitrgbtags regression results.

base/gdevp14.c
base/gscms.h
base/gxblend1.c
base/gxdevice.h
devices/gdevbit.c
lib/viewpbm.ps


2017-03-29 19:26:50 +0100
Robin Watts <robin.watts@artifex.com>
edba51f4647f56b3559451f5fdbfbde04bc87828

Bug 697678: Scan converter performance (out of range lines).

This significantly improves the timings.

Essentially, if we were rendering just a band of a page (say from
Y1 to Y2) and the line extended beyond that (say from Y0 to Y3,
where Y0 < Y1 or Y2 < Y3), we'd have run the bresenham for the
entire range rather than for just the section we needed to.

This was particularly problematic in the example file due to the
use of a clipping device, meaning that we were repeatedly
scan converting lines in 1 pixel high regions.

base/gxscanc.c


2017-03-29 20:36:04 +0100
Robin Watts <robin.watts@artifex.com>
0fe78bcd5eb6cc919e6b0a97aadb6f9259176bc8

Tweak bmpcmp to better handle tags.

toolbin/bmpcmp.c


2017-03-29 21:04:55 +0100
Robin Watts <robin.watts@artifex.com>
7dbcd5da85934c9e437c557c359556f3c67b48d5

Scan converter: Fix restrict in prototypes.

Forgot to change the prototypes while adding restrict.

base/gxscanc.c
base/gxscanc.h


2017-03-29 11:55:40 +0100
Robin Watts <robin.watts@artifex.com>
d6903654402789d60bff227fd916a368991ef3eb

Scan converter: Special case vertical lines.

base/gxscanc.c


2017-03-29 11:55:22 +0100
Robin Watts <robin.watts@artifex.com>
df5be672c357ffc884d0b2f0b7a890e1783ed402

Remove unnecessary assignments from scan converter

base/gxscanc.c


2017-03-28 19:32:26 +0100
Robin Watts <robin.watts@artifex.com>
2342e8533bf55a39226e0c99e75c9d2aae3b3d6b

Tweak Scan Converter.

Mark pointers as restricted to try to alleviate aliasing.

Use static inlines for speed.

base/gxscanc.c


2017-03-28 09:12:05 -0700
Ray Johnston <ray.johnston@artifex.com>
93e2557fb36f69310b7f325c70203ae063ef1fae

Fix clist file to invalidate the read cache upon writing (see bug 697689).

This fixes the unknownerror reported by the bug, but does not totally fix
the use of # false .outputpage with the clist since the data after the
first cmd_opv_end_page is not rendered to the page (stops the clist reader).
The bug is left open for that reason and has been marked bountiable.

base/gxclfile.c


2017-03-24 17:32:14 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
fa6f17de62fd27cef4005f336afcd1ac656dc9af

Bug 697545: Memory Squeezing fix i_register_root leaks.

Fix memory leak for i_register_root allocation when memory squeezing:

gs -sDEVICE=bit -o /dev/null: examples/tiger.eps

base/gsiodev.c
base/gslibctx.c
base/gslibctx.h
psi/imain.c
psi/zfont.c


2017-03-23 09:20:41 +0000
Chris Liddell <chris.liddell@artifex.com>
2eab4ad4d3e861e8e39a10ba58cfdb217b32db78

Remove a pointless typedef

base/gsmemory.h


2017-03-27 09:38:03 +0100
Ken Sharp <ken.sharp@artifex.com>
c06135acc959dbc0458352579bafe238794f2733

pdfwrite - don't try to allocate a 0 length buffer for metadata

Bug #697684 "Regression - Ghostscript 9.21 fails when pdfmark contains certain Unicode characters"

Under some conditions, specifying a 0 length buffer size when calling
gs_alloc_bytes() can return a NULL pointer. Since we use a NULL return
to indicate a failure to allocate a buffer, this results in a VM error.

In this commit we check the data length and don't try to allocate or
use a 0 length buffer.

We'll tackle the allocation problem separately, it would be better if
gs_alloc_bytes didn't return a NULL pointer.

devices/vector/gdevpdfe.c


2017-03-24 11:47:33 +0000
Ken Sharp <ken.sharp@artifex.com>
0d21a58ab12b9584faa54baa48ce0dab350af53e

jbig2dec - refine test for "Denial of Service" images

Bug 697682 "Incorrectly displayed a PDF file on GSView, MuPDF and GhostScript"

In commit 7366747076f3b75def52079bd4d5021539a16394 Simon introduced a
test to try and detect a JBIG2 compressed image which would take an
unreasonable amount of time to process. Unfortunately, the test also trips
up this real world (if rather extreme) example.

The test looks for an image to be > 16MB and for the segment being
processed to contain less than 1/256 of the image data. However, since
we use this same section for symbol decoding, the segment size can be
considerably smaller than that, and still be legal.

This commit alters the image size to 64MB (as this is, frankly, ridiculously
large for a JBIG2 image) and for the segment size to be less than
1/65536 of the total image data. This means that images less than 64MB,
with segments larger than ~1KB might still cause a DOS, but this seems
to be simply a problem we have to accept.

Since the DOS time is dependent on the size of the data, and the size
of the segment, this is a compromise.

jbig2dec/jbig2_generic.c


2017-03-23 19:36:43 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
eb6ebd779b24cf36ac8dd13e3553c9b262235b37

Bug 697545: Memory Squeezing fix events 244 to 267

Fix memory leaks for allocation event number 244 to 267
when memory squeezing:

gs -sDEVICE=bit -o /dev/null: examples/tiger.eps

Setting the init_done level earlier in gs_main_init1 means that the
existing code in gs_main_finit will clean up after any failures in
i_plugin_init and i_iodev_init.

psi/imain.c


2017-03-21 22:38:44 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
6dd92923afc2779975c0c7a128bb12ed92c263ba

Bug 697545: Memory Squeezing updated fix for events 10 to 33

Fix memory leaks for allocation event number 10 to 33
when memory squeezing:

gs -sDEVICE=bit -o /dev/null: examples/tiger.eps

psi/ialloc.c
psi/imain.c


2017-03-21 17:50:14 +0000
Chris Liddell <chris.liddell@artifex.com>
fa182eb185494fae17731f426fb3307d7feda4f0

Bug 697681: fix shared lib build with openjpeg >= 2.1.1

In 2.1.1 openjpeg extended the use of the OPJ_STATIC to use gcc attributes to
hide certain functions, as well as the previous use of preventing the
inclusion of the Windows DllMain function.

As we (in Ghostscript) need the functions the OPJ_STATIC on Linux/Unix hides,
only set the flag for Windows builds.

base/lib.mak
psi/msvc.mak


2017-03-21 17:59:12 +0000
Chris Liddell <chris.liddell@artifex.com>
c17c7bbaad9002b38f4881497fc3ce3cc4eb64e6

Add capability to sign the nsis installer exe

On the nmake command line or in the evironment, it requires the following
variables to be set:
KEYFILE - pfx file containing the key
KEYPWORD - password for using the above key file
TIMESTAMP - URL for the timestamp server

psi/winint.mak


2017-03-21 15:45:34 +0000
Chris Liddell <chris.liddell@artifex.com>
a0e27403bbb991f5a541d39122a92505afb0d1dc

Fix the shared openjpeg build

base/sjpx_openjpeg.c


2017-03-21 12:01:02 +0000
Chris Liddell <chris.liddell@artifex.com>
b8b1d543fe833478c167940110e04ddc353d0f3b

Bug 697677: fix support for --disable-openjpeg

base/lib.mak
base/sjpx_none.c


2017-03-20 09:04:31 +0000
Chris Liddell <chris.liddell@artifex.com>
59d8b2e95d2acd2b7e3f86809fa9ebe8ea7eeb8d

Move invalid_file_stream into gc memory.

At initialisation we create an special stream (in the gs context) to use as an
invalid stream whenever we need one.

It was originally being allocated in non-gc memory. Since the context is in
gc memory, the invalid_file_stream can leak. Rather than add explicit freeing
of the invalid_file_stream, and risk a life span conflict between a gc object
and a non-gc object, it makes it neater, and more sense, to keep the
invalid_file_stream in gc memory. It *is* stable memory (not subject to
save/restore) and allocated as an immovable object (not subject to relocating
by the garbager).

Fixes a problem spotted by Shailesh Mistry while working on memory squeezing
event 170.

psi/icontext.c


2017-03-20 09:34:11 +0000
Ken Sharp <ken.sharp@artifex.com>
309eca4e0a31ea70dcc844812691439312dad091

Ensure a device has raster memory, before trying to read it.

Bug #697676 "Null pointer dereference in mem_get_bits_rectangle()"

This is only possible by abusing/mis-using Ghostscript-specific
language extensions, so cannot happen in a general PostScript program.

Nevertheless, Ghostscript should not crash. So this commit checks the
memory device to see if raster memory has been allocated, before trying
to read from it.

base/gdevmem.c


2016-12-29 17:08:58 +0000
Robin Watts <robin.watts@artifex.com>
dd5da2cb3e08398ac6d86598b36b00994d058308

Make the edgebuffer scan converter the default.

Selecting the new (edgebuffer) scan converter (as is now the
default) has the effect of forcing the fill adjust values to
be 0 or 0.5.

base/gslibctx.h
base/gsstate.c
base/gsstate.h
base/gxfill.c
pcl/pcl/pctop.c
psi/zmisc.c


2017-03-16 18:27:54 +0000
Robin Watts <robin.watts@artifex.com>
c4bff06c6c527af4cdddc2bd4cbd6fef8ffa4e22

Set tags correctly for glyphs when sent as masked images.

In gx_image_cached_char we can end up sending the glyph as
an imagemask. When we do so, the tag is incorrectly reset
to image, rather than text.

Here we correct that by adding an 'image_is_text' flag to
gs_image_init and gs_image_begin_typed.

This can be seen by the fact that:

gs -sDEVICE=bitrgbtags -o out.bit -r600 -dMaxBitmap=1000
tests_private/customer_tests/jw202dwo.pcl

and

gs -sDEVICE=bitrgbtags -o out.bit -r600 -dMaxBitmap=400000000
tests_private/customer_tests/jw202dwo.pcl

give different tag values for the text.

base/gsimage.c
base/gsimage.h
base/gsptype1.c
base/gxccache.c
base/gxfapi.c
pcl/pcl/pctext.c
pcl/pcl/rtraster.c
pcl/pl/pldraw.c
psi/zimage.c
psi/zimage2.c
xps/xpsimage.c


2017-03-06 10:31:53 +0000
Chris Liddell <chris.liddell@artifex.com>
66361d261c6cdcf4d01463ac9d1d769951a32bed

Bring master up to date with 9.21 release branch

Update copyrights in "top" makefiles

Update dates and versions

Update News.html and History9.htm

with highlights and changelogs

Date and product string for 9.21 release

Changelog and News + date for 9.21 release

Dates for 9.21 release

Makefile.in
base/gscdef.c
base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/font2c.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
man/wftopfa.1
psi/winint.mak


2017-03-16 15:57:47 +0000
Chris Liddell <chris.liddell@artifex.com>
4237b0bc1155a781de80c0079d72c0bcdacbb95e

Remove two erroneous uses of return_error

psi/idisp.c


2017-03-16 07:54:26 -0700
Ray Johnston <ray.johnston@artifex.com>
ec32c674469fab173c6df5e97bc3f3aff37e6c92

Fix SEGV with tiffsep1 device found by customer 531.

When "warning_given" was set, the device was cast to tiffsep_device,
but the parameter was in a different offset with the tiffsep1_device.
Move the warning_given to the tiffsep_devices_common part of the structure
so the casting works properly.

devices/gdevtsep.c


2017-03-15 14:15:00 +0000
Robin Watts <robin.watts@artifex.com>
6cd467ecdb2678847670fd22a0d5dd39b89e8ca3

Tweak code in gxfapi.c to avoid repetition.

base/gxfapi.c


2017-03-15 19:04:13 +0000
Robin Watts <robin.watts@artifex.com>
8ad42f17df0c9e7afe25f95ecfae8fd005ac589c

Fix typo.

base/gxclimag.c


2017-03-15 19:38:32 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e146bb38c20e5b967d89e16db244b2beb74ba345

Bug 697545: Memory squeezing SEGV event in gstate_clone

An allocation failure in gstate_clone caused pgs->color to be
freed too early when memory squeezing:

gs -sDEVICE=bit -o /dev/null: examples/tiger.eps

base/gsstate.c


2017-03-15 15:32:03 +0000
Ken Sharp <ken.sharp@artifex.com>
917b4e28c37d5e9ac3a605658f51b29a2357ab28

PDF interpreter - add B operators to spcial 'W' handling

Previously we had altered the handling of stroke, fill and eofill when
in a 'W' context, to detect changes in the graphics state between the
'W' or 'W*' operation and the terminating path operator.

Unfortunately when this was done the B, b, B* and b* operators were
missed, which meant these always behaved as if an invalid graphics
state change was executed, ignored the graphics state change, and
ended up rednering incorrectly.

This commit adds those operators to the special handling of the W and
W* operators.

Resource/Init/pdf_ops.ps


2017-03-15 14:46:49 +0000
Chris Liddell <chris.liddell@artifex.com>
46ef6bc80bd7388883a00aa866af38fe8f05d45b

pdfwrite: properly handle text outside the clip

Bug 697442:

To work around an Acrobat limitation (related to glyphs with very large
coordinates), we don't emit glyph whose bounding box is outside the current
clipping region.

However, the file in question here uses a combination of show and glyphshow to
display text, and it also measures (in the manner of stringwidth) to position
the text. *But* because it relies on glyphshow, it cannot use stringwidth. It
moves the current point outside the page, draws the text (strings and glyph
names), and records how far the current point has moved.

The previous code would skip out early to avoid emitting the clipped out glyphs,
whilst still apparently updating the current point. *But* the values from which
the current point were updated were not correctly set due to skipping out
early.

We now do everything *except* emit the glyphs, thus the various values are
correct, and the currentpoint is updated properly.

devices/vector/gdevpdte.c


2017-03-12 17:07:18 -0700
Ray Johnston <ray.johnston@artifex.com>
16b7f46fa03a82445784608b8db21f11cd76c884

Fix Bug 697661 -- SEGV with tiffsep1 device and threshold array halftones

Threshold arrays create a different type of gx_ht_order than screen type
halftones so the bit_data is short X,Y coordinates instead of offset,mask
(gx_ht_bit) elements that the tiffsep1 "threshold_from_order" code was
expecting. Using the bit_index proc of the order works for all gx_ht_order
types.

TODO: determine if it is possible to use the gx_ht_construct_threshold
function. This function is used in the FAST_HT_CODE used for some
images to halftone devices that need halftoning.

devices/gdevtsep.c


2017-03-11 15:10:00 -0800
Ray Johnston <ray.johnston@artifex.com>
a5a2862d9503fedfb32f46f1cbc669c40497474f

Fix bug 695280 page mode and clist mode differ

The clist mode "uses_color" was ignoring CombineWithColor if the rop
did not use the texture (rop3_uses_T false). This affects the ps3cet
09-40.PS and pcl5ccet/23-11.BIN files.

Note that this reults in these cases not using high-level images
in the clist since currently the clist cannot accomodate the two
different colorspaces (painting an Indexed colorspace image through
a pattern). Since the number of changed file is minimal, I assume
that the performance impact does not affect many files.

base/gxclimag.c


2017-03-10 19:44:43 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
cc35e521d8fb162f97252a3509b9041f4253b818

Bug 697545: Memory Squeezing updated fix for events 10 to 33

Fix memory leaks for allocation event number 10 to 33
when memory squeezing:

gs -sDEVICE=bit -o /dev/null: examples/tiger.eps

psi/ialloc.c
psi/imain.c


2017-03-10 13:14:10 +0000
Ken Sharp <ken.sharp@artifex.com>
acf5451a357a8595e692fe86e0be722a69e036dc

PDF interpreter - avoid looping/recursion searching for Default* spaces

Bug #697655 " gswin32c.exe hangs while interpreting some pdf files"

The (insane) PDF file ended up looping through Resources and XObjects
looking for any instances of the Default* colour spaces. We need the
information to set UseCIEColor to true if any are present, in order
to do proper colour management on the input colours.

Follows the same technique we already use for transparency and cpot
colour searches.

Resource/Init/pdf_main.ps


2017-02-23 18:06:53 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
62a865bbdf2abafabe5971d42c71be2bd1233e5c

Bug 697545: Memory Squeezing fix events 10 to 33

Fix memory leaks for allocation event number 10 to 33
when memory squeezing:

gs -sDEVICE=bit -o /dev/null: examples/tiger.eps

psi/ialloc.c
psi/ialloc.h
psi/imain.c


2017-03-05 20:16:39 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
1df92f6952038fa70aa9cad8c398f360b0323539

Bug 697545: Memory Squeezing fix.

Fix memory leak for allocation event number 170
when memory squeezing:

gs -sDEVICE=bit -o /dev/null: examples/tiger.eps

psi/interp.c


2017-03-07 14:20:23 +0000
Robin Watts <robin.watts@artifex.com>
67dba2b7fdb5adf4b3f8cdf112c7ac67a89a9ea8

MSVC: Add 2 missing files to solution.

windows/ghostscript.vcproj


2017-03-08 10:15:25 +0000
Ken Sharp <ken.sharp@artifex.com>
f37a69d40a6222d903b48b97b58a26151ea2e493

txtwrite - fix Unicode conversion of glyph names 'unixxxx'

More fallout from the ToUnicode revamp required for pdfwrite, commit
9dba57f0f9a53c130ec2771c0ed1d7bd6bbef6ab

The code to handle converting glyphs whose name conforms to the
uniXXXX form, when there is no better ToUnicode information, was still
returning the number of bytes, not shorts. In addition, the original
change was packing the 2 bytes as two shorts instead of a singe short.

This resulted in incorrect output. Fixed here by packing the 4 nibbles
into a single short and returning a count of 1 short.

devices/vector/gdevtxtw.c


2017-03-03 19:42:29 +0000
Robin Watts <robin.watts@artifex.com>
64f5d62c80176085335d84c24e02cd49d9e032b9

Bug 697545: Extend "separable_and_linear" processing.

First, avoid needless check_separable_and_linear tests.

When we make a memory store for a target device, we use
the encoding/decoding color functions from that target
device. It seems reasonable to copy the "separable_and_linear"
information from that device too, to avoid having to needlessly
retest using the same encoding/decoding functions to get
the same answer.

Next, extend gx_color_enc_sep_lin_t to represent not just
whether we know details about the device colors separability
and linearity (and what those details are if known), but also
to encode whether those are standard encodings or not. The
standard encoding is defined to be "that which is compatible
with the pdf14 compositor".

Finally, we add a function, check_device_separable_encoding,
that 'promotes' the record for a given space from being a
known separable_and_linear one, to one that knows it's
separable_and_linear, but also knows whether it uses the
standard encoding.

Call this in clist_close_writer_and_init_reader to ensure that
the buffer device is created knowing whether it's a standard
encoding or not. If called here, it only ever needs to run once.

Call it again in pdf14_ok_to_optimize (just in case we ever slip
through - this takes no time if it has been run already). This
enables us to make a correct choice, and to avoid skipping
transparency bands if we are not using the standard (pdf14
compositor compatible) encoding.

base/gdevdflt.c
base/gdevmem.c
base/gdevp14.c
base/gscspace.c
base/gsicc.c
base/gsovrc.c
base/gxclread.c
base/gxcmap.c
base/gxdevcli.h
base/gxdevice.h
base/gxshade6.c
psi/zcolor.c


2017-03-07 10:24:37 +0000
Robin Watts <robin.watts@artifex.com>
ddd39cb2ea1773bf001cd4f975856446c2bd7f43

Bug 696915: Second attempt at fix.

In attempting to fix a buffer overrun in mapped8_copy01, I broke it.
This is a proper fix. Previously I'd missed the increment of count
after the loop.

base/gdevm8.c


2017-03-07 10:08:11 +0000
Robin Watts <robin.watts@artifex.com>
1a7bfc5dd6d84a15bba163c0f7328fb766d8be20

Revert "Bug 696915: Fix buffer overread in mapped8_copy01."

This reverts commit 4e646ef8103f3ab2ab9d7de64bd30cc2156f0441.

Cluster testing shows problems with this.

base/gdevm8.c


2017-03-06 10:00:11 +0000
Chris Liddell <chris.liddell@artifex.com>
b46bb757037a18bfcc95e61fbe751df5e4cfdd58

Bump version number.

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


2017-03-16 09:20:11 +0000
Chris Liddell <chris.liddell@artifex.com>
f80288c8a4b9c9abfc0fa3ccce3b6d169baa59ff

Dates for 9.21 release

doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/font2c.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
man/wftopfa.1


2017-03-16 09:19:16 +0000
Chris Liddell <chris.liddell@artifex.com>
a96ade6b7238764b1a940dafbe2b7d52932f66ec

Changelog and News + date for 9.21 release

doc/History9.htm
doc/News.htm


2017-03-16 09:13:57 +0000
Chris Liddell <chris.liddell@artifex.com>
db6fa66eba7427854f491738500ecf9f179446fc

Date and product string for 9.21 release

base/gscdef.c
base/version.mak


2017-03-12 17:07:18 -0700
Ray Johnston <ray.johnston@artifex.com>
6ffbbb5a389df10d7b7a0a630a910363f75b73d6

Fix Bug 697661 -- SEGV with tiffsep1 device and threshold array halftones

Threshold arrays create a different type of gx_ht_order than screen type
halftones so the bit_data is short X,Y coordinates instead of offset,mask
(gx_ht_bit) elements that the tiffsep1 "threshold_from_order" code was
expecting. Using the bit_index proc of the order works for all gx_ht_order
types.

TODO: determine if it is possible to use the gx_ht_construct_threshold
function. This function is used in the FAST_HT_CODE used for some
images to halftone devices that need halftoning.

devices/gdevtsep.c


2017-03-08 10:15:25 +0000
Ken Sharp <ken.sharp@artifex.com>
a629fb9e9f03d8d5aefd32d3c46f6045dba41ccb

txtwrite - fix Unicode conversion of glyph names 'unixxxx'

More fallout from the ToUnicode revamp required for pdfwrite, commit
9dba57f0f9a53c130ec2771c0ed1d7bd6bbef6ab

The code to handle converting glyphs whose name conforms to the
uniXXXX form, when there is no better ToUnicode information, was still
returning the number of bytes, not shorts. In addition, the original
change was packing the 2 bytes as two shorts instead of a singe short.

This resulted in incorrect output. Fixed here by packing the 4 nibbles
into a single short and returning a count of 1 short.

devices/vector/gdevtxtw.c


2017-03-07 10:24:37 +0000
Robin Watts <robin.watts@artifex.com>
bea6c3e636b0fcf49ab5042fb0506fdb1f5fe4b8

Bug 696915: Second attempt at fix.

In attempting to fix a buffer overrun in mapped8_copy01, I broke it.
This is a proper fix. Previously I'd missed the increment of count
after the loop.

base/gdevm8.c


2017-03-07 10:08:11 +0000
Robin Watts <robin.watts@artifex.com>
d1d0bf5f9776bf2ad26e223bf3d36e85176e7c78

Revert "Bug 696915: Fix buffer overread in mapped8_copy01."

This reverts commit 4e646ef8103f3ab2ab9d7de64bd30cc2156f0441.

Cluster testing shows problems with this.

base/gdevm8.c


2017-03-07 10:42:00 +0000
Robin Watts <robin.watts@artifex.com>
8115fa337c70e08516a9fad6da68edf5b461cb2d

Product string for 9.20RC2

base/gscdef.c


2017-03-06 10:57:03 +0000
Chris Liddell <chris.liddell@artifex.com>
53dc6a1e4bb61ce1aaf689550d42ec6cf706d889

Update News.html and History9.htm

with highlights and changelogs

doc/History9.htm
doc/News.htm


2017-03-06 10:32:53 +0000
Chris Liddell <chris.liddell@artifex.com>
2f4b5eb2cf7d173d69c7a6bdb8008447f8e1b174

Update dates and versions

doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/font2c.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
man/wftopfa.1


2017-03-06 10:31:53 +0000
Chris Liddell <chris.liddell@artifex.com>
7d3e8640525cab77feabf33db732e5d1bb4eb652

Update copyrights in "top" makefiles

Makefile.in
psi/winint.mak


2017-03-06 10:28:47 +0000
Chris Liddell <chris.liddell@artifex.com>
8f917db5eb0b94c864cef770022d86b22e45df98

Product string for 9.20RC1

base/gscdef.c



Version 9.21 (2017-03-16)

This is the fifteenth full release in the stable 9.x series.

Highlights in this release include:

  • pdfwrite now preserves annotations from input PDFs (where possible).

  • The GhostXPS interpreter now provides the pdfwrite device with the data it requires to emit a ToUnicode CMap: thus allowing fully searchable PDFs to be created from XPS input (in the vast majority of cases).

  • Ghostscript now allows the default color space for PDF transparency blends.

  • The Ghostscript/GhostPDL configure script now has much better/fuller support for cross compiling.

  • The tiffscaled and tiffscaled4 devices can now use ETS (Even Tone Screening)

  • The toolbin/pdf_info.ps utility can now emit the PDF XML metadata.

  • Ghostscript has a new scan converter available (currently optional, but will become the default in a near future release). It can be enabled by using the command line option: '-dSCANCONVERTERTYPE=2'. This new implementation provides vastly improved performance with large and complex paths.

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

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

Incompatible changes

  • The planned device API tidy (still!) did not happen for this release, due to time pressures, but we still intend to undertake the following: We plan to somewhat tidy up the device API. We intend to remove deprecated device procs (methods/function pointers) and change the device API so every device proc takes a graphics state parameter (rather than the current scheme where only a very few procs take an imager state parameter). This should serve as notice to anyone maintaining a Ghostscript device outside the canonical source tree that you may (probably will) need to update your device(s) when these changes happen. Devices using only the non-deprecated procs should be trivial to update.

Changelog

2017-03-16 09:13:57 +0000
Chris Liddell <chris.liddell@artifex.com>
db6fa66eba7427854f491738500ecf9f179446fc

Date and product string for 9.21 release

base/gscdef.c
base/version.mak


2017-03-12 17:07:18 -0700
Ray Johnston <ray.johnston@artifex.com>
6ffbbb5a389df10d7b7a0a630a910363f75b73d6

Fix Bug 697661 -- SEGV with tiffsep1 device and threshold array halftones

Threshold arrays create a different type of gx_ht_order than screen type
halftones so the bit_data is short X,Y coordinates instead of offset,mask
(gx_ht_bit) elements that the tiffsep1 "threshold_from_order" code was
expecting. Using the bit_index proc of the order works for all gx_ht_order
types.

TODO: determine if it is possible to use the gx_ht_construct_threshold
function. This function is used in the FAST_HT_CODE used for some
images to halftone devices that need halftoning.

devices/gdevtsep.c


2017-03-08 10:15:25 +0000
Ken Sharp <ken.sharp@artifex.com>
a629fb9e9f03d8d5aefd32d3c46f6045dba41ccb

txtwrite - fix Unicode conversion of glyph names 'unixxxx'

More fallout from the ToUnicode revamp required for pdfwrite, commit
9dba57f0f9a53c130ec2771c0ed1d7bd6bbef6ab

The code to handle converting glyphs whose name conforms to the
uniXXXX form, when there is no better ToUnicode information, was still
returning the number of bytes, not shorts. In addition, the original
change was packing the 2 bytes as two shorts instead of a singe short.

This resulted in incorrect output. Fixed here by packing the 4 nibbles
into a single short and returning a count of 1 short.

devices/vector/gdevtxtw.c


2017-03-07 10:24:37 +0000
Robin Watts <robin.watts@artifex.com>
bea6c3e636b0fcf49ab5042fb0506fdb1f5fe4b8

Bug 696915: Second attempt at fix.

In attempting to fix a buffer overrun in mapped8_copy01, I broke it.
This is a proper fix. Previously I'd missed the increment of count
after the loop.

base/gdevm8.c


2017-03-07 10:08:11 +0000
Robin Watts <robin.watts@artifex.com>
d1d0bf5f9776bf2ad26e223bf3d36e85176e7c78

Revert "Bug 696915: Fix buffer overread in mapped8_copy01."

This reverts commit 4e646ef8103f3ab2ab9d7de64bd30cc2156f0441.

Cluster testing shows problems with this.

base/gdevm8.c


2017-03-07 10:42:00 +0000
Robin Watts <robin.watts@artifex.com>
8115fa337c70e08516a9fad6da68edf5b461cb2d

Product string for 9.20RC2

base/gscdef.c


2017-03-06 10:32:53 +0000
Chris Liddell <chris.liddell@artifex.com>
2f4b5eb2cf7d173d69c7a6bdb8008447f8e1b174

Update dates and versions

doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/font2c.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
man/wftopfa.1


2017-03-06 10:31:53 +0000
Chris Liddell <chris.liddell@artifex.com>
7d3e8640525cab77feabf33db732e5d1bb4eb652

Update copyrights in "top" makefiles

Makefile.in
psi/winint.mak


2017-03-06 10:28:47 +0000
Chris Liddell <chris.liddell@artifex.com>
8f917db5eb0b94c864cef770022d86b22e45df98

Product string for 9.20RC1

base/gscdef.c


2017-03-03 10:20:14 +0000
Chris Liddell <chris.liddell@artifex.com>
278c66866eb41c0d8220d31bd7f12887706eb51c

Change git behaviour broke gitlog2changelog.py

remove the --cc options

toolbin/gitlog2changelog.py


2017-03-03 10:00:05 -0700
Henry <henry.stiles@artifex.com>
1d2da0ae232605c4f62a97f8cf1cedce15c4ba9f

Add error message when resident fonts are not found.

The fix also uncovered a regression. The XL interpreter was checking
if the function to load built in fonts returned a code less than 0
which does not happen anymore. Upon error the function returns 0 (false),
indicating no fonts found.

pcl/pcl/pcfont.c
pcl/pxl/pxsessio.c


2017-03-03 06:58:19 -0700
Henry Stiles <henry.stiles@artifex.com>
c9cb91b2fb59481247aaee88779577ef6c103327

Update the default PCL font search path.

The font search path was never updated when the directory structure
changed, also add a directory entry to allow PCL to find fonts while
cluster testing without an environment variable or command line
setting.

pcl/pl/pjparse.c


2017-03-03 09:30:59 +0000
Chris Liddell <chris.liddell@artifex.com>
62354d822b29006d7e431a2b07c70106647b62c8

Remove the left over Mac specific files.

OS X is basically just a Unix-like system, so building gs for it is now just
like for any other Unix-like system. We haven't supported Mac Classic for some
time.

Several Mac related files were left over, atrophied and no longer any value.

This removes them.

base/gsiomacres.c
base/lib.mak
base/macgenmcpxml.sh
base/macos_carbon_d_pre.h
base/macos_carbon_pre.h
base/macos_classic_d_pre.h
base/macosx.mak
base/macsystypes.h
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2017-03-02 16:35:51 -0800
Ray Johnston <ray.johnston@artifex.com>
ba8d4abaa9c33edd8c79da7022f231e4b21f22e9

fix bug 697621: color_usage.or bits were wrong with transparency

The psdcmykog uses the color_usage.or bits to decide which components need to
be processed, skipping those that are not needed. When the pdf14 device changes
the color_info the color that will actually go on the page cannot be known
without transforming the color to the device color which is too expensive.

Also fix the polarity tests in gx_color_index2usage (it was being ignored)

base/gxclist.c
base/gxclpath.c


2017-03-02 12:26:16 +0000
Chris Liddell <chris.liddell@artifex.com>
ea14e8c7c8f8ece7a7ea2a324bca2c115c61b1a3

Bug 697626: bounds check allocations in the chunk allocator

Ensure the requested memory allocation doesn't overflow the 32 bit variables
in the chunk allocator.

base/gsmchunk.c


2017-03-01 10:26:17 -0800
Ray Johnston <ray.johnston@artifex.com>
670e5d250c6049694f0f1f1c3d15270d6dc2246a

Bug 697615: Only apply CompatibleOverprint handling to some colorspaces

Testing with Adobe shows that only Gray, CMYK, DeviceN and Sep color
spaces should use the special CompatibleOverprint handling specified
in the section "Compatibility with Opaque Overprinting".

Resource/Init/pdf_ops.ps


2017-03-01 12:59:12 +0000
Robin Watts <robin.watts@artifex.com>
0a8f8a53a968a638e828086f0725780aa64793c0

Fix clump handling.

Ray spotted that running:

debugbin/gs -r300 -Z@\$\?: -dJOBSERVER

is enough to send us into an infinite loop.

Tracking this down, it appears that the reason is to do with
the gs_ref_memory_t's use of 'pcc' and 'cc'.

It copies the 'current' chunk out of the splay tree, and then
puts it back later, without realising that the splay tree
may have been altered.

The simplest fix appears to be just to not do this copying.

base/gsalloc.c
base/gxalloc.h
psi/ialloc.c
psi/igc.c
psi/ilocate.c
psi/isave.c


2017-02-28 17:36:00 +0000
Robin Watts <robin.watts@artifex.com>
f8c0d4e78f75de95b0d74210b3e929abef6f3a60

Add sanity check on image sizes.

Inspired by bug 697395, but doesn't actually solve any problem
seen in that bug (or at least, not that I can see, as I can't
reproduce the problem with file2).

jbig2dec/jbig2_image.c


2017-03-01 09:47:58 -0700
Henry Stiles <henry.stiles@artifex.com>
bbb2b961388b028d7d9d8f6454ced8192ad513c1

Fix Bug 697624 - PCL segfaults with --disable-compile inits.

Instead of trying to continue we exit upon initialization if no fonts
are found and the current emulation is PCL.

pcl/pcl/pcfont.c


2017-02-28 18:43:04 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
ce437b88df500a184ae2ca15d67a019f57a11d20

Bug 697545: Memory Squeezing fix.

Fix memory leaks for allocation event numbers 25 to 32
when memory squeezing:

gs -sDEVICE=bit -o /dev/null: examples/tiger.eps

psi/imain.c
psi/iname.c
psi/inames.h


2017-02-28 19:54:51 +0000
Chris Liddell <chris.liddell@artifex.com>
0ebb37a19ece80fa03af8de5047705722625870b

Bug 697372: Fix crash due to pattern clist being freed

When rendering a pattern from a clist into the pdf14 compositor, the compositor
takes a reference to the pattern clist device. This is fine pre-page-clist, or
with no page clist involved (when the memory is managed by the garbage
collector), but post-page-clist the life span of the pattern clist device is
dicated by the clist replay, *not* by references to it (as in the gc'ed case).
This can result in a dangling pointer, which later causes a crash in the
garbage collector when it cleans up after the page-clist has completed.

So, when pattern fill has been completed, remove the reference to the pattern
clist device.

base/gdevp14.c


2017-02-28 15:36:34 +0000
Robin Watts <robin.watts@artifex.com>
459a0e650ffab1069a6f59c17775f5fd462c45d2

Bug 696364: Restrict size of alphabits buffer

Thanks to Michael for doing the investigation, and leaving a
really good write up of the problem on the bug.

The basic problem is that we have a transparency group that
contains a softmask. The softmask is larger than the transparency
group, so it is restricted to the size of the group and written
into the clist as occupying just a small set of bands.

The content for the softmask is larger, however, so when used with
GraphicsAlphaBits, we create various alphabits devices, draw
the contents, and then send the results with copy_alpha.

These copy_alpha calls are NOT restricted to being within the
reduced region for the softmask. This therefore upsets the clist
reading.

The fix, as suggested by Michael in his bug report is to limit
the size of the softmask contents (by limiting the size of the
alphabits buffers).

Ideally the alphabits device would know what region to limit
itself to just by looking at the graphics state it's passed in.
Unfortunately, that doesn't work as the current softmask/groups
aren't reflected in the graphic state. This feels wrong to me,
but that's the way it is.

Instead, we have to resort to asking the device to limit our
bbox according to the current state. We achieve this by adding
a new dev_spec_op, and adding the required plumbing to the pdf14
device (to pass it on to the target) and the clist device (to
actually do the restriction).

base/gdevp14.c
base/gspaint.c
base/gxclrect.c
base/gxdevsop.h


2017-02-28 07:05:58 -0800
Ray Johnston <ray.johnston@artifex.com>
4a9394e6abc6b0107da4f42675bf35eb031fe068

Fix DEPTH is RAW_DUMP_AS_PAM GRAYSCALE_ALPHA header

base/gxblend.c


2017-02-27 13:37:41 -0800
Ray Johnston <ray.johnston@artifex.com>
ff07b67892c201a0a16d983b05d121ac409b78a0

Bug 697615: color_usage was incorrectly updated for devn with pdf14

When the pdf14 compositor messes with the color space and color_info,
it doesn't change the target (clist) color_info, but sets the new
information in cldev->clist_color_info. In order to properly update the
color_usage cmd_drawing_color_usage needs to set the bits according to the
clist_color_info num_components and polarity in gx_dc_devn_get_nonzero_comps,
so save the cldev->color_info values, set them to the cldev->clist_color_info
values for the calculation and restore them afterwards

base/gxclpath.c
base/gxdcolor.c


2017-02-27 14:15:30 -0700
Henry Stiles <henry.stiles@artifex.com>
97ddb45834c73f697e53839c6b433f65248d9c2a

Improve pcl page marking detection.

Instead of looking at only the character's position to determine if a
character marks the page we now look at the extant of the character's
width. Thanks to Norbert Janssen for the fix.

pcl/pcl/pcpage.c
pcl/pcl/pcpage.h
pcl/pcl/pctext.c


2017-02-27 18:20:39 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
8bb1aab8a60810aefb67a6d2764a54abc547878b

Bug 697545: Memory Squeezing fix.

Fix memory leak for allocation event number 22
when memory squeezing:

gs -sDEVICE=bit -o /dev/null: examples/tiger.eps

base/fapi_ft.c


2017-02-26 05:23:39 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
a76a82abca879fcf351fce5aba50a48e7de41963

Bug 697545: Memory Squeezing fix.

Fix memory leak for allocation event number 10
when memory squeezing:

gs -sDEVICE=bit -o /dev/null: examples/tiger.eps

psi/imainarg.c


2017-02-24 18:21:12 +0000
Robin Watts <robin.watts@artifex.com>
009e40a0534e1d11ed5ee353477859b5cdd4faed

Bug 696921: Don't "early decode" when interpolating Lab images

Applying the decode array to Lab source values during the
conversion to fracs that takes place before non-icc based
interpolation causes an overflow.

We therefore leave the application of the decode array until
after the interpolation.

After the interpolation, we don't actually want to apply the
decode array though - in that we want the result in the usual
0...1 float form rather than the 0..100/-128..127/-128...127
ranges that the color would seem to require.

One option would be simply to not apply the decode array. This
will however go wrong when we meet an Lab file with a
non-standard Decode array. We therefore apply the given decode
array (which may well be the default), and 'undo' the default
one to get the values we actually want.

base/gxiscale.c


2017-02-24 19:05:52 +0000
Robin Watts <robin.watts@artifex.com>
af3c1d10726b2d932d951bf021193cbd5bcc734d

Bug 697048: Fix compatible overprint blend mode.

Fix from Michael Vrhel.

Compatible overprint is operating in subtractive color spaces, so
a 'zero' component actually means 0xFF.

base/gxblend.c


2017-02-24 18:40:03 +0000
Robin Watts <robin.watts@artifex.com>
9e38426abd977fbc67c0d91103eb7bd3573409bb

Update clusterpush.pl

Allow "extended", "cull" and "win32".

toolbin/localcluster/clusterpush.pl


2017-02-23 15:20:35 +0000
Robin Watts <robin.watts@artifex.com>
1aebfe56c80bb46bba74c23654d9febcf5f761b5

Correct assert in new scan converter

base/gxscanc.c


2017-02-24 09:33:05 -0800
Ray Johnston <ray.johnston@artifex.com>
13686f5374600d41105587c20a15f3c1e55f3534

Return Fatal errors from PS putdeviceparams to avoid potential SEGV

The change to return Fatal from the display device (commit 269354e)
would segfault with the PS interpreter because zputdeviceparams never
returned an error code, assuming that the interpreter could handle it,
but this resulted in a segfault when setpagedevice tried to erase the
page and the display device did not have a valid bitmap. Return the
Fatal error so the interpreter can exit cleanly.without performing
the usual setpagedevice "configurationerror" recovery.

psi/zdevice.c


2017-02-24 16:10:11 +0000
Ken Sharp <ken.sharp@artifex.com>
dabad3f6e9c2bdbd152f67a66b698262f94b816d

PDF interpreter - remove some (ancient) debug code

This line seems to have been left in accidentally a long, long, time
ago. Surprisingly its never been noticed before....

Resource/Init/pdf_base.ps


2017-02-24 15:50:21 +0000
Ken Sharp <ken.sharp@artifex.com>
269354ea918e4498df67e52a1efd16295e031421

Fix display device for non-PostScript interpreters

commit cf279b8c4773e14045dd6b411c3a524c6ac39124 fixed a potential
crash when memory was exhausted, but used the gs_abort() routine to
tell the interpreter to abort immediately and not carry on.

Unfortunately, and despite the comment in gsexit.h, gs_abort() is only
available in the PostScript interpreter.

So here we opt to return a fatal error, which *should* cause the
interpreter to give up (it does on PCL and PostScript) and will allow
us to build GhostPCL on Windows.

devices/gdevdsp.c


2017-02-24 10:12:43 +0000
Chris Liddell <chris.liddell@artifex.com>
0e9a345e7badf0d53ab19761a938665079883612

Bug 694995: Fix 'wrapped' x11 devices' buffered 'mode'

The x11 devices can either unbuffered (where rendered objects go straight to the
screen) or buffered (where objects are rendered to a memory buffer device, and
then blitted to the screen).

Additionally, the 'real' x11 device always uses the resolution and color specs
of the X11 server on which it is running. Then devices such as x11mono and
x11cmyk using a "wrapper" device in order to keep the x11 device using the
specs of the X11 server, whilst presenting an appropriate character to the rest
of Ghostscript (so, even though x11 is *probably* running 24bit RBG, x11mono
needs to look like a pure monochrome device).

Because we need the 'real' x11 device to handle get_params/put_params, and we
need to temporarily 'patch' the color info of the 'real' x11 device so it
retrieves/applies the params correctly.

The problem arises when we run one of these 'wrapper' devices in buffered mode.
The memory buffer device (particularly after a resizing of the page buffer),
would end up being configured based on the color settings of the 'wrapper'
device, rather than the 'wrapped' device. So we could end up treating a 1bpp
mono bitmap (from the memory buffer device) as a 24bpp RGB pixmap and blitting
to the screen. Causing a buffer overflow, and segfault.

To solve that, store the color info we need away from its place in a
standard device, and use the x11 device's own dedicated copy for setting up
the memory buffer device.

devices/gdevx.c
devices/gdevx.h
devices/gdevxalt.c
devices/gdevxini.c


2017-02-22 07:17:54 -0800
Ray Johnston <ray.johnston@artifex.com>
670c6b29ebbd29fb3238575cb08a6c2c9586ace7

Add support for RGB_TAG PAM files to lib/viewpbm.ps (type from bitrgbtags)

The bitrgbtags device was changed recently to create a PAM (P7) file rather
than a bogus P6 file with 4 components. This means that the pcl/tools/GOT
detag.c and tagimage.c no longer worked. Instead of changing these the
lib/viewpbm.ps was enhanced to process the RGB_TAG P7 files.

By default, it shows the image, and with -dTAG it shows pseudo-color for
the tag values, UNKNOWN/UNMARKED is white, TEXT is black, PATH is yellow
and IMAGE is red.

example usage:
gs -dSCALE=1 -- lib/viewpbm.ps bitrgbags.pam
or
gs -dSCALE=1 -dTAG -- lib/viewpbm.ps bitrgbags.pam

This can also be used to convert the P7 image to another format using
-sDEVICE=___ -o ___ arguments prior to the -- option.

Also, fix numerous problems with FITPAGE and SCALE options. They were
just WRONG!

lib/viewpbm.ps
pcl/tools/GOT/README
pcl/tools/GOT/detag.c
pcl/tools/GOT/dotags.sh
pcl/tools/GOT/tagimage.c


2017-02-22 17:51:17 -0800
Ray Johnston <ray.johnston@artifex.com>
862b31689c3f1c6425f5522adc820b73e352e012

Improve bitrgbtags device so that unmarked areas are preserved.

Similar to pngalpha, the bitrgbtags device needs to have a fillpage
procedure to fill the page to "GS_UNTOUCHED_TAG" | white (0xffffff)
Without this, the page was entirely set to "PATH" by the default
fillpage.

Note this will change EVERY bitrgbtags output in the regression results.

devices/gdevbit.c


2017-02-23 13:04:11 +0000
Chris Liddell <chris.liddell@artifex.com>
b0d12644776ab1517e549903ba3262c082759680

Bug 697607: correctly bounds check glyph index in TTFs

The update to Freetype removed a bounds check in the Freetype code when the
incremental API is in use (leaving it up to the caller to validate the glyph
index). This adds that bounds check to our glyph data callback.

As part of that, return the trueNumGlyphs and numGlyphs varaibles in the
Ghostscript type 42 font structure to their (apparent) original intent:
trueNumGlyphs is the value read from the maxp table, whilst numGlyphs is a value
derived from the size of the loca table (see the bug for a fuller explanation).

base/gstype42.c
psi/zfapi.c


2017-02-23 11:30:22 +0000
Robin Watts <Robin.Watts@artifex.com>
4e646ef8103f3ab2ab9d7de64bd30cc2156f0441

Bug 696915: Fix buffer overread in mapped8_copy01.

If the stars align, we can overread by 1 source byte
in mapped8_copy01. Simple fix.

base/gdevm8.c


2017-02-22 17:24:24 -0800
Ray Johnston <ray.johnston@artifex.com>
cf279b8c4773e14045dd6b411c3a524c6ac39124

Fix SEGV is display device when PageSize needs bitmap > 2Gb

The display_put_params is supposed to revert to the original settings
if an error is encountered, but since it frees the display bitmap before
attempting to allocate the new one, if that allocation fails, the device
is left with a memory device that has an invald bitmap pointer.

Instead revert the settings and attempt to allocate a bitmap with those
settings. If that fails (unlikely) then gs_abort with an error message.

NB: It is preferable to free one bitmap before allocating the new one
in case we are near a system memory constraint.

devices/gdevdsp.c


2017-02-22 23:54:38 +0000
Robin Watts <robin.watts@artifex.com>
340b7c7f79d45ed36cd247ff0c13586e6b6a4763

Bug 696520: Avoid dereferencing NULL in epson devices.

Adopt Peter Cherepanov's patch to avoid dereferencing NULL.

Only calculate the pure color if we know we're going to need
it - by which time we know it's safe to deference.

contrib/eplaser/gdevescv.c


2017-02-20 16:32:51 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
4c99ddc1dbd610d9d677750d6b1dabcb1cda8fb0

Bug 697545: Memory Squeezing fix.

Fix memory leaks for allocation event number 8 and 9
when memory squeezing:

gs -sDEVICE=bit -o /dev/null: examples/tiger.eps

psi/gs.c
psi/iapi.c
psi/imain.c


2017-02-22 16:41:33 +0000
Robin Watts <robin.watts@artifex.com>
21901b860ca033ed14168d3c191b39ff714946b5

Bug 697602: Remove 2 instances of variable shadowing.

Hard to believe these are right because setting code
and then falling out of scope doesn't achieve much.

base/gp_wxpsprn.cpp


2017-02-22 08:11:48 -0800
Michael Vrhel <michael.vrhel@artifex.com>
f8d299c399312fdd41958843a101db36353ad8e2

Avoid getenv call in openjpeg

getenv is not allowed in certain cases causing linking
issues. This fix should be pushed to the openjpeg
group. Thanks to Chris for the fix.

openjpeg/src/lib/openjp2/j2k.c


2017-02-21 16:46:07 +0000
Chris Liddell <chris.liddell@artifex.com>
8e8831a02f172490d7b175e54c7d15814acacea4

Update bytes_decoded for the non-cache code path.

If a glyph is being rendered without going through the glyph cache, we still
must update the 'bytes_decoded' entry in the text enumerator.

base/gxchar.c


2017-02-20 10:16:32 +0000
Chris Liddell <chris.liddell@artifex.com>
948d880467b2436813f7ffe5d1bd694c9475093c

Bug 694269: valgrind issues in Type 1 charstring interpreter

1) Bounds check the charstring data so we don't run off the end of the buffer

2) Initialise various entries in the Type 1 hinter state: in a well formed
font these will never be used without being set from the charstring, but in
a broken font, they can be used without being set.

3) Initialise the (sacrificial) path we use when retrieving glyph metrics etc.

4) Initialise the contents of the stack

base/gstype1.c
base/gxhintn.c
base/gxpath.c
base/gxtype1.c
base/gxtype1.h


2017-02-17 11:07:41 +0000
Chris Liddell <chris.liddell@artifex.com>
64c433d69b7732ae919a029dbf4b635133c97f03

Bug 694250: bounds check in TTF hinting code

Broken font tries to access *way* off the end of the opcode buffer. Check the
index before using it

base/ttinterp.c


2017-02-17 11:33:36 +0000
Chris Liddell <chris.liddell@artifex.com>
83b54c55a485a17124321d437e8207515396024a

Bug 694268: init stack based data.

devices/vector/gdevpdfd.c


2017-02-16 10:27:22 +0000
Chris Liddell <chris.liddell@artifex.com>
cf60a549d2413ae96b17010f0a69f82b797d33e3

Fix low memory crash in native font enumeration.

psi/zfontenum.c


2017-02-20 10:24:14 -0800
Ray Johnston <ray.johnston@artifex.com>
12091a85336f5c422545f03b4afcd1ea7362a10e

Fix misspelled TUPLTYPE in PAM header for bitrgbtags output.

Also add in DEPTH 4

devices/gdevbit.c


2017-02-20 15:58:03 +0000
Robin Watts <robin.watts@artifex.com>
8e918ac9ca06971534c7e39087ecca05c3809ce7

Update bmpcmp to cope with PAMs with RGB_TAG input.

We treat these as CMYK PAMs for now. This should be enough for
us to spot differences in the false color images produced.

toolbin/bmpcmp.c


2017-02-20 15:48:47 +0000
Robin Watts <robin.watts@artifex.com>
f21824bbf5bd1c0ba8cb19855a8fbc5e0681ff74

Update bitrgbtags device to use better header.

The bit devices output raw data.

The bittagsrgb device outputs rgb + a tag plane, with a PPM header.
The PPM header tells code to expect 3 bytes of image data, not 4,
so is wrong. Here we change it over to use a PAM header (of type
RGB_TAG).

This allows bmpcmp to be amended to cope better.

devices/gdevbit.c


2017-02-20 09:45:18 +0000
Ken Sharp <ken.sharp@artifex.com>
ecceafe3abba2714ef9b432035fe0739d9b1a283

Resolve image enumerator ownership on error

Bug #697596 "Use-After-Free in i_free_object()"

There is confusion over ownership of 'penum' between gx_begin_image1(),
gx_begin_image4() and gx_image_enum_begin() which is called from these
two functions (and only from these two functions).

The enumerator is allocated in gx_begin_image?() and freed there if
gx_image_enum_begin() returns an error. However, gx_image_enum_begin()
also frees the enumerator on an error; except that it doesn't always do
so. Its a large function and there are at least 9 ways to exit it, only
4 of which free the enumerator.

This commit removes the 'free' instances from gx_image_enum_begin()
leaving the cleanup as the responsibility of the calling code, which
performed the allocation.

base/gxipixel.c


2017-02-19 10:13:53 -0800
Ray Johnston <ray.johnston@artifex.com>
8452f9238959a4d518af365812bf031fe4d8d4b7

Fix Coverity CID 141336 -- Indentation gripe.

base/gdevprn.c


2017-02-06 19:21:43 -0800
Ray Johnston <ray.johnston@artifex.com>
eccf38345588ced6595d3414fca10098e9855da3

Add -dDumpXML to toolbin/pdf_info.ps options and fix -dDumpFontsNeeded

As an example of getting even more info from the PDF, add -dDumpXML to
dump the PDF Metadata (if any).

Also a problem found with -dDumpFontsNeeded=false was fixed.

usage to dump the basic info and Metadata:
gs -q -dDumpXML -dDumpMediaSizes=false -dDumpFontsNeeded=false -- \
toolbin/pdf_info.ps examples/annots.pdf

toolbin/pdf_info.ps


2017-02-18 17:57:18 -0700
Henry Stiles <henry.stiles@artifex.com>
e548d290d7d052a32e65493a703e1276230554c3

Fix 697576: false colors with pxlcolor.

PXL high level image processing does not support DeviceN, fall back to
rendering rectangles.

devices/vector/gdevpx.c


2017-02-18 08:50:48 -0700
Henry Stiles <henry.stiles@artifex.com>
cb5ec3dc7d0214ca3a784f9630b0775142c2ec08

Fix bug #687561, bad parsing of intellifont data.

The previous code read the metric offset field at the wrong positon (8
vs. 6) resulting in a value that caused a range check error. Further,
the range checking which checked the offsets were ordered is not
useful or correct, and has been removed. There is nothing in the
documentation to indicate the offsets must be ordered and showing
order does not help in preventing out of bounds access.

pcl/pcl/pcsfont.c


2017-02-16 21:47:47 -0800
Ray Johnston <ray.johnston@artifex.com>
c139c069968a59bc53e45d8373dd70d30278d152

Change -Za output to omit the (mostly useless) opening/closing clump messages

The -ZA is noisier so, keep these messages for that debug level (for now).
I've worked with Ghostscript allocators for MANY years and have yet to
find these messages useful. This is a precursor to totally deleting these
messages.

base/gsalloc.c


2017-02-16 16:37:28 -0800
Ray Johnston <ray.johnston@artifex.com>
88201849f123642dac3920a0bad5e68290280798

Fix incorrect calculation of pdf14 number of components.

This was seen with DeviceN devices (psdcmyk, tiffsep, ...) with the file:
tests_private/comparefiles/Altona_Technical_v20_x4.pdf resulting in
Error messages and warnings that "Output may be incorrect". With the
-dPDFSTOPONERROR option, an reangecheck error is reported.

base/gdevp14.c


2017-02-16 07:56:26 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
7bb2ad6cce75aae3ebedaa5883e1ecd6ba19b52d

Bug 697545: Memory Squeezing fix.

Fix for 'red 85546'. This is a SEGV seen at allocation event
85546 when memory squeezing:

gs -sDEVICE=bit -o /dev/null: examples/tiger.eps

Also account for all the other places that allocate a new
colorspace without checking the returned value.

base/gsgstate.c
base/gsicc_manage.c
base/gsimage.c
base/gsptype1.c
base/gstrans.c
base/gxclrast.c
devices/vector/gdevpdfb.c
devices/vector/gdevpdfc.c
devices/vector/gdevpdfi.c
devices/vector/gdevpsdi.c


2017-01-29 11:14:39 -0800
Ray Johnston <ray.johnston@artifex.com>
40a82d9e72340b8547f0d45709693e456465ccfd

Fix Bug 697502, problems with NumRenderingThreads exceeding available RAM

The logic that determined the amount of printer buffer space, and allocated it
was including the ESTIMATED pdf14 transparency buffer space, but we only need
to make sure that amount of space is available, not actually allocate it (since
then it wouldn't be availble when needed).

if there wasn't enough memory for the band buffer when a thread's clist reader
was opened, gdev_prn_setup_as_command_list would try reducing the BufferSpace
(by successive dividing by 2) until it could fit. This would result in a
reader band size that did not match what was used to write the clist. This
so we force the BandBufferSpace to be exactly the same as was used in the writer
using the cdev page_info.band_params. The tile_cache_size was added to the
space_params used to set up the thread clist device to make it match that used
by the writer.

In order to make sure we don't "over commit" in creating threads we reserve
an extra amount per thread, currently 2 Mb plus the ht_cache size times the
number of components, plus when the page uses transparency, we increase it by
the ESTIMATED_PDF14_ROW_SPACE times the band_height. We further increase it by
the size of the link profiles and the size of the icclink profiles (CURRENTLY
ESTIMATED). We free the reserve area as we start threads.

Also when an allocation for a thread failed, the 'band' used for next_band was
being decremented but it did not need to be since it was already the correct value.
This had caused a problem with threads getting started for the wrong band.

Fix gx_ht_read_and_install to prevent double free if gx_gstate_dev_ht_install
gets an error (VMerror).

Fix gdevbit so that we don't keep going after get_bits returns an error.

TODO: collect the size of the icclinks rather than a rather worst case value
currently estimated.

base/gdevprn.c
base/gsht.c
base/gsicc_manage.c
base/gxclist.c
base/gxclthrd.c
base/gxdevcli.h
base/gxdhtserial.c
devices/gdevbit.c


2017-02-16 08:52:48 +0000
Ken Sharp <ken.sharp@artifex.com>
89371a73c6d97606ca61884b555b7c13ec1534ac

Fix segfaults in low memory conditions

Bug 697572 "Segfaults when ps2write runs out of memory"

Add some return code checks in pdfwrite/ps2write, check a stream when
trying to close an 'aside', add a check for error return codes when
rendering a cached glyph bitmap.

base/gxccache.c
devices/vector/gdevpdfb.c
devices/vector/gdevpdfi.c
devices/vector/gdevpdfj.c
devices/vector/gdevpdfo.c
devices/vector/gdevpdti.c
devices/vector/gdevpdtt.c


2017-02-11 04:30:56 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
4d2b25f06c25e6e3e2b1bf319481a7442d42af8a

Bug 697531 : Tidy up unused code.

The first patch for this bug made the error return from
jbig2_word_stream_buf_get_next_word pointless so this
patch removes all the remaining redundant code.

jbig2_word_stream_buf_get_next_word does not need to return
any value so this is now defined as a void type and the rest
of the code has been updated accordingly.

jbig2dec/jbig2.c
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_refinement.c


2017-02-15 06:13:55 -0800
Ray Johnston <ray.johnston@artifex.com>
1f8ada0d7e2c19138038bccd585e412b1f7a0267

Fix ignored return code in pdf14 transparency.

This fixes segfaults that pop up later. Found when testing multi-threaded
rendering with (somewhat) constrained memory (-K256000) on the file:
tests_private/pdf/sumatra/x_-_renders_slowly.pdf.ppmraw.300.0

base/gdevp14.c


2017-02-15 14:59:27 +0000
Ken Sharp <ken.sharp@artifex.com>
460ef0691145c8c81e238f61baa5009c29838304

pdfwrite - improve commit ad3e0de3e3ca33f00c81c071560bf6c9f4d5a0f0

Use gs_note_error instead of simply returning an error, and don't
bother checking pdfont, since we check for NULL immediately above.

devices/vector/gdevpdtt.c


2017-02-14 16:47:59 +0000
Chris Liddell <chris.liddell@artifex.com>
120f8533b705142ef83b899736e41e5739df5fc2

Tweak the string that controls the greeting message

For GPL releases we print a greeting message on execution that states the
software is supplied without warranty.

So, we should check for it being the GPL release before printing it.

Resource/Init/gs_init.ps


2017-02-15 10:01:39 +0000
Ken Sharp <ken.sharp@artifex.com>
ad3e0de3e3ca33f00c81c071560bf6c9f4d5a0f0

pdfwrite - don't seg fault for Line Printer font and UFST

Using the PCL Line Printer Font, when built to use UFST, can't be
handled with pdfwrite currently. In fact, using UFST with pdfwrite
results in garbage output anyway.

However, we should not seg fault. So here we check to see if we have a
PDF Font resource associated with a native font, and if we don't have
one when we need it, we give up and signal an invalidfont error.

devices/vector/gdevpdtt.c


2017-02-14 11:50:34 +0000
Robin Watts <robin.watts@artifex.com>
836e9a34c17b8bc2fdb4376f572982dfe1412ae0

Make frac31s hold values in the defined range in all cases.

frac31s are supposed to hold values where 0x7ff..... represents 1.

The code, however, currently converts to and from devn values using
0x00007ff8 as 1.

Either we need to update the docs, or we need to fix the code to be
consistent. This is an attempt at the latter.

base/gdevdsha.c
base/gscicach.c
base/gxcvalue.h
base/gxfrac.h
base/gxshade6.c


2017-02-14 15:37:43 +0000
Ken Sharp <ken.sharp@artifex.com>
b969fb501f59d807d54fcfc186b7b97b55cebe0f

XPS interpreter - fix some Coverity warnings

Check a few values read from TT tables to satisfy Coverity 'tainted
scalar' errors.

May need some additional changes, but I can't see any way to validate
the unsigned 32 bit values.

xps/xpsfont.c


2017-02-14 12:48:10 +0000
Chris Liddell <chris.liddell@artifex.com>
7273aa3cd04e0acb212e335ab6b3f360cbd727c9

Fix SAFER issue with filenameforall

With the change to ensure we only apply SAFER permissions to real file system
operations (so only on '%os%' and not on other PS '%<device>%' devices), the
way filenameforall called the permission checking function meant it did not
work correctly.

Basically, check_file_permissions() and co must have a valid iodev parameter
passed to them to function correctly.

So, fix that call.

psi/zfile.c


2017-02-14 10:22:46 +0000
Chris Liddell <chris.liddell@artifex.com>
b3acfdeaf1eb63a07e8169ea4c30ace7522054bc

Yet more SAFER problems with .libfile

With the change to ensure we only apply SAFER permissions to real file system
operations (so only on '%os%' and not on other PS '%<device>%' devices), the
.libfile call was dropping through without being restricted.

This changes the .libfile code to call the permissions checking function
properly.

psi/zfile.c


2017-02-14 09:37:55 +0000
Chris Liddell <chris.liddell@artifex.com>
3d14e0b20dfdc05cda60f7a9a4c78e9d3ee206e2

Split out $(MAKE) from recursive make calls

Commit 8acec58309 consolidate the common parts of the various recursive make
calls. Turns out, this breaks parallel make, as it defeats the make
algorithm which spots a make command line. As a result, none of those recursive
make calls would do parallel builds.

So, this time, we keep the options consolidated into a make variable, but put
back the $(MAKE) call explicitly for each recursive call

base/unix-end.mak


2017-02-13 16:02:54 +0000
Chris Liddell <chris.liddell@artifex.com>
e36d3979ebcaa1ce28f7c58e7e1c7a5959816eb8

Fix Windows UFST build.

psi/msvc.mak
windows/ghostscript-ufst.vcproj


2017-02-09 20:32:56 +0000
Chris Liddell <chris.liddell@artifex.com>
c7d5567fbc5f98488761ab93eaed60f1ac26023e

Bug 697484: fix mkromfs memory leak

In commit aa28186288 we missed the need to free some of the memory used during
the file name sorting phase.

base/mkromfs.c


2017-02-09 15:54:42 +0000
Chris Liddell <chris.liddell@artifex.com>
e476d710841d8be4d4e56c2b9e468e914f977161

ramfs: fix modes other than (r) and (w)

The (a), (r+) and (w+) modes were not working correctly. The "core" code of the
ramfs was correct, but the "glue" code between the Ghostscript stream API
and the ramfs core was not setting flags to support those.

Conversely, the ramfs "glue" code was not setting the permissions flags
correctly in the stream objects it created, when using the "+" modes.

Also, (w) and (w+) were not truncating the file on opening.

Finally, tweak the definition of the various read/write/etc flags for the
ramfs code so the values match those used in the stream API (this makes fixing
the flags in the stream objects much simpler).

base/gsioram.c
base/lib.mak
base/ramfs.h


2017-02-07 15:44:52 +0000
Chris Liddell <chris.liddell@artifex.com>
42fd2f459098bfda17ca8d29195ada57154cfe06

Change how we check for artibrary file accesses

When we apply the SAFER restrictions, we have to *not* apply the rules
for Postscript devices (such as %rom%, %calendar% etc), we only want to apply
the restrictions to the "real" file system (%os%).

Previously the code was checking if the iodev's "open_file" method was set to
the one for the %os% device, but that is actually not set (it is intentionally
NULL), so here we check the i/o device instance to ensure it is not the
i/o device instance for %os%

psi/zfile.c


2017-02-01 12:46:57 +0000
Chris Liddell <chris.liddell@artifex.com>
dd3c9ba2839ada5162aaccfeb442a958bfea637c

Build exes from static lib builds.

Add targets to build executables linked to the static library builds, meaning we
can actually test the static libs we create.

base/unix-end.mak
base/unixlink.mak


2017-01-12 20:55:11 +0100
Stefan Brüns <stefan.bruens@rwth-aachen.de>
aa2818628843205283c563865cd56b4091f2e37f

Bug 697484: mkromfs: sort gp_enumerate_files output....

for deterministic ROM contents

gp_enumerate_files_next returns dir entries in the same order as returned
by readdir. Sort by name to generate deterministic output.

base/mkromfs.c


2017-01-12 18:04:57 +0100
Stefan Brüns <stefan.bruens@rwth-aachen.de>
98696f718b5c0f9a5fd9c33d61f81da469b9a4e1

Bug 697484: mkromfs: make build reproducible.....

use buildtime from SOURCE_DATE_EPOCH

The environment variable SOURCE_DATE_EPOCH is the common approach for
getting reproducible timestamps and thus builds. In case the variable
is not set, keep using the current time of the mkromfs run.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>

base/mkromfs.c


2017-02-07 22:15:58 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
4c7b41dff7d57be0e13de15c45b0296602e63472

Bug 697531 : Fix decoder error on JBIG2 compressed image.

The problem is in jbig2_word_stream_buf_get_next_word
returning -1 and sending a fail error causing the whole
file to fail.

Now when the buffer is exhausted, the returned value is set
to zero so that the decoder does not try to use an
unintialised value.

This now means the error return is pointless and another
commit will follow this one to tidy up the unused code.

jbig2dec/jbig2.c


2017-02-08 10:46:58 -0800
Ray Johnston <ray.johnston@artifex.com>
7ca4d2cc269effd69273112ec7ad9d40076abbc1

Increase PDF 1.4 transparency ESTIMATED_ROW_SPACE

Testing showed that the ESTIMATED_PDF14_ROW_SPACE was too optimistic, so
increase NUM_PDF14_BUFFERS to 4 and use the target num_components (primarily
for spot color devices such as tiffsep) to try and make this more robust.
Still a guess, but works better as tested with multi-threaded rendering.

Note, the band height chosen based on the BufferSpace will be different
when the page has transparency, so there are differences. I have reviewed
them and they are all 1 pixel differences or invisible color differences.

base/gstrans.h


2017-02-08 14:49:35 +0000
Robin Watts <robin.watts@artifex.com>
9284128b1a16c21a95570f4c79258590839a10c7

Further fixes to ramfs.

All allocations are made using fs->memory, so all frees should be
done with it too. This wasn't caught by memory squeezing (or other
tests), because we don't actually use the ramdisc.

base/ramfs.c


2017-02-07 20:28:28 -0800
Ray Johnston <ray.johnston@artifex.com>
cffb5712bc10c2c2f46adf311fc74aaae74cb784

Commit a9a58bb95 was incorrect, clearing some values that it shouldn't

The penum->rect values were cleared, and this didn't cover all uses of
gx_image_enum_alloc. Also, return *ppenum NULL if alloc fails in case the
caller doesn't check the return code. Also, if we fail the enum_begin,
free the enum and set *pinfo to NULL.

base/gximage1.c
base/gximage4.c
base/gxipixel.c


2017-02-07 19:32:08 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
a1b951c274a1d48340cfbaddb1308c92836dbc61

Bug 697545: Memory Squeezing fix.

Fix for 'red 242'. This is a SEGV seen at allocation event
242 when memory squeezing:

gs -sDEVICE=bit -o /dev/null: examples/tiger.eps

base/ramfs.c


2017-02-07 19:52:51 +0000
Ken Sharp <ken.sharp@artifex.com>
6084cc0a0cb1cd6e0d5b9be044622c74a16a0573

XPS interpreter - add a reverse GID lookup for the benefit of pdfwrite

Bug #697304 "Encoding gets lost when generating PDF"

Prior to this commit the XPS interpreter, like the PCL interpreter, did
not really return a character code when asked for an equivalent for a
GID. Instead it returned the 'last' character code.

For strings with multiple characters processed at once, this meant that
all the characters in the string were assigned the same 'code' as the
last character in the string. Also there was no reason to assume that
code was even a Unicode value.

This commit adds code to reverse the TrueType CMAP subtable lookup;
given a GID it will return a character code. We then use the resulting
character code in pdfwrite (which is the only device to use this method)
to build a ToUnicode CMap in the output PDF file.

There are a number of caveats with this commit;

I've only been able to create XPS files with fonts containing format 4
CMAP subtables. While I've coded the others (but not 2 or 8 because the
normal character code -> GID mapping doesn't support them either) I
have no way to actually test whether they work

I'm not certain whether its possible to get an XPS file containing a
font which does not have a 3,1 CMAP. Again I've not been able to create
such a file, if we ever encounter one this code will likely not work
properly.


I have tested Latin and Far Eastern scripts, and files which use more
than 256 glyphs from a single font. All of these appear to work as
expected. When more than 256 glyphs are used from the same font, we
create a PDF file with multiple simple subsets of the font, each with
less than 256 glyphs. Each subset has its own ToUnicode CMap and so
cut&paste works as expected.

No differences expected, we cannot cluster test this code.

xps/ghostxps.h
xps/xpsfont.c
xps/xpsttf.c


2017-02-07 09:42:43 -0800
Ray Johnston <ray.johnston@artifex.com>
a9a58bb95e4a41014f42cae9393767b26da3aa80

Fix dangling pointer in gx_image_enum after malloc fail.

Yet another, probably a squeezing failure since it failed with:
-K30000 -dMaxBitmap=0 -r300 -sDEVICE=pkmraw -o nul: tests/pdf/cmyk_blend.pdf

base/gximage1.c


2017-02-06 19:20:40 +0000
Robin Watts <robin.watts@artifex.com>
a65893f973c65d2ba22f8b2a2c6cf0822fc8c1da

Bug 697555: Fix UTF-8 handling of args.

The logic for checking for continuation bytes in UTF-8 was
broken. Continuation bytes have the top bit set, but not the top 2
bits set.

This leaves the issue of @files on windows always being taken
as UTF-8.

base/gsargs.c


2017-02-01 16:31:03 +0000
Chris Liddell <chris.liddell@artifex.com>
c1834eb0cf024cf51231a19b975d97f33c559e0c

Fix Luratech Linux build use if "inline"

Compilers don't seem to like "inline" being used without "static", so tweak the
build flags for Luratech so that doesn't happen.

configure.ac


2017-02-06 12:31:12 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
aaf0b87aa5e0c41a32a290c836a5b3811433c561

Fix memory leak in psi/imain.c

Remove unused "paths" allocation.

psi/imain.c


2017-02-06 09:49:45 +0000
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
e4439a505ed3ac582d7f65260678bc9dca03ce54

Bug 697545: Memory Squeezing fix.

Fix for 'red 62'. This is a SEGV seen at allocation event
62 when memory squeezing:

gs -sDEVICE=bit -o /dev/null: examples/tiger.eps

Also, improve the macro for FREE in base/gxclmem.c

base/gsmemory.h
base/gxclmem.c


2016-11-27 16:38:26 +0000
Ken Sharp <ken.sharp@artifex.com>
2bf2b4cebe44b74229e086380c3c25110f37aed0

pdfwrite - where possible, preserve annotations

This allows us to preserve many (but not all) annotation from an
input PDF file as annotations in the output PDF file. This only
works with the pdfwrite device, the ps2write device does not
write pdfmarks to the output.

Certain kinds of annotations (eg Link annotations) cannot be
preserved, because they require a page (or other object) destination
which we can't easily know at the time we create the pdfmark.

Widget annotations are not preserved as these only have relvance
in AcroForms, and since we don't preserve AcroForms, its much
better to render the Widgets, otherwise their appearance will
be lost along with the AcroForm data.

It is possible that this behaviour may not be desirable, and
that there could be bugs in this code, so a new switch
'-dPreserveAnnots' is defined for use with the pdfwrite device
only. If set to false the old behaviour returns, and annotations
will be rendered instead of preserved.

There are a few differences with this code; a few progressions,
a few 'differences' and one file where the Stamp annotation no
longer renders. THis is because the Form for the Apperance is
invliad (leaves junk on the stack) and attempts to work around
this ran into al kinds of trouble. In the end I ran out of time
and chose to accept the error, the form is incorrect after all.

Resource/Init/pdf_draw.ps
Resource/Init/pdf_main.ps
base/gdevp14.c
base/gsform1.h
base/gxdevsop.h
devices/vector/gdevpdfb.h
devices/vector/gdevpdfi.c
devices/vector/gdevpdfu.c
devices/vector/gdevpdfx.h
doc/VectorDevices.htm
psi/zform.c
psi/zpdfops.c


2017-02-04 08:36:05 +0000
Robin Watts <robin.watts@artifex.com>
678e660cd4efcbf155675539c13a584cdffb5258

Fix memento builds.

base/gsrefct.h
base/lib.mak


2017-02-03 12:29:20 +0000
Robin Watts <robin.watts@artifex.com>
59d509244ddb6fe9719a6205bf5657268efcb6d6

Add missing \n to error message.

psi/interp.c


2017-02-03 02:53:02 -0800
Robin Watts <Robin.Watts@artifex.com>
1392f5d2e7fe73bce8ff56cef62e4205f8a53bfd

Memory squeezing fixes (PCL)

Harden PCL (and gslibctx etc) against memory failures
during initialisation.

base/gsicc_manage.c
base/gslibctx.c
base/gslibctx.h
base/gsmalloc.c
pcl/pl/plalloc.c
pcl/pl/plmain.c


2017-02-03 02:48:52 -0800
Robin Watts <Robin.Watts@artifex.com>
92ecd60a5218eb5bd1ba5e497e5fd2550112b5ed

Destructors should cope with being called with NULL.

Tweak pl level so that neat error closedown is easier.

pcl/pl/pltop.c


2017-02-02 20:12:33 +0000
Robin Watts <robin.watts@artifex.com>
dd6fdc6dd668776d7b9570dd07e1e1790fcba8fb

Fix Memento builds.

Some headers were sometimes being used with memento.h having
been included, and sometimes not. This lead to differing
redefinitions of 'free'.

base/gsfunc.h
base/lib.mak
base/ttfoutl.h


2017-01-27 16:32:07 +0000
Robin Watts <robin.watts@artifex.com>
9060c91ef75d7d36cfc1fd975e3368415df69b3a

New scan converter fix.

Don't convert ex and ey from endpoints to distance until *after*
we have finished using it as an endpoint.

base/gxscanc.c


2017-02-02 04:07:47 -0800
Robin Watts <Robin.Watts@artifex.com>
d8af3708a4907e98b5db54860d379702355dc077

Tweak gs to enable fast Memento memory squeezing.

Memento can memory squeeze in 2 modes; firstly it can repeatedly
run the same job again and again failing at subsequent points.

This has the advantage of being simple, but it has the problem
of being slow, in that processing is repeated again and again.

A faster mode is available where we run to the point of failure,
then fork. The child proceeds to fail, and once failed, the
parent then continues for 1 more allocation then repeats the
process. Thus the only repeated work is in the failure cases.

The downside to this is that fork copes very badly with
multi-threaded programs. Firstly, it only duplicates the current
thread - this means that we can only use it with single
threaded programs. Secondly, even with single threaded programs
the forked child goes wrong if you try to use mutexes etc.

This means that in order to use GS with the fast memento memory
squeezer, we need to ensure we don't create mutexes etc. We
do this by adding a MEMENTO_SQUEEZE_BUILD define to gs.

base/gp_psync.c
base/gsicc_cache.c
base/gsicc_lcms2.c
base/gsicc_manage.c
base/gsmalloc.c
base/sjpx_openjpeg.c


2017-02-02 03:34:22 -0800
Robin Watts <Robin.Watts@artifex.com>
8cca94c736bb4babc676bd2ce49176d93058b8b3

Memento memory squeezing tweaks.

Add Memento_bt() - a function to output the backtrace
to stderr.

Call this when we fork for a memory squeeze.

Forking only clones the active thread, so we can only use
the forking memory squeezer on single threaded tasks. Even
with single threaded tasks, you can't unlock mutexes in
the child that were taken in the parent. This means that
we need to disable mutexes in the main application if we
want to memory squeeze safely.

Also tweak the time we spend sleeping while waiting for a child
to die. This makes a huge difference to the runtime.

If we die during squeezing due to a SEGV, then don't bother
listing the blocks that we leaked.

base/memento.c
base/memento.h


2017-02-01 19:46:29 -0800
Ray Johnston <ray.johnston@artifex.com>
de2314431f400a439cb2bcebb1152fc206b8804d

Fix ignored return code for ICC profile device parameters.

All of the uses of gx_default_put_icc_colorants and gx_default_put_icc
ignored the return code which might be VMerror. Found when testing with
multi-threaded rendering and low memory conditions.

base/gsdparam.c


2017-02-01 08:40:01 -0800
Robin Watts <Robin.Watts@artifex.com>
cead170cb9e8dc25e59e3c8d7d8616d8b2f7119a

Memento: Improve memory squeezing.

It seems that Memory squeezing can sometimes run into
problems with the child hanging after a fork. This seems
to be related to the child process SEGVing and the
signal handler not picking it up.

I've introduced a workaround so that the parent now only
waits a maximum of 30 seconds before killing the child and
continuing.

base/memento.c


2017-01-25 21:42:53 -0800
Michael Vrhel <michael.vrhel@artifex.com>
3a9d6ebe560689930eaf3aca00652b22cef26423

Bug 626295 Text Knockout Transparency

When we have transparency, text knockout set,
with either a non-normal blend mode or an
opacity less than 1.0, we need to push a
non-isolated knockout group. Graphic state
changes can occur between the BT and ET commands.
As such, we will need to handling the push
operation in pdf14_text_begin (and the clist version)
when the conditions are right. This is a special
group that indicates its uniqueness with a text_group
flag. This flag is included through the clist, the
group as well as the device. Once set, subsequent
calls to pdf14_text_begin will not push another group.
The group is popped with ET is encountered through the
zendtransparencytextgroup command from the interpreter.
If the pdf14 device is not currently in a text group,
this group pop is ignored (and not even placed in
the clist). The pdfwrite compositor logic, ignores
and group pushes that occur with the text_group set
as well as all PDF14_END_TRANS_TEXT_GROUP types.
Due to confusion of with the annotation text writing
methods, I had to add a PDF14_BEGIN_TRANS_TEXT_GROUP
to denote when we encounter a BT in the source file
to ensure that we are only going to push groups if
our conditions are right and we are in a BT/ET pair and
not drawing a text annotation.

One optimization we may want to look at doing later, is
determining the bbox for the area between BT and ET.
Currently the group push is the same size as the parent
group which is likely much to large.

Resource/Init/pdf_ops.ps
base/gdevp14.c
base/gdevp14.h
base/gstparam.h
base/gstrans.c
base/gstrans.h
devices/vector/gdevpdft.c
psi/ztrans.c


2017-01-31 19:05:05 +0000
Chris Liddell <chris.liddell@artifex.com>
04c75cebae5912610526c997604f8d15fb933682

Fix a typo/thinko in the static lib build changes.

I'd mistakenly used $(TOP_OBJ) instead of $(XPS_TOP_OBJS) for the XPS
static library.

base/unixlink.mak


2017-01-31 15:04:55 +0000
Chris Liddell <chris.liddell@artifex.com>
ba07b2df0ea519b1a6e9fcdfe6f7a25be92264fa

Fix Windows build

In adding/tidying the Unix-like static library targets, I forgot to tweak the
VS nmake Makefiles to cope with the revisions. Done here.

psi/msvc.mak


2017-01-31 10:05:11 +0000
Chris Liddell <chris.liddell@artifex.com>
8acec5830978b1199b3cda4eae3064deb4d91818

Consolidate recurive make calls

We have various classes of target (e.g. debug, profile etc) that rely on
recursively calling make with specific sets of options per class.

Put the make call and the options into a macro for each class

base/unix-end.mak


2017-01-31 09:12:34 +0000
Chris Liddell <chris.liddell@artifex.com>
d9e40fcbf0a213e6717e1ab3bd234f5b20ca1270

Add debug static lib targets.

For neatness, I've moved the "visible" targets to unix-end.mak with the other
Unix-like targets.

And then added the recursive make calls to build debug versions.

base/unix-end.mak
base/unixlink.mak


2017-01-31 08:57:30 +0000
Chris Liddell <chris.liddell@artifex.com>
7718fe48373ff62f140d33080af9f49fc21b9f39

Tidy/Add static lib target(s).

Tidy up the libgs target for the gs static library on Unix-like systems (since
we're now using it).

Rejig the PCL, XPS and PDL executable builds to a) more closely match the gs
one, and b) facilitate static library targets for those, too.

Add the static library targets for the PCL/XPS/PDL builds (libgpcl6, libgxps
and libgpdl respectively).

base/gs.mak
base/unixlink.mak
gpdl/gpdl.mak


2017-01-30 15:05:36 -0800
Michael Vrhel <michael.vrhel@artifex.com>
94278ad478278567dbdfcb87137676ff73e86c22

XPS Transparency check remote resource dictionary

The XPS interpreter checks for the presence of transparency
on the page. It was not checking remote resource dictionaries
but rather was assuming that they always had transparency
which resulted in an unneeded push of the pdf14 device when
going to a raster output device.

xps/xpsanalyze.c


2017-01-30 14:08:52 -0800
Michael Vrhel <michael.vrhel@artifex.com>
587d0a7edfd3519bd28981eb2703cfaaf11c747c

Fix coverity issues 140991 and 140990

Introduced from http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=91741e126688807cd086dad55158cd0cad63725a

xps/xpszip.c


2017-01-27 12:17:00 -0800
Michael Vrhel <michael.vrhel@artifex.com>
8cde4bc582904132bd8bb78e6c5da5ab2ebdb6ce

XPS Transparency check

The XPS interpreter code was not setting the device param to
indicate if a page had transparency. As such, the fact that
a page had transparency was not getting used in the decision
to invoke or not invoke the command list.

xps/ghostxps.h
xps/xpspage.c


2017-01-30 07:25:59 -0800
Ray Johnston <ray.johnston@artifex.com>
827ab0227853b9ee5491ceb76b178757aa2ab733

Fix a potential de-reference of a NULL pointer with -Zv

base/gdevp14.c


2017-01-27 13:24:32 -0800
Michael Vrhel <michael.vrhel@artifex.com>
91741e126688807cd086dad55158cd0cad63725a

xps: low memory null dereference

If the allocation in xps_new_part fails, it returns
a null object which is then getting dereferenced.

xps/xpszip.c


2017-01-26 11:35:38 -0800
Ray Johnston <ray.johnston@artifex.com>
c27947491f9b4bc87b09bff0648e1816ebd2af19

Segfault in low memory configurations

Testing with -K values for bug 697504, I was able to reproduce some
segfaults, but don't know if they relate to the one mentioned here and
on bug 691170 (which was closed as fixed), but these need to get fixed
in any case.

These occured because the init2 had not completed, but the interp was
being called to do more stuff than it could reasonably hope to do in
this case. Testing with -K values from 15000 down to 100 by 100 now
no longer segfaults.

psi/imain.c


2017-01-26 18:09:06 +0000
Robin Watts <robin.watts@artifex.com>
0734126eafa7c9212341886626d15d90ccce400f

Add XPS_INDIRECTED_FILE_ACCESS define

If defined, then the xps interpreter looks to use user
supplied xps_{fopen,ftell,fseek,getc,fread,fclose} functions
rather than gp_fopen,ftell,fseek,getc,fread,fclose.

xps/ghostxps.h
xps/xpsjxr.c
xps/xpszip.c


2017-01-25 14:41:17 +0000
Chris Liddell <chris.liddell@artifex.com>
68af8c3b1584d0b001c7bd96456caf7547a0229e

Bug 697503: Check resource path, and GenericResourceDir...

...paths when searching for resources.

This relates back to bug 694509.

If GenericResourceDir is set as a relative path, relative to a non-standard
GS_LIB search path, we have to prefix the resource path (Category/Key) with
the GenericResourceDir for the search path machinery to find the resource
file.

*However*, if the GenericResourceDir is set in the normal way (automagically
by the initialization), then just using the plan resource path is required.

So, try both the plain 'Category/Key' path, and the
'GenericResourceDir/Category/Key' path.

Resource/Init/gs_res.ps


2017-01-25 16:00:40 +0000
Robin Watts <Robin.Watts@artifex.com>
4d07b45685976bd38e5cec8062b3a61d2ada5575

Hide more JPEG entries.

base/gsjconf.h


2017-01-24 18:07:11 +0000
Robin Watts <Robin.Watts@artifex.com>
aeb0bfb6c99e1e1683a21f684c18c1363ccc16cb

Add more jpeg symbols to be hidden.

It seems these clash with the devboards software too.

base/gsjconf.h


2017-01-20 17:02:39 +0000
Robin Watts <Robin.Watts@artifex.com>
c7d005ac1c92a6fee43554fffd9a6f38c0a6b962

Add GS_NO_FILESYSTEM define for systems with no FS.

Some systems (such as ThreadX), have std headers that
define FILE, but do not actually have a real filing
system implementation. As such, they don't support
filing system enumeration.

We therefore introduce a GS_NO_FILESYSTEM define that
stubs out the code in these entrypoints.

At some point we may split the contents out to a different
platform, but this will probably require some careful
thinking about other functions in these files to avoid
duplication of code.

base/gdevpipe.c
base/gp_unifs.c
base/gp_unix.c
pcl/pl/pjparse.c


2017-01-19 18:49:01 +0000
Robin Watts <Robin.Watts@artifex.com>
9568153b12b80d477f3031b88631910082a55bc8

Add option to hide jpeg entrypoints.

If we define GS_HIDE_INTERNAL_JPEG on build, then a series of macros
is used to rename internal JPEG entrypoints. This can prevent
symbol clashes when linking with other libraries.

There may well be more symbols to add here in future, but this
seems to be enough to solve it for me now.

base/gsjconf.h


2017-01-24 12:41:12 +0000
Robin Watts <Robin.Watts@artifex.com>
aafd60bddbb3d5cfc0d9fb726d0cf81c51805c4c

Remove opj_clock.c from build.

Only defines one function, that isn't used, and doesn't compile
on all platforms.

base/openjpeg.mak


2017-01-24 12:41:05 +0000
Robin Watts <Robin.Watts@artifex.com>
ea534adfd0a3deed4f2a70d47fc9d78c1911d928

Fix icc34.h header to compile on ThreadX.

Honour HAVE_STDINT_H predefine.

Also, tweak the #ifdeffery to be more readable (IMHO).
Less nesting and rightward creep, and a more straightforward

base/icc34.h


2017-01-21 15:01:14 -0800
Ray Johnston <ray.johnston@artifex.com>
eead75f44a03517ad50702f3c65d8c5784b4bfbb

Fizes for the ramfs (%ram% device) (Bug 226943)

There were problems with the GC not tracing the s->file pointer from the
stream (assumed to be an OS item) so change to using non_gc_memory. Also
problems with writing buffers more that a single block (not advancing
in the source buffer).

The bytesavailable operator didn't work because there was a bogus file_limit
in the stream, and s_ram_available was wrong.

Change the "this" to "thisdirent" so that C++ debuggers (like VS) can
show the structure contents correctly.

The bug shows an example that can be used to run a PDF file from stdin
without needing to write a file to disk.

base/gsioram.c
base/ramfs.c


2017-01-23 12:33:22 +0000
Robin Watts <robin.watts@artifex.com>
024e9bd9a07ff906e91f78594c9d547f5228b3c6

Force some typedef enums to be 32 bits.

Modern C's are allowed to shrink typedef enums so that they are
only as large as required to cover all the values in the
enumeration. This can mean that typedef enums can now be byte
sized.

This works very badly when we have an array of them, take the
address and cast it to an int *. That int * is no longer
appropriately aligned for some compilers. This happens in the
get_param code.

We therefore add a trailing 'large' enum value to force the
enums to be large. This will break down if we ever have a platform
where ints are larger than 32bits.

base/gscms.h


2017-01-23 11:48:11 +0000
Robin Watts <robin.watts@artifex.com>
24cb576dd60e903466b2d78cc718b3dd4da19529

MSVC: Add %ram% FS to VS project.

windows/ghostscript.vcproj


2017-01-16 18:33:25 +0000
Robin Watts <Robin.Watts@artifex.com>
e6753115b8a4c72c5e526f2a0a3849391a255962

Use consistent types in API and C implementation.

base/gssprintf.c


2017-01-19 11:44:18 -0800
Michael Vrhel <michael.vrhel@artifex.com>
79d6e96a8db2956c8317fd8bdeb8d8db5fd0e212

Bug 697489 xps transparency issue

The xps interpreter was pushing transparency groups without
pushing the pdf14 device. The problem was that the interpreter
was not checking the glyphs in the resource dictionaries.

I also optimized the code to stop checking for transparency
once it finds transparency.

xps/xpsanalyze.c
xps/xpspage.c


2017-01-18 14:49:40 -0800
Michael Vrhel <michael.vrhel@artifex.com>
a9bd0b6d95b16d594983682ae387922507e70b98

Bug 697489 bitrgbtags segv

The clist compositor call was not returning the existing
compositing device in certain cases causing an issue
later in the code.

base/gdevp14.c


2017-01-18 13:24:20 -0800
Michael Vrhel <michael.vrhel@artifex.com>
56879003723e608173cdc063a8f2da4172f29a95

Bug 697488 segv in pattern code

The transparency code was not updating the bit depth
properly when we had a color space change in the presence
of spot colors

base/gdevp14.c


2017-01-18 09:43:24 -0800
Michael Vrhel <michael.vrhel@artifex.com>
b12adcc4c201e94e1f726c8fa6ad7eea8a5f4ca7

Bug 697435 bitrgbtags device

The bit depth in the device was not getting set correctly
during a color space change in the transparency code when
the target device includes tags.

base/gdevp14.c


2017-01-18 14:18:29 +0000
Chris Liddell <chris.liddell@artifex.com>
b5abd7391d4d065e6b4d05c119d2dd243bda2f4d

Bug 697482: handle cff with broken /Private data

The problem in this case is that the offset into the cff data for the /Private
dictionary definition is well beyond the end of the cff stream.

Bounds check the offset, and if it's nonsense, treat it as a zero length
/Private dictionary (in the hope that the font doesn't actually need it.

NOTE: /Private *is* a required entry, so *using* the font may throw an error.

psi/zfont2.c


2017-01-18 14:29:18 +0000
Chris Liddell <chris.liddell@artifex.com>
90d3fb2e75aea47501dceb298ccd4f4229d4a6f3

Fix error check/return logic in the CFF parser

psi/zfont2.c


2017-01-17 10:48:07 -0800
Michael Vrhel <michael.vrhel@artifex.com>
51c5aa09762602b5dd3982ff3b92e182f1637dd4

Bug 697435 bittags device blending color space

In the clist case, there was a mixup with the ICC profile
during playback. This fixes that issue. While the small
file in Bug 697433 works with this fix, the large file
(regression3.pdf) still shows 2 issues. When the blending
color space is -sBlendColorProfile=default_cmyk.icc at 300dpi
we see a dropped band (likely some confusion about the
pdf14/clist optimization). When we use no blending color
space we end up with a segv in clist_playback_band

base/gdevp14.c


2017-01-13 19:16:56 -0800
Michael Vrhel <michael.vrhel@artifex.com>
0dbfbb773e40d23de5052fc5641387dad5d79bae

Code cleanup. Remove unused code in transparency code.

base/gdevp14.c
base/gscolorbuffer.c
base/gscolorbuffer.h
base/lib.mak
windows/ghostscript.vcproj


2017-01-13 12:33:05 -0800
Michael Vrhel <michael.vrhel@artifex.com>
8aa6b2ae6b27912339548380b602b8e3e6d17db3

Bug 697435 Tags device with Blending color space

Allow the use of put_image when we specified a blending color space.

base/gdevp14.c


2017-01-12 13:25:04 -0800
Ray Johnston <ray.johnston@artifex.com>
7d97633daa0679a688a85a8a8805c261bd828a7e

Add bitrgbtags device to Windows default build.

psi/msvc.mak


2017-01-12 13:16:58 -0800
Ray Johnston <ray.johnston@artifex.com>
3434578b240b1e4bc34a0ce108595653e0994a11

Add basic support for CMYK PAM (P7) format files.

This works for the files generated by Ghostscript and mupdf, so it
is useful enough to add.

lib/viewpbm.ps


2017-01-11 09:58:34 -0800
Ray Johnston <ray.johnston@artifex.com>
0130e9cc9f196b4bd2e107cd71826210a8274c9d

Fix SEGV bug 697473 bitrgbtags device with transparency

The SEGV was caused by setting tos->n_planes to the wrong value if we
converted colors to a different number of color components. Also fix
clearing of the tags if the backdrop was NULL (leave it set as it was
by pdf14_buf_new to GS_UNKNOWN_TAG).

Lastly, the pdf14_put_image wasn't setting up the buffer pointers for
all of the planes (alpha and tag), so bit_put_image choked. This
probably would have caused a problem with pngalpha.

base/gdevp14.c


2017-01-11 10:08:42 +0000
Chris Liddell <chris.liddell@artifex.com>
e424a42d269a626db054fb76e481df011ec6f1d6

pdfwrite: set the 'bytes_decoded' value in the text enum

For CIDFont subsitutions (and spotting single byte space characters), we need
to know how many bytes were read from the input string for the current glyph,
hence we have the 'bytes_decoded' value. For one code path, pdfwrite was
failing to set the value.

devices/vector/gdevpdtc.c


2017-01-11 09:16:59 +0000
Chris Liddell <chris.liddell@artifex.com>
aedc5a96d855086711b8accd48bd014dd57b18fa

Fix the profile (pg) build.

base/unix-end.mak


2017-01-11 09:19:07 +0000
Ken Sharp <ken.sharp@artifex.com>
40869fa69cdb74126977e35c2028d4176d350cdb

Improve CIDFont rearranged font handling slightly

Noticed while investigating a customer problem. We do not handle
rearranged fonts (because they are a hideous hack) but we do have code
to at least process them. Unfortunately there's a typo in the code which
causes it to throw an error if its ever executed.

Fix the typo here.

The fact that this has never come up indicates how often this mess is
used; ie never.

Resource/Init/gs_cmap.ps


2017-01-04 13:13:14 +0000
Chris Liddell <chris.liddell@artifex.com>
8360852efab5643d93cc3b040832075e199cd205

Bug 697462: pdfwrite: avoid cached glyph use

When pdfwrite is accumulating a Type 3 font, and we want to try to capture the
CharProc (rather than falling back to a bitmap), we need to stop the core
font code from using a previously cached glyph bitmap (for example, from an
earlier stringwidth operation), so we're sure the CharProc gets executed.

If we don't ensure the cache doesn't get used, we end up in an infinite loop,
where pdfwrite repeatedly returns to the core to run the CharProc.

devices/vector/gdevpdtt.c


2017-01-06 15:37:08 -0800
Michael Vrhel <michael.vrhel@artifex.com>
3f4e699c31368a08b0146ef62f5b196315bd700d

Update color document with new GS logo

doc/GS9_Color_Management.pdf


2017-01-06 09:59:29 -0800
Michael Vrhel <michael.vrhel@artifex.com>
434ae2a49e9b6026a3ae1eeceb0f32b78a894ee1

Color code clean up.

base/gdevp14.c
base/gsicc_cache.c
base/gsicc_manage.c
base/gsicc_manage.h
psi/zicc.c


2017-01-06 09:56:15 -0800
Michael Vrhel <michael.vrhel@artifex.com>
32765969861bee5773b5f1207dae2500fa1fd506

Update color management documentation

doc/GS9_Color_Management.pdf
doc/GS9_Color_Management.tex


2017-01-05 15:21:22 +0000
Robin Watts <robin.watts@artifex.com>
2259f4c693d02a43c007cab6cb268fa4e6d6c542

Tidy variable naming in iapi.{c,h}

Use 'instance' consistently.

psi/iapi.c
psi/iapi.h


2017-01-03 14:37:26 +0000
Robin Watts <robin.watts@artifex.com>
2f45ea017e9691c2b817884746306d27e06e0199

Windows gs: Avoid unininitialised read.

pcl/pl/plwmainc.c
psi/dpmain.c
psi/dwmain.c
psi/dwmainc.c
psi/dxmain.c


2017-01-03 10:17:13 +0000
Robin Watts <robin.watts@artifex.com>
8071bb2950068a3c6a1b5a405d16548177503a14

New scan converter: Fix some warnings.

"ey is set and then never used" in some release builds.

Rejig the code to avoid this.

base/gxscanc.c


2017-01-02 18:27:50 +0000
Robin Watts <robin.watts@artifex.com>
06e756898579cd21dbff40ad30efff9571a549fe

New scan converter: Fix problems in trap fills.

I was calculating trapezium fills slightly wrong.

Also, I was filling the 'centre of a pixel' cases edgebuffers
with slightly incorrect values. Now the debugging shows that
we are getting exactly what we want in the example files I
have tried.

This results in much smoother edges on some shapes.

base/gxscanc.c


2017-01-02 18:25:08 +0000
Robin Watts <robin.watts@artifex.com>
fb1f10f6eaed79016dd924b2e5730160e9267fd3

New scan converter: Improved debugging.

Update the debugging output from the new scan converter to be
more useful.

base/gxscanc.c


2016-12-29 14:00:21 -0800
Michael Vrhel <michael.vrhel@artifex.com>
90fd0c7ca3efc1ddff64a86f4104b13b3ac969eb

Bug 697456. Dont create new ctx when pdf14 device reenabled

This bug had yet another weird case where the user created a
file that pushed the pdf14 device twice. We were in that case,
creating a new ctx and blowing away the original one with out
proper clean up. To avoid, only create a new one when we need it.

base/gdevp14.c


2016-12-29 12:00:40 -0800
Michael Vrhel <michael.vrhel@artifex.com>
d621292fb2c8157d9899dcd83fd04dd250e30fe4

Bug 697444 Unmatched transparency group pop

This issue can only occur if there is an unmatched group pop.
If the interpreter is doing that, then the interpreter is
broken. With this bug the user is intentionally doing it.
We now throw and error when it occurs.

base/gdevp14.c


2016-12-29 15:57:43 +0000
Robin Watts <Robin.Watts@artifex.com>
4bef1a1d32e29b68855616020dbff574b9cda08f

Bug 697453: Avoid divide by 0 in scan conversion code.

Arithmetic overflow due to extreme values in the scan conversion
code can cause a division by 0.

Avoid this with a simple extra check.

dx_old=cf814d81
endp->x_next=b0e859b9
alp->x_next=8069a73a

leads to dx_den = 0

base/gxfill.c


2016-12-29 13:39:50 +0000
Robin Watts <robin.watts@artifex.com>
0aeb0bbd41cc16e70ab6e4b1d56e0c510bf2a758

Bug 697423: Fix overflow in pngalpha.

The composite creation maths in the copy_alpha method overflowed
due to the alpha range being changed from 0..15 to 0..255 in
commit d9f041d6fe7eda89364df1424f85ace974ed0fec. Changing to
unsigned solves this.

devices/gdevpng.c


2016-12-28 18:34:03 +0000
Robin Watts <robin.watts@artifex.com>
a7f3177cb0ae8f56cfec52ea38a4f6f613c91055

New scan converter: Fix problems seen at local minima/maxima.

Sometimes the fill isn't quite right at the extremes of shapes.

This is due to a problem when we exactly align with scanlines.

See the output of tests_private/comparefiles/Bug696174.ps at 300dpi
for some examples. Look at the tie lines for the first notes in the
last line of page 2 - a scanlines worth of pixels are missing from
the top.

base/gxscanc.c


2016-12-28 14:16:00 +0000
Robin Watts <robin.watts@artifex.com>
79572779090e4f777bfd21996f04ff9bddcd3cbc

New scan converter: Fix zero height rectangle behaviour.

base/gxscanc.c


2016-12-27 16:18:40 +0000
Robin Watts <robin.watts@artifex.com>
290c044b5156b8111326da25738cbc3c1ad2b182

Add some debug code to new scan converter.

Output the rectangles/traps filled by the scan converter as
postscript.

base/gxscanc.c


2016-12-23 19:39:23 +0000
Robin Watts <robin.watts@artifex.com>
deb69ac011df1cc58a0da4c08123e2aebf819c7e

New scanconverter; fix various problems

1) Fix problems seen when stroke and fills don't line up.

This turns out to be because fills done with traps and "any
part of a pixel" (APP) were being rounded wrongly. Fixed here.

2) Fix some debug statements.

3) Fix some centre of pixel trap filling code - the code to
look for the 'end' of traps was failing due to only comparing
the first half of the intercepts on a given line.

base/gxscanc.c


2016-12-22 17:27:11 +0000
Robin Watts <robin.watts@artifex.com>
8d722263343e7c17769cc4026a76cc28046a8e1a

Fix new scan converter.

When filling by traps with any part of a pixel in the new scan
converter, we were hitting cases where we we missing parts
of lines.

As seen in the borders of the "CPU" and "CACHE" boxes on:

gs -dSCANCONVERTERTYPE=2 -o out.png -sDEVICE=png16m -r72
-dFirstPage3 -dLastPage3 tests/pdf/Bug6901014_SMP_Warwick_14.pdf

base/gxscanc.c


2016-12-22 17:26:24 +0000
Robin Watts <robin.watts@artifex.com>
0c625d998fb85d87b6184bd52bfeee954746a2cd

Improve debugging in new scan converter.

base/gxscanc.c


2016-12-22 10:34:31 +0000
Ken Sharp <ken.sharp@artifex.com>
64fcc1460ef1af131c17d3ced0f01ec755243986

Fix a scan-build warning

The return value stored in code wasn't being actioned, move it to
code1 instead.

devices/vector/gdevpdfv.c


2016-12-21 18:16:28 +0000
Robin Watts <robin.watts@artifex.com>
5924a809c21ce8564c72b9917e4a5fbd278049ad

Fix double pixels writes in new scanconverter.

When scan converting to scanlines with any part of a pixel
we have to be careful not to double write pixels. The logic
for this was broken. Fix it here.

Seen with:

gs -dSCANCONVERTERTYPE=2 -o out.png -sDEVICE=png16m -r72
tests_private/comparefiles/Bug687295c.pdf

base/gxscanc.c


2016-12-21 16:54:14 +0000
Ken Sharp <ken.sharp@artifex.com>
daf85701dab05f17e924a48a81edc9195b4a04e8

fix crash with bad data supplied to makeimagedevice

Bug #697450 "Null pointer dereference in gx_device_finalize()"

The problem here is that the code to finalise a device unconditionally
frees the icc_struct member of the device structure. However this
particular (weird) device is not setup as a normal device, probably
because its very, very ancient. Its possible for the initialisation
of the device to abort with an error before calling gs_make_mem_device()
which is where the icc_struct member gets allocated (or set to NULL).

If that happens, then the cleanup code tries to free the device, which
calls finalize() which tries to free a garbage pointer.

Setting the device memory to 0x00 after we allocate it means that the
icc_struct member will be NULL< and our memory manager allows for that
happily enough, which avoids the problem.

base/gsdevmem.c


2016-12-21 15:42:36 +0000
Ken Sharp <ken.sharp@artifex.com>
2299c9a25fc9ae7b59752f1795f8b53920901c80

pdfwrite - don't emit degenerate Matrix for type 2 Patterns

Bug 697451 "shfill with degenerate matrix leads to PDF unreadable with Acrobat"

The original file deliberately makes the CTM degenerate before drawing
a shfill. Although all PostScript consumers handle this without complaint.
When converted to PDF most PDF consumers also are happy with the
situation, however Adobe Acrobat recoils in horror and aborts the
processing of the page stream with an error.

Adobe Acrobat Distiller simply refuses (silently!) to embed the shfill
in the PDF file.

We don't have a way to drop the fill, so instead, if the Matrix is
degenerate, replace it with the smallest scale matrix we can. Acrobat
is happy with this.

No differences expected.

devices/vector/gdevpdfv.c


2016-12-20 10:40:56 +0000
Ken Sharp <ken.sharp@artifex.com>
7d820556974dbafaed04cfe5356fc66556907128

Fix accuracy of bbox device with curves in filled paths

Bug #697446 "bbox device is inaccurate with certain curves, when filled"

The problem here is that, when a path is not clipped, is composed of
certain types of flattish curves at the boundary, we used an inaccurate
method to determine the bounds of the path.

The old code used gx_path_bbox, which only considers the points in a path
which is a problem for curves, because it considers the control points
to be part of the curve, which they are not, and with some curves
they can lie a long way from the actual path, as in this case.

This commit simply forces the code through the scan-converter in order
to get an accurate result, the same as the stroked code.

No differences expected.

base/gdevbbox.c


2016-12-19 16:24:37 +0000
Robin Watts <Robin.Watts@artifex.com>
79a594c9bd95239ee975e930563e7fb567018372

Fix SEGV seen with new scan converter.

The following command:

gs -sOutputFile=out.ppm -dMaxBitmap=400000000 -sDEVICE=ppmraw -r300
-Z: -sDEFAULTPAPERSIZE=letter -dNOPAUSE -dBATCH -K2000000 -dClusterJob
-dJOBSERVER -dSCANCONVERTERTYPE=2 %rom%Resource/Init/gs_cet.ps ~/11-11.PS

was failing, due to a problem in the scan conversion code with
extreme paths.

base/gxscanc.c


2016-12-17 10:33:18 +0000
Ken Sharp <ken.sharp@artifex.com>
2d46dd9e83edc813f2047a89cd260ab4de48fdf4

More heuristic fixes from ToUnicode CMap changes

Bug #697436 "Chinese character can not be copied out correctly"

The changes in commit 9dba57f0f9a53c130ec2771c0ed1d7bd6bbef6ab to
properly handle ToUnicde CMaps had rippling effects throughout the
code wherever ToUnicode CMaps are read or generated. In this case the
code which turned glyph names of the form uniXXXX into Unicode code
point XXXX (in the absence of a GlyphNames2Unicode table) was not
updated correctly.

This commit changes the allocation from two shorts to a single unsigned
short, and fill sin the data from the glyph name in big-endian format
(as required throughout the ToUnicode code now), which results in
the correct ToUnicode CMap being generated.

devices/vector/gdevpdte.c


2016-12-13 09:20:45 -0800
Michael Vrhel <michael.vrhel@artifex.com>
00dfdefe5d38871c0c67b08ede10a208b6897d10

Bug 693307 Overprint issues

Remove the portions of code used to simulate
the overprinting of CMYK and spot colorants while
in an RGB device. This really can't work and
we are doing a real separation compositor device for
this process. The code parts removed only confuse
understanding of the overprint compositor. Also fix
problems related to Bug 693307 which were caused by
some confusion in the code with regard to the overprint
mode. Fix other issues related to the Ghent overprint
tests where we were not handling properly the case
of overprinting with a gray color when the output
device was CMYK based. Finally there were multiple
issues with the testing and setting of the overprint
settings and the use of the effective overprint mode

base/gdevp14.c
base/gdevp14.h
base/gscdevn.c
base/gscolor.c
base/gscsepr.c
base/gscspace.c
base/gsicc.c
base/gsovrc.c
base/gsovrc.h
base/gstrans.h
base/gxblend.h
base/gxblend1.c
base/gxcmap.c
base/gxcspace.h
base/gxdevcli.h
base/gxoprect.c
base/gxoprect.h


2016-12-15 13:56:43 -0800
Michael Vrhel <michael.vrhel@artifex.com>
46de0c56a0132356084b320a9f7e4d2ac1396c1c

Bug 697435 add blending color space

This adds the ability to specify the default (based) blending
color space for a target device when we have transparency blending.
-sBlendColorProfile="my_profile.icc" is used for the specification.
Only Gray, RGB, or CMYK ICC profiles are allowed. Also, separation
devices (e.g. tiffsep and psdcmyk) will not support the use of this
at this time. Note also that if a target device has a put_image
procedure where it did its own blending or tag processing, this command
proc is not called if the blending color space is specified as the final color
conversion is applied through begin_typed_image.

base/gdevp14.c
base/gdevp14.h
base/gscms.h
base/gsdparam.c
base/gsequivc.c
base/gsicc_manage.c


2016-12-14 15:56:31 +0100
Tor Andersson <tor.andersson@artifex.com>
73060a27e554f8e64ae2aba4a1b03822207346c7

Fix warnings: remove unsigned < 0 tests that are always false.

jbig2dec/jbig2_image.c
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_symbol_dict.c


2016-12-12 17:47:17 +0000
Robin Watts <robin.watts@artifex.com>
cecf6b592945d247bf932f6a4f50065db4acfba8

Squash signed/unsigned warnings in MSVC jbig2 build.

Also rename "new" to "new_dict", because "new" is a bad
variable name.

jbig2dec/jbig2.c
jbig2dec/jbig2.h
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_huffman.h
jbig2dec/jbig2_image.c
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_symbol_dict.h
jbig2dec/jbig2_text.c
jbig2dec/jbig2_text.h


2016-12-12 08:31:34 -0800
Michael Vrhel <michael.vrhel@artifex.com>
0efaa8dff5b82169313a086861597e0f455892d3

Bug 697350. Fix isolated knockout group rendering

The blending code in the knockout isolate case had issues
and the only difference compared to the non-isolated case
is that we don't need to do the blend with the backdrop.

base/gdevp14.c
base/gxblend.c
base/gxblend.h
base/gxblend1.c


2016-12-12 17:53:23 +0000
Robin Watts <robin.watts@artifex.com>
15d9aaac64334776284310f5cbfe8ae79edae540

Squash annoying MSVC warning.

base/gxpcmap.c


2016-12-09 19:29:37 +0000
Robin Watts <robin.watts@artifex.com>
f5ac81f27674c54540c6313ed31b027f1385ceb5

Add ETS to Downscaler.

Currently only hooked up for tiffscaled and tiffscaled4.

Enable using -dDownScaleETS=1 along with the usual other downscaler
hooks.

No control over all the myriad ETS flags as yet.

base/ets.c
base/ets.h
base/ets_tm.h
base/gxdownscale.c
base/gxdownscale.h
base/lib.mak
devices/gdevtifs.c
devices/gdevtifs.h
devices/gdevtsep.c
doc/Devices.htm
windows/ghostscript.vcproj


2016-12-09 12:33:41 -0800
Michael Vrhel <michael.vrhel@artifex.com>
dd50b33582901eda25fce78a40552de91db3c8e5

Use normal blend mode for spots when mode is non-white preserving

When we are doing the group compositing, make sure to catch the
cases where we have spot colorants and the blend modes is either
non-separable or non-white preserving. In those cases, the spot
colorants have to use the normal blend mode.

base/gxblend.c
base/gxblend.h
base/gxblend1.c


2016-12-09 10:43:57 +0000
Chris Liddell <chris.liddell@artifex.com>
8894abf2985a58900e778957f93151b6cec1c17a

Address a segfault and error introduced in 4b3be09

In the zbegintransparencymaskgroup with a '/None' SMask parameter with the clist
in use, we get to clist_create_compositor().

In there, the return value of the get_cropping method can be either an error
(negative) or a specific cropping operation (positive). We assign it to 'code',
and if it's an error, return it, if not, assign it to another variable. But
don't set 'code' to anything else. It is then possible to get to the end of the
function without going through the path where 'code' is used again.

Setting 'code' to 0 after storing the cropping op solves the problem.

base/gxclimag.c


2016-12-08 18:09:58 +0000
Chris Liddell <chris.liddell@artifex.com>
4b3be091fa0384e679baaf04b14ea195da5adf21

Bug 697415: 'clean up' after images with SMask entries

Our handling of images with SMasks depends on telling the transparency
compositor to expect an SMask image, draw the SMask as a regular image,
tell the compositor the SMask is done, and then draw the 'main' image (to
which the compositor will apply the SMask).

The problem was that the compositor treats SMasks from images and SMasks from
ExtGState as the same (which they really are), but the image drawing code
took no action to inform the compositor we were done with the SMask, thus
leaving it place.

By adding a call to "unset" the SMask from the current graphics state (in this
case, it's really the current group in the compositor), we ensure the SMask
is only applied to the current image).

Resource/Init/pdf_draw.ps


2016-12-05 18:30:06 +0000
Ken Sharp <ken.sharp@artifex.com>
c875bf7490447579e850fa4722874848c3be4657

PDF Interpreter - more indirect object foolishness

Bug #697402 "PDF rendered as blank in PDF with unusual font width array"

Not ony the /Widths array of one of the fonts, but also an entry in a
/W array for a CIDFont specify a value using an indirect object
reference.

While this is silly (it makes the PDF file larger and slower) it is legal
so this commit copes with it by dereferencing any indirect references.

We alos now handle W2 arrays with references, even though this file
doesn't use one.

Resource/Init/pdf_font.ps


2016-12-03 06:40:17 -0800
Michael Vrhel <michael.vrhel@artifex.com>
0e16bd592aaccde9b384415a87d8a9bef9c57f83

Fix debug output for pattern bitmaps

base/gxpcmap.c


2016-12-03 12:25:58 +0000
Ken Sharp <ken.sharp@artifex.com>
cc746214644deacd5233a1453ce660573af09443

txtwrite - sort out endian-ness of Unicode based on architecture

Bug #697339 "Device txtwrite seems to be broken"

decode_glyph sppears always to return big-endian shorts for Unicode
code points. On litlee-endian platforms, reverse the byte order so
that we can treat the data as shorts instead of bytes.

As I don't have a big endian device to test this on, further work may
be required.

devices/vector/gdevtxtw.c


2016-12-02 09:00:20 -0800
Ray Johnston <ray.johnston@artifex.com>
d05c99ba9f3c1539a5b02a96ed050422677d9704

Remove MarginsHWResolution non-standard device parameter

base/gdevp14.c
base/gscoord.c
base/gsdevice.c
base/gsdevmem.c
base/gsdparam.c
base/gspath.c
base/gxclist.c
base/gxdevcli.h
base/gxdevice.h
devices/gdevbit.c
devices/gdevupd.c
devices/gdevxalt.c
devices/gdevxini.c
lib/align.ps


2016-12-02 19:03:42 +0000
Ken Sharp <ken.sharp@artifex.com>
b880332b899e0e59d17c7e48033e5cc816e5a831

pdfwrite - adjust Mono Subsample resolution to integer

Bug #697351 "/Subsample filter needs to make non-integer scales integer for monochrome images"

The only downsampling filter available for monochrome images and
imagemasks (1 bpp images and masks) is the /Subsample filter. However
the Subsample filter only works when the downsampling factor is an
exact integer.

Its unreasonable to insist that all the monochrome images in a given
document can be downsampled to a specific resolution and that the downsample
factor for all those images will be an integer.

So here, if the image is monochrome (so we canot switch to the Bicubic
filter) and the factor is not an integer, we force the factor to the
nearest integer.

Also, update the documentation which incorrectly stated that when
/PDFSETTINGS was set to 'prepress', monochrome images used the Bicubic
filter, it actually uses the Subsample filter.

devices/vector/gdevpsdi.c
doc/VectorDevices.htm


2016-12-02 17:13:35 +0000
Ken Sharp <ken.sharp@artifex.com>
26acbbb980a44d9610080876afeef5bb834d21e3

Documentation - Document the fact that setpagedevice resets distiller params

doc/VectorDevices.htm


2016-12-02 16:33:25 +0000
Ken Sharp <ken.sharp@artifex.com>
336c69b8be32c7193909a7f25b1a073b0ac2d92f

PDF Interpreter - have warning messages respect QUIET

Bug #697394 "stderr is included with stdout when result is set to stdout"

We do want the warnings to go to stdout, for debugging purposes,
because it is easier to use -dPDFDEBUG if the warnings are interleaved.

For the benefit of user piping the output to stdout, have the warning
messages respect -dQUIET so they don't end up in the output file.

Error messages (which are directed to stderr anyway) are not suppressed
as these are important.

No differences expected

Resource/Init/pdf_main.ps


2016-11-24 12:26:17 -0800
Ray Johnston <ray.johnston@artifex.com>
a8d6c4074ee8cfc251ebdd44ce4d2f97cdf20517

Revert commit 3cde6d6d, require %d OutputFile spec for multi-page tiffsep

The previous commit allowed multi-page separation files, but this would only
work if all pages had the same spot colors. If a later page added a spot color
it would be appended to the set of spot colors, but then the separation layer
would be emitted with the previous spot color name (according to the order)
and the CMYK equivalent for that previous spot color would be used to make the
CMYK composite.

Now multi-page tiffsep requires the use of %d (or some other format that uses
the page number in the filename). The first page can be output without %d, and
the second page will issue an error message and quit with ioerror.

In theory we could wait to issue the error until we encounter a spot color order
that was not the same as the first page, but this is of little utility, and
this change makes tiffsep operate similarly to the psdcmyk device.

devices/gdevtsep.c
doc/Devices.htm


2016-11-24 09:56:12 +0000
Ken Sharp <ken.sharp@artifex.com>
f42898997f249062f5da8fcf9c3a46cd6443fb39

PDF interpreter - skip 'R' operator in invalid context

Bug #697365 "corrupted content stream causes error"

The file has 2 Form XObject whose content streams have a single garbage
byte at the end of the stream, and which forms part of the 'endstream'.

In one case this simply leads to garbage on the stack, which we deal with
already, but in the other case the garbage happens to be a 'R character
which we attempt to process as a token.

Now attempting to process an R operator fails in this case, because the
stack contents are not a pair of integers. However, in the process, it
removes two stack objects which we require for further processing.

There's no way to restore those to the operand stack, and there is no
way to not process the 'R' as a token. We also cannot temporarily
define 'R' as a no-op for the course of a stream, because if the
stream uses named objects which have not already been dereferenced
we need to execute the R operator to resolve them.

This commit modifies the definition of R so that it checks the type
of the expected operands before consuming them. If they are not both
integers then it flags an error, leaves the stack alone and exits.

THis will, of course, be slightly slower than the current approach
which doesn't check types, but it should only be executed once
for each object in the file. Even for a large file that should only
be a few tens of thousands, and this is likely to be lost among
the processing time for real operations. However, shuold this
causew significant performance problems we may remove this in the
future.

No differences expected.

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


2016-11-23 09:26:16 -0800
Michael Vrhel <michael.vrhel@artifex.com>
b7ea690782c306241ed94fa3bdaf296f6bcc455f

Bug 697366

Partial fix. Pattern now renders correctly. Issues
with a few other spots though.

base/gdevdsha.c


2016-11-23 06:58:19 -0800
Michael Vrhel <michael.vrhel@artifex.com>
2237813596c8703de6008dd6c05460f9dac3ed75

Fix segv due to improper depth computation

Commit
47294ff5b168d25bfc7db64f51572d64b8ebde91
had an issue that was found when running
eci_altona-test-suite-v2_technical2_x4.pdf
(the Altona file with ALL the pages on one page)
with tiffsep and psdcmyk. This fixes the segv.
A rending issue remains on this issue.
Bug http://bugs.ghostscript.com/show_bug.cgi?id=697366
was opened to address.

base/gdevp14.c


2016-11-21 10:03:24 +0000
Chris Liddell <chris.liddell@artifex.com>
5b87f18df814aaa9f0036c843a4b24b1638aa4cf

libtiff: update to 4.0.7

Add in portability changes to tiffiop.h

Portability tiffiop.h

Remove globals from tif_pixarlog.c

tiff/CMakeLists.txt
tiff/ChangeLog
tiff/HOWTO-RELEASE
tiff/Makefile.am
tiff/Makefile.in
tiff/RELEASE-DATE
tiff/VERSION
tiff/aclocal.m4
tiff/build/CMakeLists.txt
tiff/build/Makefile.am
tiff/build/Makefile.in
tiff/config/compile
tiff/config/depcomp
tiff/config/ltmain.sh
tiff/config/missing
tiff/config/test-driver
tiff/configure
tiff/configure.ac
tiff/configure.com
tiff/contrib/CMakeLists.txt
tiff/contrib/Makefile.am
tiff/contrib/Makefile.in
tiff/contrib/addtiffo/CMakeLists.txt
tiff/contrib/addtiffo/Makefile.am
tiff/contrib/addtiffo/Makefile.in
tiff/contrib/addtiffo/addtiffo.c
tiff/contrib/addtiffo/tif_overview.c
tiff/contrib/addtiffo/tif_ovrcache.c
tiff/contrib/dbs/CMakeLists.txt
tiff/contrib/dbs/Makefile.am
tiff/contrib/dbs/Makefile.in
tiff/contrib/dbs/xtiff/CMakeLists.txt
tiff/contrib/dbs/xtiff/Makefile.am
tiff/contrib/dbs/xtiff/Makefile.in
tiff/contrib/dbs/xtiff/xtiff.c
tiff/contrib/iptcutil/CMakeLists.txt
tiff/contrib/iptcutil/Makefile.am
tiff/contrib/iptcutil/Makefile.in
tiff/contrib/iptcutil/iptcutil.c
tiff/contrib/mfs/CMakeLists.txt
tiff/contrib/mfs/Makefile.am
tiff/contrib/mfs/Makefile.in
tiff/contrib/pds/CMakeLists.txt
tiff/contrib/pds/Makefile.am
tiff/contrib/pds/Makefile.in
tiff/contrib/ras/CMakeLists.txt
tiff/contrib/ras/Makefile.am
tiff/contrib/ras/Makefile.in
tiff/contrib/stream/CMakeLists.txt
tiff/contrib/stream/Makefile.am
tiff/contrib/stream/Makefile.in
tiff/contrib/tags/CMakeLists.txt
tiff/contrib/tags/Makefile.am
tiff/contrib/tags/Makefile.in
tiff/contrib/win_dib/CMakeLists.txt
tiff/contrib/win_dib/Makefile.am
tiff/contrib/win_dib/Makefile.in
tiff/html/CMakeLists.txt
tiff/html/Makefile.am
tiff/html/Makefile.in
tiff/html/addingtags.html
tiff/html/bugs.html
tiff/html/build.html
tiff/html/contrib.html
tiff/html/document.html
tiff/html/images.html
tiff/html/images/CMakeLists.txt
tiff/html/images/Makefile.am
tiff/html/images/Makefile.in
tiff/html/index.html
tiff/html/internals.html
tiff/html/intro.html
tiff/html/libtiff.html
tiff/html/man/CMakeLists.txt
tiff/html/man/HtmlDoc.cmake
tiff/html/man/Makefile.am
tiff/html/man/Makefile.in
tiff/html/man/TIFFClose.3tiff.html
tiff/html/man/TIFFDataWidth.3tiff.html
tiff/html/man/TIFFError.3tiff.html
tiff/html/man/TIFFFieldDataType.3tiff.html
tiff/html/man/TIFFFieldName.3tiff.html
tiff/html/man/TIFFFieldPassCount.3tiff.html
tiff/html/man/TIFFFieldReadCount.3tiff.html
tiff/html/man/TIFFFieldTag.3tiff.html
tiff/html/man/TIFFFieldWriteCount.3tiff.html
tiff/html/man/TIFFFlush.3tiff.html
tiff/html/man/TIFFGetField.3tiff.html
tiff/html/man/TIFFRGBAImage.3tiff.html
tiff/html/man/TIFFReadDirectory.3tiff.html
tiff/html/man/TIFFReadEncodedStrip.3tiff.html
tiff/html/man/TIFFReadEncodedTile.3tiff.html
tiff/html/man/TIFFReadRGBAImage.3tiff.html
tiff/html/man/TIFFReadRGBAStrip.3tiff.html
tiff/html/man/TIFFReadRGBATile.3tiff.html
tiff/html/man/TIFFReadRawStrip.3tiff.html
tiff/html/man/TIFFReadRawTile.3tiff.html
tiff/html/man/TIFFReadScanline.3tiff.html
tiff/html/man/TIFFReadTile.3tiff.html
tiff/html/man/TIFFSetDirectory.3tiff.html
tiff/html/man/TIFFSetField.3tiff.html
tiff/html/man/TIFFWarning.3tiff.html
tiff/html/man/TIFFWriteDirectory.3tiff.html
tiff/html/man/TIFFWriteEncodedStrip.3tiff.html
tiff/html/man/TIFFWriteEncodedTile.3tiff.html
tiff/html/man/TIFFWriteRawStrip.3tiff.html
tiff/html/man/TIFFWriteRawTile.3tiff.html
tiff/html/man/TIFFWriteScanline.3tiff.html
tiff/html/man/TIFFWriteTile.3tiff.html
tiff/html/man/TIFFbuffer.3tiff.html
tiff/html/man/TIFFcodec.3tiff.html
tiff/html/man/TIFFcolor.3tiff.html
tiff/html/man/TIFFmemory.3tiff.html
tiff/html/man/TIFFsize.3tiff.html
tiff/html/man/TIFFstrip.3tiff.html
tiff/html/man/TIFFswab.3tiff.html
tiff/html/man/TIFFtile.3tiff.html
tiff/html/man/fax2ps.1.html
tiff/html/man/fax2tiff.1.html
tiff/html/man/gif2tiff.1.html
tiff/html/man/index.html
tiff/html/man/pal2rgb.1.html
tiff/html/man/ppm2tiff.1.html
tiff/html/man/ras2tiff.1.html
tiff/html/man/raw2tiff.1.html
tiff/html/man/rgb2ycbcr.1.html
tiff/html/man/sgi2tiff.1.html
tiff/html/man/thumbnail.1.html
tiff/html/man/tiff2bw.1.html
tiff/html/man/tiff2pdf.1.html
tiff/html/man/tiff2ps.1.html
tiff/html/man/tiff2rgba.1.html
tiff/html/man/tiffcmp.1.html
tiff/html/man/tiffcp.1.html
tiff/html/man/tiffcrop.1.html
tiff/html/man/tiffdither.1.html
tiff/html/man/tiffdump.1.html
tiff/html/man/tiffgt.1.html
tiff/html/man/tiffinfo.1.html
tiff/html/man/tiffmedian.1.html
tiff/html/man/tiffset.1.html
tiff/html/man/tiffsplit.1.html
tiff/html/man/tiffsv.1.html
tiff/html/misc.html
tiff/html/support.html
tiff/html/tools.html
tiff/html/v3.4beta007.html
tiff/html/v3.4beta016.html
tiff/html/v3.4beta018.html
tiff/html/v3.4beta024.html
tiff/html/v3.4beta028.html
tiff/html/v3.4beta029.html
tiff/html/v3.4beta031.html
tiff/html/v3.4beta032.html
tiff/html/v3.4beta033.html
tiff/html/v3.4beta034.html
tiff/html/v3.4beta035.html
tiff/html/v3.4beta036.html
tiff/html/v3.5.1.html
tiff/html/v3.5.2.html
tiff/html/v3.5.3.html
tiff/html/v3.5.4.html
tiff/html/v3.5.5.html
tiff/html/v3.5.6-beta.html
tiff/html/v3.5.7.html
tiff/html/v3.6.0.html
tiff/html/v3.6.1.html
tiff/html/v3.7.0.html
tiff/html/v3.7.0alpha.html
tiff/html/v3.7.0beta.html
tiff/html/v3.7.0beta2.html
tiff/html/v3.7.1.html
tiff/html/v3.7.2.html
tiff/html/v3.7.3.html
tiff/html/v3.7.4.html
tiff/html/v3.8.0.html
tiff/html/v3.8.1.html
tiff/html/v3.8.2.html
tiff/html/v3.9.0beta.html
tiff/html/v3.9.1.html
tiff/html/v3.9.2.html
tiff/html/v4.0.0.html
tiff/html/v4.0.1.html
tiff/html/v4.0.2.html
tiff/html/v4.0.3.html
tiff/html/v4.0.4.html
tiff/html/v4.0.4beta.html
tiff/html/v4.0.5.html
tiff/html/v4.0.6.html
tiff/html/v4.0.7.html
tiff/libtiff/CMakeLists.txt
tiff/libtiff/Makefile.am
tiff/libtiff/Makefile.in
tiff/libtiff/Makefile.vc
tiff/libtiff/libtiff.def
tiff/libtiff/mkg3states.c
tiff/libtiff/tif_aux.c
tiff/libtiff/tif_close.c
tiff/libtiff/tif_codec.c
tiff/libtiff/tif_color.c
tiff/libtiff/tif_compress.c
tiff/libtiff/tif_config.h.cmake.in
tiff/libtiff/tif_config.h.in
tiff/libtiff/tif_config.vc.h
tiff/libtiff/tif_dir.c
tiff/libtiff/tif_dirinfo.c
tiff/libtiff/tif_dirread.c
tiff/libtiff/tif_dirwrite.c
tiff/libtiff/tif_dumpmode.c
tiff/libtiff/tif_extension.c
tiff/libtiff/tif_fax3.c
tiff/libtiff/tif_fax3.h
tiff/libtiff/tif_getimage.c
tiff/libtiff/tif_jpeg.c
tiff/libtiff/tif_jpeg_12.c
tiff/libtiff/tif_luv.c
tiff/libtiff/tif_lzma.c
tiff/libtiff/tif_lzw.c
tiff/libtiff/tif_next.c
tiff/libtiff/tif_ojpeg.c
tiff/libtiff/tif_open.c
tiff/libtiff/tif_packbits.c
tiff/libtiff/tif_pixarlog.c
tiff/libtiff/tif_predict.c
tiff/libtiff/tif_predict.h
tiff/libtiff/tif_print.c
tiff/libtiff/tif_read.c
tiff/libtiff/tif_stream.cxx
tiff/libtiff/tif_strip.c
tiff/libtiff/tif_swab.c
tiff/libtiff/tif_thunder.c
tiff/libtiff/tif_tile.c
tiff/libtiff/tif_unix.c
tiff/libtiff/tif_win32.c
tiff/libtiff/tif_write.c
tiff/libtiff/tif_zip.c
tiff/libtiff/tiff.h
tiff/libtiff/tiffconf.h.cmake.in
tiff/libtiff/tiffconf.vc.h
tiff/libtiff/tiffio.h
tiff/libtiff/tiffiop.h
tiff/libtiff/tiffvers.h
tiff/libtiff/uvcode.h
tiff/man/CMakeLists.txt
tiff/man/Makefile.am
tiff/man/Makefile.in
tiff/man/TIFFClose.3tiff
tiff/man/TIFFDataWidth.3tiff
tiff/man/TIFFError.3tiff
tiff/man/TIFFFieldDataType.3tiff
tiff/man/TIFFFieldName.3tiff
tiff/man/TIFFFieldPassCount.3tiff
tiff/man/TIFFFieldReadCount.3tiff
tiff/man/TIFFFieldTag.3tiff
tiff/man/TIFFFieldWriteCount.3tiff
tiff/man/TIFFFlush.3tiff
tiff/man/TIFFGetField.3tiff
tiff/man/TIFFRGBAImage.3tiff
tiff/man/TIFFReadDirectory.3tiff
tiff/man/TIFFReadEncodedStrip.3tiff
tiff/man/TIFFReadEncodedTile.3tiff
tiff/man/TIFFReadRGBAImage.3tiff
tiff/man/TIFFReadRGBAStrip.3tiff
tiff/man/TIFFReadRGBATile.3tiff
tiff/man/TIFFReadRawStrip.3tiff
tiff/man/TIFFReadRawTile.3tiff
tiff/man/TIFFReadScanline.3tiff
tiff/man/TIFFReadTile.3tiff
tiff/man/TIFFSetDirectory.3tiff
tiff/man/TIFFSetField.3tiff
tiff/man/TIFFWarning.3tiff
tiff/man/TIFFWriteDirectory.3tiff
tiff/man/TIFFWriteEncodedStrip.3tiff
tiff/man/TIFFWriteEncodedTile.3tiff
tiff/man/TIFFWriteRawStrip.3tiff
tiff/man/TIFFWriteRawTile.3tiff
tiff/man/TIFFWriteScanline.3tiff
tiff/man/TIFFWriteTile.3tiff
tiff/man/TIFFbuffer.3tiff
tiff/man/TIFFcodec.3tiff
tiff/man/TIFFcolor.3tiff
tiff/man/TIFFmemory.3tiff
tiff/man/TIFFsize.3tiff
tiff/man/TIFFstrip.3tiff
tiff/man/TIFFswab.3tiff
tiff/man/TIFFtile.3tiff
tiff/man/bmp2tiff.1
tiff/man/fax2ps.1
tiff/man/fax2tiff.1
tiff/man/gif2tiff.1
tiff/man/libtiff.3tiff
tiff/man/pal2rgb.1
tiff/man/ppm2tiff.1
tiff/man/ras2tiff.1
tiff/man/raw2tiff.1
tiff/man/rgb2ycbcr.1
tiff/man/sgi2tiff.1
tiff/man/thumbnail.1
tiff/man/tiff2bw.1
tiff/man/tiff2pdf.1
tiff/man/tiff2ps.1
tiff/man/tiff2rgba.1
tiff/man/tiffcmp.1
tiff/man/tiffcp.1
tiff/man/tiffcrop.1
tiff/man/tiffdither.1
tiff/man/tiffdump.1
tiff/man/tiffgt.1
tiff/man/tiffinfo.1
tiff/man/tiffmedian.1
tiff/man/tiffset.1
tiff/man/tiffsplit.1
tiff/man/tiffsv.1
tiff/nmake.opt
tiff/port/CMakeLists.txt
tiff/port/Makefile.am
tiff/port/Makefile.in
tiff/port/Makefile.vc
tiff/port/libport.h
tiff/port/snprintf.c
tiff/port/strcasecmp.c
tiff/test/CMakeLists.txt
tiff/test/Makefile.am
tiff/test/Makefile.in
tiff/test/TiffSplitTest.cmake
tiff/test/TiffTest.cmake
tiff/test/TiffTestCommon.cmake
tiff/test/ascii_tag.c
tiff/test/bmp2tiff_palette.sh
tiff/test/bmp2tiff_rgb.sh
tiff/test/common.sh
tiff/test/custom_dir.c
tiff/test/gif2tiff.sh
tiff/test/images/palette-1c-8b.bmp
tiff/test/images/palette-1c-8b.gif
tiff/test/images/quad-tile.jpg.tiff
tiff/test/images/rgb-3c-8b.bmp
tiff/test/long_tag.c
tiff/test/raw_decode.c
tiff/test/rewrite_tag.c
tiff/test/short_tag.c
tiff/test/strip.c
tiff/test/tiff2rgba-quad-tile.jpg.sh
tiff/tools/CMakeLists.txt
tiff/tools/Makefile.am
tiff/tools/Makefile.in
tiff/tools/Makefile.vc
tiff/tools/bmp2tiff.c
tiff/tools/fax2ps.c
tiff/tools/fax2tiff.c
tiff/tools/gif2tiff.c
tiff/tools/pal2rgb.c
tiff/tools/ppm2tiff.c
tiff/tools/ras2tiff.c
tiff/tools/rasterfile.h
tiff/tools/raw2tiff.c
tiff/tools/rgb2ycbcr.c
tiff/tools/sgi2tiff.c
tiff/tools/sgisv.c
tiff/tools/thumbnail.c
tiff/tools/tiff2bw.c
tiff/tools/tiff2pdf.c
tiff/tools/tiff2ps.c
tiff/tools/tiff2rgba.c
tiff/tools/tiffcmp.c
tiff/tools/tiffcp.c
tiff/tools/tiffcrop.c
tiff/tools/tiffdither.c
tiff/tools/tiffdump.c
tiff/tools/tiffgt.c
tiff/tools/tiffinfo.c
tiff/tools/tiffmedian.c
tiff/tools/tiffset.c
tiff/tools/tiffsplit.c
tiff/tools/ycbcr.c


2016-11-08 09:50:00 +0000
Chris Liddell <chris.liddell@artifex.com>
6655712ee1d0bf2a7818044613bbed226b7abddd

Update freetype to 2.7.0

Tweak makefile for new freetype version

Force use of the v35 Freetype bytecode interpreter

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/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/atari/ATARI.H
freetype/builds/atari/README.TXT
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/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.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-sh
freetype/builds/unix/install.mk
freetype/builds/unix/ltmain.sh
freetype/builds/unix/mkinstalldirs
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.sln
freetype/builds/wince/vc2005-ce/freetype.vcproj
freetype/builds/wince/vc2005-ce/index.html
freetype/builds/wince/vc2008-ce/freetype.sln
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.UNIX
freetype/docs/INSTALL.VMS
freetype/docs/LICENSE.TXT
freetype/docs/TODO
freetype/docs/VERSION.DLL
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-pfr_fonts.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-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/config/ftconfig.h
freetype/include/config/ftheader.h
freetype/include/config/ftmodule.h
freetype/include/config/ftoption.h
freetype/include/config/ftstdlib.h
freetype/include/freetype.h
freetype/include/freetype/config/ftconfig.h
freetype/include/freetype/config/ftheader.h
freetype/include/freetype/config/ftmodule.h
freetype/include/freetype/config/ftoption.h
freetype/include/freetype/config/ftstdlib.h
freetype/include/freetype/freetype.h
freetype/include/freetype/ftadvanc.h
freetype/include/freetype/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/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/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/ftcalc.h
freetype/include/freetype/internal/ftdebug.h
freetype/include/freetype/internal/ftdriver.h
freetype/include/freetype/internal/ftgloadr.h
freetype/include/freetype/internal/fthash.h
freetype/include/freetype/internal/ftmemory.h
freetype/include/freetype/internal/ftobjs.h
freetype/include/freetype/internal/ftpic.h
freetype/include/freetype/internal/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/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/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/include/ftadvanc.h
freetype/include/ftautoh.h
freetype/include/ftbbox.h
freetype/include/ftbdf.h
freetype/include/ftbitmap.h
freetype/include/ftbzip2.h
freetype/include/ftcache.h
freetype/include/ftcffdrv.h
freetype/include/ftchapters.h
freetype/include/ftcid.h
freetype/include/fterrdef.h
freetype/include/fterrors.h
freetype/include/ftgasp.h
freetype/include/ftglyph.h
freetype/include/ftgxval.h
freetype/include/ftgzip.h
freetype/include/ftimage.h
freetype/include/ftincrem.h
freetype/include/ftlcdfil.h
freetype/include/ftlist.h
freetype/include/ftlzw.h
freetype/include/ftmac.h
freetype/include/ftmm.h
freetype/include/ftmodapi.h
freetype/include/ftmoderr.h
freetype/include/ftotval.h
freetype/include/ftoutln.h
freetype/include/ftpfr.h
freetype/include/ftrender.h
freetype/include/ftsizes.h
freetype/include/ftsnames.h
freetype/include/ftstroke.h
freetype/include/ftsynth.h
freetype/include/ftsystem.h
freetype/include/fttrigon.h
freetype/include/ftttdrv.h
freetype/include/fttypes.h
freetype/include/ftwinfnt.h
freetype/include/ftxf86.h
freetype/include/internal/autohint.h
freetype/include/internal/ftcalc.h
freetype/include/internal/ftdebug.h
freetype/include/internal/ftdriver.h
freetype/include/internal/ftgloadr.h
freetype/include/internal/ftmemory.h
freetype/include/internal/ftobjs.h
freetype/include/internal/ftpic.h
freetype/include/internal/ftrfork.h
freetype/include/internal/ftserv.h
freetype/include/internal/ftstream.h
freetype/include/internal/fttrace.h
freetype/include/internal/ftvalid.h
freetype/include/internal/internal.h
freetype/include/internal/psaux.h
freetype/include/internal/pshints.h
freetype/include/internal/services/svbdf.h
freetype/include/internal/services/svcid.h
freetype/include/internal/services/svgldict.h
freetype/include/internal/services/svgxval.h
freetype/include/internal/services/svkern.h
freetype/include/internal/services/svmm.h
freetype/include/internal/services/svotval.h
freetype/include/internal/services/svpfr.h
freetype/include/internal/services/svpostnm.h
freetype/include/internal/services/svprop.h
freetype/include/internal/services/svpscmap.h
freetype/include/internal/services/svpsinfo.h
freetype/include/internal/services/svsfnt.h
freetype/include/internal/services/svttcmap.h
freetype/include/internal/services/svtteng.h
freetype/include/internal/services/svttglyf.h
freetype/include/internal/services/svwinfnt.h
freetype/include/internal/services/svxf86nm.h
freetype/include/internal/sfnt.h
freetype/include/internal/t1types.h
freetype/include/internal/tttypes.h
freetype/include/t1tables.h
freetype/include/ttnameid.h
freetype/include/tttables.h
freetype/include/tttags.h
freetype/include/ttunpat.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/hbshim.c
freetype/src/autofit/hbshim.h
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/fthash.c
freetype/src/base/ftinit.c
freetype/src/base/ftlcdfil.c
freetype/src/base/ftmac.c
freetype/src/base/ftmm.c
freetype/src/base/ftobjs.c
freetype/src/base/ftotval.c
freetype/src/base/ftoutln.c
freetype/src/base/ftpatent.c
freetype/src/base/ftpfr.c
freetype/src/base/ftpic.c
freetype/src/base/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/ftwinfnt.c
freetype/src/base/ftxf86.c
freetype/src/base/md5.c
freetype/src/base/rules.mk
freetype/src/bdf/Jamfile
freetype/src/bdf/bdf.h
freetype/src/bdf/bdfdrivr.c
freetype/src/bdf/bdfdrivr.h
freetype/src/bdf/bdferror.h
freetype/src/bdf/bdflib.c
freetype/src/bdf/rules.mk
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/cf2arrst.c
freetype/src/cff/cf2arrst.h
freetype/src/cff/cf2blues.h
freetype/src/cff/cf2error.h
freetype/src/cff/cf2fixed.h
freetype/src/cff/cf2font.h
freetype/src/cff/cf2ft.c
freetype/src/cff/cf2ft.h
freetype/src/cff/cf2glue.h
freetype/src/cff/cf2hints.c
freetype/src/cff/cf2hints.h
freetype/src/cff/cf2intrp.c
freetype/src/cff/cf2intrp.h
freetype/src/cff/cf2read.h
freetype/src/cff/cf2stack.c
freetype/src/cff/cf2stack.h
freetype/src/cff/cf2types.h
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/cfftypes.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/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/pcf.h
freetype/src/pcf/pcfdrivr.c
freetype/src/pcf/pcfdrivr.h
freetype/src/pcf/pcferror.h
freetype/src/pcf/pcfread.c
freetype/src/pcf/pcfread.h
freetype/src/pcf/pcfutil.h
freetype/src/pcf/rules.mk
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/module.mk
freetype/src/psaux/psaux.c
freetype/src/psaux/psauxerr.h
freetype/src/psaux/psauxmod.c
freetype/src/psaux/psauxmod.h
freetype/src/psaux/psconv.c
freetype/src/psaux/psconv.h
freetype/src/psaux/psobjs.c
freetype/src/psaux/psobjs.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/chktrcmp.py
freetype/src/tools/docmaker/content.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/Makefile
freetype/src/tools/ftrandom/README
freetype/src/tools/ftrandom/ftrandom.c
freetype/src/tools/glnames.py
freetype/src/tools/no-copyright
freetype/src/tools/test_afm.c
freetype/src/tools/update-copyright
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


2016-11-15 09:58:58 +0000
Chris Liddell <chris.liddell@artifex.com>
99c6a18eb430a9091c79369b2bdd2952d481c7d5

Document use of string for subsituted CIDFont name

Add a comment and example at the top of cidfmap with details of dealing with
CIDFont names with spaces in them.

Resource/Init/cidfmap


2016-11-07 14:52:28 +0000
Chris Liddell <chris.liddell@artifex.com>
23dc144b3c3d3dbafd83dca7b9c09e6977b774d6

Update lcms2 to 2.8

Tweak makefile for lcms2 2.8

Delete mac file system specific files from lcms2 tree

Bug 697056: Fix LCMS static init of critical section.

LCMS2 relies on being able to statically init a mutex
(actually a Critical Section on windows). Windows has
no official API for statically initing a critical
section, so lcms2 uses a hack (albeit it a safe one)
to do this.

Unfortunately ApplicationVerifier (and presumably other
similar tools) don't understand this idiom, and get
confused by not seeing an explicit initialisation call.
This is causing problems for a customer.

This commit therefore introduces code to properly
initialise it on Windows. In order to avoid any possible
multithreaded startup issues, we use the Windows
InterlockedCompareExchangePointer API (introduced in
Windows XP).

If anyone wants to avoid this code (so they can work
on pre-Windows XP), they can build with:

CMS_RELY_ON_WINDOWS_STATIC_MUTEX_INIT

defined, and get the old behaviour. We automatically
set this when building with any version of MSVC older
than VS2005 (i.e. those that don't have that API
available).

base/lcms2.mak
lcms2/AUTHORS
lcms2/ChangeLog
lcms2/Makefile.am
lcms2/Makefile.in
lcms2/Projects/BorlandC_5.5/lcms2.rc
lcms2/Projects/BorlandC_5.5/lcmsdll.lst
lcms2/Projects/VC2008/jpegicc/jpegicc.vcproj
lcms2/Projects/VC2008/lcms2.rc
lcms2/Projects/VC2008/lcms2.sln
lcms2/Projects/VC2008/lcms2_DLL/lcms2_DLL.vcproj
lcms2/Projects/VC2008/lcms2_static/lcms2_static.vcproj
lcms2/Projects/VC2008/linkicc/linkicc.vcproj
lcms2/Projects/VC2008/psicc/psicc.vcproj
lcms2/Projects/VC2008/resource.h
lcms2/Projects/VC2008/testbed/testbed.vcproj
lcms2/Projects/VC2008/tiffdiff/tiffdiff.vcproj
lcms2/Projects/VC2008/tifficc/tifficc.vcproj
lcms2/Projects/VC2008/transicc/transicc.vcproj
lcms2/Projects/VC2010/jpegicc/jpegicc.vcproj
lcms2/Projects/VC2010/jpegicc/jpegicc.vcxproj
lcms2/Projects/VC2010/lcms2.rc
lcms2/Projects/VC2010/lcms2.sln
lcms2/Projects/VC2010/lcms2_DLL/lcms2_DLL.vcproj
lcms2/Projects/VC2010/lcms2_static/lcms2_static.vcproj
lcms2/Projects/VC2010/linkicc/linkicc.vcproj
lcms2/Projects/VC2010/psicc/psicc.vcproj
lcms2/Projects/VC2010/testbed/testbed.vcproj
lcms2/Projects/VC2010/tiffdiff/tiffdiff.vcproj
lcms2/Projects/VC2010/tifficc/tifficc.vcproj
lcms2/Projects/VC2010/transicc/transicc.vcproj
lcms2/Projects/VC2012/jpegicc/jpegicc.vcproj
lcms2/Projects/VC2012/jpegicc/jpegicc.vcxproj
lcms2/Projects/VC2012/jpegicc/jpegicc.vcxproj.filters
lcms2/Projects/VC2012/lcms2.rc
lcms2/Projects/VC2012/lcms2.sln
lcms2/Projects/VC2012/lcms2_DLL/lcms2_DLL.vcproj
lcms2/Projects/VC2012/lcms2_DLL/lcms2_DLL.vcxproj
lcms2/Projects/VC2012/lcms2_DLL/lcms2_DLL.vcxproj.filters
lcms2/Projects/VC2012/lcms2_static/lcms2_static.vcproj
lcms2/Projects/VC2012/lcms2_static/lcms2_static.vcxproj
lcms2/Projects/VC2012/lcms2_static/lcms2_static.vcxproj.filters
lcms2/Projects/VC2012/linkicc/linkicc.vcproj
lcms2/Projects/VC2012/linkicc/linkicc.vcxproj
lcms2/Projects/VC2012/linkicc/linkicc.vcxproj.filters
lcms2/Projects/VC2012/psicc/psicc.vcproj
lcms2/Projects/VC2012/psicc/psicc.vcxproj
lcms2/Projects/VC2012/psicc/psicc.vcxproj.filters
lcms2/Projects/VC2012/resource.h
lcms2/Projects/VC2012/testbed/testbed.vcproj
lcms2/Projects/VC2012/testbed/testbed.vcxproj
lcms2/Projects/VC2012/testbed/testbed.vcxproj.filters
lcms2/Projects/VC2012/tiffdiff/tiffdiff.vcproj
lcms2/Projects/VC2012/tiffdiff/tiffdiff.vcxproj
lcms2/Projects/VC2012/tiffdiff/tiffdiff.vcxproj.filters
lcms2/Projects/VC2012/tifficc/tifficc.vcproj
lcms2/Projects/VC2012/tifficc/tifficc.vcxproj
lcms2/Projects/VC2012/tifficc/tifficc.vcxproj.filters
lcms2/Projects/VC2012/transicc/transicc.vcproj
lcms2/Projects/VC2012/transicc/transicc.vcxproj
lcms2/Projects/VC2012/transicc/transicc.vcxproj.filters
lcms2/Projects/VC2013/jpegicc/jpegicc.vcxproj
lcms2/Projects/VC2013/jpegicc/jpegicc.vcxproj.filters
lcms2/Projects/VC2013/lcms2.rc
lcms2/Projects/VC2013/lcms2.sln
lcms2/Projects/VC2013/lcms2_DLL/lcms2_DLL.vcxproj
lcms2/Projects/VC2013/lcms2_DLL/lcms2_DLL.vcxproj.filters
lcms2/Projects/VC2013/lcms2_static/lcms2_static.vcxproj
lcms2/Projects/VC2013/lcms2_static/lcms2_static.vcxproj.filters
lcms2/Projects/VC2013/linkicc/linkicc.vcxproj
lcms2/Projects/VC2013/linkicc/linkicc.vcxproj.filters
lcms2/Projects/VC2013/psicc/psicc.vcxproj
lcms2/Projects/VC2013/psicc/psicc.vcxproj.filters
lcms2/Projects/VC2013/resource.h
lcms2/Projects/VC2013/testbed/testbed.vcxproj
lcms2/Projects/VC2013/testbed/testbed.vcxproj.filters
lcms2/Projects/VC2013/tiffdiff/tiffdiff.vcxproj
lcms2/Projects/VC2013/tiffdiff/tiffdiff.vcxproj.filters
lcms2/Projects/VC2013/tifficc/tifficc.vcxproj
lcms2/Projects/VC2013/tifficc/tifficc.vcxproj.filters
lcms2/Projects/VC2013/transicc/transicc.vcxproj
lcms2/Projects/VC2013/transicc/transicc.vcxproj.filters
lcms2/Projects/VC2015/jpegicc/jpegicc.vcxproj
lcms2/Projects/VC2015/jpegicc/jpegicc.vcxproj.filters
lcms2/Projects/VC2015/lcms2.rc
lcms2/Projects/VC2015/lcms2.sln
lcms2/Projects/VC2015/lcms2_DLL/lcms2_DLL.vcxproj
lcms2/Projects/VC2015/lcms2_DLL/lcms2_DLL.vcxproj.filters
lcms2/Projects/VC2015/lcms2_static/lcms2_static.vcxproj
lcms2/Projects/VC2015/lcms2_static/lcms2_static.vcxproj.filters
lcms2/Projects/VC2015/linkicc/linkicc.vcxproj
lcms2/Projects/VC2015/linkicc/linkicc.vcxproj.filters
lcms2/Projects/VC2015/psicc/psicc.vcxproj
lcms2/Projects/VC2015/psicc/psicc.vcxproj.filters
lcms2/Projects/VC2015/resource.h
lcms2/Projects/VC2015/testbed/testbed.vcxproj
lcms2/Projects/VC2015/testbed/testbed.vcxproj.filters
lcms2/Projects/VC2015/tiffdiff/tiffdiff.vcxproj
lcms2/Projects/VC2015/tiffdiff/tiffdiff.vcxproj.filters
lcms2/Projects/VC2015/tifficc/tifficc.vcxproj
lcms2/Projects/VC2015/tifficc/tifficc.vcxproj.filters
lcms2/Projects/VC2015/transicc/transicc.vcxproj
lcms2/Projects/VC2015/transicc/transicc.vcxproj.filters
lcms2/Projects/cppcheck/lcms2.cppcheck
lcms2/Projects/mac/LittleCMS/._Info.plist
lcms2/Projects/mac/LittleCMS/._LittleCMS.xcodeproj
lcms2/Projects/mac/LittleCMS/English.lproj/InfoPlist.strings
lcms2/Projects/mac/LittleCMS/Info.plist
lcms2/Projects/mac/LittleCMS/LittleCMS.xcodeproj/mariama.mode1v3
lcms2/Projects/mac/LittleCMS/LittleCMS.xcodeproj/mariama.pbxuser
lcms2/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.pbxproj
lcms2/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.xcworkspace/contents.xcworkspacedata
lcms2/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.xcworkspace/xcuserdata/User.xcuserdatad/UserInterfaceState.xcuserstate
lcms2/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.xcworkspace/xcuserdata/User.xcuserdatad/WorkspaceSettings.xcsettings
lcms2/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
lcms2/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcschemes/LittleCMS.xcscheme
lcms2/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcschemes/testbed.xcscheme
lcms2/Projects/mac/LittleCMS/LittleCMS.xcodeproj/xcuserdata/User.xcuserdatad/xcschemes/xcschememanagement.plist
lcms2/Projects/mac/LittleCMS/LittleCMS_Prefix.pch
lcms2/Projects/mac/LittleCMS/TestBed-Info.plist
lcms2/aclocal.m4
lcms2/autogen.sh
lcms2/compile
lcms2/config.guess
lcms2/config.sub
lcms2/configure
lcms2/configure.ac
lcms2/depcomp
lcms2/doc/LittleCMS2.6 API.pdf
lcms2/doc/LittleCMS2.6 Plugin API.pdf
lcms2/doc/LittleCMS2.6 tutorial.pdf
lcms2/doc/LittleCMS2.8 API.pdf
lcms2/doc/LittleCMS2.8 Plugin API.pdf
lcms2/doc/LittleCMS2.8 tutorial.pdf
lcms2/doc/src.zip
lcms2/include/Makefile.in
lcms2/include/lcms2.h
lcms2/include/lcms2_plugin.h
lcms2/install-sh
lcms2/ltmain.sh
lcms2/m4/acx_pthread.m4
lcms2/m4/libtool.m4
lcms2/m4/ltoptions.m4
lcms2/m4/ltsugar.m4
lcms2/m4/ltversion.m4
lcms2/m4/lt~obsolete.m4
lcms2/missing
lcms2/src/Makefile.am
lcms2/src/Makefile.in
lcms2/src/cmsalpha.c
lcms2/src/cmscam02.c
lcms2/src/cmscgats.c
lcms2/src/cmscnvrt.c
lcms2/src/cmserr.c
lcms2/src/cmsgamma.c
lcms2/src/cmsgmt.c
lcms2/src/cmshalf.c
lcms2/src/cmsintrp.c
lcms2/src/cmsio0.c
lcms2/src/cmsio1.c
lcms2/src/cmslut.c
lcms2/src/cmsmd5.c
lcms2/src/cmsmtrx.c
lcms2/src/cmsnamed.c
lcms2/src/cmsopt.c
lcms2/src/cmspack.c
lcms2/src/cmspcs.c
lcms2/src/cmsplugin.c
lcms2/src/cmsps2.c
lcms2/src/cmssamp.c
lcms2/src/cmssm.c
lcms2/src/cmstypes.c
lcms2/src/cmsvirt.c
lcms2/src/cmswtpnt.c
lcms2/src/cmsxform.c
lcms2/src/extra_xform.h
lcms2/src/lcms2.def
lcms2/src/lcms2_internal.h
lcms2/testbed/Makefile.am
lcms2/testbed/Makefile.in
lcms2/testbed/crayons.icc
lcms2/testbed/ibm-t61.icc
lcms2/testbed/new.icc
lcms2/testbed/test1.icc
lcms2/testbed/test2.icc
lcms2/testbed/test3.icc
lcms2/testbed/test4.icc
lcms2/testbed/test5.icc
lcms2/testbed/testcms2.c
lcms2/testbed/testcms2.h
lcms2/testbed/testplugin.c
lcms2/testbed/toosmall.icc
lcms2/testbed/zoo_icc.c
lcms2/utils/common/utils.h
lcms2/utils/common/vprf.c
lcms2/utils/delphi/delphidemo.res
lcms2/utils/delphi/demo1.dfm
lcms2/utils/delphi/lcms2.dll
lcms2/utils/delphi/lcms2dll.pas
lcms2/utils/jpgicc/LICENSE_iccjpeg
lcms2/utils/jpgicc/Makefile.am
lcms2/utils/jpgicc/Makefile.in
lcms2/utils/jpgicc/iccjpeg.c
lcms2/utils/jpgicc/jpgicc.1
lcms2/utils/jpgicc/jpgicc.c
lcms2/utils/linkicc/Makefile.am
lcms2/utils/linkicc/Makefile.in
lcms2/utils/linkicc/linkicc.1
lcms2/utils/linkicc/linkicc.c
lcms2/utils/psicc/Makefile.am
lcms2/utils/psicc/Makefile.in
lcms2/utils/psicc/psicc.1
lcms2/utils/psicc/psicc.c
lcms2/utils/samples/Makefile.am
lcms2/utils/samples/roundtrip.c
lcms2/utils/samples/wtpt.c
lcms2/utils/tificc/Makefile.am
lcms2/utils/tificc/Makefile.in
lcms2/utils/tificc/tifdiff.c
lcms2/utils/tificc/tificc.1
lcms2/utils/tificc/tificc.c
lcms2/utils/transicc/Makefile.am
lcms2/utils/transicc/Makefile.in
lcms2/utils/transicc/transicc.1
lcms2/utils/transicc/transicc.c


2016-11-07 10:42:05 +0000
Chris Liddell <chris.liddell@artifex.com>
64ad2a92195fd05e9ba34995ae994eb250fc9c7c

Update libpng to 1.6.26

libpng/ANNOUNCE
libpng/CHANGES
libpng/CMakeLists.txt
libpng/INSTALL
libpng/LICENSE
libpng/Makefile.am
libpng/Makefile.in
libpng/README
libpng/TODO
libpng/arm/arm_init.c
libpng/arm/filter_neon_intrinsics.c
libpng/autogen.sh
libpng/config.h.in
libpng/configure
libpng/configure.ac
libpng/contrib/README.txt
libpng/contrib/arm-neon/README
libpng/contrib/arm-neon/linux-auxv.c
libpng/contrib/arm-neon/linux.c
libpng/contrib/conftest/pngcp.dfa
libpng/contrib/examples/README.txt
libpng/contrib/examples/iccfrompng.c
libpng/contrib/examples/pngpixel.c
libpng/contrib/examples/pngtopng.c
libpng/contrib/examples/simpleover.c
libpng/contrib/gregbook/README
libpng/contrib/gregbook/readpng2.c
libpng/contrib/gregbook/rpng-win.c
libpng/contrib/gregbook/rpng2-win.c
libpng/contrib/gregbook/rpng2-x.c
libpng/contrib/intel/INSTALL
libpng/contrib/intel/filter_sse2_intrinsics.c
libpng/contrib/intel/intel_init.c
libpng/contrib/intel/intel_sse.patch
libpng/contrib/libtests/fakepng.c
libpng/contrib/libtests/makepng.c
libpng/contrib/libtests/pngimage.c
libpng/contrib/libtests/pngstest-errors.h
libpng/contrib/libtests/pngstest.c
libpng/contrib/libtests/pngunknown.c
libpng/contrib/libtests/pngvalid.c
libpng/contrib/libtests/readpng.c
libpng/contrib/libtests/tarith.c
libpng/contrib/libtests/timepng.c
libpng/contrib/mips-msa/README
libpng/contrib/mips-msa/linux.c
libpng/contrib/pngminus/README
libpng/contrib/pngminus/png2pnm.c
libpng/contrib/pngminus/pnm2png.c
libpng/contrib/pngsuite/README
libpng/contrib/tools/README.txt
libpng/contrib/tools/chkfmt
libpng/contrib/tools/genpng.c
libpng/contrib/tools/png-fix-itxt.c
libpng/contrib/tools/pngcp.c
libpng/contrib/tools/pngfix.c
libpng/contrib/tools/reindent
libpng/contrib/visupng/PngFile.c
libpng/example.c
libpng/libpng-manual.txt
libpng/libpng.3
libpng/libpngpf.3
libpng/mips/filter_msa_intrinsics.c
libpng/mips/mips_init.c
libpng/png.5
libpng/png.c
libpng/png.h
libpng/pngconf.h
libpng/pngdebug.h
libpng/pngerror.c
libpng/pngget.c
libpng/pnginfo.h
libpng/pngmem.c
libpng/pngpread.c
libpng/pngpriv.h
libpng/pngread.c
libpng/pngrio.c
libpng/pngrtran.c
libpng/pngrutil.c
libpng/pngset.c
libpng/pngstruct.h
libpng/pngtest.c
libpng/pngtrans.c
libpng/pngwio.c
libpng/pngwrite.c
libpng/pngwtran.c
libpng/pngwutil.c
libpng/projects/vstudio/README.txt
libpng/projects/vstudio/WARNING
libpng/projects/vstudio/libpng/libpng.vcxproj
libpng/projects/vstudio/pnglibconf/pnglibconf.vcxproj
libpng/projects/vstudio/pngstest/pngstest.vcxproj
libpng/projects/vstudio/pngtest/pngtest.vcxproj
libpng/projects/vstudio/pngunknown/pngunknown.vcxproj
libpng/projects/vstudio/pngvalid/pngvalid.vcxproj
libpng/projects/vstudio/readme.txt
libpng/projects/vstudio/zlib.props
libpng/projects/vstudio/zlib/zlib.vcxproj
libpng/scripts/README.txt
libpng/scripts/def.c
libpng/scripts/genchk.cmake.in
libpng/scripts/genout.cmake.in
libpng/scripts/gensrc.cmake.in
libpng/scripts/libpng-config-head.in
libpng/scripts/libpng.pc.in
libpng/scripts/makefile.cegcc
libpng/scripts/makefile.linux
libpng/scripts/makefile.msys
libpng/scripts/makefile.ne12bsd
libpng/scripts/makefile.netbsd
libpng/scripts/makefile.openbsd
libpng/scripts/makefile.sco
libpng/scripts/pnglibconf.dfa
libpng/scripts/pnglibconf.h.prebuilt
libpng/scripts/symbols.def
libpng/scripts/test.cmake.in
libpng/tests/pngimage-full
libpng/tests/pngimage-quick
libpng/tests/pngstest
libpng/tests/pngstest-0g01
libpng/tests/pngstest-0g02
libpng/tests/pngstest-0g04
libpng/tests/pngstest-0g08
libpng/tests/pngstest-0g16
libpng/tests/pngstest-2c08
libpng/tests/pngstest-2c16
libpng/tests/pngstest-3p01
libpng/tests/pngstest-3p02
libpng/tests/pngstest-3p04
libpng/tests/pngstest-3p08
libpng/tests/pngstest-4a08
libpng/tests/pngstest-4a16
libpng/tests/pngstest-6a08
libpng/tests/pngstest-6a16
libpng/tests/pngstest-error
libpng/tests/pngtest
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-size
libpng/tests/pngvalid-progressive-interlace-standard
libpng/tests/pngvalid-progressive-interlace-transform
libpng/tests/pngvalid-progressive-standard
libpng/tests/pngvalid-standard


2016-11-22 09:14:28 +0000
Ken Sharp <ken.sharp@artifex.com>
1b1e7f3f4abf7a97101ff7f4e2389ca2edd9af0a

PDF Interpreter - ensure /Separation ink names are not indirect objects

Bug #697358 "PDF interpreter throws an error on a colour space"

Another bizarre file that thinks its a good idea to reference items
as indirect objects instead of a simple inclusion. This time its the
ink name in a /Separation space.

Simply make sure it is not an indirect object.

Resource/Init/pdf_draw.ps


2016-10-20 13:53:06 -0700
Michael Vrhel <michael.vrhel@artifex.com>
47294ff5b168d25bfc7db64f51572d64b8ebde91

Bug 697345 Blend Color Space Support for Separation devices

This is a rather large commit that brings support for transparency
blend color spaces to the separation devices. Previously the
transparency compositor always used CMYK for the blend color space
if the output device was a separation device.

With this commit:

If the blend space is RGB or Gray based, then we now ensure that the
alternate tint transform is not used when we encounter a separation or DeviceN color space.
(assuming we have not run out of spot color space at the target device). Note that
if the any of the spot colors in a DeviceN color space are CMYK process colorants and the
blend space is Gray or RGB, the alternate tint transform IS used.

2) The pdf14 compositor now handles a mixture of additive and subtractive components.
I.e. RGB + spots or Gray + spots.

3) If the blend mode is non white preserving or not separable, then the spot colors
use the normal blend mode while the process colorants use the specified blend mode.

4) In the process there was a bit of code clean up. But much remains to be cleaned.

base/gdevdevn.c
base/gdevdevn.h
base/gdevdsha.c
base/gdevp14.c
base/gdevp14.h
base/gscdevn.c
base/gscsepr.c
base/gxblend.c
base/gxblend.h
base/gxblend1.c
base/gxclrast.c
base/gxcmap.h
base/gxdcolor.c
base/gxdevsop.h
base/gxshade6.c
base/lib.mak


2016-11-17 16:45:04 +0000
Robin Watts <robin.watts@artifex.com>
c9d8618934ebf682f72dd9b3ebef48b2be535a8d

Change API for put_image

base/gdevflp.c
base/gdevmpla.c
base/gdevoflt.c
base/gdevp14.c
base/gdevsclass.c
base/gxblend1.c
base/gxdevcli.h
devices/gdevbit.c
devices/gdevpng.c


2016-11-21 15:43:14 +0000
Ken Sharp <ken.sharp@artifex.com>
b33ffc0e958b613cd6ba114d42720694b11219ff

PDF interpreter - ensure Rect array entries are not indirect objects

Bug #697357 "Can't handle annots where /Rect entries are indirect"

The example file has an insanely constructed Rect entry, where not only
is the /Rect value itself an indirect object, but each of the entries
in the array is also an indirect object.

Here we ensure that the entries in a /Rect for an annotation are
fully resolved.

Resource/Init/pdf_draw.ps


2016-11-21 11:30:50 +0000
Ken Sharp <ken.sharp@artifex.com>
737da8a64a873ea128c5830519d3327baecc6444

PDF interpreter - when detecting transparent pages, include Form 'Groups'

Bug #697354 "PDF Interpreter fails to push pdf14 compositor"

We have an optimisation in the PDF interpreter which ignores page
level Group definitions, as these have no effect on the output.

However, the way this is performed meant that we also did not detect
Group entries in Form XObjects. So if the only transparency on a page
was a Form XObject with a Group entry, then we would incorrectly
decide that the page had no transparency.

We do still want to do the performance check at the page level, but its
important that we include Form XObject Groups in the resources check. So
here we specifically check Form XObjects to see if they have a Group.

This produces differences in a few files, surprisingly miniscule
differences. It appears that we have a number of files which include
Forms with Group entries which, as is so often the case with PDF
files produced by naive graphics libraries, don't actually *do* any
real transparency.

Unfortunately this does mean we now process those files slower than
we did before (and ps2write now produces images for them), but I don't
see any real prospect of detecting pointless transparency at this depth
in a PDF file.

So the only differences are small colour changes depending on the
ProcessColorModel of the destination device. None of these appear to
be significant to me.

Resource/Init/pdf_main.ps


2016-11-16 14:13:18 -0200
Till Kamppeter <till.kamppeter@gmail.com>
36269a8e76b7b495eba9cc061ebf52163188876a

"rpdl" output device: Allow 5pt tolerance for page size selection

The "rpdl" printer driver required an exact match of the page size in
points so that the correct command for selecting the page size was
sent to the printer. Otherwise the printer received the command for a
custom size. Tis is fixed now, allowing a 5-point tolerance (Bug
697348).

contrib/japanese/gdevrpdl.c


2016-11-15 15:06:58 +0000
Robin Watts <robin.watts@artifex.com>
99e9ca317adbd28b5faf3e9eda4c63d636478f43

Bug 697045: Skip over broken tile data rather than aborting.

openjpeg/src/lib/openjp2/j2k.c


2016-11-01 18:50:30 +0000
Robin Watts <robin.watts@artifex.com>
2f6ddae95676585717159445001fda2ebb00db8d

Squash compiler warning.

base/gxccman.c


2016-11-14 16:59:45 +0000
Ken Sharp <ken.sharp@artifex.com>
90b7603c1afb3ad79a6a0dfee97560b1c3565379

PCL - fix pdfmark parsing for PUTFILE

Bug #697285 "Not able to produce a valid PDF/A - Invalid ColorSpace error opening a PDF"

We have a special pdfmark type '/PUTFILE' for dealing with files,
because unlike PostScript we can't deal with these as file objects in
PJL. The code reading the file had a bug, I think caused by altering
for error detection.

Fixed here, and returned the error back up the tree. However, note that
the PCL interpreter still ignores error returns from PJL parsing.

No differences expected.

pcl/pl/plparams.c


2016-11-14 15:06:49 +0000
Ken Sharp <ken.sharp@artifex.com>
0f6067d2531298060392d0e25fa759d320e03021

ps2write - don't try to alter /pagesave when modifying media size

Bug #697245 " Generated postscript by ps2write causes limitcheck for save error"

When altering the media size for a page the code defined the save object
'pagesave' with the new media size. I believe the intention was probably
to have the new media size persist, in order to avoid calling setpagdevice
for every subsequent page with the modified media.

Unfortunately, this does not remove the prior 'save' object attached to
/pagesave. The only way to get rid of that is to actually 'restore' it.

So, fundamentally, we need to remove the definition of pagesave from
the code which sets the media size. We can achieve the same effect in a
rather more roundabout fashion by also moving the definition of pagesave
within the page stream to a point after the definition of the page
dictionary.

Less neat, but it works.

For some obscure reason this results in some pages being rendered
very slightly different sizes on the cluster. I've checked and the
current sizes are correct. I have no idea why this was wrong before
and I'm not interested enough to go looking, since they are now
correct.

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


2016-11-14 10:14:01 +0000
Ken Sharp <ken.sharp@artifex.com>
8cefc79359e14fdb8b967697bba33b754e83bcad

pdfwrite - fix calculation of a bounding box

Bug #697237 "ps2pdf not producing correct PDF with a rotated character in the PS"

The code for detecting a glyph which is completely clipped out of the
output had a fault; after calculating the Font BoundingBox in current
user space, it only considered three of the points of the resulting
rectangle to calculate the largest rectangle.

This erroneous rectangle was then used to decide if a glyph was entirely
outside the clipping area. Since the top left corner was not considered
a sufficiently large glyph rotated to an acute enough anti-clockwise
angle could appear to be totally clipped when in fact it is only
partially clipped.

Fix this here by considering all four points.

This show two very minor progressions in Quality Logic tests and some
PXL->PDF conversions are now larger. The reason is that we use the
font bounding box and a couple of glyphs are now considered to be
unclipped when in fact they are totally clipped out, but we can't tell.
This results in not only the glyphs but also a font being embedded
in the output and increasing the size slightly.

devices/vector/gdevpdte.c


2016-11-12 11:24:18 +0000
Ken Sharp <ken.sharp@artifex.com>
a46245139253b2ec607fcd06c549a6293d05a3a8

Fix a bug in device subclassing

If we free the memory used by a child device, we must not then try
to write to that memory.

Chanced upon while working on bug #697279

base/gdevdflt.c


2016-11-10 17:45:38 +0000
Ken Sharp <ken.sharp@artifex.com>
513d6fd7ddfc5a59fbf8bf6ce72eda6c97fea9f8

remove a bunch of now unused variables from the earlier shading code
commit.

base/gxshade1.c


2016-11-10 14:42:49 +0000
Ken Sharp <ken.sharp@artifex.com>
8a26fa67398970f357e1292310ef20556a8e5d96

Fix 'corner' radial gradient case.

Bug #697144 " Some incorrectly rendered radial shadings"

This is to address 'radialshade4.ps, but fixed (the customer had managed
to create incorrect PostScript for this specific test, see radialshade4b.ps).

In the case where the two circles defining a radial gradient are
tangential, and the larger circle has 'extend' set to true, the extended
area should be limited to the tangent which touches the two circles, and
the smaller circle should not be filled.

Getting this corre4ct with our existing method for drawing gradients
has been difficult. It 'looks like' all gradients are defined in terms
of tensor patches, rather than having a dedicated plotter for each
gradient type.

In order to generate a proper 'truncated' annulus for this case, it is
necessary to construct a number of different 'quadrilaterals' and fit
them carefully around the larger circle. To ensure no 'cracks' appear
between the quads, we must also take care to ensure that they join at
horizontal or vertical boundaries (in user space).

There's some trigonometry involved to get this correct, and to avoid
having to check for infinity returns from tan(alpha), and generally
avoid the complex work required in the general case, we handle the
cases where the tangent point of the circles is on a horizontal or
vertical axis.

This passes cluster tests, the customer test suite, and my own hand
created PostScript files which exercise the code rather more thoroughly

No differences expected.

base/gxshade1.c


2016-11-09 22:02:47 -0800
Ray Johnston <ray.johnston@artifex.com>
d4d8b7d51f79b47d21d3c82fe652a79e1f890df5

Fix bug 697323, Segfault after pattern with transparency.

While the pdfwrite device usage may have contributed to the path being
taken, the segfault was in the GC and was due to a pattern-clist device
still existing in the allocator, but no longer referenced (at least as
seen with a debug build. The fix was to set gx_device_retain false for
the adev (pattern accum device, which may be a pattern-clist device) for
the case where the pattern uses transparency so the freeing the saved
gstate would free the pdf14 device and it would rc_decrement its target,
thus freeing the accumulator device.

base/gxpcmap.c


2016-11-07 14:03:30 +0000
Chris Liddell <chris.liddell@artifex.com>
0e2523b9dae517f91bd7da78323e5207d099a10e

Fix expat build on Windows

The new version of expat uses time/date API calls to seed a hash function. That
means we need a extra CFLAG (/DWIN32) and to drop the /Za CFLAG as we do for
LCMS2.

base/expat.mak
psi/msvc.mak


2016-09-14 10:40:36 +0100
Chris Liddell <chris.liddell@artifex.com>
c9f7be4f4de8e98df9d34ff8e4a7f781c0a33899

Bring master up to date with 9.20 release branch

Docs, dates, copyrights etc.

Copyrights, dates etc

Update News and changelog

Fix a type in the release comments

Changelog update for 9.20 RC2

Update date and product string for 9.20 release

Copyrights, dates etc

base/gscdef.c
base/version.mak
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Details8.htm
doc/Details9.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/Helpers.htm
doc/History1.htm
doc/History2.htm
doc/History3.htm
doc/History4.htm
doc/History5.htm
doc/History6.htm
doc/History7.htm
doc/History8.htm
doc/History9.htm
doc/Install.htm
doc/Issues.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Projects.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/Xfonts.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/thirdparty.htm
man/dvipdf.1
man/font2c.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
man/wftopfa.1
psi/msvc.mak


2016-11-04 13:18:21 +0000
Chris Liddell <chris.liddell@artifex.com>
21b582ca561214aa9c5b9c8987a1c0cdce43ace6

Add expat endian settings.

And fix the logic for the LCMS2 endian setting (noticed in passing).

configure.ac


2016-11-04 12:41:02 +0000
Chris Liddell <chris.liddell@artifex.com>
c99d0ad7d5f5187e5e0279b6f9c8092798badc2f

Bug 697181: allow xps build with shared expat.

Makefile.in
configure.ac


2016-11-04 12:13:08 +0000
Chris Liddell <chris.liddell@artifex.com>
00b5d81646bb936577cbea2476e13f0a5dd4b9f1

Update to expat 2.2.0

expat/CMake.README
expat/CMakeLists.txt
expat/COPYING
expat/Changes
expat/ConfigureChecks.cmake
expat/MANIFEST
expat/Makefile.in
expat/README
expat/aclocal.m4
expat/amiga/Makefile
expat/amiga/README.txt
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/launch.c
expat/amiga/stdlib.c
expat/bcb5/elements.bpr
expat/bcb5/expat.bpr
expat/bcb5/expat.mak
expat/bcb5/expat_static.bpr
expat/bcb5/expat_static.mak
expat/bcb5/expatw.bpr
expat/bcb5/expatw.mak
expat/bcb5/expatw_static.bpr
expat/bcb5/expatw_static.mak
expat/bcb5/outline.bpr
expat/bcb5/xmlwf.bpr
expat/bcb5/xmlwf.mak
expat/configure
expat/configure.ac
expat/configure.in
expat/conftools/PrintPath
expat/conftools/ac_c_bigendian_cross.m4
expat/conftools/config.guess
expat/conftools/config.sub
expat/conftools/expat.m4
expat/conftools/get-version.sh
expat/conftools/install-sh
expat/conftools/libtool.m4
expat/conftools/ltmain.sh
expat/conftools/mkinstalldirs
expat/doc/expat.png
expat/doc/reference.html
expat/doc/valid-xhtml10.png
expat/doc/xmlwf.1
expat/doc/xmlwf.sgml
expat/doc/xmlwf.xml
expat/examples/elements.c
expat/examples/elements.dsp
expat/examples/outline.c
expat/examples/outline.dsp
expat/expat.dsw
expat/expat.pc.in
expat/expat_config.h.cmake
expat/expat_config.h.in
expat/lib/amigaconfig.h
expat/lib/expat.dsp
expat/lib/expat.h
expat/lib/expat_external.h
expat/lib/expat_static.dsp
expat/lib/expatw.dsp
expat/lib/expatw_static.dsp
expat/lib/internal.h
expat/lib/libexpat.def
expat/lib/libexpatw.def
expat/lib/xmlparse.c
expat/lib/xmlrole.c
expat/lib/xmltok.c
expat/lib/xmltok.h
expat/lib/xmltok_impl.c
expat/m4/libtool.m4
expat/m4/ltoptions.m4
expat/m4/ltsugar.m4
expat/m4/ltversion.m4
expat/m4/lt~obsolete.m4
expat/tests/README.txt
expat/tests/benchmark/README.txt
expat/tests/benchmark/benchmark.dsp
expat/tests/chardata.c
expat/tests/minicheck.c
expat/tests/minicheck.h
expat/tests/runtests.c
expat/tests/xmltest.sh
expat/win32/README.txt
expat/win32/expat.iss
expat/xmlwf/codepage.c
expat/xmlwf/readfilemap.c
expat/xmlwf/unixfilemap.c
expat/xmlwf/xmlfile.c
expat/xmlwf/xmlwf.c
expat/xmlwf/xmlwf.dsp


2016-11-03 13:09:27 +0000
Chris Liddell <chris.liddell@artifex.com>
a73e3cf1ca91bbdb51d5a999a491e58fb9a7ce35

Bug 697286: handle GlyphDirectory as an array

For high level devices that need to copy CIDFonts, we need to establish the
highest CID in a given CIDFont. If the font has a GlyphDirectory dictionary
the only way to do so is to iterate through the keys to find the highest.

The code handling this ignored that the GlyphDirectory could be an array,
which confused the dictionary content iterator, and caused a segfault.

In the case of an array, set the high CID to the highest index available in the
array.

psi/zfcid.c


2016-11-02 16:19:02 +0000
Robin Watts <robin.watts@artifex.com>
dc62c90930512f4b571f68c9110022b234cbd411

Bug 697186: Tweak to previous JPEG fix.

Only clamp the DC coefficient. This shouldn't make a difference
in any real world cases, but is more correct.

jpeg/jidctint.c


2016-11-01 18:40:04 +0000
Robin Watts <robin.watts@artifex.com>
8dcec8cc076a0cf8350ca7a6ec1d3136812e2a24

Bug 697186: Workaround JPEG lib bug.

Commit fix for overflow. Awaiting response from IJG.

jpeg/jidctint.c


2016-10-26 16:35:38 +0100
Robin Watts <robin.watts@artifex.com>
1eebbfa373d295bdd2bad88aaef1edc368450568

Bug 697231: Introduce caching to use of clipping paths.

When we create a clipping device from a path, we copy over the
pointers to the rectangle list, and start searching them from
the start.

This means that if we perform an operation that causes lots of
calls to something with the same clipping path (like for instance
a stroke operation with a clipping path that calls down to a fill
path with a clipping path), then we will repeatedly search from
the top of the rectangle list.

This massively slows stuff down.

This commit introduces a 'cached' entry in the clipping path
that can be updated after a clipping device has been used to show
the last place in the list that was found. Subsequent creations
start searching from this point.

This gives us the desired locality of reference, and massively
speeds up the test file.

base/gxacpath.c
base/gxclip.c
base/gxcpath.c
base/gxcpath.h
base/gxfill.c
base/gzcpath.h


2016-10-26 12:14:48 +0100
Robin Watts <robin.watts@artifex.com>
71629c04758788b238d6ff3537d9708f430a4db7

Tweak to clip device nesting.

Any call through clip_call_fill_path will be safely nested
in terms of the clippers used. Reflect this in the
initialisation of the local device. This avoids an error given
with the next commit.

base/gxclip.c


2016-10-26 17:39:29 -0200
Till Kamppeter <till.kamppeter@gmail.com>
0726780b28920045ee6f344a34bc5e8565bc4ed5

"cups" output device: When creating PWG Raster output, always output the bitmap of the full page, ignoring any unprintable margins suggested by the PPD file.

cups/gdevcups.c


2016-10-26 08:37:46 +0100
Ken Sharp <ken.sharp@artifex.com>
f0b49c3cf4e0602627c4dc5b6ff910074d298398

set GX_DOWNSCALER_PARAMS_DEFAULTS to remaining JPEG devices

Michael's fix in commit 45268652fcddf2031f5edb592bc61e53d9ac4f5b
resolves the problem for jpeg, but didn't fix the jpeggray or jpegcmyk
devices, as shown by the all devices test.

I believe copying the same fix to the other devices should resolve those
too.

No differences expected.

devices/gdevjpeg.c


2016-10-25 15:34:10 -0700
Michael Vrhel <michael.vrhel@artifex.com>
45268652fcddf2031f5edb592bc61e53d9ac4f5b

Set GX_DOWNSCALER_PARAMS_DEFAULTS in jpeg

Fix for crash caused by division by zero

devices/gdevjpeg.c


2016-10-25 18:25:36 +0100
Robin Watts <robin.watts@artifex.com>
cb8022f3e15b761adf4bbc78621cf0699f69e21c

Fix SEGV caused by previous commit.

Running:

gs --debug

would cause a SEGV in gs_finit_push_systemdict due to
i_ctx_p being NULL.

psi/imain.c


2016-10-25 11:16:13 +0100
Chris Liddell <chris.liddell@artifex.com>
2f3679b53632c5b7b9e9a416311ae82f36645fc9

Bug 697220(2): Fix returning execstackoverflow

In one case of returning execstackoverflow from the main interpreter loop,
we'd set the interpreter's private count value of objects to execute, *before*
we try to push the ref array onto the stack. As a consequence the object
count was for the new array, but the top of the exec stack was still the
previous array. This meant when we sync'ed the interpreter loop's internal
state with the state in the interpreter context, the size of the top object
on the exec stack could be wrong, causing problems in the garbager - especially
if the length was too long.

To resolve, move the exec stack bounds check before the count gets set.

psi/interp.c


2016-10-25 11:10:54 +0100
Chris Liddell <chris.liddell@artifex.com>
3f09e7022e39412af98602cdfe22adfb34a7fa63

Bug 697220(1): Push systemdict onto dict stack before we cleanup.

As part of shutting down the Postscript interpreter, we run some Postscript
from the C code. We really don't want to stumble across random redefinitions
of operators (especially if the definitions trigger errors) at this point.

So, push systemdict onto the top of the dict stack before we start our cleanup.

Do it in C, to further ensure we don't trip over redefinitions in the Postscipt
world.

This *should* resolve the segfaults, but leaves a garbage collector error

psi/imain.c


2016-10-25 11:10:07 +0100
Chris Liddell <chris.liddell@artifex.com>
5d1ae930711d492d01110ef054c0add3c7615910

Fix BOBBIN undefined warnings.

base/bobbin.h


2016-10-23 00:58:23 +0100
Robin Watts <robin.watts@artifex.com>
3216c2b692fe5a4c87936819b2fe14d0963a347a

Bug 697144: Fix fix for previous radial shading fix.

This fixes the final case in page_create_color.ps

In some cases R_tensor_annulus can be called twice; avoid
flipping function_arg_shift back and forth.

base/gxshade1.c


2016-10-22 15:47:35 +0100
Robin Watts <robin.watts@artifex.com>
5915f971fa47c8ad1561e403bc7aacd86325c428

Bug 697144: Fix radial shadings broken by previous fix.

The previous fix addressed the fact that monotonicity of a
filled quad was being tested based on splitting on u rather
than v (or vice versa). It turns out that in some
circumstances (when circles are entirely nested), we reverse
u and v, and hence need to reverse the test.

The previous fix did not allow for this.

base/gxshade1.c


2016-10-21 17:00:15 +0100
Robin Watts <robin.watts@artifex.com>
898cdaedf52a37c84923d75aa2942e48b0fec91c

Bug 697144: Fix radialshade2.ps

Many many moons ago, a fix was committed for bug 690831. The
commit message for that was lost in the great svn -> git
migration, but the bug itself makes the history clear.

Looking back at this again now, it appears that the fix was
incorrect. Ghostscript was in fact doing the right thing by
the letter of the standard, but Acrobat was applying a fudge
factor.

When filling a radial shade, the code tests to see if the
two circles are nested. If so, then when the shade is 'extended',
the entire area outside the final circle is filled. If not,
a different fill operation has to happen.

The file given in the bug has a shade where the two circles are
very close to being nested, but are not strictly so. Acrobat is
choosing to treat them as if they were.

We therefore revert the code to 'unbreak' it, and adjust the
fudge factor in our code to give the same results as Acrobat does.

This causes no changes in the cluster tests.

base/gxshade1.c


2016-01-25 10:59:23 +0000
Chris Liddell <chris.liddell@artifex.com>
c3c4bf022a631be939ebb4bf6f59e41514cb1e48

Bug 696508: improve configure cross compile support

This is a squashing of the commits on the branch:

CCAUX-configure

This allows CCAUX and related settings to be set on the configure command
line, or in the environment.

Also, using configure to guess at creating an arch.h file which gets used
rather than genarch generating one. A couple of things in that file will
not be as accurate as using genarch, but those are rare, and almost
certainly for outdated systems (such as whether floats use IEEE
representation).

Better documentation to follow, but as an example, building for Android would
work with:

./configure --host=arm-linux-gnu --build=x86_64-linux-gnu \
CC=/opt/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc \
CFLAGS="--sysroot=/home/cliddell/bin/android-ndk-r10e/platforms/android-18/arch-arm -MMD -MP -MF -fpic \
-ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp \
-mfpu=vfpv3-d16 -mthumb -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Wa,--noexecstack" LDFLAGS=" \
--sysroot=/home/cliddell/bin/android-ndk-r10e/platforms/android-18/arch-arm -MMD -MP -MF -fpic -ffunction-sections \
-funwind-tables -fstack-protector -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb \
-fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Wa,--noexecstack" CCAUX=gcc CFLAGSAUX=" "

.gitignore
Makefile.in
arch/arch_autoconf.h.in
base/gsroprun.c
base/unix-aux.mak
base/unix-end.mak
configure.ac
xps/xps.mak


2016-10-20 16:45:09 +0100
Robin Watts <robin.watts@artifex.com>
0845a1c90f7a22a5b50fddbf7809d985b98290cd

Bug 697144: Fix radialshade1.ps

When filling a radial shading, we form 4 tensor patches, one for
each quadrant. The points for these are represented as poles of
the tensor patches as p->poles[v][u].

One quadrant might look like (excuse the ascii art)

J I H G p->poles[0][0] = A p->poles[3][0] = J
F p->poles[0][1] = B p->poles[2][0] = K
K ED p->poles[0][2] = C p->poles[1][0] = L
p->poles[0][3] = D
C p->poles[1][3] = E (plus 4 more points
p->poles[2][3] = F internal to the
B p->poles[3][3] = G patch, not shown
p->poles[3][2] = H here)
L A p->poles[3][1] = I

Thus 'u' controls how far along the radius of the radial shading
we are, and 'v' controls how far 'around' the shading we are.

The shading code first subdivides the patch on v (using the
split_patch routine). This gives us a succession of slices running
from the centre of the radial fill to the outside (like slices of
pizza).

It then subdivides these slices (using split_slice) to give small
quadrangles to fill.

The code then checks to see whether these quadrangles need to be
further divided by checking to see whether the color change across
such quadrangles is monotonic or not. If it is, and the quadrangles
are 'not big' (for some definition of big) then it is considered
reasonable to fill them using a linear fill.

For simple radial fills, the color changes across 'u' not 'v'.
We thefore check for the color change in the given range to see
if it is monotonic, and if it not, we divide the patch.

As part of the work for bug 689189 (see commit 36375961a02091)
Igor had identified some uses of the radial fill code where the
tensor patches are constructed such that the color varies across
'v' rather than 'u', and had therefore amended the code so allow
for this.

Unfortunately the setup for this appears to have got it wrong
for the normal radial case. Fixing that here solves the problem.

base/gxshade1.c
base/gxshade6.c


2016-10-20 11:45:54 -0700
Michael Vrhel <michael.vrhel@artifex.com>
cca05810721874cabcc377615cac050bd775ed37

Add -dNoSeparationFiles to tiffsep device

If -dNoSeparationFiles is specified when using the tiffsep
device, only the composite file will be created, no
separations are created in this case.

devices/gdevtsep.c
doc/Devices.htm


2016-10-17 16:34:14 +0100
Chris Liddell <chris.liddell@artifex.com>
6d1822faa68c17b945aea2713985b7095ca424aa

ASAN segfault: add missing pointer to pclxl_image_enum_t gc info

The pclxl_image_enum_t stores a pointer to an icclink which is allocated in gc
memory, so the garbager needs to know about that.

devices/vector/gdevpx.c


2016-10-17 15:14:54 +0100
Chris Liddell <chris.liddell@artifex.com>
e6460567fcec3b4c96dd4912e556e3b846adaef2

Refine SAFER file access permissions

SAFER (amongst other things) is to stop arbitrary file accesses on the host
system (in Postscript terms '%os%....') but it should not limit access to
other Postscript devices (most importantly '%rom%').

psi/zfile.c


2016-10-17 16:21:30 -0700
Michael Vrhel <michael.vrhel@artifex.com>
ed425fcd620837bf63a18a3ee2a2202fa91b1207

Add -sPostRenderICCProfile support to tiffsep

Customer would like to have this capability.

devices/devs.mak
devices/gdevtsep.c


2016-10-17 20:10:46 +0100
Robin Watts <robin.watts@artifex.com>
937efa62c23c2c79c7487895421041896e8c14b7

Fix previous JPEG commit.

The previous commit did not even compile. I have no idea how
I managed to get that to pass the tests I ran!

Apologies.

devices/gdevjpeg.c


2016-10-17 18:11:08 +0100
Robin Watts <robin.watts@artifex.com>
6f14fb471faedbe9657d32743dba609ddd3a0465

Add Downscaler functionality to jpeg devices.

devices/gdevjpeg.c
doc/Devices.htm


2016-10-12 14:15:50 +0100
Robin Watts <robin.watts@artifex.com>
910f459d535cec757b8e5f541dd39be6fa2fb0c9

Bug 697012: Fix buffer overflow in gxps.

Port back same fix already applied to muxps.

xps/xpsglyphs.c


2016-10-17 10:03:53 +0100
Robin Watts <robin.watts@artifex.com>
9388ecefe9d8659d8434aa78d07a1fa247c8ea4e

Rework openjpeg subsampled decode.

The current code performs the yuv -> rgb step on the data
within openjpegs buffers. Unfortunately, this means that
subsampled data is "expanded" into rgb, converted, and then
redecimated. The R plane stays intact, and the G and the B
are degraded. The code is then desubsampled again when copying
out into the stream, but the damage has been done.

This gives awful results.

Instead here, we simplify the code to decode a row at a time
into a row buffer. We then convert that row buffer to rgb, and
copy that out. We never redecimate the output.

This looks much better.

base/sjpx_openjpeg.c
base/sjpx_openjpeg.h


2016-10-16 11:36:34 +0100
Chris Liddell <chris.liddell@artifex.com>
08b3f4a91fc65f36da13dfb02a1273c70638c6af

Bug 697217(4): deal with negative index in context ops

In this case the join operator was being passed a negative index.

psi/zcontext.c


2016-10-16 11:30:36 +0100
Chris Liddell <chris.liddell@artifex.com>
a7a8b148c368d313f913c23a754e14394d6fb5a1

Bug 697217(3): guard against stack underflow in debug info dump

In the event of an error exit, we dump out the contents of the stacks.

*But* in the event of an error, we can already be into the "guard" entries
below the bottom of the normal operand stack - so protect against that
when dumping out the stack.

psi/idebug.c


2016-10-16 13:11:46 +0100
Chris Liddell <chris.liddell@artifex.com>
86ea41068f8ee8930aa169ad3a106db4f7d6c7db

Bug 697217(2): cleanup exec stack on currentcolor* error

If an error occurs when retrieving currentcolor values, we have to clean up
the exec stack before returning the error.

psi/zcolor.c


2016-10-16 11:18:43 +0100
Chris Liddell <chris.liddell@artifex.com>
060cfdc002d29158d9d7f6c5fb15f187c165d408

Bug 697217(1): Match signs when checking lengths in binary sequences

psi/iscanbin.c


2016-10-14 15:50:30 +0100
Chris Liddell <chris.liddell@artifex.com>
1f6581f9b77868b56a2f6269f3d1440c9eaad8b0

Bug 692721: remove SMask specific stuff from form dict

When we get an SMask group, we have to store the graphics state and the contents
of the ExtGState, and reset all that before we execute the content stream
for the group XObject. So it all gets setup in the correct place, that
information needs to be added to the group's form dictionary.

It turns out we also need to *remove* these entries from the group's form
dictionary, in case it gets reused as a normal for XObject.

The gstate and extended gstate values remain in the SMask parameter dictionary,
so any reuse of the SMask will still work correctly.

Resource/Init/pdf_draw.ps


2016-10-14 08:38:29 +0100
Ken Sharp <ken.sharp@artifex.com>
3bf51ac09d8759761057bbf1817434415616258e

pdfwrite - fix SMask handling, when painting with a Pattern

Bug #697212 "Error in SMask during ExtGState"

The title is misleading, the error occurs with a Pattern, but there must
be an SMask preceding it. This appears to have been a very long-standing
problem in the code, but it was hidden by ignoring an error return code.
Fixing Coverity reports meant that the return code was actioned, and that
is what revealed the problem.

When we start a new substream to capture a Pattern PaintProc we need to
reset the 'soft_mask_id' (the ID assigned to the SMask pdfwrite has
created) in the graphics state. If we don't do that then the code (in
effect) tries to handle the SMask twice, once for the correct stream
and once for the pattern PaintProc stream, and this results in the
stack of pdfwrite internal gstate copies becoming unsynchronised, as well
as creating a PDF file with unbalanced q/Q operators.

Ignoring the return code had masked this problem.

No differences expected.

devices/vector/gdevpdfi.c


2016-10-13 16:47:47 -0700
Michael Vrhel <michael.vrhel@artifex.com>
84fec37351ebd502c70ac16347fae4b1b5f5cbe6

Fix for Bug 695154

The pngalpha device should really have its separable_and_linear setting
set to GX_CINFO_UNKNOWN_SEP_LIN. In this case, the device will get its shifting
and mask color info settings set up and in this case the gradient
code will actually work in the manner to which it is designed.

devices/gdevpng.c


2016-10-12 11:02:09 -0700
Michael Vrhel <michael.vrhel@artifex.com>
06add83a38437ccd2e7f0f1deb5e2d7bc7a8546d

Bug 695340. Avoid NULL dereferences

base/gsptype1.c


2016-10-09 08:22:03 -0700
Michael Vrhel <michael.vrhel@artifex.com>
6d5b4ffeb00f50faf45b72191d38dea422f28405

Bug 694189 catch NULL of pinst

If an error occurs and we dig through the saved
gstates to find the pattern but come up empty
then return an error

psi/zpcolor.c


2016-10-11 11:16:59 -0700
Ray Johnston <ray.johnston@artifex.com>
62e787ce74c5c22aaba9377a709bc06217bd46f8

Fix Bug 696866: patterns need to set color_usage.or over the entire area

Thanks to Michael Vrhel for the simplified file and suggesting the cause of
the problem.

base/gxclpath.c


2016-10-11 16:07:40 +0100
Chris Liddell <chris.liddell@artifex.com>
a48d5240229d2a5cf9413ff2a425c40e2db03b8e

xpswrite: Add color space to enumerated pointers

In the xps_image_enum_s the pointer to the color space (pcs) was not
declared to the garbage collector, so could end up moving with the
object being updated.

Caused a segfault spotted in the weekly regression test (for EPSCrop, but
that's not relevant)

devices/vector/gdevxps.c


2016-10-10 14:03:51 -0700
Ray Johnston <ray.johnston@artifex.com>
a34f71c530409a559c4cb35cb1a23296541d53c3

Fix Bug 696864: Use Default colorspaces when processing SMask

This is done by saving the OverrideICC user parameter before setting the
colorspace, etc. so as to ignore the ICC profile, which may have a gamma
that we don't expect, and restore it after the SMask has been rendered.
Note this file rendered correctly with -dOverrideICC on the command line,
but this patch automatically applies that during execmaskgroup.

Thanks to Michael Vrhel for identifying the problem and coming up with a
simplified test case.

Resource/Init/pdf_draw.ps


2016-10-08 17:27:34 +0100
Chris Liddell <chris.liddell@artifex.com>
a87e380acd5e326f7d4e4380348bac393fac3058

Remove the appledmp, iwlo, iwhi, iwlq devices

base/unix-gcc.mak
configure.ac
devices/contrib.mak
devices/gdevadmp.c
doc/Develop.htm
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2016-10-07 15:52:42 +0100
Chris Liddell <chris.liddell@artifex.com>
ad13de0b7a11675f34a29a03d1597a780da54851

Update docs to reflect removal mswindll device

doc/DLL.htm


2016-10-07 15:38:14 +0100
Chris Liddell <chris.liddell@artifex.com>
e0f5118c432d4f17d8038871691517d84ce01918

Remove the os2prn device

base/pcwin.mak
devices/devs.mak
devices/gdevos2p.c
doc/Develop.htm
psi/os2.mak
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2016-10-07 15:31:06 +0100
Chris Liddell <chris.liddell@artifex.com>
5be37082980552a9d8a21b70a7ee93fbf4320e8f

Remove the mswindll and mswin devices

As well as the (long non-functional/non-useful) Windows "xfont" code.

base/pcwin.mak
devices/devs.mak
devices/gdevmswn.c
devices/gdevmswn.h
devices/gdevmsxf.c
devices/gdevwddb.c
devices/gdevwdib.c
devices/gdevwprn.c
doc/DLL.htm
doc/Develop.htm
psi/gsdll32.def
psi/gsdll32metro.def
psi/gsdll32w.lnk
psi/gsdll64.def
psi/gsdll64metro.def
psi/gsdllARM32metro.def
psi/msvc.mak
toolbin/pre.chk
toolbin/tests/check_comments.py
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2016-10-07 15:07:17 +0100
Chris Liddell <chris.liddell@artifex.com>
ff59e2a9f86a4476aa67b5e768811fe43b0b4f0c

Remove the macos device

devices/gdevmac.c
devices/gdevmac.h
devices/gdevmacpictop.h
devices/gdevmacttf.h
doc/Develop.htm
toolbin/tests/check_comments.py
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2016-10-07 15:01:26 +0100
Chris Liddell <chris.liddell@artifex.com>
6c0d6e66d219006acfa3201963a0a7123dce3cc9

Remove sgirgb device

base/unix-gcc.mak
configure.ac
devices/contrib.mak
devices/gdevsgi.c
devices/gdevsgi.h
doc/Develop.htm
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2016-10-06 15:05:23 +0100
Chris Liddell <chris.liddell@artifex.com>
fa981020ef9f96cb2d4d92bd48da81b025bc267a

Remove the various "vga" devices

devices/devs.mak
devices/gdevevga.c
devices/gdevpcfb.c
devices/gdevpcfb.h
devices/gdevs3ga.c
devices/gdevsco.c
devices/gdevsvga.h
doc/Develop.htm
toolbin/pre.chk
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2016-10-06 14:52:09 +0100
Chris Liddell <chris.liddell@artifex.com>
3488db574bf6d7291f51180395da9aa7fd6816cc

Remove svga device(s)

devices/devs.mak
devices/gdevsvga.c
doc/Develop.htm
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2016-10-06 14:40:14 +0100
Chris Liddell <chris.liddell@artifex.com>
323a1cb0e1fbd96bed87f818874f51543b286949

Remove the sunview device

devices/contrib.mak
devices/gdevsun.c
doc/Develop.htm
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2016-10-06 14:37:29 +0100
Chris Liddell <chris.liddell@artifex.com>
74aa1c0b1f71f59f866c800bd698712cdb5c9405

Remove the sunhmono device

base/unix-gcc.mak
configure.ac
devices/contrib.mak
devices/gdevsunr.c
doc/Develop.htm
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2016-10-06 14:32:43 +0100
Chris Liddell <chris.liddell@artifex.com>
4010f1e52592197537e1af639fe3228b8b5fc727

Remove sparc (printer) device

devices/contrib.mak
doc/Develop.htm
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2016-10-06 14:28:52 +0100
Chris Liddell <chris.liddell@artifex.com>
5c6b4d035b6c8c3466e77bc4a581732659d3687e

Remove the att3b1 device

configure.ac
devices/contrib.mak
devices/gdev3b1.c
doc/Develop.htm
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2016-10-06 14:25:38 +0100
Chris Liddell <chris.liddell@artifex.com>
6e98f2159d615b4bedd6e5d83c95a511d4f9ea6f

Remove the herc device

devices/contrib.mak
devices/gdevherc.c
doc/Develop.htm
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2016-10-06 14:16:48 +0100
Chris Liddell <chris.liddell@artifex.com>
8901d9044df836f9ee8988f1ce9f6bbebbc6c314

Remove lvga256 device

devices/devs.mak
devices/gdevl256.c
doc/Develop.htm
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2016-10-06 14:09:30 +0100
Chris Liddell <chris.liddell@artifex.com>
a6b63be35e0278b4018863cf9b197e90686cc374

Remove the s3ga device

devices/devs.mak
doc/Develop.htm
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2016-10-06 14:04:23 +0100
Chris Liddell <chris.liddell@artifex.com>
461b6c19ab09b19ac436b6ccba234f36ad70c197

Remove vgalib device

devices/devs.mak
devices/gdevvglb.c
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2016-10-06 13:47:19 +0100
Chris Liddell <chris.liddell@artifex.com>
f659ff57a2e3fa011255569dcdf54cc825aaa9af

Remove omni device

Makefile.in
configure.ac
contrib/contrib.mak
contrib/defs.h
contrib/gomni.c
windows/ghostscript.vcproj
windows/ghostscript_rt.vcxproj


2016-10-06 13:43:59 +0100
Chris Liddell <chris.liddell@artifex.com>
ec346cc09daada7c16e7213be154e86f644c6d04

Remove mag16 and mag256 devices

configure.ac
contrib/contrib.mak
contrib/japanese/gdevmag.c
psi/msvc.mak


2016-10-06 13:05:56 +0100
Chris Liddell <chris.liddell@artifex.com>
c0448269dd1928b2aff0307ed1206118f329af14

Remove the moribund Mac Classic specific files.

base/gp_mac.c
base/gp_mac.h
base/gp_macio.c
base/gp_macpoll.c
base/macos-mcp.mak


2016-10-10 09:45:44 +0100
Chris Liddell <chris.liddell@artifex.com>
ed539f1b8d29b2f03cd22ac2d54ee9036000d565

Remove doc sections about making SAFER the default

man/gs.1


2016-10-10 09:40:31 +0100
Ken Sharp <ken.sharp@artifex.com>
7119a01ae110a4c81b002f86464e684259626b30

Remove from the documentation the stated intention to make -dSAFER the
default.

doc/Use.htm


2016-10-10 08:45:46 +0100
Ken Sharp <ken.sharp@artifex.com>
9572484beac8fda920cbca3f6c6d09a5dc424825

Fix pdfmark argument validation

This doesn't fit neatly into any category, its a PostScript 'operator'
but it is only implemented for the pdfwrite device...

The pdfmark operator takes a mark, a series of arguments and a name
object. Zero argument sis valid, but the absence of a name object is
not. We weren't checking for the absence of a name object, or
validating its type.

No differences expected.

Resource/Init/gs_pdfwr.ps


2016-10-10 08:09:15 +0100
Ken Sharp <ken.sharp@artifex.com>
ec6ba697311d2424189583f8fc26d373a584a4ce

Coverity ID 137703 - remove some dead code

devices/vector/gdevpdfe.c


2016-10-08 16:35:39 +0100
Chris Liddell <chris.liddell@artifex.com>
b60d50b7567369ad856cebe1efb6cd7dd2284219

Bug 697193: status operator honour SAFER option

psi/zfile.c


2016-10-08 16:18:25 +0100
Chris Liddell <chris.liddell@artifex.com>
4ea759bbd40746410fb2beb82e3ba9ebb6788107

Bug 697204: fully init lock object

The scheduler field (which is relocatable) was not being initialisedm causing a
segfault in teh garbage collector

psi/zcontext.c


2016-10-08 16:10:27 +0100
Chris Liddell <chris.liddell@artifex.com>
f5c7555c30393e64ec1f5ab0dfae5b55b3b3fc78

Bug 697203: check for sufficient params in .sethalftone5

and param types

psi/zht2.c


2016-10-08 16:01:12 +0100
Chris Liddell <chris.liddell@artifex.com>
a5360401495654e89301b2516703c1d2877fc5ba

Check for NULL return from memory allocation

base/gxipixel.c


2016-10-05 09:36:33 -0700
Michael Vrhel <michael.vrhel@artifex.com>
f3de2191afc0d8fcf0285736d2d25fa6071a7981

Bug 696860 remove memcmp of structs in gscrdp.c

base/gscie.c
base/gscie.h
base/gscrdp.c


2016-10-05 09:59:25 +0100
Chris Liddell <chris.liddell@artifex.com>
6f749c0c44e7b9e09737b9f29edf29925a34f0cf

Bug 697179: Reference count device icc profile

when copying a device

base/gsdevice.c


2016-10-05 09:55:55 +0100
Chris Liddell <chris.liddell@artifex.com>
6d444c273da5499a4cd72f21cb6d4c9a5256807d

Bug 697178: Add a file permissions callback

For the rare occasions when the graphics library directly opens a file
(currently for reading), this allows us to apply any restrictions on
file access normally applied in the interpteter.

base/gsicc_manage.c
base/gslibctx.c
base/gslibctx.h
psi/imain.c
psi/int.mak
psi/zfile.c
psi/zfile.h


2016-10-03 01:46:28 +0100
Chris Liddell <chris.liddell@artifex.com>
8abd22010eb4db0fb1b10e430d5f5d83e015ef70

Bug 697169: Be rigorous with SAFER permissions

Once we've opened our input file from the command line, enforce the SAFER
rules.

psi/zfile.c


2016-07-19 08:43:35 +0100
Chris Liddell <chris.liddell@artifex.com>
d609a3d4c1b8583d1c22db6b4d3bce4b239cf88c

Use ToUnicode for substituted CIDFonts

When we substitute a CIDFont in a PDF file with a TTF from disk, use the
ToUnicode CMap (if available) to extract Unicode values. In a lot of case, this
gets a more accurate character code to glyph mapping than the previous reliance
on the low level glyph ordering from the TTF.

This also meant being more robust for broken ToUnicode CMap. Also, an additional
option (-dIgnoreToUnicode) to skip parsing of the ToUnicode CMap - for cases
where a correctly formed ToUnicode is semantically wrong.

Resource/Init/pdf_font.ps
base/gstext.c
base/gxfapi.c
base/gxfapi.h
pcl/pl/plfapi.c
psi/zfapi.c


2016-10-05 08:32:39 -0700
Michael Vrhel <michael.vrhel@artifex.com>
3089131dc90ec008ff540d41df0f1a9fbc2dd47b

Bug 696859 memcmp of struct removal in gscrd.c

base/gscrd.c


2016-10-05 13:15:23 +0100
Ken Sharp <ken.sharp@artifex.com>
799531ffc1240933786cd2121add9d7e3cba778e

Coverity ID 137283 - pdfwrite - remove some redundant code

I had left some code that catered for a UTF16 surrogate pair promoted to
UTF32, converting the result to UTF8. But I didn't implement the UTF32
promotion, leaving it as a potential future enhancement.

However, Coverity whinges about the test always being true, so here
just remove the code. Its trivial enough to add in if we ever need it.

devices/vector/gdevpdfe.c


2016-10-05 10:10:58 +0100
Ken Sharp <ken.sharp@artifex.com>
875a0095f37626a721c7ff57d606a0f95af03913

DSC parser - validate parameters

Bug #697190 ".initialize_dsc_parser doesn't validate the parameter is a dict type before using it."

Regardless of any security implications, its simply wrong for a PostScript
operator not to validate its parameter(s).

No differences expected.

psi/zdscpars.c


2016-10-05 09:41:18 +0100
Ken Sharp <ken.sharp@artifex.com>
aef8f6cfbff9080e4b9c54053bc909875c09a2be

Prevent dereference of NULL device method

Bug #697189 ".gethardwareparams crashes with any special device"

Another NULL device method problem. As noted previously, the original
design intended that device methods should never be NULL, but this
has been ignored over the years leading to the current mess of some
methods being NULL accidentally, some being NULL deliberately and
having different effects when NULL, and some methods never being NULL.

While I do still intend to try and rectify this one day, in the meantime
add a check to make sure the method is not NULL before trying to
execute it in this case.

No differences expected

base/gsdparam.c


2016-10-04 16:24:13 -0700
Michael Vrhel <michael.vrhel@artifex.com>
36a2c94c4ebea8aa1c9cb2ca98e124a5b363000e

Fix misplace parenthesis and missing const

base/gdevdevn.c
base/gscie.c


2016-10-04 15:54:56 -0700
Michael Vrhel <michael.vrhel@artifex.com>
e4ab4499f9f33c51cdb95020c99cf0f4f1e6ee77

Bug 696858 remove memcmp struct in gscie.c

base/gscie.c


2016-10-04 14:39:54 -0700
Michael Vrhel <michael.vrhel@artifex.com>
2e9a339b766fb7a4d791c5ba1d85bdd24e6dbbaa

Bug 696854 remove memcmp of structs in gdevdevn.c

base/gdevdevn.c


2016-10-04 12:04:03 -0700
Michael Vrhel <michael.vrhel@artifex.com>
4fd414107c5b36419896a9c46956cb254adf201f

Bug 696862 remove memcmp() color info structure

base/gsdevice.c
base/gxclpage.c
base/gxdevcli.h
base/gximage2.c


2016-10-03 16:21:49 +0100
Ken Sharp <ken.sharp@artifex.com>
a8642064fe21752b00e28d05483baca029fe0891

pdfwrite - fix ToUnicode CMap sequence consolidation

Bug #697176 "ToUnicode CMap generation broken in 9.20"

The reworking to handle the current version of ToUnicode CMap missed
a case where the size of a code pair had changed. This led to a loop
comparing incorrect values, instead of comparing two consecutive
values, it compared a value with one much earlier.

In general this led to a loss of efficient, causing us to emit two or
more entries when it was possible to emit a single range. However in th