Table of contents
- Version 9.54.0 (2021-03-19)
- Version 9.53.3 (2020-10-01)
- Version 9.52 (2020-03-19)
- Version 9.50 (2019-10-15)
- Version 9.27 (2019-04-03)
- Version 9.26 (2018-11-20)
- Version 9.25 (2018-09-13)
- Version 9.24 (2018-09-03)
- Version 9.23 (2018-03-21)
- Version 9.22 (2017-10-04)
- Version 9.21 (2017-03-16)
- Version 9.20 (2016-09-26)
- Version 9.19 (2016-03-23)
- Version 9.18 (2015-09-23)
- Version 9.16 (2015-03-30)
- Version 9.15 (2014-09-22)
- Version 9.14 (2014-03-26)
- Version 9.10 (2013-08-27)
- Version 9.09 (2013-08-21)
- Version 9.07 (2013-02-14)
- Version 9.06 (2012-07-31)
- Version 9.05 (2012-02-08)
- Version 9.04 (2011-08-05)
- Version 9.02 (2011-03-30)
- Version 9.01 (2011-02-07)
- Version 9.00 (2010-09-14)
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
For other information, see the Ghostscript
See Enabling OCR for more details.
See Enabling OCR for more details.
overview
Version 9.54.0 (2021-03-19)
The 9.54.0 release is a maintenance release, and also adds new functionality.
Highlights in this release include:
-
Overprint simulation is now available to all output devices, allowing quality previewing/proofing of PostScript and PDF jobs that rely on overprint. See the
-dOverprint
option documentation in: Overprint -
The "docxwrite" device adds the ability to output to Microsoft Word "docx" (it currently only handles text). See: docxwrite
-
The pdfwrite device is now capable of using the Tesseract OCR engine when it is built into Ghostscript to improve searchability and copy and paste functionality when the input lacks the metadata for that purpose. See: UseOCR
-
Ghostscript/GhostPDL now includes a "map text to black" function, where text drawn by an input job (except when drawn using a Type 3 font) can be forced to draw in solid black. See: BlackText
-
Ghostscript/GhostPDL now supports simple N-up imposition "internally". See: NupControl
-
Our efforts in code hygiene and maintainability continue.
-
The usual round of bug fixes, compatibility changes, and incremental improvements.
-
(9.53.0) We have added the capability to build with the Tesseract OCR engine. In such a build, new devices are available (pdfocr8/pdfocr24/pdfocr32) which render the output file to an image, OCR that image, and output the image "wrapped" up as a PDF file, with the OCR generated text information included as "invisible" text (in PDF terms, text rendering mode 3).
Mainly due to time constraints, we only support including Tesseract from source included in our release packages, and not linking to Tesseract/Leptonica shared libraries. Whether we add this capability will be largely dependent on community demand for the feature.
See Enabling OCR for more details.
For a list of open issues, or to report problems, please visit bugs.ghostscript.com.
Incompatible changes
Included below are incompatible changes from recent releases (the specific release in question listed in parentheses). We include these, for now, as we are aware that not everyone upgrades with every release.
-
(9.53.0) As of 9.53.0, we have (re-)introduced the patch level to the version number, this helps facilitate a revised policy on handling security related issues.
Note for GSView Users:The patch level addition breaks GSView 5 (it is hardcoded to check for versions
704-999
. It is possible, but not guaranteed that a GSView update might be forthcoming to resolve this. -
(9.52) As of 9.52, the Windows binaries released by the Ghostscript development team are built with Microsoft Visual Studio 2019. As a result, Microsoft Windows XP and earlier are no longer supported by these binaries. This does not imply we are, or will start relying upon features only available in VS2019, so the
nmake
Makefiles will continue to allow older Visual Studio versions (back to VS2005) to build Ghostscript. -
(9.52)
-dALLOWPSTRANSPARENCY
: The transparency compositor (and related features), whilst we are improving it, remains sensitive to being driven correctly, and incorrect use can have unexpected/undefined results. Hence, as part of improving security we limited access to these operators, originally using the-dSAFER
feature. As we made "SAFER" the default mode, that became unacceptable, hence the new option-dALLOWPSTRANSPARENCY
which enables access to the operators. -
(9.50) There are a couple of subtle incompatibilities between the old and new SAFER implementations. Firstly, as mentioned in the 9.50 release notes, SAFER now leaves standard Postcript functionality unchanged (except for the file access limitations). Secondly, the interaction with
save
/restore
operations, see SAFER.Important Note for Windows Users:
The file/path pattern matching is case sensitive, even on Windows. This is a change in behaviour compared to the old code which, on Windows, was case insensitive. This is in recognition of changes in Windows behaviour, in that it now supports (although does not enforce) case sensitivity. -
(9.27) The process of "tidying" the PostScript name space should have removed only non-standard and undocumented operators. Nevertheless, it is possible that any integrations or utilities that rely on those non-standard and undocumented operators may stop working or may change behaviour.
If you encounter such a case, please contact us (either the #ghostscript IRC channel, or the gs-devel mailing list would be best), and we'll work with you to either find an alternative solution or return the previous functionality, if there is genuinely no other option.
Changelog
2021-03-29 12:09:07 +0100
Chris Liddell <chris.liddell@artifex.com>
28f5ec9d1b374449c89f7200e87ba855a97ebdd2
Bug 703741: clear xstate_change flag on gsave
xstate_change is used (partly) to track whether ExtGState parameters have
changed since the last "q" op, and thus whether we need to set them back again
(for the benefit of the pdf14 compositor) on the "Q" op.
Previously, the flag was inherited by the "new" gstate created by a gsave,
so we could end up trying to reset the ExGState params at the wrong point.
This is especially problematic with internally triggered gsave/grestore for,
for example, rendering glyphs, or accumulating patterns, etc.
In other words, we currently can end up with a sequence like:
q
<change ExtGState params> <- set the xstate_change flag
q <- flag still set
q <- flag still set
Q <- reset the ExtGState params, flag still set
Q <- reset the ExtGState params, flag still set
Q <- reset the ExtGState params, restores to gstate without flag set
Whereas what we want is:
q
<change ExtGState params> <- sets the xstate_change flag
q <- flag not set (still set in a gstate lower down the stack)
q <- flag not set (still set in a gstate lower down the stack)
Q
Q <- this returns the gstate with the flag to the top of the gstate stack
Q <- reset the ExtGState params, restores to gstate without flag set
So, reset the flag during the gsave.
base/gsstate.c
2021-03-24 13:07:41 +0000
Ken Sharp <ken.sharp@artifex.com>
906f906617067aaf42e4e995cc63acdf9bded7c0
pdfwrite - fix FastWebView with multiple put_params() calls
When testing this I must have used a setup which either set the
OutputFile before setting FastWebView, or set them simultaneously. If we
have the two assignments in different calls, and the first call is not
to set OutputFile, then the assignment of FastWebView will not work.
This is because we didn't check whether OutputFile was set before
checking if it was seekable, obviously a NULL file is not seekable! This
caused us to reset 'Linearize'. The subsequent call to set OutputFile
could not re-enable Linearize, and so linearization would not be
enabled.
The fix here is simply to check that pdev->flle is not NULL before
checking if it is seekable.
devices/vector/gdevpdfp.c
2021-03-20 20:00:33 -0700
Ray Johnston <ray.johnston@artifex.com>
49a8691f19e9d7d1370f157d0cd423b4b5d5a526
Fix a performance regression introduced by commit 813b5f48e8
The fix is to keep the PageUsesOverprint parameter in the device
dictionary, not in the outer dictionary, and use it from there.
It isn't understood why storing in the outer dictionary causes such a
substantial performance hit, but profiling shows that the time comes
from "dstack_find_name_by_index". The performance hit showed up with
j9_acrobat.pdf of the performance test suite (about 8%).
Resource/Init/pdf_main.ps
2021-03-22 09:51:06 +0000
Chris Liddell <chris.liddell@artifex.com>
db2a48697289ae2d53aeb3bbbf82276f0e85a134
Automate tesseract build compatibility with clang++
On MacOS (at least), clang++ requires the addition of the -std=c++17 to enable
support of the features that tesseract uses.
Also, on Linux (at least) clang++ requires -stdlib=libstdc++ in order to
pickup a usable stdc++ library.
So, tweak configure to test whether the compiler accepts the options to do both
the above, and if so, add them to the CXXFLAGS used to build tesseract.
In addition, in configure, pickup CXXFLAGS so custom options can be set on the
configure command line.
configure.ac
2021-03-22 09:12:19 +0000
Chris Liddell <chris.liddell@artifex.com>
f40d70eeb5194a51fc585cb9ac9037c12557a826
Tweak gitlog2changelog.py to exclude the per-commit file list
toolbin/gitlog2changelog.py
2021-03-22 12:09:55 +0000
Robin Watts <Robin.Watts@artifex.com>
4a7db3c313f4c3e0e5ea87510b0d353b4441368f
Add /utf-8 command to TESSCXXFLAGS in msvc.mak.
Suggested by Akira Kakuto. I don't need this myself, but then my
default windows codepage is probably different to Akira's. Adding
this shouldn't cause any problems.
psi/msvc.mak
2021-03-22 09:11:11 +0000
Chris Liddell <chris.liddell@artifex.com>
73c5567d62b6e9278818c3077c1c3ea3b5ee43ee
Update change log post-9.54.0rc1
doc/History9.htm
2021-03-19 16:14:33 +0000
Robin Watts <Robin.Watts@artifex.com>
26009e688cf4275c252a9e060f30f006c1f1b9de
Fix crash in display device (seen with apitest.c).
When calculating the size for the display, we setup a
fake gx_device_memory to call the calculation routine
with. Because we hadn't initialised the graphics_type_tag
sometimes it would incorrectly assume there was 1 more
plane than there should be.
In calculating the required size, it would therefore add
in bitmap_raster(plane[i].depth * width) more bytes for
that plane. If plane[i].depth was negative, this would
cause the amount of memory we allocate to shrink, and
accordingly, we'd allocate too little memory.
The fix is to ensure that the fake device is always
zero'd to start with.
2021-03-19 13:39:37 +0000
Chris Liddell <chris.liddell@artifex.com>
42d688a1c90685d2123540416c60bcdf6b0db7dc
Update man pages to reflect SAFER is now the default.
2021-03-19 13:13:21 +0000
Ken Sharp <ken.sharp@artifex.com>
48a8946f886b18b182868a9866b4927f80860510
Erasepage optimisation - fix invalid device ordering assumption
The erasepage optimisation device, when checking to see whether the
underlying device permitted optimisaton, was assuming that its own child
would always be the 'final' device. If we have a chain of subclass
devices this might not be true.
Run down the chain to the fist non-subclass device and check that
instead. In future this should be replaced by a spec_op or something
but this resolves the problem for now.
2021-03-19 09:51:25 +0000
Chris Liddell <chris.liddell@artifex.com>
a96257ec48dc13a1404990c4a473db88545dcc71
Update dates, and changelog for 9.54.0rc1
2021-03-16 09:24:00 +0000
Chris Liddell <chris.liddell@artifex.com>
905d82cc03d74a69a850eac16596267ed96473a5
Update dates and changelog for 9.54.0 rc1
2021-03-18 15:39:30 +0000
Ken Sharp <ken.sharp@artifex.com>
38a768a651fd4d11a6c27792067f59713f141634
Drop DynaLab special bbox stretching of metrics
For historical reasons relating to glyph caching the zchar42_set_cache
code used the minimum and maximum of the glyph bounding box and font
bounding box when setting the metrics of a glyph.
This was done for DynaLab (one of the FreeType 'tricky' font types),
because these fonts abuse the TrueType 'hinting' mechanism.
Unfortunately this results in the wrong origin 1 being sent to
setcachedevice2, and hence CDevProc when the font is vertically
oriented.
We no longer use this function for clipping, and the remaining client
pdfwrite doesn't use it for clipping but very much does use it for
gathering font metrics, so it is vital that these be correct.
Since it's only used by pdfwrite, and testing suggests that DynaLab
fonts are not a problem for this, the code has been removed here. If
it should ever prove to be required then we should check the Font to
see if it is a DynaLab font. MuPDF has a function is_dynalab() for this
and we should use that if we prove to need it.
2021-03-17 20:18:44 -0700
Ray Johnston <ray.johnston@artifex.com>
109cae320d32df84b26d668bc03b0068be4482f4
Fix bug 703704: Matte in SMask is indirect reference.
Thanks to Peter Cherepanov for this fix. This also catches /null Matte
entries.
2021-03-17 15:33:59 +0000
Chris Liddell <chris.liddell@artifex.com>
bd711e60fb48e0dbedd40742dde58ac1e85a91ec
Make --disable-threads incompatible with including OCR
Tesseract requires threading, even though Ghostscript doesn't actually call any
of the parts of tesseract that use threading, there is no sensible way to
leave it out.
So, throw an error if --disable-threads is used when tesseract/leptonica is
present. The error includes a note to use "--without-tesseract" to avoid the
error.
Also, fix a typo from a03ce3d6a130c843cb4dd91b7e767706973b4e22
2021-03-17 11:06:42 +0000
Chris Liddell <chris.liddell@artifex.com>
157aab06770e5b0f3255e45866d578cac8ff861d
Pick up C++ compiler from configure script
Rather than rely on the GNU make predefine.
2021-03-16 17:48:43 +0000
Robin Watts <Robin.Watts@artifex.com>
ef8fc3115ea0361db31599400129c0e980f79ab1
Rejig clist_mutate_to_clist for Coverity.
Coverity spotted us accessing *the_memory without having checked
that the_memory != NULL first.
In fixing that, I've taken the chance to tidy up the function a bit.
2021-03-15 13:09:13 +0000
Robin Watts <Robin.Watts@artifex.com>
0e0611db144ac91c7b1825f94d100b7505a33a5c
Fix merge error causing CAL SEGVs.
We were detecting plugins as being old format. This only shows up
in testing with CAL.
2021-03-11 14:59:05 +0000
Chris Liddell <chris.liddell@artifex.com>
1c60ca5e897375dcd3afbb886fba8808e2e09e12
Update copyright to 2021
2021-03-11 15:14:21 -0800
Michael Vrhel <michael.vrhel@artifex.com>
628909cfa7b776c81461c511a88ee002ec51fcdb
Bug 703414 : Halftone artifacts
There are two different representations of the turn-on-sequence
in GS. One of them uses an array of unsigned short integers that
indicate what bits get turned on. The array stores an address
offset into the bitmap tile that is created for a particular level.
The decision to use this representation is made in gsht.c
in the gx_ht_alloc_theshold_order method and is based upon the
width and height of the threshold array which indicates the total
number of addresses or offsets into the tile to reference which
bits get turned on in the tile by the turn-on-sequence. The tiles
themselves however are forced to have their rows raster aligned meaning
that if w*h <= 65535 the offsets into the tile dots can be larger
than 65535, which will not fit in the short turn-on-sequence array.
The code uses a different representation for the TOS if the number
of elements is less than 2000. Then it stores a pointer to a structure
for every element. That is the "default" implementation. Here
a uint (32-bit) implementation is added for cases where the tile is
larger than 65536 (e.g. bigger than 256 x 256). The implementation is
the same as the ushort case, but just uses four byte offsets for the TOS.
2021-03-11 16:46:13 -0800
Ray Johnston <ray.johnston@artifex.com>
9ba7e720143cc11bfd54c26a548860e738b97dfc
Fix SEGV with -sNupControl=1x2 to pbmraw -r300 Bug693331.pdf
This was due to the pdf14 getting confused during clist playback when the
'master' page contained more than one nested page with transparency. Each of
the nested pages would PUSH, then POP the pdf14 compositor, but since the pdf14
compositor remains as the current device, the first POP 'disables' the pdf14
compositor and the subsequent PUSH 'recreates' the pdf14 device in active
compositing mode. The problem was that the 'recreate' did not perform all of
the setup of color_info, cmap_procs, and device procs needed for all of the
subsequent clist playback through the compositor.
2021-03-10 17:48:37 -0800
Michael Vrhel <michael.vrhel@artifex.com>
aa26ed7d8cf0edda3db6c15dc7947ee8bea5ba3d
Add additional debug for halftones
2021-03-11 19:25:00 +0000
Chris Liddell <chris.liddell@artifex.com>
3f1195b0523a1d3c8b80a47d7101e31954770767
Bug 703687: Fix logic for alpha bits in do_fill_stroke()
We can only do the GraphicsAlphaBits anti-aliasing if we are drawing with a
"pure" color (or a DeviceN color). Basically, not a pattern.
For fill_stroke that means checking for the fill and stroke colors, but the
conditional was erroneously using "or" rather than "and" - so if either
color was pure, we'd try to use the alpha buffer, causing incorrect results.
2021-03-11 13:09:52 +0000
Ken Sharp <ken.sharp@artifex.com>
224cafab373865f96f49ac186012bad63b99ff3b
Bug 703324 - restore fill state after fill+stroke path operation
The file in bug 703324 fills and strokes a rectangle ('B' operator)
and sets the fill constant alpha to 1, and the stroke constant alpha
to 0, so that the stroke is not drawn. Pointless but that's what it
does.
It then draws some text.
Now the clist maintains an 'opacity' member, which is set and reset by
(amongst other things) looking at the fill and stroke alpha values. When
we do a fill+stroke we set the opacity to the fill alpha, and do the
fill, then we set it to the stroke alpha and draw the stroke.
We then do an 'image_fill_masked' operation to draw the text bitmaps.
This device method does not take a graphics state as a parameter and so
is unable to set the opacity in the device based on the fill alpha. It
simply uses whatever opacity is current at the time. Because the
fill+stroke left this at the 'stroke' alpha, this is applied to the text
which (because the alpha is 0) is then not drawn.
In addition the graphics state fill constant alpha value was left with
the wrong value, but fixing that wasn't sufficient. However we should
do both, and this commit resets the fill constant alpha in the graphics
state and recalculates the 'opacity'.
2021-03-11 17:05:37 +0000
Robin Watts <Robin.Watts@artifex.com>
e2f1611a14000d6a2927ac49a865e5a954dd88b2
Extract clist setup code from prn and display device.
Move to a common clist_mutatable function.
2021-03-11 18:38:18 +0000
Robin Watts <Robin.Watts@artifex.com>
d15d0ea0873ca27d4f3410d18603bfd0ad890fd5
Fix exports for GPL DLL.
This was preventing api_test working on windows.
2021-03-11 17:08:00 +0000
Robin Watts <Robin.Watts@artifex.com>
08215797e95bb9db1c19e42b644829afb04a43ca
Fix MSVC warning.
2021-03-11 17:07:11 +0000
Robin Watts <Robin.Watts@artifex.com>
3657ca38aec1e0b77e9b6c9aae62f03e212475b3
Fix some comment typos.
2021-03-11 08:58:30 -0800
Ray Johnston <ray.johnston@artifex.com>
becd66c4064abad46a2c1d2f35710555362a1502
Fix bug 703681. Illegal Mask for image in PDF.
Thanks to Peter Cherepanov for this fix. Check for the type of the Mask
entry, and ignore it (with an Error message) if not array or dictionary.
2021-03-11 15:10:21 +0000
Ken Sharp <ken.sharp@artifex.com>
a30569c455b412e2f5ee05ad7df69059886f0a7e
Fix ordering of operators in FitPage
Bug #703685 "Crash when using -dPDFFitPage"
The 'cvi' in pdf_PDF2PS_matrix in pdf_main.ps here was meant (I think)
to apply to the /Rotate value from the page dictionary, but instead
was applied to the divisor, 90, which isn't needed because 90 is
obviously already an integer.
If the PDF file (illegally) had a floating point number then the cvi
should convert it to an integer, so we need to move the cvi so that it
applies to the /Rotate value.
2021-03-10 09:11:08 -0800
Ray Johnston <ray.johnston@artifex.com>
91dd2c391c7c68c172d387bd7d2e5904296b68f5
Fix rangecheck from pdf_info when -dDumpXML is used and lines are > 256 bytes.
Just dump the XML metadata rather than trying to suppress blank lines.
2021-03-10 01:38:44 +0100
Sebastian Rasmussen <sebras@gmail.com>
8d4390862d0391430efd65e2bb5f9336231d4ff2
Bug 703653: jbig2dec: Use correct freeing function for JBIG2 images.
When jbig2_image_compose() errors out, remember to release all allocated
pattern images. Previously the most recently allocated image would not
be release.
Finally remember to free the array of images itself.
2021-03-09 19:48:59 +0000
Robin Watts <Robin.Watts@artifex.com>
f6ba75df38529d3c3d9c57cb9c99429d36ee3072
Slightly tidy the tessocr.h interface.
Delete an unused function, and move the ocr and hocr functions
to using ocr_init_api and ocr_fin_api as the others do.
2021-03-04 21:14:46 -0800
Ray Johnston <ray.johnston@artifex.com>
4d2bf7b009922bef2efdbc3d0c8dcfe5d3a8cdb0
Fix Bug 703648. Commit 00e7143ce9 caused this to surface by changing allocator.
The clist_make_accum_device previously used the target device's allocator which
was 'system' VM, and commit 00e7143ce9 changed it to use 'local' VM which is
subject to save/restore. The sample file resutled in an extra rc_decrement of
the device on page 4 (from gx_pattern_accum_finalize during the restore).
Fix this by using 'stable_memory' (from the mem allocator passed in) prevents
the restore from affecting the pattern-clist accumulator.
Note the simple command line to reproduce is:
bin/gs -r1200 -sDEVICE=pgmraw -dBufferSpace=16m -o /dev/null \
Ad_Quark.ps Ad_Quark.ps Ad_Quark.ps
which results in "corrupted double-linked list"
2021-03-09 09:35:04 -0800
Ray Johnston <ray.johnston@artifex.com>
62c5e1b5b6079cabf9008f12f7e038c413dda2d0
Prevent segfault from -Z^ debug output.
Tripped over this while trying to use it for reference count debug.
Tested on linux and Windows. No more hackish than the other constants
in this function.
2021-03-09 12:13:35 +0000
Robin Watts <Robin.Watts@artifex.com>
e8ae31abf5a2b365f086d3ccf34f64c47503f565
Fix documentation for moved display device test.
2021-03-09 11:54:31 +0000
Ken Sharp <ken.sharp@artifex.com>
8747ffd4e32faab3fd08b48bc443d4094ae21a5f
Documentation fix - gdevdsp.h is no longer in base
The links to gdevdsp.h in use.htm were (mostly) referencing base when
in fact the file is in the devices sub-directory.
2021-03-01 18:28:54 +0000
Robin Watts <Robin.Watts@artifex.com>
a5185dc45dd8c1981fbe5f46a0577ec0378bf449
Fix compositor operation with subclassing.
Compositors/PS2Write/Subclassing/Clist interact badly, due to the need
for the subclass code to 'tightly' wrap the original device, rather
than wrapping the created compositor.
Use a new gxdso to handle the insertion of the device lower down the
device chain.
This frees the subclass device of the need to know how to insert itself
into different types of device.
Unfortuntely, the pdf14clist devices, when popped, assume that they
tightly wrap the actual clist device. This causes SEGVs when there
is actually a subclass device in the way.
Accordingly, we update that code to find the correct clist device
in the stack, by using a new gxdso added for this purpose.
2021-03-04 09:27:34 -0800
Michael Vrhel <michael.vrhel@artifex.com>
8fe5fb55424ebcc3ed66e8ce9a0fbfaac57aaa85
Do not allow psd devices to change color model
This keeps the psdcmyk device cmyk based and the psdrgb device rgb based.
2021-03-03 13:08:34 -0800
Ray Johnston <ray.johnston@artifex.com>
8d95baab43318d1feecb70ee326734a883545484
Fix erasepage_optimization device to allow for other subclass devices.
The epo device assumed that it was the current device, then checked the child
of that device to decide if it could optimize. If another subclass device was
the current device the decision could be invalid.
Note that the comparison of the child's fillpage proc is not ideal, but the
change to that is more involved and risky, and left for a subsequent change.
2021-03-01 10:26:57 -0800
Ray Johnston <ray.johnston@artifex.com>
7a3dd047a07ed3f24bd388b72432990d9cd508fb
Fix page independence logic on the examples PostScript files.
Back in 2001, commit f78b0481 added save/restore around the examples files,
but did not follow the recommendations from the PostScript Language Reference
Manual about save/restore and page independence and Technical note #5001.
The PLRM states (in section 3.7.3): "Each page has a save at the beginning
and a restore at the end, immediately before the showpage operator."
This fixes the files, and allows them to work properly with usage that
expects correct page independence including -sNupControl=WxH and the use
of setpagedevice BeginPage/EndPage actions.
2021-01-28 08:20:57 -0800
Ray Johnston <ray.johnston@artifex.com>
d9a13c96f9ac0cfcaaa843b7e51780de114cf48a
NupControl improvements to prevent save/restore problems.
The NupControl string needs to be a reference counted to work with save/
restore, and when the parameter is changed the new value needs to be
propagated to children devices. The structure containing the string is
adpated (simplified slightly) from the PageList implementation.
Note that the parents and children references must be included in the ref_count
when the NupControl structure is updated (example if 'epo' is installed, when
it uninstalls itself, cannot free the the structure when it does rc_decrement).
Minor comment change to devices/gdevbit.c to change NupList to NupControl.
2021-03-03 10:29:33 -0800
Michael Vrhel <michael.vrhel@artifex.com>
648a17ed91e089c11621053201c97c93304086c9
Update gen_ordered to provide improved debug output
2021-03-03 12:28:02 +0000
Robin Watts <Robin.Watts@artifex.com>
359cf3ce11c32a5c05c24028d8785902799cb2fc
Add another nmake variant.
2021-03-02 15:26:24 +0000
Robin Watts <Robin.Watts@artifex.com>
f74dcd064d5de5e13ad907d7ac270bc82bb7858b
Extract build: Ensure zlib is used as an include path for extract.
Without this, the Windows build fails, and (presumably) the linux
build is picking up the system zlib.h.
2021-03-02 16:33:13 +0000
Chris Liddell <chris.liddell@artifex.com>
4698574e2711da90888915f0c5a7dc4644153689
History/News updates
And add an html link target for BlackText
2021-03-02 09:21:58 +0000
Chris Liddell <chris.liddell@artifex.com>
590d3744111e267e2cebc09f3f7f98e6410704be
Update changelog and dates for 9.54.0 RC 1
2021-03-02 15:25:21 +0000
Robin Watts <Robin.Watts@artifex.com>
db7f4bfc013549b22d8c30fbb75fc639bfb35799
MSVC build: Detect and use 'extract' directory if it exists.
This can be overridden by setting EXTRACT_DIR.
2021-03-02 12:20:24 +0000
Chris Liddell <chris.liddell@artifex.com>
4f11ff15600c9d6ed8032f671f2e693388d01cc1
Check for extract in a "default" location
i.e. ghostpdl/extract
as well as still allowing --with-extract-dir for custom locations.
2021-03-02 12:23:17 +0000
Robin Watts <Robin.Watts@artifex.com>
6ac61452f9717536430a315fc832b5c64b3c02eb
Fix tessocr.cpp building on linux.
Missing include file.
2021-03-02 09:17:53 +0000
Chris Liddell <chris.liddell@artifex.com>
6425f74266dd66f6064dc8f24d0b827e39a18855
Tweaks and corrections for News.htm
2021-03-01 11:17:29 +0000
Ken Sharp <ken.sharp@artifex.com>
59eea43bf3f3e09182c0457d94b91c347f54bfbd
Fix seg faults in subclassing
Commit a754bd375a625368567947b1e1b77ce3e5c06a3f fixed a different class
of seg faults, but unfortunately removed a crucial line of code.
When the child device has pushed a compositor, we still need to check
to see if the compositor is pointing at the child device. If it is not
then the compositor must have pushed more than a single device, so it
is not safe to behave as if the target of the compositor is our child
device.
Originally I had hoped to walk down the forwarding devices until we
reach our device, but the actual behaviour of the pdf14 device in
combination with the clist, when the final device is ps2write renders
that all but impossible, as well as unnecessary.
In this case the compositor action starts by defining a new device,
It then pushes a pdf14_accum device (there are 3, one per device space)
it then pushes the pdf14clist device in front of that. Finally it turns
the device it first created into a forwarding device, and points its
target at the original device.
So we return with 3 new devices pushed, not just one. However, the
final forwarding device is in fact forwarding to the subclassing device
and the device reference counting magic is applied to the forwarding
device, which means we don't need to dance around with the references
to the subclassing device and child.
We could detect this condition by checking the name of the target device
of the pdf14clist forwarding device, but that isn't really any better
than simply assuming that the compositor takes care of inserting new
devices correctly. The pdf14_accum devices are not forwarding devices,
they store the pdf14 device in a member called saved_pdev14, so we can't
readily follow that either. Finally there is no way to determine if a
device is a forwarding device, or a gx_device_pdf14_accum type which
limits the amount of checking we cna perform.
This is an interim commit to work around the problem, because we are
about to do a release. A better fix which eliminates all (we hope)
of the hidden assumptions and magic knowledge in the code here
will be committed shortly, but may be too risky for the release.
2021-03-01 14:35:15 +0000
Chris Liddell <chris.liddell@artifex.com>
109fb95822a5c4fa6d7dc99ed120149acafd8341
Edit release highlights text
2021-03-01 11:58:04 +0000
Chris Liddell <chris.liddell@artifex.com>
79d04193b05200e1dd606c583c0b4e0b46520217
Tidy up/add labels for URL destinations
A few in VectorDevices.htm were wrong, and I added one in that file and a couple
in Use.htm for convenience.
2021-03-01 13:01:02 +0000
Julian Smith <julian.smith@artifex.com>
6a3a11e8e9a1420702867afdd555dff62ab7ba20
doc/VectorDevices.htm: added information about DOCX device.
2021-02-25 09:36:18 -0800
Ray Johnston <ray.johnston@artifex.com>
fa775ffdd2ab6dff3b3178f9d36975308eeb9893
Add documentation for NupControl (N-up printing) feature.
2021-02-27 14:51:38 -0800
Ray Johnston <ray.johnston@artifex.com>
f06760e64c088ea24cd6a41c07cb459ecc690b05
Add Colorant name for HalftoneType 5 components to -Zh output
2021-02-26 08:03:56 +0000
Chris Liddell <chris.liddell@artifex.com>
1e30bb81fae075519db85af1bc7fb1658891627d
Bug 703273: Prioritise Nonsymbolic over Symbolic font flag
The font in this PDF has it descriptor flags set to 36, that is bit 3 (Symbolic)
and bit 6 (Nonsymbolic) are both set. Since the two flags are mutually exclusive
this is clearly broken!
Previously, we only test the Symbolic flag, since !Symbolic should imply
Nonsymbolic, which caused us to use the wrong encoding scheme.
Now, we'll act on the Symbolic flag iff the Nonsymbolic flag is not set.
(Originally a mupdf report, that also exhibited in Ghostscript).
2021-02-26 09:38:27 +0000
Ken Sharp <ken.sharp@artifex.com>
5d0bd867b7d9fce50119adeae293568375fa8847
Fix a few typos in the documentation of UseOCR for pdfwrite
2021-02-22 19:57:35 +0000
Robin Watts <Robin.Watts@artifex.com>
1aa6a230ecc56ee3cb02459fbf6fc5e400e26eba
Bug 703265: Tweak create_compositor device method.
Update create_compositor device method, so that it always returns
the compositor device (or the leaf device if there is no specific
compositor device). The device now returns 1 if we created a
compositor device to wrap the given device.
This should enable us to identify exactly the cases where forwarding
devices need to update which device they forward to.
In particular, this allows us to remove the horribly fragile code
in apply_create_compositor in gxclrast.c, and to ensure that we
correctly identify the 'new compositor' case.
This avoids us sending stuff to the wrong device, and having to
cope with a slew of warnings.
2021-02-25 09:16:33 +0000
Chris Liddell <chris.liddell@artifex.com>
8bc7ba4ba7df15310d406d5a1d8f6b755b04d13b
Update dates/docs for 9.54.0 RC1
2021-02-22 18:53:09 +0000
Chris Liddell <chris.liddell@artifex.com>
5fc905ca8f04aa2a1088c3af635fd38bf9c8c3a0
Remove Luratech integration code/makefiles
2021-02-22 14:11:46 +0000
Chris Liddell <chris.liddell@artifex.com>
af92546c044b18a1796e269aba58c246ca977290
Change GS_PRODUCT string, and dates for release
2021-02-22 10:32:13 +0000
Chris Liddell <chris.liddell@artifex.com>
1430230bdf35928e5fb75eba631db3e5b89ce845
Bug 703589: handle overlapping ranges in TTF format 4 cmaps
The fonts embedded in this file contain a large number of overlapping/repeated
ranges in the format 4 cmap table definition - which is *strictly* not permitted
according to the spec.
For example:
scode=117 ecode=117
scode=117 ecode=117
scode=118 ecode=118
scode=118 ecode=118
scode=119 ecode=119
scode=119 ecode=119
scode=120 ecode=120
scode=120 ecode=120
scode=121 ecode=121
scode=121 ecode=121
Turns out, other consumers use the *first* mapping they encounter where, because
we use a Postscript dictionary to store the cmap table, later definitions
overwrite earlier ones.
Resolved by checking if the key already exists in the dictionary, and not
overwriting it if it does.
2021-02-10 09:35:39 +0000
Chris Liddell <chris.liddell@artifex.com>
9c7347c8e1bb146b9ae27b35b8207e10a7c5dc43
Bug 703326: Create a new clip path for clist typed image handling
Stupid fuzzing file uses a Type 3 font with a sampled image in the glyph
proc. The image uses a procedure as a data source. The glyph proc does
gsave, and the image data source procedure does a grestore. So by the time we
clean up the image "samples", the gstate and the clip path it contains have
gone. So the image enumerator's reference to the clip path is left dangling.
Copying, rather than referencing, that clip path solves the crash.
Fixes oss-fuzz issue: 26987
2021-02-19 17:34:35 -0800
Ray Johnston <ray.johnston@artifex.com>
2c7a78d3e2ae6a3053827e915735e29eb16e12ba
Catch potential NULL derefence in gdev_prn_close.
Thanks to Robin for spotting this.
2021-02-19 11:02:40 +0000
Ken Sharp <ken.sharp@artifex.com>
fc5aa3b392cbd7c879b049d805a2afd158a05eb6
Fix buffer overrun in ASCIIHexEncode
This exhibited as a memory corruption error (buffer overrun) in pdfi.
The ASCIIHexEncode filter is required to write linfeed characters to the
output at least every 80 (output characters). Ghostscript chooses to do
so every 64 characters. So every 64 characters the filter emits a
linefeed, crucially without checking whether there is room in the
output buffer.
In order to determine how many linefeed characters we are going to need
to write into any given output buffer we divide the number of characters
in the output buffer by 65 (64 characters + linefeed), taking into
account any character slaready emiitted (stored as 'count' in the stream
state). We subtract that from the size of the output buffer, in order
to ensure that there is enough spare space for the linefeeds.
Unfortunately, this is not sufficient. Consider an output buffer 194
bytes in size, on the first pass. We divide that by 65, which tells us
that 2 complete buffers will fit, so we need to reserve space in the
output for 2 bytes. We subtract 2 from the count, giving 192, We then
proceed to write the output data. We write 64 bytes of data, then a
linefeed, then 64 bytes of data, then a linefeed, then 64 bytes of data.
Total 194 bytes.
At this point we have exhausted the output buffer, but because we have
written 64 bytes, we unconditionally write a linefeed. This is written
one byte beyond the end of the buffer.
There are many ways to address this but I've chosen to change the
divisor from 65 to 64. This may mean that occasionally we will write one
input character (2 output characters) less than the maximum possible
to the output, but it will prevent the possibility of a buffer overrun.
2021-02-18 17:59:26 -0800
Ray Johnston <ray.johnston@artifex.com>
d4c0981839bb2194040a9d15c8772e266ae235e3
Fix bug 703557. Replace .sort procedure for use in SAFER mode
Thanks to Peter Cherepanov for this patch.
2021-02-18 08:19:45 -0800
Ray Johnston <ray.johnston@artifex.com>
a32419cebfe2db81aa5e838b95e5770241a22fb1
Add Page Spot color list to output info
2021-02-18 08:07:22 -0800
Ray Johnston <ray.johnston@artifex.com>
32c912d6d6b12956f69056c0e7f3050c5aabf2d4
Address Coverity 365984 -- 'code' variable set but not used before changed.
2021-02-18 15:52:00 +0000
Julian Smith <julian.smith@artifex.com>
4fa213b9cd6f310bc6dd236ecce2d549ed3c5a55
devices/vector/gdevdocxw.c: default to spacing=0 when calling extract_process().
This gives better output, e.g. for zlib.3.pdf.
2021-02-16 15:13:40 +0000
Julian Smith <julian.smith@artifex.com>
cda1ad8f402829c4677f73d8f805b119632dad5f
devices/vector/gdevdocxw.c: fixed creation of .docx when not using file-per-page.
2021-02-16 15:01:27 +0000
Julian Smith <julian.smith@artifex.com>
4e9c31c3b6660d50afbca498ceddf0179ca2540c
toolbin/localcluster/clusterpush.pl: have rsync expand links if product is extractgs.
This allows one to have ghostpdl:extract be a soft link, e.g.:
extract -> ../mupdf/thirdparty/extract
Also use rsync -i instead of -v if $(verbose) is set so that one can see
exactly what files are being transferred etc.
2021-02-16 14:58:47 +0000
Julian Smith <julian.smith@artifex.com>
895c5bc12814d4106a106afaddea5dcdd2d0519d
toolbin/localcluster/clusterpush.pl: fix exclude of extract binaries within ghostpdl.
The previous exclude arg only worked when extract directory was
thirdparty/extract inside mupdf (typically a submodule).
Also added exclusion of extract/test/generated/ to avoid locally-generated
files being uploaded.
Restored exclude of /src/build/ because needed for product=extract.
2021-02-16 14:55:36 +0000
Julian Smith <julian.smith@artifex.com>
2e06b811daafbc95487727f88b9ec7398a250963
psi/msvc.mak: remove 'Not building with extract' diagnostic.
2021-02-18 16:44:43 +0000
Chris Liddell <chris.liddell@artifex.com>
fafb962c4f57b4b7d8e724414e3762f209099b99
Windows gpcl6/ufst project: use better/correct targets
Firstly, the recursive call to nmake was using the wrong target name (an
internal use target), so fix that to use the "real" target.
Secondly, give the "real" target a better name, more in keeping with other
equivalents.
2021-02-18 09:51:01 +0000
Ken Sharp <ken.sharp@artifex.com>
a3cfccc2401222818dd4d587fd5c695811427bc4
Initialise some PDF-specific portions of the graphics state
The text rendering matrix and text line matrix, which are PDF-specific,
were not being initialised when the graphics state was created. This
should not be a problem in normal operation because the PDF interpreter
should always initialise them before use.
However, during development on pdfi it did show up so this commit
initialises the matrices to the identity.
2021-02-17 23:01:03 -0800
Michael Vrhel <michael.vrhel@artifex.com>
72fcae41c44e4cf33e57b34b748521a00612be21
Bug 703578 : XPS to PDF missing stroke
Caused by my "fix" for the pattern issue. I was inadvertently setting
ca and CA to 0 during the gradient strokes.
2021-02-17 13:05:35 -0800
Ray Johnston <ray.johnston@artifex.com>
331fcb49b62a615976711cccdd3ff9796152a323
Fix bug 703245: bitmap size exceeds buffer.
The pdf14 compositor changes the color depth to 8 for a SMask, but the
compositor actions were not being put in all the bands needed. In this
case the copy_color_alpha was output from the interpolation logic because
the image gridfitting expanded the image. Fix it by expanding the top and
bottom limits for the "temp_cropping" which controls the RECT loop writing
the compositor info to the bands.
2021-02-17 19:32:11 +0000
Robin Watts <Robin.Watts@artifex.com>
8608819c8531174290d6075ad5747bd0b0f32d4b
Bug 703577: Correctly initialise texture data pointer.
The ROP in use was failing to initialise the texture data pointer.
Amazing that this doesn't show more problems.
2021-02-17 08:16:25 -0800
Ray Johnston <ray.johnston@artifex.com>
a28c4d3d22156086db3b53011824a88847d114e1
Minor improvement to gx_ht_construct_threshold debug
2021-02-16 22:35:57 -0800
Michael Vrhel <michael.vrhel@artifex.com>
7a3df79b2b0e0725753a0eac84fb205341cc9fed
Bug 703404: XPS to pdfwrite patterns
Patterns that are filled with glyphs and then subsequently
filled with another pattern (Visual brush in XPS) was not
working when going to pdfwrite due to the fact that
gs_text_begin gets called by the XPS interpreter
before we have finished the pattern fill of the glyph.
This ends up referencing the pattern that is not done
which ends badly for high level patterns. Instead
if we are already in a high level pattern, set the color
to just a gray. Then after the gs_text_begin, the XPS
interpreter sets the brush to the visual brush which is
subsequently collected. Fixing this, has revealed another
XPS to PDF bug where we are not doing shading fills of glyphs
correctly (at least when dealing with patterns).
2021-02-17 17:28:29 +0000
Chris Liddell <chris.liddell@artifex.com>
66200b6fafe8b4de6fd11d1b38ccb85eb3d37d83
Add the cup "images" directory back so the docs work
The cups source has shtml documentation dotted through it, and that references
images in the "images" directory (which we removed originally, thinking it
wasn't necessary).
2021-02-17 16:04:27 +0000
Robin Watts <Robin.Watts@artifex.com>
82dce7f8f6b5218f7943eadff0f01d0e278850fa
Update lcms2mt to lcms2 2.12.
2021-02-16 14:28:52 +0000
Robin Watts <Robin.Watts@artifex.com>
5882f2d765a9348c6f6e2cc45353a06924930c88
Chunk allocator was using unsigned int rather than size_t.
Both in the main allocator routine and in the structures. Solved
here.
2021-02-15 17:22:28 +0000
Robin Watts <Robin.Watts@artifex.com>
a634d187722befab735da23957d938f156b6cf8f
Change macro names to be less confusing.
The graphics state contains pairs of color/colorspaces. The 0th ones
are known as 'current' ones. The 1st ones have historically been known
as 'alt' ones.
This nomenclature is held to be confusing, as 'alternate'
colors/colorspaces mean something quite different. We therefore update
the macros etc to refer to these as 'swapped' ones, which fits better
into our usage.
2021-02-15 16:26:18 +0000
Robin Watts <Robin.Watts@artifex.com>
a67862f2f7ec3826ac1f55947ebdbfe740c1829f
Fix 'cast away const' warning in gdevplnx.c
We do this by splitting gstate_clone into gstate_clone_for_gsave
and gstate_clone_for_gstate. The latter can have the source gstate
as being const, as you'd expect.
This enables gs_gstate_copy to similarly take a const gstate, as
you'd expect.
2021-02-15 17:09:20 +0000
Robin Watts <Robin.Watts@artifex.com>
4618b1dea2e55fa0a39f8fa216e4965785ed8d21
Squash warnings in gdevwpr2.c
2021-02-15 16:24:41 +0000
Robin Watts <Robin.Watts@artifex.com>
83118eaa3e8733d8755eef21b3b404ce0ee97123
Add cs_adjust_altcounts_icc.
This enables us to avoid swapping colors twice in every
gstate_clone.
2021-02-16 19:58:28 +0000
Robin Watts <Robin.Watts@artifex.com>
564e9365b8803903d077cd7deca247e65d8f7a29
Memento fix: Memento_strdup was inconsistently defined.
2021-02-15 19:09:50 +0000
Robin Watts <Robin.Watts@artifex.com>
f95b2611921546b424d899a5828341f6c4c9a52a
Add 'extractmu' and 'extractgs' to clusterpush.pl
2021-02-09 17:48:35 +0000
Robin Watts <Robin.Watts@artifex.com>
eff4e8fca8ebbc75b00e7c1d2e672d17090b2222
Quell Memento warnings in debug non-Memento builds.
2021-02-15 12:34:05 +0000
Robin Watts <Robin.Watts@artifex.com>
19baed479febdc6372c7b3fccf6e97d71fca1b95
Squash warnings in DEBUG code in gsalloc.c
2021-02-11 09:27:23 +0000
Chris Liddell <chris.liddell@artifex.com>
1efe1f702f9723dec2803395cf4679593987c422
Bug 703550: handle escaped percent chars in file access controls
The separating devices make a (fairly blunt) effort to avoid attempting to use
proscribed characters in file names for separations (for example, '/', '\',
etc). As part of this some characters can be replaced with escaped percent
chars - so the single percent character survives a later call to a formatted
string function (sprintf).
This ended up foxing the file access validation code which added the fully
escaped file name string to the permit write table, but later attempted to
validate a file name post sprintf, where the escaping had been undone.
So, add code to remove escape '%' characters before adding the string to the
file access permit lists.
2021-02-12 14:33:58 +0000
Peter Cherepanov <sphinx.pinastri@gmail.com>
0ca4ae94020a1e3b48c337759ccb9fc0b3af61ec
Bug 702910: Fix mkromfs for THREADSAFE build
Since local versions of errprintf_nomem() and errprintf() are mostly
identical, we can just call errprintf() with a dummy mem argument.
The "mem" argument for errprintf() inside GhostPDL is used to ensure
the error prints are directed to/through the correct gs_lib_ctx
instance for the current thread
This is safe because, mkromfs is only using during the build, and won't
ever implement threading, thus has no need to worry about the extra
parameter.
(slightly tweaked patch to keep working without THREADSAFE)
2021-02-12 14:30:44 +0000
Peter Cherepanov <sphinx.pinastri@gmail.com>
28d3245fbaff5f6edc74fe3fc21237d69672e947
Bug 703294: Fix Ghostscript build for Android
Header files shifted around so that the redefinition of printf happens
after cdefs.
Also removes redundant CONTDEVH definition from contrib/contrib.mak
2020-11-23 14:09:31 +0000
Julian Smith <julian.smith@artifex.com>
b151406bbf22fb9001895f856168166f2ecf7fe2
Added docxwrite device; uses extract library to write docx output.
Summary:
This adds a new docxwrite device which generates docx files.
Unlike the txtwrite device, we don't output xml for later use by
extract-exe or store information about spans in arrays. Instead we call
extract functions such as extract_add_char() directly.
Code changes:
Have moved txtwrite and docxwrite common code into new devices/vector/doc_common.{c,h}.
Shared types and functions are currently:
txt_glyph_width_t
txt_glyph_widths_t
txt_glyph_widths()
txt_get_unicode()
txt_char_widths_to_uts()
txt_calculate_text_size()
Building:
By default we do not build with Extract and there will be no docxwrite
device in the final executables.
To build with Extract, specify the location of the extract checkout to
build and link with.
Unix:
./autogen.sh --with-extract-dir=<extract-dir>
Windows:
Set environmental variable EXTRACT_DIR=<extract-dir> when building,
e.g.:
EXTRACT_DIR=<extract-dir> devenv.com windows/GhostPDL.sln /Build Debug /Project ghostscript
On both Unix and Windows we exit with an error message if the specified
location does not exist.
2021-02-12 03:39:30 -0800
Robin Watts <Robin.Watts@artifex.com>
833dc8c9ffde58f001308b303c8d7956107633a1
Fix build failure with HAVE_VALGRIND and not PACIFY_VALGRIND
2021-02-12 15:25:56 +0000
Ken Sharp <ken.sharp@artifex.com>
180419375973b9ce4664286a67106d712260ef7f
Remove .setpdfwrite from the documentation
Deprecated in 9.50 removed in the next release (9.54)
2021-02-12 10:34:23 +0000
Chris Liddell <chris.liddell@artifex.com>
7861fcad13c497728189feafb41cd57b5b50ea25
oss-fuzz 30715: Check stack limits after function evaluation.
During function result sampling, after the callout to the Postscript
interpreter, make sure there is enough stack space available before pushing
or popping entries.
In thise case, the Postscript procedure for the "function" is totally invalid
(as a function), and leaves the op stack in an unrecoverable state (as far as
function evaluation is concerned). We end up popping more entries off the
stack than are available.
To cope, add in stack limit checking to throw an appropriate error when this
happens.
2021-02-11 22:32:50 -0800
Ray Johnston <ray.johnston@artifex.com>
ea1624205c8e1ca936bd38a6095a0dd1880e7287
Fix hang condition detected on Windows release build.
The NupControl commit changed 'gx_device_set_hwsize_from_media' to call the
dev_spec_op of the parent device, but the body of the while loop to find the
uppermost parent could hang.
2021-02-11 11:12:34 -0800
Robin Watts <Robin.Watts@artifex.com>
76b7cdd9c407afc5c620dbfb79770bb5583cf532
Pad PDF14 buffer allocations when building with CAL.
This allows for SSE/AVX to overread slightly when reading
16 bytes at a time.
2021-02-10 18:07:07 +0000
Chris Liddell <chris.liddell@artifex.com>
b5e44d6709642727ee524cccd2b5ab09f2e48572
oss-fuzz 30795: handle remap_color failure in clist_begin_typed_image
In this case "remap_color" is gx_concretize_ICC() and the link profile
creation fails. Previously we were ignoring the error, and trying to use the
resulting (invalid) color space.
2021-02-09 14:17:01 +0000
Chris Liddell <chris.liddell@artifex.com>
7351373f5e3e8d9cd8c75be7d176570f95bd7c97
Add a VS project to build gpcl6 with ufst
(stemmed from Bug 703415)
2021-02-09 14:08:54 +0000
Chris Liddell <chris.liddell@artifex.com>
7a92c21b4a842cfa90134eb46544d142cc4c13d0
Bug 702362: "make soinstall" install GhostPDL
If available, have "soinstall" the libs and binaries for gpcl6, gxps and
gpdl.
2021-02-10 16:46:16 -0800
Robin Watts <Robin.Watts@artifex.com>
2abffa72c2ac815df38927431744232ae421d42d
Fix CAL CFLAGS.
2021-02-10 16:03:40 -0800
Michael Vrhel <michael.vrhel@artifex.com>
7395ad17d12b0c8b420fd7a8d139baf52d9791e0
Update docs.
2021-02-10 14:24:24 -0800
Michael Vrhel <michael.vrhel@artifex.com>
7a469b14c88409b96614e6b8abe2b645078ded3a
Bug 703555 : Seg fault in pdf14_dev_spec_op
So the issue is that the pdf14 clist device was not
doing its clean-up and set to forwarding when there was an
abort for the device sent by the interpreter.
2021-02-10 14:44:51 +0000
Ken Sharp <ken.sharp@artifex.com>
9699aea5cf6491106a2ad1be260d9eb2e85903c3
Remove .setpdfwrite
This has basically done nothing for years and in September 2019 I
added a warning message that it was deprecated and would be removed.
Time to make good on that promise.
2021-02-03 09:25:37 -0700
Chris Liddell <chris.liddell@artifex.com>
6f6c88f92f98d0f8340c29201c7536ec1a521efd
Sort tifftop.c dependency on jpeg headers
Spotted in testing the Apple M1 Mac builds
2021-02-07 19:19:15 +0000
Ken Sharp <ken.sharp@artifex.com>
141e5067e40d25ed3aa191589d4a325941efa57a
pdfwrite - don't try to linearize when the output file is not seekabkle
No bug report. The linearization (-dFastWebView) 'feature' of pdfwrite
relies upon being able to seek in the output file. If we can't do that
then we can't linearize the file.
If linearization is enabled, check the output file is seekable; if it
is not then warn the user and abort linearization.
2021-02-07 15:04:36 +0000
Ken Sharp <ken.sharp@artifex.com>
4ab5dd6c004a252e64f26d6238799004f70d4a35
pdfwrite - further checks on Title for PDF/A
Bug #703486 "PDF containing just a JPEG converted to PDF/A-1b fails rule 6.7.3-1"
The PDF file, produced by ImageMagick 7 has a /Title in the Document
Information dictionary which appears to be UTF-16BE encoded, but is
lacking the BOM. It also has a 2-byte NULL appended which seems likely
to be an error as well (PDF strings are not NULL-terminated).
This is valid (if not useful) as a string with PDFDocEncoding, though
Acrobat displays an empty string in the Document Properties, but when
converted to a text string for the output Document Information
dictionary, and a UTF-8 string for the XMP, the two strings are not
byte-for-byte identical, resulting in a PDF/A validation error.
Add some more checking for character codes which will result in UTF-8
and PDFDocEncoding strings which do not match (anything outside the
range 0x20 to 0x7F, or escaped).
2021-02-06 12:56:36 -0800
Ray Johnston <ray.johnston@artifex.com>
7e8b585e7577044dc1d6a9a36d715be12fc2524c
Fix bug 703487. pageusesoverprint needs self-reference check for Parent.
Ken's fix for bug 698372 is needed in the procedure that I added to check
for overprint usage.
2020-11-14 18:26:21 -0800
Michael Vrhel <michael.vrhel@artifex.com>
813b5f48e845d528d3070d9168aa51035a614c1c
Bug 695925: Implement overprint simulation for all devices
This adds the capability to simulate overprint including that of
spot colors for all devices including gray and RGB devices. This
is achieved by having the PDF interpreter look if overprint
is present, the seting of -dOverprint (/simulate /enable /disable),
if the page has transparency, and if the page has spot colors. Depending upon
the color model of the device, and if transparency is present,
a special push of the pdf14 device may occur. The pdf14 device
buffer collects the data in a CMYK or CMYK+spots buffer and the
put_image method in the pdf14 device will map the buffer to
the target device color space. The code was tested with
devices that support and do not support spot colors, those that
support and do not support alpha channels, tag based devices,
gray, RGB, and CMYK devices. A special test file to check
multiple cases was added to the regression suite. By default
-dOverprint is set to /enable, which should result in the existing
behavior where by RGB and Gray devices do no show overprint or spot
colors and CMYK devices will handle CMYK overprinting and separation
devices will show spots and overprint of all colorants. With
-dOverprint set to /disable no device will show overprinting. With
-dOverprint set to /simulate all devices will show overprint and
spot colors. Ray Johnston did the work in the interpreter as
well as the device parameter default setup. I did the pdf14 device
changes and testing. Changes in a variety of locations were required
due to the fact that new combinations were encountered, for example
we had cases where devn colors were being used with a device that
supports tags (bitrgbtags device and pdf14 compositor setup for CMYK+spots).
One file:
tests_private/xps/xpsfts-a4/fts_34xx.xps.pdf ppmraw 72 now produces
an error. This file should have been throwing an error all
along but was being quietly swallowed. Acrobat will not open
the created pdf file and throws and error. I will open a bug
for the issue as it is a problem with the XPS interpreter.
2021-02-05 11:59:45 +0000
Ken Sharp <ken.sharp@artifex.com>
0bd6877f480a84657696a80adc13f9c5485dd996
Remove vestigial documentation
The NOCCFONTS feature was removed some years back and the documentation
removed from fonts.htm, but a vestige remained in use.htm.
2021-02-04 16:34:58 +0000
Chris Liddell <chris.liddell@artifex.com>
8cac642a1caf0ff821b2f1f83ee322a1cffc9a3e
oss-fuzz 22842: sanity check the claimed number of objects in a PDF
This test case is a file that we identify as a broken PDF, and attempt to
repair.
As part of trying to repair the xref, we an extremely large value integer which
we take to mean the number of objects in the file, and then attempt to loop
over them. The result is, in practice, an endless loop.
On the basis that the very barest PDF object:
1 0 obj
endobj
takes 15 bytes to define, we add a check: if the number of claimed objects is
greater than the number of bytes in the file divided by 15, then the number
is not to be trusted, and we dicard it.
2021-02-04 13:42:51 +0000
Chris Liddell <chris.liddell@artifex.com>
180f35cecf582c0cd321e5d5cd8e11c4304ec519
oss-fuzz 25846: Store "printable" refs for errors
When we get an op/dict/exec stack overflow error, we take a copy of the stack
in question, and store it in an array (or as much of it as we feasibly can).
That allows us to clear enough stack space to allow the error handler(s) to run
without losing the information needed to report the error.
With the exec stack, however, that can (and usually does) include references to
"internal" objects, which are really just pointers to arbitrary C structures,
(t_struct and t_astruct ref types). Those can contain pointers referencing
objects of unrelated and uncertain lifespans, so persistent storage of them is
potentially problematic.
So, when we create that array representation, replace every t_struct and
t_astruct object with a printable string representation.
This isn't a big problem for speed because a) exec stack overflow is a rare
error b) for exec stack overflow, we already have to traverse the objects
checking for another condition, and c) we already do (basically) the same
conversion considerably later, for the benefit of the error handler.
2021-02-04 09:05:42 +0000
Chris Liddell <chris.liddell@artifex.com>
a9a440babc49ed54d0086cd9e5faa9bdd3452e51
Fix build failure
gsparamx.c is now required in the "base" configuration, since it contains
function(s) now being called from gsdparam.c
2021-02-04 08:30:31 +0000
Ken Sharp <ken.sharp@artifex.com>
f9583327eeaf733cf44eb02790994308d4b9e91b
Fix Coverity ID C366347
Removing some code revealed a pre-existing pointless operation; we were
setting the render mode twice.
2021-02-03 16:38:39 +0000
Ken Sharp <ken.sharp@artifex.com>
6665826ff3b0ec30e3c084c5b550006a2b7c9bf5
txtwrite - fix a load of memory leaks
Noticed while working on some bug reports. The memory cleanup hadn't
been updated when a bunch of members were added to the tracking data.
In addition the font name was allocated and recorded (and then over
written on the next pass) for every character in the text. Oops!
All these are fixed here. I've run a couple of hundred random PDF
files from our test repository with memory leak checking and found
no leaks.
2021-02-02 19:15:44 +0000
Chris Liddell <chris.liddell@artifex.com>
4021e019eaccffb809595b90d04626f337f5e237
Bug 703452: Add type checks for error dicts
This is, at best, a theoretical problem now, but for extra safety, ensure the
values we read back from systemdict for the /gserrordict and /errordict keys
are actually dictionary objects before looking up the error key in them.
2021-02-02 19:06:12 +0000
Chris Liddell <chris.liddell@artifex.com>
32867dfea274afaf5e335ec8f2691b4cfed88b78
Bug 703454: Handle multiple CharString definitions
The test file for this has a number of Type 1 fonts whose CharStrings
dictionary definitions contain more than one entry for several glyph names.
According to Postscript rules (which Type 1 fonts are supposed to follow),
defining a key/value pair for which the key already exists in the dictionary
should overwrite the earlier value - i.e. the later definition takes
precedence.
It appears that the non-Postscript based implementations used in other
PDF consumers do not honor that, and the earlier definition ends up taking
precedence.
To work around various other PDF embedded Type 1 font breakages, we push an
extra dictionary onto the dict stack which contains definitions for missing
procedures, and various other "fixups".
To work around this problem, we add a new definition of the Postscript "def"
operator which, *only* for the CharStrings dictionary, will not allow existing
keys to have their values replaced.
2021-02-01 10:22:03 -0800
Ray Johnston <ray.johnston@artifex.com>
c23d68c1e8da7a4e4134b143f147427092b3d2f2
Replace -dSimulateOverprint boolean with multi-valued -dOverprint
Internally the name is changed to "overprint_control" which has enum values
of gs_overprint_control_t. This is in preparation for Michael Vrhel's
overprint simulation implementation.
Documentation of the change and the new parameter specifics added to the
doc/Use.htm file. Also added change to gs_init.ps so that command line use
of -dSimulateOverprint=true maps to -dOverprint=/enable and similarly,
-dSimulateOverprint=false maps to -dOverprint=/disable with a warning.
2021-02-01 09:44:14 +0000
Chris Liddell <chris.liddell@artifex.com>
322d21b4c04d2f64583630de4b190ce8d3b0721d
Fix building mkromfs in a memento build
Adding malloc_.h to gp_ntfs.c means it gets the memento redefinitions of
malloc/free. That causes missing symbols errors when gp_ntfs.c is used in the
mkromfs build. So (as we do for other such cases) add those missing symbols
to mkromfs.c.
2021-02-01 16:21:24 +0000
Ken Sharp <ken.sharp@artifex.com>
41130dd35b2dc43b07600b51d7c9fab466e8bf6c
PDF interpreter - work around broken ObjStms (again)
Bug #703448 " Ghostscript can't read files that poppler, mupdf and Firefox and others can read"
The problem is in an OObjStm, a compressed representation of various
PDF objects. In the example file the ObjStm returns a lone 'mark'
object for one of the compressed objects, which is not legal.
This appears to be the font T1_2 on page 87.
The mark confuses our counting of the returned objects and that leads
to the interpreter falling in a heap.
There's no trivial way to address this, so I've chosen to use the
approach used for error handling in other places; push a specific name
onto the stack, and then use that instead of a mark to delimit the
portion of the stack of interest.
Obviously nothing is going to rescue the broken font; but since this is
a PDF file which has been OCR'ed I don't think this is a problem as we
will not to try to use it for rendering as the text is all 'drawn' in
text rendering mode 3 (neither fill nor stroke).
Because we keep using this I've also added a couple of utility procedures
CountToKey and ClearToKey, which work similarly to countomark and
cleartomark. Because I wanted to be able to detect a missing key on the
stack CountToKey returns a boolean, not just a number.
I've also used that approach around the verify_page_tree call so that
we don't end up with a pile of junk on the stack if it should fall
over similar errors in future.
Finally I tested with the customer supplied file which originally
inspired the changes in resolveobjectstream to detect the last kind of
broken ObjStm and that file continues to work.
2021-02-01 14:47:07 +0000
Robin Watts <Robin.Watts@artifex.com>
a6c2b025f820dd06cb94014ed5f040ddb203f97d
Update tesseract build for latest versions.
2021-02-01 13:14:24 +0000
Robin Watts <Robin.Watts@artifex.com>
ce2fcde6d32586ef468fd56121ffd7d66d03b613
Fix leptonica compilation due to removed file.
2020-09-06 11:23:35 -0700
Ray Johnston <ray.johnston@artifex.com>
dfed81f5a657a67f672777389bff70d6d31253f7
A customer (#584) file exposed a problem with Link handling
Thanks to Ken Sharp for this fix. He discovered that if annotsetcolor
returns false, the annotation did not return false.
This occurred with the test file received from that customer on 9/1/2020
Note delayed commit due to proximity to release.
2021-01-30 15:45:34 +0000
Ken Sharp <ken.sharp@artifex.com>
5bbb4c7e686ddfb28b27e0a790dabef6338ffa6d
txtwrite - fully initialise a structure
Bug #702960 "Valgrind error in clamp_poin_aux on txtwrite device"
Initialise all members of the structure to 0.
2021-01-30 11:00:08 +0000
Ken Sharp <ken.sharp@artifex.com>
d787dad3cd310788ea7201eb2fe1fff9a0a263c2
txtwrite - Address some memory handling problems
Bug #703143 "segfault in ps2txt with certain large file"
There are two problems here; firstly the textw_text_release()
function is called *from* gs_text_release, and should not be calling
that function. This was the initial cause of the seg fault.
Secondly the txtwrite custom text enumerator was not declaring the
'pte_fallback' text enumerator member, which meant that it could be
relocated without updating the txtwrite text enumerator, leading to
seg faults further through the processing.
This resolves the seg faults on the supplied test file for me, but there
are still memory problems (memory leaks in fact) revealed by running
under Memento. I'll address these in a later commit or commits.
2021-01-28 04:09:20 -0800
Robin Watts <Robin.Watts@artifex.com>
e21027b895f3ba6abda70cefb8facbc772bd7ea9
Better fix for psdcmyk indeterminisms.
When calculating buffer sizes, we now take the presence/absence of
tags into account. This must be copied into the temporary device
structure from the target.
Simply setting it to 0 will stop the indeterminisms, but will give
problems with potential future devices (psdcmyktags?).
Accordingly, I've removed the memset, and copied the value, meaning
we can rely on valgrind to help spot such problems in future.
2021-01-28 09:31:29 +0000
Chris Liddell <chris.liddell@artifex.com>
a448691e97cc4b4b7040e8c7d7a39e13eedfc0c2
oss-fuzz 27399: Handle NaN and Inf in object type conversions
In the core of cvs detect unrepresentable floating point numbers and throw
an error (note: not using fpclassify or similar because they are C99 additions).
If we hit such a case, throw an error, in this case undefinedresult - we
cannot use rangecheck because that gets special handling which also triggers
the uninitialized value error.
2021-01-27 12:53:35 -0800
Nancy Durgin <nancy.durgin@artifex.com>
66a8ec27ede82a353cb2775c4be1904aca529b2a
Init mdev struct to 0 on stack -- fix psdcmyk non-determinism
Big giant structure full of random stuff is probably not a good idea....
This hopefully fixes non-determinisms seen in pdfi psdcmyk device.
2021-01-27 13:14:10 +0000
Chris Liddell <chris.liddell@artifex.com>
2679ddae53883ba3c7129846494d921151527a74
More jpeg passthrough error case fixes.
Ensure that on an error return, we communicate the end of JPEG passthrough to
the (potential) recipient(s) of the data.
Basically, we need to ensure that JPEG passthrough is completed before the
last time we return from s_DCTD_process for the current stream - i.e. whether
it is an EOD condition, or an error condition.
2021-01-27 09:51:59 +0000
Ken Sharp <ken.sharp@artifex.com>
5d59986af2b7df560b85ccf54a491eb632022439
Close down JPEG passthrough when finalizing DCT decoding.
This doesn't seem too cause any problems with Ghostscript, but it
is implicated in seg faults in pdfi. Probably because the pdfwrite
streams are in a faulty state.
2021-01-10 10:17:35 -0800
Ray Johnston <ray.johnston@artifex.com>
3eb6b9866aa1dae4c2778b450cc99b29e9d11d7e
Implement Nup subclass device to support nesting images on a page.
By using a subclassing device to intercept a few of the device procs
(get_initial_matrix, output_page, fillpage, put_params, close_device, and
dev_spec_op) pages can be placed on to a page that is eventually output.
This initial implementation scales the pages on the 'nest' as defined
by -sNupControl parameter that is a string of the form "HxV" where H
and V are integers controlling nesting across (H) and down (V) the page.
All pages on the nest are the same size/orientation as the first page of
the nest, and if a different PageSize is encountered, any pages on the
current nest will be output before starting a new nest.
In gx_device_set_hwsize_from_media dev_spec_op is used to prevent changing
the device width and height (HWSize) for PageSize or .MediaSize params.
This requires that the graphics library should not assume that HWSize is
derived from PageSize and HWResolution, but it allows the intial clip_path
for the nested pages to be set from the MediaSize, Margins, and HWMargins
in gx_default_clip_box.
There are a few files that have differences with the 'psdcmyk' devices when
tested with -sNupControl=1x1:
Bug688584.ps: Page 6 missing graphics,related to SeparationOrder usage.
(a bug will be opened for this once this is committed).
Bug692517.ps: subclass device barely switches to clist mode for 72.0
(don't care, page mode still works for larger MaxBitmap),
tests_private/pdf/PDFIA1.7_SUBSET/CATX2975.pdf.ppmraw.300.0..gs
(seems to be a progression on page 9)
2021-01-25 19:04:55 -0800
Michael Vrhel <michael.vrhel@artifex.com>
7f52ae74a19bf1076ebfb9ed1695b0077fc70ee7
Bug 703320: Export cmsCloneTransformChangingFormats
2021-01-25 16:33:26 -0800
Michael Vrhel <michael.vrhel@artifex.com>
181672f2faccccfd613837d0e60610301a1816ea
Bug 703378: Error handling for memory failures in gstate
2021-01-25 11:24:46 -0800
Michael Vrhel <michael.vrhel@artifex.com>
14c51e628fc78f43aa9360ad94c359085583bec5
Coverity 365590 Parameter set but not used.
2021-01-23 12:03:29 +0000
Chris Liddell <chris.liddell@artifex.com>
730d1c410e38500f98ae11cad42d8672521588b4
Initialize the current_glyph entry in pdfwrite text enumerator
Also address a compiler warning about "operation" might be unintialised at
line 3682.
2021-01-23 09:36:09 +0000
Ken Sharp <ken.sharp@artifex.com>
054d35268592bba2434dffdb3b36e4ad224adcf0
Guard against indirect /Length in an XRef stream
Bug #703372 "Unable to find Trailer"
The file has an XRef stream (a compressed cross-reference), where the
/Length of the stream is itself an indirect object. We can't dereference
the Length, because to do so we would need to look up its object number
in the cross-reference!
Oddly the PDF specification does not state that the /Length must be a
direct object.
This commit wraps the code which retrieves the /Length in a stopped and
if it fails we fall back to the assumption that the length is invalid
and apply our normal recovery strategy.
2021-01-21 09:52:31 -0800
Ray Johnston <ray.johnston@artifex.com>
98669b8da7d1dd925a1e3bc0bc785cffcb12acab
Fix PDF 'colorspacespotcolors' to handle uncolored Patterns.
Michael Vrhel noticed that the PageSpotColor count was wrong for test
file Bug694385.pdf, finding the "Dieline" Separation, but missing the
"PANTONE 378 C" Separation that was the underlying colorspace for an
uncolored Pattern.
2021-01-16 22:37:13 -0800
Ray Johnston <ray.johnston@artifex.com>
d020a4e75e351d1de387d13edebffc36ab54c6d5
Fixes/changes to default subclass device procedures.
The 'output_page' should pull the PageCount from the child device (that
is the only real fix.)
The other changes are to get rid of all of the return statements that
cannot be reached. The 'else' is retained as a comment /* else */ in
case someone can't figure that out. It is sort of surprisng that we
don't get 'statement cannot be reached' messages out of any compiler or
static analysis tool.
2021-01-20 20:54:10 -0800
Michael Vrhel <michael.vrhel@artifex.com>
cc676010ad929da40db4c89810ede2f5c4a0ed7b
Implement strip_tile_rect_devn for pdf14 device
The default strip_tile_rect_devn method returns an error
and has a comment that the method is only implemented
for devices that support devn, which the comment says
are only the memory planar devices. However, the pdf14 device
also supports devn colors and has to be able to handle
pattern tiles that have spot colors. When such files
are encountered, the interpreter will just report an error in
the file and continue on its way if we are in non-clist mode.
When in clist mode, the error will cause ghostscript to stop
execution.
This implementation borrows heavily from gx_default_strip_tile_rectangle
to deal with all the logic of where we are on the tile,
it then borrows heavily from pdf14_copy_mono but
using devn colors and dealing with the case of
one of the colors possibly being gx_no_color_index.
2021-01-21 13:00:22 +0000
Ken Sharp <ken.sharp@artifex.com>
47ec79f910892810d0d72116667d9487093d5c34
Add malloc_.h to gp_ntfs.c
Bug #703310 "gp_ntfs.c uses malloc but does not include "malloc_.h""
There doesn't seem to be a problem with adding malloc_.h to the C file
it matches what we do with other files, doesn't produce any warnings
and passes regression testing.
Using WIN32_LEAN_AND_MEAN however causes the compiler to fail with a
number of errors, so we won't be adding that. The nature of the errors
look like these would be difficult to solve and the benefit of this
preprocessor directive is moot, even Microsoft insiders describe it
as 'largely useless'.
2021-01-19 11:15:28 +0000
Chris Liddell <chris.liddell@artifex.com>
5c540233af993678154914eede088a42039ae745
libtiff build fail in old VS versions
2021-01-17 20:01:08 -0800
Michael Vrhel <michael.vrhel@artifex.com>
be18309f3ce815c21ce858527515e7765d672a9b
Fix issues with windows C# demos/csharp/api/ghostnet.cs
Make sure to explicitly tell C# that the callback delegates will use a Cdecl
calling convention, which means that the caller (in this case the ghostscript)
will clean the stack. Also some minor changes to the project settings.
The default for debug is to use gpdldllxx.dll while the release versions will
use gsddllxx.dll just to help with the testing. Finally, make sure to *always*
copy the dll from the appropriate gs directory, even when the C# application
did not need to do a build (as it was already built)
2021-01-15 15:13:05 +0000
Robin Watts <Robin.Watts@artifex.com>
b9ad2c23e6fd1f7cf0c4889504ac1642f077b660
Tifflib fix: Thunder RLE can fail to decode last run.
GPDL decode of tests_private/tiff/text.tif gives valgrind errors
due to the "thunder decode" failing to extract the last run of
bytes.
The logic in the decoder, presumably intended to spot overruns of
data is incorrect, in that runs that end at the end of a row
(npixels == maxpixels) will not be decoded.
Fix this by limiting 'n', the number of pixels to copy. Note that
npixels is updated by the 'unlimited' value to ensure the error
reporting at the end of the loop still works.
2021-01-15 12:26:22 +0000
Chris Liddell <chris.liddell@artifex.com>
4e956a2ee5137812007a7862a6eb8fddd9b709d2
Update libtiff to 4.2.0
And then re-apply: ef66198ade77d5d551b3045cd36bed81c0b04f54
Changes to libtiff for gpdl.
1) Ensure that libtiff doesn't mess with 'boolean' in GS builds
on Windows. Without this, the jpeg structures used by our JPEG
lib build are different in size when called from gs and libtiff,
resulting in runtime errors.
2) Update libtiff so that it can correctly call into the jpeg
library so that memory operations happen from our pools, not
malloc/free. Slightly horrid in that this is more complex with
OJPEG than JPEG files.
2020-04-01 19:05:40 -0500
Rob Boehne <robb@datalogics.com>
35035761ffe178284c4ef9fc2ef75a4843e64a63
Bug 703339: Fix libtiff name clash on AIX
Patch grabbed from upstream:
https://gitlab.com/libtiff/libtiff/-/commit/31ca59cb047353d7edf66d04fe052861b180e42d
Rename itrunc to fix name clash with a different itrunc in math.h on AIX.
Fixes issue #189
2021-01-15 12:10:58 +0000
Robin Watts <Robin.Watts@artifex.com>
364a3883326b90bf078d488909ba3203450da3d3
Bug 703301: Fix logic error in display device structure checks.
Thanks to Pino Toscano for spotting this.
2021-01-14 19:45:33 +0000
Robin Watts <Robin.Watts@artifex.com>
f9723a92bcb3ab1de8f5cf16da5b5e6c807eeda2
Bug 703336: Fix GPL crash with jpg input on 64bit windows.
The Jpeg code uses setjmp/longjmp for error handling. On Windows at
least, in 64bit builds, jmpbufs need to be 16 byte aligned. This is
generally achieved by malloc blocks being 16 byte aligned, and
structures have their offsets calculated so that their contents lie
at appropriate positions.
Unfortunately, our malloc routines only align to 8 byte aligned.
We therefore bend the jpgtop.c code to align the jmpbuf manually.
Similar tricks are required in the pngtop.c code, which also uses
setjmp/longjmp, but a slightly different approach has to be taken
as the png routine allocates the structure with the callback in
itself, so we don't get to align just that. Instead, we modify the
allocation routines that we provide to pnglib so that blocks are
correctly padded.
2021-01-14 16:42:03 +0000
Robin Watts <Robin.Watts@artifex.com>
496d1d927acfe2460b69552f372f9ec7a411a172
Improve memory device bitmap size calculation in tagged planar cases.
The planar calculations for memory device sizes were failing to take
the presence of tags into account. Fix those calculations here.
2021-01-14 13:31:15 +0000
Ken Sharp <ken.sharp@artifex.com>
6376e75907ab7eff2248236333a10489cfad3787
Remove paths stored in --permit-file* when sanitising.
Bug #703338 "Hide permitted paths from invocation comment"
As noted in the bug report, the --permit-file* control arguments are
not replaced with '?' when sanitising the arguments. This leads to an
information leak with the 'Invocation' comment emitted by pdfwrite.
This commit adds checking for the -- switches and sanitises the
permit-file* cases.
2021-01-13 13:03:22 +0000
Robin Watts <Robin.Watts@artifex.com>
f11882a4b09beb0d74f88df759841cb49ed63683
MSVC: Yet another nmake version.
2021-01-12 22:11:13 -0800
Ray Johnston <ray.johnston@artifex.com>
79decaf7eca50a7dc6201dc86ef487ee1e7563f9
Fix GhostPDL TIFF reader to be able to handle tiff32nc output.
The PHOTOMETRIC_SEPARATED case would only handle num_comps == 3, but the
tiff32c device creates 4 component images with PHOTOMETRIC_SEPARATED.
Allowing 3 or 4 components works.
2021-01-07 17:24:44 -0800
Ray Johnston <ray.johnston@artifex.com>
904c546962cb749fa8136130612e1c0a9cf558af
Add CMYK equivalent colorants for Separation Spot colors to tiffsep device.
This may be useful information -- adding the equivalent colors for the Spot
color names.
2021-01-07 17:32:12 -0800
Ray Johnston <ray.johnston@artifex.com>
34ec1a4deb5275280184346ef877e6984da59da8
Fix pdf_info.ps "write-doc-string" to handle names as well as strings.
2020-12-09 10:32:36 +0000
Chris Liddell <chris.liddell@artifex.com>
ead8676f2b8686605b8f6976da4de677d99d39e0
Fix yet another version number handling ommission
From the introduction of the patch level to the version number.
2021-01-06 16:23:05 +0000
Chris Liddell <chris.liddell@artifex.com>
a081833ac163dd6d6b404b679cf086f125847ef8
oss-fuzz 26175: propagate error for invalid arc4 key
Also, precautionary initialisation of a couple of variables in the arc4 stream
state.
2020-12-04 10:38:29 +0000
Chris Liddell <chris.liddell@artifex.com>
b0b1b89c767809c05abbe118c47875743438580c
oss-fuzz 27985: Initialize the glyph lengths array
Just memset to 0x00, so in the event of an error, we don't later use the memory
uninitialized.
2021-01-06 16:22:15 +0000
Robin Watts <Robin.Watts@artifex.com>
62a98980772fde394c99e92bfc9c18d5407c06e1
Update for another version of MSVC.
2021-01-05 11:25:03 +0000
Chris Liddell <chris.liddell@artifex.com>
b01bdd87eb96b3d8db7ef2727d5a6ab7b122b8fc
Update openjpeg to 2.4.0
Fixes:bugs 703275, 703276, 703277, 703278, 703279, 703280, 703281.
2021-01-05 09:01:59 +0000
Chris Liddell <chris.liddell@artifex.com>
cc2f67265d1508a6cf953470ef7b2a0d9a1a14e3
Update freetype to 2.10.4 (for real, this time!)
(with zlib "Diagnostic functions" hack/fix in freetype/src/zutil.h)
2021-01-01 17:50:54 +0000
Robin Watts <Robin.Watts@artifex.com>
6b4c229d4bf4bcccf8000611caaef59f859d04a6
Build apitest demo with -DCLUSTER.
This ensures that pdfwrite doesn't put timestamps in the
produced PDF files, which means the md5sums are consistent.
2020-12-16 15:50:09 +0000
Ken Sharp <ken.sharp@artifex.com>
01194f9c8a0f2df53ad8f1815bfadc10ad247ba7
PDF interpreter - check type of Group entries in Form XObjects
Bug #703271 "Using oitsample to convert some pdf files to tif errors out with "The export process timed out.""
This is for the larger (205 pages) of the two files. The file is badly
broken, 3 fonts point to objects which are not dictionaries but are
simply integers. In addition at least one of the Form XObjects has a
Group entry which also points to an object which is an integer, not a
dictionary.
The Group was corrupting the operand stack leading to later errors. This
commit checks the type of the Group (and the BBox since we're making
changes anyway) and simply aborts the Group if the type is incorrect.
Obviously this is going to lead to incorrect output, but at least we
can carry on to later pages.
Note that Acrobat throws errors on pages 168, 169 and 171-175 of this
file and renders blank pages for them, so the file is clearly very badly
broken.
2020-12-16 09:56:40 +0000
Julian Smith <julian.smith@artifex.com>
eef97dac4d6d6e88319c17af4f739e7d899776f3
base/memento.h: fix Memento_listBlockInfo macro - needs to take one argument.
2020-12-15 17:42:35 +0000
Robin Watts <Robin.Watts@artifex.com>
9912c583aba35b68e251a73861ead44b0dbd91b4
Add Memento_blockInfo(void *addr).
Show the history for a block.
2020-12-15 16:46:56 +0000
Ken Sharp <ken.sharp@artifex.com>
e1dfb92cc593cd27ed593ffcc3a79711b7504563
PDF interpreter - handle indirect objects in Encrypt dictionary
Bug #703272 "This PDF files converts to tiff using the oitsample program, but the font turns from English to what looks like chinese"
The Encrypt dictionary and the subsidiary StdCF dictionary are stored
as indirect objects (presumably in order to make the file larger). The
decryption code wasn't expecting that.
Add code to dereference the objects. While we're here, add code to check
the types of the objects and ensure they are correct, and throw an
error if they are not.
2020-12-11 11:19:22 +0000
Chris Liddell <chris.liddell@artifex.com>
4d91c6ad3e76e19f36d23a50dce253fbbc7d0560
Update CFF strings "known" encoding in C
There were a few missing strings.
2020-12-11 10:55:29 +0000
Chris Liddell <chris.liddell@artifex.com>
87eed438b0cffba111371c25e1d169163f310465
Reintroduce and update cff std strings "encoding" PS file
and move it to "lib" since we don't actually use it in Postscript any more.
It's only used if we ever need to regenerate the C representation of "known
encodings".
Also, update to include missing strings.
Finally, fix the tool that relies on this "encoding" - .namestring is no
longer exposed as a Postscript operator, so define a local equivalent. And
update the example invocation in the comments
2020-12-14 20:15:25 +0000
Chris Liddell <chris.liddell@artifex.com>
bcd9f9d0126d07dc6f93e47618baa6d23fcaf1c2
Mask off the transparency bits from the rop value
before we use it as an index into a 256 entry rop table.
2020-12-15 09:10:55 +0000
Ken Sharp <ken.sharp@artifex.com>
0fa1513841981e7d3bc4da11c93edeeedd452b72
Fax Decode filter - add a simple sanity check
I have a test file (source unknown) e249869cf6a250726711c21fda42763c_signal_sigsegv_a418b9_5694_4827.pdf
which has a number of type 3 bitmap glyphs with invalid CCITTFaxDecode
parameters. The (optional) Columns key in the dictionary has an
associated value of 2^32-1 in one case and an even larger value in
another.
The new pdfi interpreter causes a seg fault in the CCITTFaxDecoder
because this breaks a 32-bit signed integer on Windows, causing the
'raster' value to be negative, when added to the memory pointer this
causes us to try and read from before the beginning of the data buffer.
Ghostscript's PDF interpreter doesn't trigger this because it fails
much earlier and doesn't try to execute these glyphs but I'm certain
it would be possible to modify the file so that it did.
Adding a simple negative check and throwing an error if it is, resolves
the problem.
2020-12-11 11:45:34 -0800
Ray Johnston <ray.johnston@artifex.com>
d8dd6797ba52cd8af28839d1f5f2a4a5fca055d7
Fix -dAntidropuoutDownscaler for non-masked images.
The masked image case set the polarity needed in order for the
ISpecialDownScale image interpolation to work, but the ordinary images
did not set the 'pol' leaving it set to GX_CINFO_POLARITY_UNKNOWN.
2020-12-14 08:39:50 -0800
Ray Johnston <ray.johnston@artifex.com>
c6166768c6e963b0fe28ccdb266629443e521381
Fix bug 703270: Wrong path for PostScript helper file in ps2epsi
In the change mentioned in the bug, rather than rely on the LIBPATH
search method, the ps2epsi script assumed that pd2epsi.ps would be
in the same directory as the 'gs' executable, which is not correct.
Change to use bare 'ps2epsi.ps' so that it will be found on the
LIBPATH as instialled by: make install
2020-12-12 10:31:50 +0000
Ken Sharp <ken.sharp@artifex.com>
3f16ba6aa7c12ee469736f3c8e2205be81087f2a
PDF interpreter - improve commit for bug #703217
In the event that the execution of a Form XObject for a transparency
Group consumed more operands than were pushed, we left the number
of operands on the stack. This just cleans up the stack.
The file for bug #697655, with the pdfwrite device, is the only known
case of this, and the file fails with pdfwrite anyway, so this is not a
truly vital fix, but its best to tidy up.
2020-12-12 09:29:36 +0000
Ken Sharp <ken.sharp@artifex.com>
96e881edc16d7ffe562f8e46354a16275008fe08
Have Git ignore some more directories
Add debugobjrt, memobj64 and windows./vs to the ignore list for Git.
2020-12-10 11:01:55 +0000
Ken Sharp <ken.sharp@artifex.com>
d1be0cd16079c34c05b790683ea76b790486989b
pdfwrite - fix another memory leak on an error path
Again this does not exhibit with the garbage-collecting memory allocator,
discovered by Nancy while working on pdfi.
2020-12-08 11:27:10 -0800
Michael Vrhel <michael.vrhel@artifex.com>
733a8f209ecce61f31621ab87d1d1a81f4935602
Bug 70716: ETS code clean up.
Add checking for memory allocation failures, static code analysis findings,
and issue mentioned in 701716. Also update windows project to VS2019.
2020-12-08 15:35:28 +0000
Ken Sharp <ken.sharp@artifex.com>
a1b4377ffe877fcd3ec2832ca670833cc45adb7a
pdfwrite - fix memory leak on error path
When writing outlines via a pdfmark, if the code failed for any reason
then we would leak various objects. As usual this is cleaned up for us
by the garbage collector when running in PostScript but leaks when we
aren't using the garbage collector.
There are likely to be many, many more paths that leak like this, the
only way to find them is going to be a complete audit of the pdfwrite
source, which would be a major undertaking. For now we'll fix them as
we find them.
2020-12-08 09:35:26 +0000
Peter Cherepanov <sphinx.pinastri@gmail.com>
7a5ed5d0f3fd955bc5d0b1dbb18e63636f697a76
PDF Interpreter - Clean up stack after Form Xobject for transparency Group
Bug #703217 "Error: /typecheck in /--pdfshowpage_finish--"
This is basically the patch supplied by Peter Cherepanov, which uses
the existing mechanism for restoring the stack to a count stored
before the execution of the Form XObject.
However, Peter's patch caused a regression with the file for bug 697655
when run with pdfwrite, because that file consumes more operands from the
stack than it should, leading to us trying to pop -1 elements.
This commit only pops a positive number of objects, and has a slightly
different error text.
2020-12-07 09:25:05 -0800
Ray Johnston <ray.johnston@artifex.com>
fb78a833aeb27ddd59a88c799fde1e939fb43e5a
Fix bug 702786: Ignore null node in Page tree
Thanks to Peter Cherepanov for this analysis and the patch,
The sample file has an element in the /Pages array that cannot be resolved,
and following the PDF spec is interpreted as null.
This patch makes Ghostscript ignore null nodes in the page tree. In turn,
this causes a missing page error, which was considered a fatal error before.
-dPDFSTOPONERROR causes Ghostscript to not proceed with this broken file.
Regression testing shows no differences with other files.
2020-12-07 16:43:37 +0000
Ken Sharp <ken.sharp@artifex.com>
f4ef8bb9684bcc7d07c83b8ffabb607046930a7d
pdfwrite - Limit XUID to 16 values and don't emit it for subset fonts
Bug 703225 "The document breaks after repeated processing"
As noted by Peter Cherepanov, we currently preserve the XUID in the font
when writing it out from pdfwrite, and the PDF interpreter extends any
existing XUID (or adds a new one) every time we process the file.
The PLRM documents an Adobe limitation of 16 entries in an XUID array
and it appears Acrobat has the same limitation.
This commit adds new flags to the type 1 and type 2 font writers so that
we only write an XUID when we are *not* subsetting the font (as the use
of an XUID on two different subset fonts would be incorrect). It also
only emits the first 16 values from an XUID even if we aren't subsetting
the font.
2020-12-07 09:59:35 +0000
Ken Sharp <ken.sharp@artifex.com>
7bfb672daea29645ee40c0facbd5f2eec7cf58e7
pdfwrite - fix memory leak when converting names into references
When writing certain kinds of metadata from pdfmarks we need to convert
a named object into an indirect reference. The code for doing this
assumed that the gs_param_string array was arranged so that each
gs_param_string's data member pointed to an individually allocated
chunk of memory, so it was safe to replace it.
This had 2 problems; firstly the original data buffer was not freed,
leading to memory leaks. Secondly, and more seriously, not all
gs_param_string_arrays are organised this way. Sometimes the array
has a single data pointer containing all the entries sequentially,
each member of the array is a gs_param_string where the data member
points into a location in the string. We cannot free and reallocate
the data members from that kind of string array.
SO this commit modifies the code to make a new copy of the data in the
param_string_array in the format expected by the remaining code, and
frees the copied data afterwards. This fixes the meory leak and avoids
the potential crashes caused by the incorrect assumption.
Note that the assumption in the code is true when the input is from the
PostScript interpreter, but is not true for the input from pdfi and
obviously potentially any other front-end.
2020-12-04 15:07:31 +0000
Robin Watts <Robin.Watts@artifex.com>
6dbcee4e0b4868843938233eb2c37c927f674d69
Update MSVC makefiles.
Firstly, another version of nmake to cope with. In fixing this, I
note that we haven't been setting MS_TOOLSET_VERSION in some cases.
For building from the IDE this evidently doesn't matter, but I suspect
it is required for building using nmake. Add those back in.
Thanks also to Julian for spotting that the logic to cope with
"Community" vs "Professional" editions was failing due to extra
quotes. Fixed here.
Also, msvclib.mak hadn't been updated for VS2017 or VS2019. Copy
the relevant sections across. Possibly we should pull this code out
to a separate file that we can !include so we only have to maintain
it in one place.
2020-12-01 18:06:42 +0000
Chris Liddell <chris.liddell@artifex.com>
fb1a336ac4d2613a63dc0b6054f20f9a8a467fe9
Bug 694692: Handle custom left-sidebearing values.
Ghostscript was ending up ignoring LSB values read from Metrics dictionaries.
This stemmed from some confusion about Freetype's incremental interface
API get_metrics call. We had taken the references to "overriding" the metrics
to mean it allowed for custom metrics to be passed into (and back out of)
Freetype. That is not the case: it is intended to allow integrations supporting
"incomplete" (primarily TrueType) fonts, such as PCL/XL embedded TTFs, that are
permitted to omit certain tables - specifically, in this case, the hmtx and vmtx
tables.
So, this drops that approach, and applies custom LSB values in our code.
Coincidentally, this also makes gs somewhat immune from a pending change in
Freetype related to that get_metrics call.
2020-11-27 12:17:36 +0000
Chris Liddell <chris.liddell@artifex.com>
fce9bcfbda7acdf758fe6fb5264bb1e78eb39039
FAPI: fix applying offsets for glyph paths
If the renderer doesn't deal with replacing metrics, we apply an offset to the
glyph before we pass it back into Ghostscript....
Except we weren't doing it for outline glyphs. Shouldn't (currently) affect
freetype, but nevertheless....
2020-12-03 11:42:27 +0000
Chris Liddell <chris.liddell@artifex.com>
596394e2cdff74488fb53fc818d7f5ca4d3ac1da
Address a compiler warning from 2ed1184b7513
If unrolling the just created, incomplete save state fails we are out of safe
options to carry on, so throw a fatal error.
2020-11-20 13:07:00 +0000
Chris Liddell <chris.liddell@artifex.com>
2ed1184b75132c1ef10cfeec2415f13eaefc7f9e
oss-fuzz 27011: Improve handling of error during a "save".
Previously, in the event of an error during a Postscript save operation, we
could end up leaving a half formed save object in existence. If the error
happened during the gs_gsave_for_save() function, that could end up leaving
the graphics state cleanup "out of sync" with the save state cleanup at the
final virtual memory cleanup as we shut down.
To resolve that, destroy the partially formed save state at the point of the
error. This also means tweaking dorestore() to handle unrolling a save state
without the graphics state reference in it.
2020-11-09 15:27:57 +0000
Chris Liddell <chris.liddell@artifex.com>
634d9c76a6c4c92273c7994cd228e01e263b9d7c
oss fuzz 27304: validate glyph offset against stream size
When we retrieve a glyph offset, check it is within the size of the sfnt data
and if it is not, throw an error.
2020-12-02 15:10:33 +0000
Ken Sharp <ken.sharp@artifex.com>
97152401c7d4490be8f8112829ea440b95411702
Bug 703214 - treat some kinds of free objects as not free
The file in Bug 703214 has been edited incrementally a number of times.
The bug is actually the creation of the initial file, which declares
its xref table as having a section 7 entries long starting at object
1.
In fact, as is normal, the xref table starts at object 0 with the free
entry at the start of the linked list. Because of the incorrect
subsection header though, a PDF consumer should read this as being
object 1, not object 0.
Obviously *all* the objects are then incorrect.
The incremental updates then redefined very object *except* object 1.
The result of this is that these objects are all correctly defined. The
file then attempts to render object 1, which is free. Acrobat can deal
with this, which must mean it is ignoring the 'free' status of the
object and reading the 'next free object' value as if it were the offset
of the object.
Because the next free object is 0, and object 1 is the first object in
the PDF file, and the preceding line is a comment, this actually works
though I'm pretty certain its only by sheer luck, it really should not
work at all.
Unfortunately, because of the way the the PDF interpreter reads PDF
files and stores xref entires, we cannot easily detect an attempt to
use a 'free' object and try to treat it as non-free. We have to do this
upfront when we read the xref table. Because this is such a fluke and I
believe not likely to be repeatable, I've tried to keep the condition
for ignoring the free flag as tight as possible; The generation number
must be exactly 65535 (the canonical value for the head of the free
list), and the object number must be not zero. In this case only we
will store the 'next free object number' as an offset.
If the object is truly free then either it is unused (in which case we
will not use the xref entry) or it should have been superseded by a
later incremental update, in which case we still won't use this entry.
The only way we could try to use this entry is if the PDF file attempts
to use a free entry.
This might change some handling of other broken files.
2020-12-02 00:48:45 +0000
Robin Watts <Robin.Watts@artifex.com>
ed946acb20ec03426d35b0d9341c551e7e459184
LGTM: Reduce goto use in zsort_continue.
2020-12-02 00:22:20 +0000
Robin Watts <Robin.Watts@artifex.com>
4633ebbca0c9690003aebc9f4661c232c61cecdd
LGTM fix: Reduce goto use in s_hex_process.
2020-12-01 12:56:09 -0800
Michael Vrhel <michael.vrhel@artifex.com>
4cbe8fa61a3dc7bb8f9e425024b79a66950664ec
;Bug 703208 Make changes from bug 703164 gsicc_lcms2mt.c over to gsicc_lcms2.c
Thanks to Stefano Rivera for catching this.
2020-12-01 10:25:06 +0000
Robin Watts <Robin.Watts@artifex.com>
4ab2d212dba1475647508b085feb5ee93ea678f8
LGTM: Reduce gotos in s_LZWD_process
2020-12-01 09:39:42 +0000
Ken Sharp <ken.sharp@artifex.com>
cea43d89382fc253f64a7b942722a636080e8138
pdfwrite - fix memory leak with high level forms
As usual this does not exhibit with Ghostscript, because of garbage
collection, and was observed with pdfi.
We transferred ownership of the form object to the local named
resources dictionary, and removed the resource from the XObject chain
of stored resources, but we didn't free the actual resource structure.
Rejigged the code order slightly because we need the resource for a
few purposes before we transfer ownership and free it. Also fixed a
typo and a misleading string (only used for debug purposes in each case)
2020-11-30 12:44:25 -0800
Michael Vrhel <michael.vrhel@artifex.com>
cbe110579288e1d54afd5fecd0abe6e59fe49caa
Bug 698848 Fix mismatch of color space and number of components in JPEG2000
Peter Cherepanov and Ray Johnston had earlier patches. This fix builds
on those and runs cleanly on our test files including Bug694909, which
had an odd unknown cs jp2k image.
2020-11-30 13:21:22 -0800
Ray Johnston <ray.johnston@artifex.com>
080a23c44808a93fa27ba2d4dfdf8d8748a8e84a
Fix bug 703198: SEGV's with psdcmykog device and --saved-pages-test
This was a reference of a missing icc_table caused by the band count not
being adjusted during saved-page playback as it was during writing. The
orig_spec_op in the gx_device_printer structure was being set to the
gdev_prn_spec_op, but this did not call the target device's spec_op, so
it did not get the result from gxdso_adjust_bandheight that was needed.
Caused by commit 8df410c26.
Also clean up a left over extern in gxclrect.c (not related to the fix).
2020-11-30 10:41:20 -0800
Michael Vrhel <michael.vrhel@artifex.com>
50a9fad340a659e64c5dbc74125b97e16cf529de
Bug 703197 : Seg fault in close of x windows
2020-11-28 13:37:45 +0000
Robin Watts <Robin.Watts@artifex.com>
6c94917b4a36c19b30dc451f03715ec2c257d2e5
lgtm fixes: Fix previous fix to s_A85E_process.
continue in a do { } while (0); doesn't work.
2020-10-01 15:58:25 +0100
Chris Liddell <chris.liddell@artifex.com>
bac9c5d2ed82390da058653afbac0d9e29e9bd3f
Searching for a marker in a stream, honor alignment
When searching for markers in a stream buffer, we were "seeking" to the point
in the buffer, and casting to either a byte, ushort or a uint to make the
value comparison. But we cannot do that on SPARC because of the strict
alignment on that hardware.
So, we have to "unpack" the individual bytes from the stream to do the value
comparison.
Note: there are slightly confusing comments in the code that mention being
"on a 16 bit boundary" and "on a 32 bit boundary" - that's referring to the
offset into the buffer, *not* the actual memory address alignment.
Found in testing on Solaris/SPARC
2020-11-27 14:59:40 +0000
Ken Sharp <ken.sharp@artifex.com>
3d33e44d3d014ee78a4505c37b244957066d7b12
Fix memory leak with copied type 1 fonts.
If we copy a type 1 font (for the benefit of the pdfwrite family of
devices) then we make a copy of the Subrs and GSubrs as well, but the
routine to free the copied font wasn't freeing those copies.
This isn't normally obvious because these are garbage collected, found
while checking pdfi.
2020-11-27 10:19:23 +0000
Robin Watts <Robin.Watts@artifex.com>
fec1090d129630c23f425c6aae5a4a1308a973da
LGTM: Rejig s_A85E_process for goto's.
All gotos are now forwards.
2020-11-27 11:14:07 +0000
Ken Sharp <ken.sharp@artifex.com>
2c3b29a81c5cb0859ea567657c646b06f7df4039
Fix compiler warning
Explicitly cast gx_device_null pointer to a gx_device pointer.
2020-11-26 16:23:17 +0000
Ken Sharp <ken.sharp@artifex.com>
f789ded2e122578af6e9e0350e487e7ff89e74ae
Ensure the nulldevice has a proper set of device methods
gs_make_null_device uses the gs_null_device structure to create an
instance of the nulldevice, but it did not call gx_device_fill_in_procs
to set the device methods which are left as NULL in the declaration.
Since all device methods (except fill_rectangle) are expected to be
real functions, not NULL, many places in the code do not check that
the device method is not NULL before calling it. This could (and in
pdfi did) lead to us attempting to execute 0x00 causing seg faults.
2020-11-24 18:20:39 +0000
Robin Watts <Robin.Watts@artifex.com>
9aa09cbca96e722568be76c2de35b41ee9881ba5
lgtm: Rejig gotos in gs_type2_interpret.
All gotos are now forwards. No change to actual operation of code.
2020-11-25 10:11:16 +0000
Robin Watts <Robin.Watts@artifex.com>
db51437d7799576dadeb91014b483d57a39e98ae
Coverity 364047: Structurally dead code.
The previous fix to gs_type1_interpret to make lgtm happy has upset
Coverity. Coverity (incorrectly) believes that some code is now
structurally dead, when actually there is a goto jumping into it.
I think we can make both happy by moving the code to the location of
the last goto.
2020-11-25 08:07:28 +0000
Ken Sharp <ken.sharp@artifex.com>
09377ecc18f952fa7e29c1c884f5fcb493809577
pdfwrite - fix a compiler warning
remove a now unused variable
2020-11-24 19:56:49 +0000
Ken Sharp <ken.sharp@artifex.com>
8e912ff13757dcff888319f78c05297b4fde8359
pdfwrite - fix 2 memory leaks with metadata
Discovered with pdfi. There is a temporary buffer which wasn't being
freed.
A more complex problem involves the Metadata value stored in the
Catalog dictionary. A long comment describes why this is not freed as
an 'otherResource', but experience contradicts the comment, the
Metadata value is not freed along with the Catalog object.
I've altered this here to solve the memory leak but this may need more
investigation.
2020-11-23 01:10:54 +0000
Robin Watts <Robin.Watts@artifex.com>
437c020e8f99f429b3b95f11c47ef452b7da287b
LGTM fixes: Rejig gs_type1_interpret to avoid backward gotos.
2020-11-23 00:27:52 +0000
Robin Watts <Robin.Watts@artifex.com>
63fc05354eae86931f5949086b1b11641f3e23c0
LGTM: fn_PtCr_evaluate: Simplify gotos.
All gotos are now forwards.
2020-11-20 00:28:58 +0000
Robin Watts <Robin.Watts@artifex.com>
c5ae96a828fa459c0093c578ddbfefe0ce0da5de
Rework cf_decode_2d to minimise gotos.
2020-11-19 19:26:22 +0000
Robin Watts <Robin.Watts@artifex.com>
0d6498f19173bf3213c289e3e4480e7eb0ee9868
Reduce use of goto within cf_decode_1d.
All gotos are now forwards. Hopefully this should assuage LGTM.
2020-11-21 12:26:40 +0000
Ken Sharp <ken.sharp@artifex.com>
42ab76c9eb52d5c7dd5f96e0bbee495b84c9d3de
First Page/Last Page - fix a memory leak
This doesn't exhibit on regular Ghostscript due to garbage collection,
noticed it while running a Memento build of pdfi to track down a
different memory leak.
We allocate the enumerator in flp_begin_typed_image() and so we need
to free it in flp_image_end_image.
2020-11-20 11:45:50 -0800
Michael Vrhel <michael.vrhel@artifex.com>
bd48c43be5f736393372dffbad627ed6fc486238
Bug 703164: Endian issues with CMM
The interface code to the CMM was corrected to indicate when a
endian swap was needed on the data. This should only occur
in the case when we are dealing with transparency buffers
during the put image blending operation that may include
a color conversion. The final blend bakes the data as BE
so if we are on a LE machine, the CMM will need to know to
swap the bytes (assuming the pdf14 device is using 16bit buffers).
The code was rewritten to make it clear that this setting is no
BE vs LE but simply an endian swap. That was a source of confusion.
Revealed in this testing was the lack of some proper error
reporting during buffer conversions, which were fixed.
2020-11-20 16:01:33 +0000
Robin Watts <Robin.Watts@artifex.com>
bccfeb0626074ca7cf2a60b194509b8b94b38327
Memento: Workaround VS2008 not having va_copy.
2020-11-20 15:34:54 +0000
Robin Watts <Robin.Watts@artifex.com>
e2e50a951f3f06c48d908ea8f095e2d7ae2ee5e9
Bug 703161: Fix unknown error when interpolating transparent imagemasks.
Patch from Alex Cherepanov.
Add a dev_spec_op to check for whether copy_alpha is disabled or not.
Clist devices with transparency disable it. Use this to bolster the
decision made in mask_suitable_for_interpolation.
2020-11-20 12:35:59 +0000
Julian Smith <julian.smith@artifex.com>
86ed012049f58ef01d02c18b8f16c6f343be30db
demos/python: removed old unused code.
2020-11-19 19:08:04 +0000
Robin Watts <Robin.Watts@artifex.com>
e83bc652ee4776b2c51878267f1c6f5aef0447db
LGTM: Suppress warnings about gotos.
In these functions, for implementing state machines, gotos are
inevitable.
2020-11-19 18:43:25 +0000
Robin Watts <Robin.Watts@artifex.com>
cae348d95825d65319a5127f39a954bf68de9ca3
Rejig dict_find so that gotos are all forwards.
Hopefully this will make lgtm happier.
2020-11-19 17:50:04 +0000
Robin Watts <Robin.Watts@artifex.com>
5e23e7e9daab8498db642fc8ac241ba7f00a157b
LGTM: Attempt to avoid "Expression has no effect" warnings.
Some calls may be NOPs in the lgtm tests, but might not be in
other builds. Attempt to label them as such.
Possibly we may need to label the call sites rather than the
functions themselves.
2020-11-19 13:26:12 -0800
Nancy Durgin <nancy.durgin@artifex.com>
905dc88bb9fb75e39dd81ff0268215a1305d94c0
Change init values of PreserveEPSInfo and ParseDSCCommentsForDocInfo
This is needed for pdfi.
The docs (VectorDevices.htm) say these will defaulted to 'true' and
the gs/PostScript code sets them to true, but they were initialized to
false in the device itself.
The only place these variables are actually used is in
pdf_document_metadata() where they are tested to decide whether to
emit the Metadata.
This change makes no difference for gs and gs/pdf, but it will cause
gpcl to start including Metadata in its pdfwrite output.
2020-11-17 11:24:28 -0800
Ray Johnston <ray.johnston@artifex.com>
385c2f5d06ec9f99be83d64e83b05296caa20051
Fix bug 703142: typecheck error caused by Length value with decimal point
Thanks to Peter Cherepanov for this patch.
2020-11-17 17:55:48 +0000
Robin Watts <Robin.Watts@artifex.com>
c1a5382ab783cbae9fd5e069abcc89cb4195e89a
Bug 703027: Tweak previous fix.
The previous fix was incomplete; the bounds for the overflow
check were incorrect. Corrected here.
2020-11-17 13:32:10 +0000
Robin Watts <Robin.Watts@artifex.com>
658ddea8bc15f4ab7dd4cf1ff151828b9ce957f9
Bug 703027: Avoid Infinite loop.
The problem here is that the scale is so large that the width
overflows what will fit in an int, and becomes negative.
Harden the code by watching for such overflows, and abandoning
interpolation if this happens.
2020-11-17 11:47:31 +0000
Robin Watts <Robin.Watts@artifex.com>
0716daba34064520c2ae0a49edb88095aaceac3c
Update makefiles for new nmake version.
2020-11-15 19:59:15 -0800
Ray Johnston <ray.johnston@artifex.com>
f82f5a5e381f18a76d7099611202a281e61f343f
Fix bug 703088. ASAN reports read outside allocated buffer of an image.
There was an area in gx_begin_image3_generic setup for bug 700538 to
detect rangecheck but it did not check all extremes. Note that this
stems from an absurd CTM in the PDF: 548.0 0 0 -1.43262569e+37 0 0 cm
2020-11-16 16:13:53 +0000
Robin Watts <Robin.Watts@artifex.com>
0e2d58de146abc7bbb5b4f420086b57e500e9181
Fix lgtm issue: int * int used as a size_t.
int * int can overflow, before being promoted. Best to promote one of
the ints to a size_t before the operation, so we don't lose any bits.
2020-11-16 15:37:00 +0000
Robin Watts <Robin.Watts@artifex.com>
8acc8cf60d99cbd6c9da7c7fd7c2636b09e70624
Tweak memento.c handling of memento.h header.
Intended to remove differences between all the different versions
of memento.
Rather than manually editing memento.c as we copy it between
gs/mupdf/extract we now have a MEMENTO_MUPDF_HACKS define to
enable the mupdf specific changes (currently just where we find
the header file).
2020-11-16 15:10:51 +0000
Robin Watts <Robin.Watts@artifex.com>
b06da3dc08682c57001b3686af38eee0a49cb407
Bug 703146: Fix assert in scan converter.
This is caused by lines changing in x position by more than 1<<31,
and hence the sign bit of an int being confusing. (e.g. the difference
between 0x7fffffff and 0x80000000 is positive, but appears negative
when held in an int). Use an unsigned int instead.
This doesn't affect normal operation as the value is promoted to an
int64_t before being used.
2020-11-16 10:32:06 +0000
Julian Smith <julian.smith@artifex.com>
1f56cb0a80f9c0485ff224831c4db497da647c0a
base/memento.c: fix coverity warnings about need to call va_end().
We now call va_end() for each va_list that we create with va_start() or
va_copy().
We don't call va_end() for va_list's that are passed in as a function
argument.
2020-11-13 22:39:26 -0800
Michael Vrhel <michael.vrhel@artifex.com>
07ff645bd83474f01c4fdb658df04f2626bafd7d
Bug 702952: Minor fixes to conversion to V2 ICC Profile
The byte padding calculation was wrong and the padded bytes
were being left uninitialized. In addition, the profile dump
debug code had bit-rotted.
2020-11-13 16:45:31 +0000
Robin Watts <Robin.Watts@artifex.com>
f0e2607a2c31f71a469c993b7c6c76db900ca5b1
Update Memento to match MuPDF and Extract.
Mostly this is pulling in enhancements from Julian Smith.
2020-11-13 09:02:07 +0000
Ken Sharp <ken.sharp@artifex.com>
2f585295725c43827544352852a8ed2a357395b9
Fix Coverity ID 363850
Correct a return to actually return a value (no match found).
2020-11-12 15:12:07 +0000
Ken Sharp <ken.sharp@artifex.com>
6b1ee0c65a8caf8f81d2534402af945d2916feb7
pdfwrite - fix OCR processing
We were not correctly updating the operation and size variables after
we had captured the bitmaps leading the code to error out and drop
content.
Also, if the OCR engine initialisation fails, don't throw an error,
just do nothing. Throwing an error results in us falling back to
rendering the text as bitmaps.
2020-06-25 13:56:08 +0100
Ken Sharp <ken.sharp@artifex.com>
75e260886473a74a8d8ec133b0bae9fdee30818b
Squashed commit of pdfwrite_ocr branch.
This introduces OCR operation to the pdfwrite device.
The full development history can be seen on the pdfwrite_ocr branch.
The list of individual commits is as follows:
--------------------------------------------
Interim commit for pdfwrite+OCR
This is the initial framework for pdfwrite to send a bitmap of a glyph
to an OCR engine in order to generate a Unicode code point for it.
This code must not be used as-is, in particular it prevents the function
gs_font_map_glyph_to_unicode from functioning properly in the absence
of OCR software, and the conenction between pdfwrite and the OCR engine
is not present.
We need to add either compile-time or run-time detection of an OCR
engine and only use on if present, as well as some control to decide
when to use OCR. We might always use OCR, or only when there is no
Glyph2Unicode dictionary available, or simply when all other fallbacks
fail.
--------------------------------------------
Hook Tesseract up to pdfwrite.
--------------------------------------------
More work on pdfwrite + OCR
Reset the stage of the state machine after processing a returned value
Set the unicode value used by the ToUnicode processing from the value
returned by OCR.
Much more complex than previously thought; process_text_return_width()
processes all the contents of the text in the enumerator on the first
pass, because its trying to decide if we can use a fast case (all
widths are default) or not.
This means that if we want to jump out an OCR a glyph, we need to track
which index in the string process_text_return_width was dealing with,
rather than the text enumerator index. Fortunately we are already
using a copy of the enumerator to run the glyph, so we simply need
to capture the index and set the copied enumerator index from it.
--------------------------------------------
Tweak Tesseract build to include legacy engine.
Actually making use of the legacy engine requires a different set
of eng.traineddata be used, and for the engine to be selected away
from LSTM.
Suitable traineddata can be found here, for instance (open the link,
and click the download button):
https://github.com/tesseract-ocr/tessdata/blob/master/eng.traineddata
--------------------------------------------
Add OCRLanguage and OCREngine parameters to pdfwrite.
--------------------------------------------
Add gs_param_list_dump() debug function.
--------------------------------------------
Improve use of pdfwrite with OCR
Rework the pdfwrite OCR code extensively in order to create a large
'strip' bitmap from a number of glyphs in a single call to the text
routine. The hope is that this will provide better context for
Tesseract and improved recognition.
Due to the way that text enumerators work, and the requirement to exit
to the PostScript interpreter in order to render glyph bitmaps, I've had
to abandon efforts to run as a fully 'on demand' system. We can't wait
until we find a glyph with no Unicode value and then try to render all
the glyphs up to that point (and all the following ones as well). It is
probably possible to do this but it would mean rewriting the text
processing code which is quite hideous enough as it is.
So now we render each glyph in the text string, and store them in a
linked list. When we're done with the text we free the memory. If we
find a glyph with no Unicode value then on the first pass we take the
list of glyphs, create a big bitmap from them and send it to Tesseract.
That should then return all the character codes, which we keep. On
subsequent missing Unicode values we consult the stored list.
We need to deal specially with space glyphs (which make no marks) as
Tesseract (clearly!) can't spot those.
Modify makefile (devs.mak) so that we have a preprocessor flag we can
use for conditional compilation. Currently OCR_VERSION is 0 for no OCR,
1 for Tesseract, there may be higher numbers in future.
Add a new function to the OCR interface to process and return multiple
glyphs at once from a bitmap. Don't delete the code for a single bitmap
because we may want to use that in future enhancements.
If we don't get the expected number of characters back from the OCR
engine then we currently abort the processing. Future enhancements;
fall back to using a single bitmap instead of a strip of text, if we get
*more* characters than expected, check for ligatures (fi, ffi etc).
Even if we've already seen a glyph, if we have not yet assigned it a
Unicode value then attempt to OCR it. So if we fail a character in one
place we may be able to recognise it in another. This requires new code
in gsfcmap.c to determine if we have a Unicode code point assigned.
Make all the relevant code, especially the params code, only compile
if OCR is enabled (Tesseract and Leptonica present and built).
Remove some debugging print code.
Add documentation
--------------------------------------------
Remove vestiges of earlier OCR attempt
Trying to identify each glyph bitmap individually didn't work as well
and is replaced by the new 'all the characters in the text operation'
approach. There were a few vestiges of the old approach lying around
and one of them was causing problems when OCR was not enabled. Remove
all of that cruft here.
2020-11-11 15:34:31 -0800
Ray Johnston <ray.johnston@artifex.com>
8aa60c55d789c9c4d9e600162a1233a2da7ba516
Fix bug 703125: -dNOINTERPOLATE leaves 'true' boolean on the stack.
Thanks to Peter Cherepanov for spotting this. This patch is slightly
different to his in that it makes -dNOINTERPOLATE=false enable interpolation
at the default level (the original patch and the old code would have
disabled interpolation even with 'false'. This version makes the NOINTEPOLATE
and DOINTERPOLATE options operate more symmetrically, however it is sort of
moot since both of these options are intended to be replaced by the better
control on image interpolation provided by -dInterpolateControl=#
Operation tested with fts_17_1712.pdf using the various command line options.
2020-11-10 23:38:08 -0800
Michael Vrhel <michael.vrhel@artifex.com>
7d1f774ccf8d3c96dc9a40d317e1448cb5a6475a
Bug 701804: Fix for device that causes buffer overflows
This contributed device is odd how it changes its color model.
Unfortunately it does not change the ICC profile. This mismatch
between the ICC profile and the color information that is
being changed by the device causes all sorts of problems. This
should fix the issue.
2020-11-11 12:22:39 +0000
Robin Watts <Robin.Watts@artifex.com>
d3a0d4c4c5e6c7c1662094500f25c11b27016268
MSVC: Add sanitize configurations/targets.
While we have 64bit configurations, these will only work for 32
bit builds at the moment, due to MSVC not supporting 64bit builds.
2020-11-10 13:00:49 +0000
Ken Sharp <ken.sharp@artifex.com>
c2fa28dbaa4c238eba4c8236d7da3a12113b734c
PDF interpreter - fix searching for missing Resources in parent object
Bug #703105 "PDF file gives "Unable to determine object number..." and output is missing some images."
As per the bug thread; the PDF file has annotations which are deeply
nested forms. The final form stream draws an Image XObject but the
Form dictionary does not contain a /Resources dictionary so we are unable
to resolve the name.
The form which calls the final form *does* define the missing XObject,
this is pretty clearly illegal but Acrobat copes with it. In fact the
Ghostscript PDF interpreter has code to deal with it too, but there
was a bug in it, it pops an object that was never pushed, resulting in
the code being unable to find the resource.
Fixed very simple here. Also uploaded the simplified file for this bug
and the file for the original bug (700493) to the test repository.
2020-11-09 15:39:41 +0000
Julian Smith <jules@op59.net>
9a7452d624e9ef8f284869a2943b3751ecb6dbd6
toolbin/localcluster/clusterpush.pl: exclude extract's src/build.
2020-11-09 13:53:46 +0000
Robin Watts <Robin.Watts@artifex.com>
5a3812294b479fbae21e7d0fa3e1c6e0887fe51e
api_test: Simplify pointer hiding.
We can get pointer reuse that can vary from run to run, so we
resort to just using null/non-null pointer hiding.
2020-11-09 13:31:23 +0000
Ken Sharp <ken.sharp@artifex.com>
40d306bf6707c365996eb1d41782ca3f063311d0
ps2write - fix use of /.HWMargins with ps2write output
Bug #703017 "When print a file created with pdf2ps command with a PDF driver, the image shifts to the upper right as the number of pages increases."
The bug report here is, unfortunately, insufficient to duplicate and
resolve the problem. The missing information was supplied quite
independently by the user 'vyvup' on the #ghostscript IRC channel. See
the #ghostscript logs at around 08:45 on November 9th 2020.
https://ghostscript.com/irclogs/20201109.html
The important missing information is that the device must have the
Ghostscript-specific page device key /.HWMargins set. When this is set
and has non-zero values the offsets are applied cumulatively on every
page by the code in pdfread.ps. This is because we set up the page
'view' before we save the current setup in the ps2write dictionary
under the 'pagesave' key. When we restore back to that at the end of the
page it therefore does not remove the translation applied to account
for the /.HWMargins.
Here we just shift the save so that it occurs before we apply the page
size setup.
2020-11-07 13:14:06 -0800
Ray Johnston <ray.johnston@artifex.com>
cceb68900b433e7ce518619b9dd2ceb01c4fed9d
Fix bug 688166. EPS DSC comment processing not terminating properly.
The example files of this bug do not have %%EndComments before other
BoundingBox comments which confuse the image placement logic resulting
in a blank page.
This patch, provided by Peter Cherepanov, fixes the problem by stopping
the DSC processing when (%%BeginProlog) (%%BeginSetup) or %%EndComments
is encountered.
Cluster regression passes, showing only 1 file that rotates differently
when -dEPSFitPage is used (just to insure that DSC processing is OK).
2020-11-06 16:31:11 +0000
Robin Watts <Robin.Watts@artifex.com>
abe5348a1de7793a5d4d6ecfa4d054e5f94731de
apitest: Hide pointer values in output.
This should enable the runtests values to be consistent.
2020-11-06 11:18:47 -0800
Michael Vrhel <michael.vrhel@artifex.com>
2f6d9adb2e1cf6d7043c1de6168fee42dcb2cb8f
Bug 702005 : rectfill and transparency
If we end up in the rectfill operation and we have transparency
make sure that we take the path that uses gs_fill to ensure that
pdf14_fill_path is executed, which will update the marking parameters.
2020-11-07 00:33:46 +0800
Sebastian Rasmussen <sebras@gmail.com>
63281fa98f6df0864315a9fc78ef436a6d96f90a
jbig2dec: Add casts to silence a compiler warning.
2020-11-05 21:24:13 -0800
Michael Vrhel <michael.vrhel@artifex.com>
2a427e4dfb0b74f121b846e7d08e8c80db0f5f37
Bug 703087: CIEBased color space with overprint
If the source space is CIEBased PS type, then be
sure to use the equivalent ICC color space in
determining the overprint drawn components.
2020-11-05 12:40:00 -0800
Nancy Durgin <nancy.durgin@artifex.com>
0132ddfb73e316303fe382aed939f1145052d15c
Bug 703086 -- Disable trying to preserve Movie annotations
Movie annotations are not implemented. This fix just disables the attempt to
preserve them, so that the pdfwrite output will be valid.
This file has a /Movie annotation that references a local file that
isn't included in the PDF, so it will never play properly anyway.
The annotation tries to reference a stream in its /Poster entry (for
the image preview of the Movie), and this was not being handled
correctly.
2020-11-03 22:00:17 -0800
Ray Johnston <ray.johnston@artifex.com>
bdf7cf8b6c7c97531aac14e16b9d2c16775ae8c8
Fix Bug 702034. Missing image to DeviceN devices.
The file from Bug 693300 has a blank image when going to DeviceN devices
such as psdcmyk and tiffsep. The CompatibleOverprint blend mode must be
set before the transparency group is pushed.
Add a .special_op for SupportsDevn to let the PostScript PDF interpreter
detect that the device supports separations.
Make sure the mark fill rect for the knockout case handles
the hybrid case of additive process colors with subtractive spots
and overprint.
And make sure the group that is pushed in gstrans.c for text knockouts
uses compatible overprint if needed.
Ray did the PS parts and Michael did the pdf14dev parts.
2020-11-04 09:10:26 +0000
Ken Sharp <ken.sharp@artifex.com>
e6d34e7d08dac91b5b3b858c23e186a0d3bcbefc
pdfwrite - Fix potential seg faults with ColorConversionStrategy
Bug #702885 " ICC profile management can lead to a crash due to lack of reference counting of profiles" ICC profile management can lead to a crash due to lack of reference counting of profiles
See the bug report for details, this commit removes the dereference of
the ICC profile as recommended by Michael in that thread.
2020-11-03 15:21:46 +0000
Robin Watts <Robin.Watts@artifex.com>
10036de9c385d900f2ec0312908954ab77664438
Update clusterpush.pl for extract jobs.
2020-11-03 09:24:37 -0800
Ray Johnston <ray.johnston@artifex.com>
b4c9f0004f950a7f55fff5777c6fa0d74d1f54bd
Fix bug 702957, 702971. PageList problems with PDF input files.
Thanks to Peter Cherepanov for this fix.
The page skipping was caused by not disabling the PageHabdler in
even or odd page selection modes due to a typo (Pagelist instead of
PageList). The PDF interpreter fed only the odd (or even pages),
and then the PageHandler also skipped every other page.
Also correct log messages and associated operand stack mess-up.
2020-10-31 18:38:51 -0700
Ray Johnston <ray.johnston@artifex.com>
3f191b620de1b1cdead14305aac09ad49340828f
Fix another SEGV with BGPrint due to device_unsubclass
The printer device needs to have the bg_print structure external to the
device so that when the device is freed the bg_print communication area
shared with the thread doesn't get freed. This is similar to the clist
band_range_list issue.
The SEGV was seen with 15-01.BIN as it unsubclasses the PCL_Mono_Palette
gs_pcl_mono_palette_device device.
2020-10-31 10:48:22 -0700
Ray Johnston <ray.johnston@artifex.com>
8df410c269150bce143d3b8875ac9d60a013d206
Set orig_spec_op for printer class devices so it forwards properly.
2020-10-29 15:15:00 -0700
Ray Johnston <ray.johnston@artifex.com>
2c5a8a34dd741936469f0500cfebe364d8a1fdc3
FIx SEGV with gx_device_unsubclass when child is a clist device.
The 'band_range_list' was a structure of two pointers within the device
(gx_device_clist_writer) so when it was copied, the 'ccl' pointer could
point to the band_range_list structure in the child device. This pointer
would no longer be valid when the child device was freed as the device
unsubclass did.
Detected with 15-01.BIN as it called gx_device_unsubclass for the PCL_mono
subclass device. With -Z@ the band_range_list would be overwritten with
(known, but invalid pointer) data resulting in the SEGV.
Cured by putting the band_range_list into the clist_writer 'data' area.
This area is not GC'ed and since it points into other memory in the
clist writer 'cbuf' area, it is internal to the clist writer.
2020-09-26 20:45:48 -0700
Ray Johnston <ray.johnston@artifex.com>
9848e66c0687645ed533e50557c233bf196ec9b9
Make gs_next_ids thread safe by using the core->monitor.
This cures data races with gs_next_ids seen with helgrind and BGPrint
and/or NumRenderingThreads.
2020-09-26 18:36:16 -0700
Ray Johnston <ray.johnston@artifex.com>
eec6fd158ee477facfb4bf9edd4e99506c195732
Pacify helgrind so that gs_heap_status is thread safe.
The 'heap_available' is documented as a 'snapshot', but is not a
thead risk. This change locks around the collection of the info to
be returned in the gs_memory_status structure.
2020-09-15 08:51:08 -0700
Ray Johnston <ray.johnston@artifex.com>
13ed12281b6b60804172a6844081a9ea3e067d2d
Fix problem with BGPrint and multi-threaded rendering caused by commit cca27988
The unconditional call to enable multi-threaded rendering during set up of the
gx_device_printer as a clist caused the SEGV of bug 702181, but enabling
multi-threaded rendering here isn't correct since it is usually done when we
output the page (gdev_prn_output_page_aux). The problem is that BGPrint would
setup a new clist device to render the page, but needs to enable multi-threaded
rendering for the background clist device. Do this if NumRenderThreads > 0.
2020-09-22 13:10:04 -0700
Ray Johnston <ray.johnston@artifex.com>
4ceaf92815302863a8c86fcfcf2347e0118dd3a5
Fix gp_file allocations to use thread_safe_memory.
The gpmisc.c does allocations for gp_file objects and buffers used by
gp_fprintf, as well as gp_validate_path_len. The helgrind run with
-dBGPrint -dNumRenderingThreads=4 and PCL input showed up the gp_fprintf
problem since the clist rendering would call gp_fprintf using the same
allocator (PCL's chunk allocator which is non_gc_memory). The chunk
allocator is intentionally not thread safe (for performance).
2020-10-28 12:17:23 -0700
Michael Vrhel <michael.vrhel@artifex.com>
033ed8bf196b1cddd681a9b32d9398bf6bc02d24
Bug 702671: Make sure X11 device cleans up with closure
The issue is that the pdf14 device will close and reopen the
target device under certain cases and the X11 devices were not
cleaning themselves up sufficiently. Also added a finalize
method where the call to XCloseDisplay should actually be made.
The pdf14 device does this close and open dance to ensure that
the page_has_transparency parameter will be set in the device.
It is possible that we could end up in the pdf14 device
push without page_has_transparency if the call is done from
Postscript code. The PDF interpreter
always sets the page_has_transparency value before doing the
push so this should not be a problem with PDF.
Thanks to Chris Liddell for helping with this.
2020-10-29 10:43:46 -0700
Nancy Durgin <nancy.durgin@artifex.com>
36568c21f45ed0686abec8316f56bc171ab416a8
Add /Type /Outlines to Outlines entry for pdfwrite
This is technically required, but appears to be harmless to omit it.
However, since the fix is trivial, I have fixed it.
2020-10-29 15:49:11 +0000
Chris Liddell <chris.liddell@artifex.com>
14a3807f1a13d7a4fed1b1ef24852d55a4361431
Fix ios build script and headers
The predefined headers for the ios build were missing the size_t updates.
We also don't want to try using CAL with ios (at least, for the moment).
2020-10-28 17:07:20 +0000
Chris Liddell <chris.liddell@artifex.com>
10ff34748a56d521b5a901c11edb4b6408a2860a
Fix an option typo: "nonredundnat" -> "nonredundant"
2020-10-28 15:31:28 +0000
Ken Sharp <ken.sharp@artifex.com>
ddd5cf4ddcfba1a3e85708b75efa0d8f8f4156f6
pdfwrite - fix Type 4 Chroma-keyed images with Colour Conversion
Bug #702698 "convert Grayscale error in output"
Images with a /Mask where the Mask is a range of values, and hence a
chroma-keyed image, as opposed to the Mask being an external Image
Mask, and therefore a stencil cannot be preserved as such when we are
colour converting.
There is no reliable way to be certain that the colour of the image
samples after conversion and the converted Mask values will relate in
the same way. Its entirely possible for multiple RGB values to map to
the same gray value for instance, and if that happens to be a masked
value then pixels will be masked which were not originally.
This commit checks the ColorConversionStrategy and if it is not
LeaveColorUnchanged then we further examine the Mask. If the Mask is a
range of values then we consider the colour space of the image.
If ColorConversionStrategy is not LeaveColorunchanged and the image has
a range of values and it is not in the target colour space, then we
cannot preserve it. In this case we fall back to either preserving the
image, and creating a clip path from the chroma key and the image
samples, or (if Version < 1.3) we fall right back to writing each image
sample as a filled rectangle.
This does, of course, result in larger output.
2020-10-13 08:16:11 -0700
Ray Johnston <ray.johnston@artifex.com>
81ed663a4a81a265afecbc7b7c7835ba4f5f24e1
Change default ShowAcroForm to true to match Adobe Acrobat.
Change it and the documentation. It may be that older Acrobat defaulted to
ignoring AcroForm, but current Adobe doesn't.
Also fix pdf_draw draw_form_field to match check in pdf_main process_trailer_attrs
for the file from Bug 692447 which has null entries in Fields array.
Fix indentation in pdf_main process_trailer_attrs area that processes
AcroForm dict.
2020-10-17 12:52:36 -0700
Ray Johnston <ray.johnston@artifex.com>
8313e4f30bef7c50711cd503c3037184a7850d51
Fix Bug702995: Inconsistent auto-rotation of EPS with EPSFitPage.
We need to defer the EPSFitPage scaling, centering and rotation until
after both the the %%BoundingBox and/or the %%HiResBoundingBox have been
processed. Doing one after the other results in slight rounding diffs
depending on the resolution. Change to save the value (prefering the
HiResBoundingBox) and do the scaling/translate/rotate only once when
%%EndComments is processed.
2020-10-13 08:21:05 -0700
Ray Johnston <ray.johnston@artifex.com>
76359f0c03e8b4d8db7359d521865894ac7a4592
Fix bug 702951. Valgrind error in image_render_interpolate_landscape_icc
Make the same adjustment in image_render_interpolate_landscape_icc() as
was done in image_render_interpolate_icc() by the commit a936cf76.
Thanks to Peter Cherepanov for this bug report and the patch. Regression
testing looks fine and the previous code looks like it would bump the
p_cm_interp value twice in some cases previously.
2020-10-23 08:54:02 +0100
Chris Liddell <chris.liddell@artifex.com>
9cdacf4e5efcf7b92ff7a02158a47ac04cc12fa7
Revise font dir global_glyph_code callback API
The global_glyph_code callback API relies on the name table being avaiable in
the gs_lib_ctx and accessible via the gs_memory_t object.
This is not something that is true, nor can we make it true, for pdfi. Because
pdfi is required to integrate with the Postscript interpreter, we cannot have
the gs_lib_ctx "top_of_system" pointer point to the pdfi context.
So, change the global_glyph_code API so it takes a gs_font pointer, instead of
a gs_memory_t pointer. The Postscript implementation will work exactly the same,
just accessing the gs_memory_t through the gs_font pointer.
But it allows pdfi to grab it's own context through the gs_font "client_data"
pointer.
2020-10-20 11:20:45 +0100
Chris Liddell <chris.liddell@artifex.com>
17cec404918eb458b63aba71fe680264f2a00179
Update freetype to 2.10.4
Also includes:
Work around a change in the zlib API for 1.2.11
where it's used in the Freetype/zlib interface debugging code.
2020-10-21 16:11:23 -0700
Michael Vrhel <michael.vrhel@artifex.com>
660aa7a7eaeca446d97332ae1655a3612c9bcfe6
Add error check on gx_device_text_begin return_error
gx_device_text_begin may return an error if there is still
work to be done on a pattern device. Catch that before
the check on *ppte, which will not be a valid value in this
case.
2020-10-22 17:20:11 +0100
Ken Sharp <ken.sharp@artifex.com>
7670751b807e369e4bb768cce2812a8d8719b8fa
Fix typos in comments of zugferd program
As (mostly) spotted by Lisa Fenn, fix comments in typos and messages.
2020-10-21 19:20:43 +0100
Robin Watts <Robin.Watts@artifex.com>
b231780b739720451e8d6517b2e97a07908b7469
lcms2: automatically align blocks appropriately on sparc.
The sparc architecture requires pointers within structures to
be at 64bit alignment, even if they are 32bit pointers.
LCMS2 allows for this by having a CMS_PTR_ALIGNMENT symbol
that can be predefined. If it's not predefined, it defaults to
sizeof(void *).
We update the source here so that when building for sparc, it
defaults to 8. This shouldn't affect gs, as it sets the value
via configure/make. I believe our lcms2 repo as used in MuPDF
is autogenerated from this though, and this will help us there.
2020-10-20 12:38:24 +0100
Robin Watts <Robin.Watts@artifex.com>
337be82addaaf8740b60e2a0cf354ae96d46468f
Correct OCR docs for multiple languages.
2020-10-20 09:49:45 +0100
Chris Liddell <chris.liddell@artifex.com>
41ef9a0bc36b9db7115fbe9623f989bfb47bbade
Bug 702985: drop use of FT_CALLBACK_DEF() def
From 2.10.3, Freetype disappeared the FT_CALLBACK_DEF() macro, which is what
we used when defining our callbacks from Freetype.
No guidance forthcoming from the Freetype developer who made those changes,
so change to explicitly declaring the callbacks file static.
Should fix the reported build failures.
2020-07-31 11:07:18 +0100
Julian Smith <jules@op59.net>
3b2f9c53c8e5cebcf80a4158684b820d9a0a2f73
devices/vector/gdevtxtw.c: updated extract output to match mupdf.
Text extraction now works for Python2.pdf and zlib.3.pdf.
Added GlyphWidths[] and SpanDeltaX[] arrays, containing information required
for generating intermediate format used by extract system.
2020-07-30 13:09:51 +0100
Julian Smith <jules@op59.net>
de5cb392ad32d4e44646b144f435ad186f3dbabe
doc/VectorDevices.htm: added brief info about txtwrite TextFormat=4.
2020-10-19 16:34:32 +0100
Robin Watts <Robin.Watts@artifex.com>
5c115ea0d27640b2a3940410c6eeef9e7d17f178
Fix indeterminisms within halftoned rendering.
When checking for pdf14 being in an opaque state, we check to see
whether we are either constructing an SMask or are within an
SMask. We need to use a dev spec op for this, as we might be within
a clipper device, and so not actually be directly a pdf14 device.
2020-10-19 11:24:15 +0100
Ken Sharp <ken.sharp@artifex.com>
5fc95757e3f732d5806a9a74967d70571eec91db
New file - program to assist in creating ZUGFeRD electronic invoices
While documenting the process for creating a ZUGFeRD invoice from a PDF
file and an XML invoice it became clear to me that it was beyond any
reasonable expectation of a user to be able to use it unaided. So this
program assists in the creation of a ZUGFeRD document.
The program requires two command line parameters; -sZUGFeRDProfile=
which contains a fully qualified path to an appropriate (correct colour
space) ICC profile, and -sZUGFeRDXMLFile= which contains a fully
qualified path to the XML invoice file.
Example command line is in the comments, and a usage message if the user
fails to provide either of the required elements. Obviously the user
must also set -dPDFA=3 and -sColorConversionStrategy in order to create
a valid PDF/A-3b file.
2020-10-14 11:28:56 -0700
Michael Vrhel <michael.vrhel@artifex.com>
23afb36c6d8c5368a7df09718b872f83c510cab7
Bug 702891 and Bug 700593 Fix pdf14 device color procs
The pdf14 color mapping procs clearly had some issues as they are reading uninitialized
memory and using transfer functions that would not make sense with changing
color spaces. Also, the soft mask should not be going through the effective_transfer.
It has its own transfer function to deal with. Careful reading of the PDF spec revealed
that the transfer function is only to be used if the color being drawn is opaque. It
states that this is true if the blend mode is normal, stroke and fill alpha are 1.0, and
no soft mask is present. Also, an image that has a soft mask does not use the transfer
function. These changes resulted in a lot of diffs. I reviewed them and
did some checking of color values to verify things are ok.
2020-10-14 15:05:04 +0100
Ken Sharp <ken.sharp@artifex.com>
fceb46d81b0277b335481368dcc5a62e6383575e
PDF interpreter (with pdfwrite) - another non-square scaling stroke fix
Bug #702946 "Ghostscript creates PDF originals with black stripes"
This is another case of the problem in bug #702900, The commit to fix
that problem (d5494de2cab28b91ba360d15b8afffef50a3f421) fixed four
places in the code, but missed a fifth place because it is distant from
the other four. The offending procedure is setstrokeforTrpreservation.
This commit adds the required code to that location to go along with the
other four, at the same time:
1) Move the actual code to calculate the width into a procedure
2) Have all 5 places use that procedure
3) Improve the non-square calculation (hypotenuse/2 instead of hypotenuse)
4) Add some 'tolerance' to the equality test.
The tolerance is because both the test file here and in 702900 have a
CTM which is minutely non-square. In this case the c and y scaling
differ by less than 0.0001. The intention of this code is actually to
deal with non-square resolutions, rather than non-square CTM, and it
does so by calculating the hypotenuse of a triangle where the x an y
values are the linewidth in each direction. In fact the hypotenuse/2
seems a closer approximation. But in any event its incorrect, better to
simply use the linewidth if the difference between the two is not very
large. (eventually, with pdfi, we will probably do away with this
horrible kludge entirely)
This causes minor but useful progressions in the test suite files
Bug695841.pdf, clipping_image_problem.pdf and
sumatra/712_-_image_not_displaying.pdf. most notably the latter.
It also produces slightly less bold output for the test file here,
which Acrobat shows as matching precisely with the original.
2020-10-07 17:41:36 +0100
Chris Liddell <chris.liddell@artifex.com>
c6ce09aa5c9ed0c66c597478a2c4fb75aa25267f
Revert "Remove deprecated opvp/oprp devices from default build"
This reverts commit 66c2469c7d4543f32d6dc93edf1d649e809b8419.
A user got in touch to say that he maintains a printer driver "back end" that
uses the opvp device. So reinstating it - at least we know it's getting
tested.
2020-10-12 13:19:09 +0100
Robin Watts <Robin.Watts@artifex.com>
5af4f31bcda18c6fb7d14501c0a22697a7f49ac0
Update tesseract traineddata loader with new path search.
First, we look in TESSDATA_PREFIX (if defined).
If not found there, we look in ROMFS (in tessdata).
If not found there, we look at the configured "tessdata" path
(which defaults to ${datadir}/tessdata). (${datadir} defaults to
${prefix}/share on unix, and ${gsrootdir} on windows.)
If not found there, we look in the current directory.
Update doc/Devices.html (and fix some indexing).
2020-10-13 11:05:00 +0100
Ken Sharp <ken.sharp@artifex.com>
848077c4f7b8b9131263b483ba90b05e0ee4e9d2
pdfwrite - reorder code to change evaluation order of image parameters
Bug #702961 "GS produces significantly larger PDFs with same settings as Adobe Distiller"
This is a problem with the interaction of various image parameters. The
relevant options are PassThroughJPEGImages, ColorConversionStrategy and
AutoFilterColorImages.
Because PassThroughJPEGImages is true, we don't set up a compression
filter (we don't want to apply compression to a DCT compressed data
stream). But ColorConversionStrategy is /sRGB, so we then turn off the
PassThroughJPEGImages (we cannot change the colour model and still
pass through the original data, obviously). Ordinarily the compression
chooser would then select a compression based on the result, but
AutoFilterColorImages is false, so the compression chooser is disabled.
The result is that we write uncompressed image data to the file.
By reordering the code so that we check the ColorConversionStrategy
earlier we can turn off PassThroughJPEGImages before selecting the
initial compression which means that this p[articular sequence of
options will then work as expected.
2020-05-26 12:05:46 -0700
Michael Vrhel <michael.vrhel@artifex.com>
02e3169b57724f63ce01c994d39c20647be5c20b
Bug 702192 Map text to black
Map all text to black. This is achieved by altering the
color space to DeviceGray with a fill of black during
gs_text_begin. When gs_text_release occurs, the color space
is restored. This will only occur with the option -dBlackText
and if the text is actually to be drawn.
When going to a raster device, the stroke and stroke fill of
the text is handled with a stroke or stroke fill command.
My original plan of storing the old color spaces and client
color in the text enumerator will not work in this
situation as it the enumerator will have already been
destroyed when the stroke or stroke/fill command occurs.
For this reason I store the old color space information
for the current and alternate color spaces
in the graphic state. The structure holding the information
is garbage collected as it is holding objects that may be
garbage collected. We also need to know if the target
was a high level device like pdfwrite, as that device
will handle the fill AND stroke, and we will need to restore
the color space when we tear down the text enumerator.
gs_text_release needed to have the pgs added as a parameter
to allow the possible release of the blacktext structure
when the text is released from the other languages. This
did not seem to be too big of an issue as gs_text_begin
passes the pgs also. If the pgs is not available, NULL can
be passed, and that is done in several locations.
A new special op was added to let us avoid doing the black
text setting if we are constructing a soft mask. If we did not
do this the mask could result in the loss of the text.
Finally, Type 3 fonts will NOT be affected by this process.
Type 3 fonts are often used for actual graphic logos etc.
Ken Sharp suggested we not have them affected by this setting.
There were also issues with trying to do type 3 fonts in
in that the PDF interpreter does some color space settings
of its state when dealing with type 3 fonts and this put the
interpreter's state out of sync with the graphic library state.
This was tested with a forced setting of black text enabled.
No seg faults or errors occurred. There were obviously a lot
of differences reported (over 33,000). All the images that were available
to me with bmpcmp were gone through. Problems were found
and addressed (the soft mask issue for example was found,
as were issues with color spaces not getting properly restored).
2020-10-12 16:10:30 +0100
Ken Sharp <ken.sharp@artifex.com>
1ff2ddac001612df3d54b504b49f6ee8e0685be7
PostScript interpreter - add a new IdiomSet for PPI 'ColorUtils'
Bug #702964 "EPS file hangs with pdfwrite"
This is not related to the hang, but to the remaining problem with this
file and pdfwrite.
When using pdfwrite with PassThroughJPEGImages the output is incorrect.
The reason is that the PostScript program processes the JPEG compressed
data, turning a 4-component CMYK image into a single component gray
image.
Obviously if we pass through the original CMYK data, but declare the
image a DeviceGray the result is incorrect.
The only way to deal with this is to turn off the feature. There's no
simple way to do this in pdfwrite (where we normally decide to turn it
off, for downsampling etc) without disabling it for a number of other
useful cases. So instead add a new IdiomSet which replaces part of the
PPI ColorUtils ProcSet with a redefined procedure which turns off the
PassThroughJEPGImages feature if the ProcSet forces Gray output.
2020-10-12 16:05:10 +0100
Ken Sharp <ken.sharp@artifex.com>
447d30a88cf38d623c9afa783ff0a16b98f9e4ff
pdfwrite - Terminate pass-through images when we have read enough data
Bug #702964 "EPS file hangs with pdfwrite"
This is only a partial fix for the bug report, the remaining problem
is addressed in a following commit.
The problem here is that the EPS file includes a ProcSet which processes
the JPEG compressed data. It does so using a procedural DataSource for
the image operator. Unfortunately the procedure fails to spot that
readstring returns 0 bytes and identify this as en EOD. Instead it
continues to try and read data, which continuously fails.
While the cause of the hang is in the PostScript program, it does not
normally exhibit because the image operator ceases to read data from the
DataSource when it has read enough samples to satisfy the declared
Width/Height/BPC. An oversight in the pass-through code meant that the
image operator wasn't properly terminating even when enough data had
been supplied.
This commit correctly returns either 0 (require more data) or not-zero
(enough data read) so that the operator terminates.
2020-10-12 13:18:16 +0100
Robin Watts <Robin.Watts@artifex.com>
d4777d3bfa3fe17297d52eb318b4b93e1b0485b6
Update makefile for tesseract changes.
2020-10-12 08:10:17 +0100
Chris Liddell <chris.liddell@artifex.com>
965f842329e697a945a40ba1ff9a578612bf9f16
Coverity ID 363024: Check gs_sprintf() retrn value
before we use it.
2020-10-07 14:14:37 +0100
Robin Watts <Robin.Watts@artifex.com>
b2a7564bc80f61095e7dd3024f1ce51026366909
Add/remove paths to permit-file-read automatically for tesseract.
2020-10-07 11:50:23 +0100
Robin Watts <Robin.Watts@artifex.com>
1bbd20f2f099c63e5d325979e43182b617e9fb3a
Fix Tesseract build glitches.
2020-10-02 15:03:32 +0100
Chris Liddell <chris.liddell@artifex.com>
9666e6206135b637b7545f074a25969972662252
Squash a compiler warning (uninitialized variable)
2020-10-02 14:52:33 +0100
Chris Liddell <chris.liddell@artifex.com>
5e85cde6eb20fc1f6ae13c69f80cc800cbacf164
"Address" subscript -1 is outside array bounds warning
There is no immediate prospect of resolving the underlying issue: that the
stream code requires the data pointer in the "cursor" to be initialised to the
address one byte *before* the beginning of the actual buffer.
We also do not want to disable the array bounds warning completely, as that
risks missing real mistakes.
So, define a static inline function which does the offending pointer assignment,
and disable the warning locally, for only that function. Then have everywhere
that uses such a buffer setup call that function, rather than do the assignment
itself.
At the moment, it is only disabled for gcc (and compatible) compilers, we can
add others if/as required.
2020-10-01 16:06:31 +0100
Chris Liddell <chris.liddell@artifex.com>
fd902c6702ef81008d7c91b09a0723661c0f9201
oss-fuzz 23946: Move buffer bounds check to *before* using it!
ASCII85Decode filter: We correctly bounds check the buffer size, but dumbly
were doing so *after* we'd used the relevant indices into the buffer. Change
that order, and add another check.
2020-09-17 08:26:44 +0100
Chris Liddell <chris.liddell@artifex.com>
aaeccfffecee65225dabac32689a15a239d01681
Change order of compiler options for third party libs
Move the compiler parameters around so the third party lib specific -I options
come first - hopefully meaning we'll favor any included headers over those in
the system include path(s).
This assumes the compiler searched include directives given on the command line
left to right. Apparently this used to be a problem, I've not found a recent
compiler that breaks that assumption (yet!).
This applies to: expat, freetype, ijs, jbig2dec, jpeg, jpegxr, openjpeg, png
tiff and zlib
2020-09-16 18:58:05 +0100
Julian Smith <jules@op59.net>
978df385c36ee4d65c9144924d0224243a5ebb71
Added PDL_DYNAMIC_LDFLAGS to $host *bsd* section
to match the other platforms.
2020-09-16 18:49:42 +0100
Chris Liddell <chris.liddell@artifex.com>
477d315af46d9a7932108135137adc7aebfc77fe
Use pkg-config to get CFLAGS for libidn
We already get the libs, missing the CFLAGS (mainly the -I) was just an
omission.
2020-09-28 12:54:48 +0100
Chris Liddell <chris.liddell@artifex.com>
c97c4ebb08474e1fbd9a3a6db71da52330f2d67b
Bring master up to date 9.53.x branch
Docs/dates/version for 9.53.3
2020-10-01 10:18:33 -0700
Nancy Durgin <nancy.durgin@artifex.com>
f7646980a69dc3b302b0640220347b9865f49d0e
Fix preserving Line annotations without AP
This only affects the pdfwrite device.
It was rescaling the /L entry for no apparent reason, which meant the
Line annotations rendered incorrectly when they had no AP.
2020-10-01 19:01:33 +0100
Ken Sharp <ken.sharp@artifex.com>
df537046c2130be285b213b5d0478159d1c5b16d
Initialise a variable to silence a compiler warning
2020-10-01 18:01:00 +0100
Robin Watts <Robin.Watts@artifex.com>
dee305c09cb60af041c0cc0b301f5fa8347eccc2
Update makefiles for another version of nmake.
2020-10-01 09:15:37 -0700
Robin Watts <Robin.Watts@artifex.com>
1039ade1c0e0066f03a22598edb327648f59d578
Squash a couple of compiler warnings.
2020-10-01 15:48:19 +0100
Ken Sharp <ken.sharp@artifex.com>
61e227ed7bcdddd652f32f14539702773fcbcf33
pdfimage devices - fix %Invocation and add /Info dictionary
I'd thought that we had missed off the %Invocation from the PDF output
of the PDF image devices, but in fact it was only that the pdfocr
devices had it emitted in a surprising place in the file.
That's fixed here just by moving when we write it so that its location
is consistent between the devices.
Moved some definitions common to both pdfimage and pdfocr from the
device's .c files to the pdfimage.h file.
Added emission of a very basic /Info dictionary. To facilitate future
enhancements the number of 'static' (ie predefined) objects has been
turned into a #define and we use that wherever possible instead of the
previous hard-coded magic number. Because of the font objects required
for pdfocr, and the fact that they refer to each other, these still
don't use the #define and will have to be manually adjusted if we ever
change this again.
Acrobat ignores the /Info dictionary, apparently it only reads the XML
/Metadata values (at least in modern versions), so adding the Info
dictionary doesn't help. Creating the XMP metadata is unfortunately
quite complicated, we'd need to steal quite a bit of code from pdfwrite
and at the moment I think its more trouble than its worth. I may change
my mind in future.
2020-09-29 20:16:10 +0100
Chris Liddell <chris.liddell@artifex.com>
6290ce42ac84767a84ddc949c9348a194477ab9b
Bug 702948: Ensure initial bitmap cache sizes are properly aligned
Now that the allocations from the bitmap cache are aligned to the platform's
required alignment, see commit:
260c443bc14cdffa4d94e14c3a57e35bebee3a5b
We also want the initial size of the memory pool used by the cache to be
"aligned".
This is so that code that attempts to identify cache entries to evict by
requesting a size equal to the entire size of cache memory pool doesn't get an
unexpected failure, because we've rounded up that allocation request to a value
larger than the entire size of the memory pool.
Because we don't expect an error to be possible at that point, a crash can
occur.
Of the "normal" platforms we use, this only exhibits on Win32 because that is
the only platform where the align_bitmap_mod we use is less than the
obj_align_mod used for the memory managers.
2020-09-28 20:10:16 +0100
Chris Liddell <chris.liddell@artifex.com>
c6f2518cd3331d7a64c79d533d525299683a57ac
Fix icc profile reference counting in transparency compositor
Found during Windows testing for a release.
The full test file for
https://bugs.ghostscript.com/show_bug.cgi?id=693365
would cause Ghostscript to crash due to an ICC profile being freed whilst a
reference was still being held for it. That was not counting up a reference
count when restoring the device profile back to a previous value.
Fixing that introduced a leak for other profiles. And that turned out to be
not decrementing the reference count when replacing a device profile.
2020-09-28 10:21:47 +0100
Chris Liddell <chris.liddell@artifex.com>
660af5758360293e5c041ebf4500144c54521fc8
Work around for (I think) a VS2019 optimiser bug
VS2019 release builds crash with the input file from bug 702916 and several
other files, in copied_glyph_slot() because the pointer retrieved and stored
in *pslot is non-sensical.
Debug/Profile builds and optimised builds with earler VS versions don't show
the problem.
Adding debug code to assign the calculated index to an interim unsigned integer
variable also cause the problem to go away.
So, use that as a workaround.
2020-09-28 10:20:26 +0100
Chris Liddell <chris.liddell@artifex.com>
1a606b57f6eb9a38d355dcf8766f63be6140d42c
Fix some casting confusion for special glyph CID/index values
And a whitespace/indentation issue.
Noticed in passing....
2020-09-24 10:28:07 -0700
Michael Vrhel <michael.vrhel@artifex.com>
aca94c29896f51198a98b1d3e831f7710295ee8c
First Page Last Page: Add strictly mono increasing error check
2020-09-25 13:03:40 -0700
Ray Johnston <ray.johnston@artifex.com>
0cec771833490249af508823914be8b7d6931fbe
Fix Bug 702941 - Mispelled PDF interpreter variable name.
s/RepiredAnError/RepairedAnError/ A simple typo that was missed because
we did not have a test file with a format error to trigger this code.
2020-09-25 12:40:01 +0100
Chris Liddell <chris.liddell@artifex.com>
260c443bc14cdffa4d94e14c3a57e35bebee3a5b
Bug 702938: Allocating cached glyphs, account for alignment
For efficiency, the glyph cache allocates "large" blocks of memory into which
it parcels out offsets for individual glyph cache bitmaps, as required.
Since cached glyphs are usually fairly small, and potentially can be short
lived, this saves the overheads of "full" memory for every cached glyph.
Unfortunately, in calculating the offsets for the cached glyph, it was failing
to account for the required alignment of the system. In any environment that
strictly enforces aligned memory accesses, this will potentially cause a bus
error.
In this case, it was switching the gs_glyph type to a 64 bit type that triggered
the issue. But any changed to the contents of the cached_char struct could have
resulted in it happening.
2020-09-24 15:27:10 -0700
evrhel <ethanvrhel@gmail.com>
9e7fcb56612746fa93f8d76fa4cb8ecc72f43f30
Squashed commit of the java-demo branch:
commit 385a750c39e3112f4b640f8dbfea28fbad9885a2
Author: evrhel <ethanvrhel@gmail.com>
Date: Sun Sep 13 14:42:08 2020 -0700
Added several devices, updated documentation, and README.txt.
commit 64fad0d5035ccf7394c1863e369b108ca471b5fb
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Wed Sep 9 15:30:58 2020 -0700
Worked on PDFPostscriptDeviceFamily implementation
Added all of the parameter types specified in
https://ghostscript.com/doc/current/VectorDevices.htm for
PDF/Postscript devices.
Added several devices, updated documentation, and README.txt.
commit fc6593654f7d1e114d8fd0a8b2da89224e193c92
Author: evrhel <ethanvrhel@gmail.com>
Date: Wed Sep 9 14:19:25 2020 -0700
Added missing Settings class to viewer
commit ea92fe4f172911dfe79e8423bd7b98d14d585393
Author: evrhel <ethanvrhel@gmail.com>
Date: Wed Sep 9 14:19:25 2020 -0700
Added missing Settings class to viewer
commit 792ddf8525e903e55bf668b41b84f002ef4757cb
Author: evrhel <ethanvrhel@gmail.com>
Date: Sat Sep 5 14:04:44 2020 -0700
Added more implementations of Device class
commit 4f2056eafb633f5e4aa9f6ac3bed99247110f556
Author: evrhel <ethanvrhel@gmail.com>
Date: Sun Aug 30 16:11:20 2020 -0700
Added device classes to allow easy device manipulation
New abstract classes Device and FileDevice and several subclasses
to allow easy modification and output to devices.
commit ea360f254e7638b37529b8db105f0a2b9b7e722f
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Mon Aug 24 21:16:56 2020 -0700
Updated to newer Ghostscript version and fixed a bug
Updated to the newest Ghostscript version and fixed an
ArrayIndexOutOfBoundsException bug when unloading zoomed pages.
commit 34c47909939b4e85f18e2fc03088203c51bba292
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Sun Aug 23 15:58:44 2020 -0700
Added better documentation
commit eda31b70496337caefd0dc912c5a0850de769147
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Thu Aug 20 14:36:48 2020 -0700
Updated how zooming is handled
Zooming is now done through the SmartLoader and is no longer
a separate operation. Fixed an issue when the SmartLoader could
become out of date due to the condition variable being signaled
before the SmartLoader had finished.
commit 5b08d9eadfe64d87cf26869c47a2a5f78755dd4b
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Wed Aug 19 17:38:34 2020 -0700
Implemented distilling documents
Users now have the option to distill a document if the desired
input is not a PDF.
commit 4a78a968777521f23fefaeb277d378b9dc08b555
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Tue Aug 18 15:04:09 2020 -0700
Fixed zooming and some other bugs in the viewer
Zooming in on documents in the viewer no longer causes a crash.
Fixed a bug where documents would not display after being loaded.
Fixed a bug where closing a document when none was loaded would
crash.
Fixed a bug where gsapi_delete_instance would cause a crash.
commit 9c9190192c1acdafbf4e9f277dba9e2079046cc7
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Sun Aug 16 16:28:44 2020 -0700
Fixed JNI bugs and began updating viewer to use one GS instance
Fixed JNI crashes when Ghostscript calls were made from different
threads. Migrated loading low res and high res images from using
multiple instances to using one global instance.
commit fbe9a961e7fef31c79cfd8ed857643ad00798af8
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Sat Aug 15 14:36:34 2020 -0700
Added init_with_args to the test code in Main.java
commit 96ede7306ce8d71be3016e7d708c801c5718fdfe
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Sat Aug 15 14:33:40 2020 -0700
Fixed a small error in test code in Main.java
commit dcb1141da6901f0c42336861428cf13f6cc9b202
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Sat Aug 15 14:13:23 2020 -0700
Finished updating to newer Ghostscript functions
Replaced all Reference objects in Ghostcript calls in Java
and JNI to Reference<T>. Iteration over parameters now must be
done through GSInstance instead of creating an explicit iterator.
commit aa9288fa60aa6030b88f909ac494b388737e1748
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Thu Aug 13 16:00:51 2020 -0700
Finished implementing the rest of Ghostscript functions in Java
All GS functions are now able to be called through GSAPI. Fixed
a possible memory leak related to exception checking in C++.
commit b02df334fdbc14fb1ed4d75bcaddcf7091391ee7
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Thu Aug 13 12:49:33 2020 -0700
Got gsapi_enumerate_params working in Java
Got gsapi_enumerate_params working and added a utility class
to do the same work as gsapi_enumerate_params with a Java
iterator.
commit 502baba9568406ce923944f693728af30c81473e
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Wed Aug 12 16:25:54 2020 -0700
Got gsapi_set_param working
Renamed java function to gsapi_set_param_once to distinguish from
the actual Ghostscript call. This method does the call to
gsapi_set_param twice in native code and is used to make it easier
to use the function in Java.
commit 614c55f1989d04178c916db56cfc38753918097e
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Wed Aug 12 13:30:07 2020 -0700
Worked on implementing new Ghoscript methods in Java
Wrote out all native method signatures in Java and C++. Workekd
on gsapi_add_control_path and associated helper methods.
commit 08cd824e589cf9cdd4848b9b3606898ac7141c9f
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Tue Aug 11 16:32:08 2020 -0700
Worked on improving References in C++ code
commit de7f2303372bed8b19ca401392151cba7f2ab013
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Tue Aug 11 13:58:54 2020 -0700
Progress on updating Java bindings to newest version.
Added some of the new methods, but currently none work.
commit bcf2db77c8c106b1b3d80d647b0fe04201d9c645
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Mon Aug 10 14:08:42 2020 -0700
Fixed some errors related to loading pages too fast
An error would occasionally be thrown in the SmartLoader having to
do with the Document being modified while in the SmartLoader, causing
an error. Reconfigured how the SmartLoader handles documents and
is started and stopped.
commit cb2be4f3b0635efd4616f567389b19a7351d078b
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Mon Aug 3 15:41:20 2020 -0700
Added thread safety to the viewer.
The viewer now ensures that no more than one ghostscript call is
happening at the same time and has multiple options for controlling
the behavior if multiple operations are attempting to be called.
Also began work on a utility class to make Ghostscript calls easier
by having a class carry around a instance and a caller handle.
commit f81dfc177f71d0d12b38371fae54b45e158833ce
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Sat Aug 1 17:16:43 2020 -0700
Progress on improving concurrency
Added better exception handling. Began progress on handling
concurrent operations better.
commit e0f4af0e59580dabca01cb9b932185475d4032a8
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Sat Aug 1 14:48:37 2020 -0700
Viewer now will load a higher resolution image on zoom.
The high resolution image loads correctly, but the viewer does
not correctly load the right page when in a zoom other than 1x.
commit 843914f25b1a58841bac94e5df8cded8b47dd948
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Wed Jul 29 15:40:14 2020 -0700
Optimizations to page loader
Page loader now only loads around where the use is viewing and
does not load pages unless the user actually navigates to those
pages.
commit 458f93f005920b9ca58bed67178dba26cd6d8a18
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Wed Jul 29 14:13:44 2020 -0700
Progress on viewer
Optimizations and easier user interface as well as basic zooming
implemented.
commit ab65f0672d2be5f5c312b229af66d8d028661d08
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Mon Jul 27 15:12:45 2020 -0700
Various bug fixes in viewer
Added utility methods in ViewerWindow.java to help with changing
pages and zoom levels. Added framework for zooming pages.
commit e3e7dbac2b5b271a4d4225ebae34d36f603b8a07
Author: evrhel <ethanvrhel@gmail.com>
Date: Fri Jul 24 14:03:54 2020 -0700
Got viewer working
Viewer now works and can open files. Still does not "smartly"
target pages which the use is directly viewing or take
advantage of file-specific properties. It instead loads all
the pages' high-resolution images in order.
commit f1441ed36302f75d94cf4aa4a8047150bf5b7585
Author: evrhel <ethanvrhel@gmail.com>
Date: Thu Jul 23 18:57:52 2020 -0700
Basic viewer working
The viewer has basic capabilities, but still lacks loading
high resolution images, spacing components, and resizing correctly.
commit ea3eecbc30b1a4a4747dfd2818262c2f6eea112c
Author: evrhel <ethanvrhel@gmail.com>
Date: Thu Jul 23 16:13:13 2020 -0700
Worked on creating GUI
Added GUI (generated using NetBeans). Added support for callbacks
into the GUI specifically related to the wanted viewer operations.
commit cb15f051db01135cf1eef8df6a8cfb53cb5ff840
Author: evrhel <ethanvrhel@gmail.com>
Date: Wed Jul 22 16:24:13 2020 -0700
Progress on Document class for handling a documentLoader
Document class is a list of Pages which stores a low-resolution image
and a high-resolution image. The low-resolution image should always
be loaded while the high-resolution can be unloaded to save memory
usage.
commit 99fa4ae3667cd58d6f2a72f01d1b9410929f4847
Author: evrhel <ethanvrhel@gmail.com>
Date: Tue Jul 21 15:19:10 2020 -0700
Converted original Java project to be used as a JAR library
The original project should be compiled as a JAR library and
where needed, should be placed alongside the required native
libraries to run. The executable Java project has been moved
to the gsviewer project.
commit 80dd426da705c160b79a57a161c5d95c3a57aca6
Author: evrhel <ethanvrhel@gmail.com>
Date: Tue Jul 21 15:01:18 2020 -0700
Colors now being displayed correctly after getting image
Fixed drawing colors coming from ghostscript. Next: need to migrate
the current project into a jar file instead of a runnable application.
The viewer will use the Java library.
commit 06a50542391c3f0ad64f20a0ae6a1f63d9aa61e0
Author: evrhel <ethanvrhel@gmail.com>
Date: Mon Jul 20 17:10:36 2020 -0700
Fixes to display callback and C++ and added window to display images
Fixed Java methods not being found in C++ and added a window class
to start displaying images.
commit 4b0e69075619f7c4ef8df850d0e85d125e2b67da
Author: evrhel <ethanvrhel@gmail.com>
Date: Fri Jul 17 16:02:37 2020 -0700
Implemented NativePointer methods in C++ and updated onDisplayPage
onDisplayPage now uses a BytePointer object for the pimage parameter
to interface into native memory.
commit 0d24844082f6c566af417ad35b394e3fd591c38e
Author: evrhel <ethanvrhel@gmail.com>
Date: Fri Jul 17 15:03:06 2020 -0700
Added new Java class allowing native access to memory blocks
Added NativePointer and NativeArray as two base classes for low-level
memory-access alongside other classes to assist with this.
commit 9643091f698293181dcb484e04e96d19df12950a
Author: Ethan Vrhel <ethanvrhel@gmail.com>
Date: Thu Jul 16 17:01:53 2020 -0700
Security improvements in native code
Fixed multiple points where the program could crash
and instead returned NULL and/or threw a (safer) Java
exception.
commit fdade3eedc6469edd3da510bd648a39fdb9f9a93
Author: evrhel <ethanvrhel@gmail.com>
Date: Tue Jul 14 15:52:22 2020 -0700
Fixed how display_callback was being passed to Ghostscript
The display_callback device did not have the correct values regarding its size,
major version, and minor version. Furthermore, the display_device structure
was not being dynamically allocated and ended up being freed too early.
commit 5a3e822ca0e076708bed843a2578a18eebb37f3d
Author: evrhel <ethanvrhel@gmail.com>
Date: Sun Jul 12 15:17:16 2020 -0700
Fixed some bugs related to stdio
Fixed stdio bugs and added some more utility methods to make calling
ghostscript functions easier in Java.
commit 88fad771fcd4024a538f4bf6f6819d62d8180440
Author: evrhel <ethanvrhel@gmail.com>
Date: Sat Jul 11 14:29:58 2020 -0700
Completed JNI bindings to Ghostscript
Added implementations for StdIO and display callback, and added
some testing in main().
commit bb197f9ae65b39bf55ae6fd932203e514472ff8f
Author: evrhel <ethanvrhel@gmail.com>
Date: Fri Jul 10 14:06:07 2020 -0700
Finished writing JNI bindings.
Finished writing JNI bindings and added more utility methods to
help with setting Reference objects in Java.
commit 8a0074ea3624921cd8ff98684e5efa2fc0b4d5ce
Author: evrhel <ethanvrhel@gmail.com>
Date: Thu Jul 9 18:27:52 2020 -0700
Progress on linking Ghostscript functions to Java
Added support for more functions and finished implementing display
callback functions.
commit 32fee0e8ea1d82897ff4d2a3ce4b9ba92a680cd3
Author: evrhel <ethanvrhel@gmail.com>
Date: Wed Jul 8 19:39:27 2020 -0700
Worked on implementing display_callback in Java
Added utility methods in C++ code to help with calling functions,
setting fields, and creating objects. Started to implement the functions
defined in display_callback.
commit fe751db5f899c3e59c961d65ec013f307adef8f9
Author: evrhel <ethanvrhel@gmail.com>
Date: Tue Jul 7 17:31:18 2020 -0700
Implemented Ghostscript functions in Java in the C++ project
Created a new C++ project which allows for Java calls into Ghostscript.
Current working functions are gsapi_revision, gsapi_new_instance, and gsapi_delete_instance.
gsapi_set_stdio_with_handle and gsapi_set_stdio are untested.
commit 4c2bf73539f440bf8f6b45d85820cc84df2e6b28
Author: evrhel <ethanvrhel@gmail.com>
Date: Tue Jul 7 14:52:47 2020 -0700
Finished writing ghostscript api signatures in GSAPI.java
commit 4850223d252d6e245104c42fafc0190b91177be2
Author: evrhel <ethanvrhel@gmail.com>
Date: Mon Jul 6 18:16:15 2020 -0700
Progress on creating the JNI bindings to Ghostscript.
Started GSAPI class to store exported Ghostscript functions. Added error constants and declared
gsapi_revision, gsapi_new_instance, gsapi_delete_instance, gsapi_set_stdio_with_handle,
gsapi_set_stdio, gsapi_set_poll_with_handle, gsapi_set_poll, and gsapi_set_display_callback bindings.
Added multiple callback interfaces and a Java representation of struct display_callback_s.
commit 8da16a603b124c15ce4dc7c7fccc97f711d75fb2
Author: evrhel <ethanvrhel@gmail.com>
Date: Mon Jul 6 15:18:32 2020 -0700
Java demo: Initial commit with README
2020-09-24 12:34:18 -0700
Nancy Durgin <nancy.durgin@artifex.com>
4f9c59a2875e4a5cd2b2160cfc507966795e0787
Fix error in token parsing in pdfwrite
I am trying to use a hex string <XXXXXXXX> in pdfi.
The code had a bug in it (probably because the ps code never generates
a hex string?) that was incrementing the token to be 1 longer than it
should have been. Logic was just mangled.
I also simplified it to to take out the goto, which was egregious in
this case. Just put in two lines of code where it belongs, instead of
a goto to those two lines of code... (really?)
2020-09-24 19:08:25 +0100
Chris Liddell <chris.liddell@artifex.com>
82aceb33f2521854bc781bdf0f47cbfe32d6ece8
Remove links to ghostscript.com/release_history.html
That page is now gone.
2020-09-24 17:10:21 +0100
Chris Liddell <chris.liddell@artifex.com>
921f2737a72e64d9c8113fc9418422ab185cb60f
Remove dead end links from Readme.htm
2020-09-24 16:59:20 +0100
Chris Liddell <chris.liddell@artifex.com>
e36e62c0631f73627ff3caec5752eefe37a14948
Allow configure caller to choose a sanitizer
Our "sanitize" target just uses address sanitizer.
With this commit, we'll still default to address, but the caller can do:
--with-santizer=memory
to opt for the "memory" sanitizer instead.
2020-09-24 10:00:39 -0700
Nancy Durgin <nancy.durgin@artifex.com>
c210bb3d2a0c6131ebeedc44c1d8cc6fc92fb08f
Fix compiler warnings
(unused variables)
2020-09-23 20:20:59 +0100
Chris Liddell <chris.liddell@artifex.com>
d7d05e0ef54662054e038b421795e6e7dedd1e4a
Bug 702920: Fix type confusion in new param type code.
In a few cases we were using the wrong element in the union to read the
value back from the param list (and to range check the values).
2020-09-24 08:19:27 +0100
Chris Liddell <chris.liddell@artifex.com>
038df4baf368196942cd32aedcd29e4916a190c8
WhatIsGS.htm updates from Lisa F
2020-09-23 17:12:54 -0700
Michael Vrhel <michael.vrhel@artifex.com>
d178fa10548d101a248e3ec3fc6ddcf5bf044692
XPS Interp: Fix missing initialization in XPS page reversal
2020-09-23 14:18:59 +0100
Ken Sharp <ken.sharp@artifex.com>
b53045b45866fe5b41e9ca6b4fe8318f14178d3d
Fix a compiler warning
2020-09-23 13:14:31 +0100
Ken Sharp <ken.sharp@artifex.com>
6a1f7167cf45d23c4e1faec3ef37fb4b9e5d7a53
pdfwrite - fix memory leak with annotations
Annotations are somewhat odd and don't quite fit the scheme of other
cos objects. Each annotation is created as a dictionary, which is
stored in the Annots array (also a cos object)) of the page.
But we write the annots out to the file immediately, and free the
dictionary contents at that time. We cannot, however, free the dict
cos object, because we need the object number to write the Annots
array in the page dictionary, which we only do when writing the page
dictionary.
So at the end of the page the annots array contains a number of empty
dictionaries. We free the array, which would free the dictionary
contents (except there are none) but it does *not* free the dictionaries
because they have an ID......
So when we free the Annots array, we first need to set the ID of each
of the dictionary objects it contains to 0, so that the dictionary
will also be freed.
2020-09-22 10:31:09 -0700
Nancy Durgin <nancy.durgin@artifex.com>
5ff586fa9e51ac7fdb306ff7b616d7cf23ed754d
Fix PolyLine annotation for pdfwrite device
This implementation was missing, just copy-pasted the default for it.
It was going through a code path that I think only works for Widgets.
2020-08-26 16:53:36 -0700
Michael Vrhel <michael.vrhel@artifex.com>
9bfaeeace268f6a59f325e12efab9fb8273f64e0
XPS interpreter: Have interpreter handle page range processing
This has the obvious benefit that the interpreter will skip processing
pages except those that lie in the FirstPage LastPage range.
If the PageList is used, the XPS interpreter will create a new
list of linked pages to process. The XPS interpreter handles all
the PageList cases currently implemented by the PDF interpreter
including even and odd. In addition, the XPS interpreter will handle
backward indexing (e.g. 100-1), as well as starting from last page
to another page (e.g. -2 which means from last page to second page),
and page repeats (e.g. 1,2,1,2,1,2 or 1-3,3-1 or 1-,-1 which is
do page 1 to end and end to page 1) Also, setting -dFirstPage=4
-dLastPage=1 will create pages 4,3,2,1
2020-09-16 17:33:30 +0100
Chris Liddell <chris.liddell@artifex.com>
c4e79952b42ebccb669063e053e3d7ce0f88cc22
Fix compile failure due to missing header.
A user reported (privately) that a pre-release of an upcoming XCode release
fails to compile due to a missing prototype/declation of abs() in the jpegxr
code. It's clearly a simple omission, as several files use abs() and do include
the relevant header.
So adding it here.
2020-09-22 11:18:22 +0100
Chris Liddell <chris.liddell@artifex.com>
71bbd0f12f48e1300a1e768483b5999099243f8d
Bug 702810: fix fapi buffer size parameter types
The buffer size parameters for the fapi callbacks used to be unsigned short,
but were changed to ints a while back. The calls for the (g)subr data in
Type 2/CFF fonts hadn't had the casts to ushort removed, causing the values
to be trucated.
There was also a Postscript/FAPI internal function that had not had the
buffer length parameter changed to int.
2020-09-22 11:11:30 +0100
Chris Liddell <chris.liddell@artifex.com>
a5aa22546b191b9465b2d6f6aa00c2ad591238af
Remove pointless 'recopying' of CFF (g)subr strings
For some reason, the Type 2 font serialisation (used for reassembling font
streams to pass to freetype) was using the FAPI callback to read the
(g)subr string data into it's main buffer, but then called the writing
function to write data to the buffer, using its own buffer as input -
effectively overwriting the bytes with the same bytes.
The only purpose (it seems) was to move the current stream position forward by
the appropriate amount.
Change it so we simply move the "current position" pointer on by the correct
offset.
2020-09-22 08:58:31 -0700
Nancy Durgin <nancy.durgin@artifex.com>
3abfca2a925427962ed644872057f75c44afc0d8
Fix memory leak in pcl pdfmark implementation
The memory allocated by param_write_string_array() was never being
released.
(Note: the cluster doesn't test this code path currently)
2020-09-22 15:43:03 +0100
Robin Watts <Robin.Watts@artifex.com>
652c71e0f7766f3696330f654abf01c79a5493f2
Updates to 'WhatIsGS.htm' document from Lisa.
2020-09-22 08:25:36 +0100
Ken Sharp <ken.sharp@artifex.com>
b7a413e2d28540ca0113af1c783532ecea6f6ba0
pdfwrite - remove erroneous free from cos_dict_put_copy
Nancy discovered this one while working on annotations for pdfi. The
code here would attempt to free the memory pointing to the key name
which is passed as an argument to the function, if the *dictionary*
properties were set to free dictionary keys.
Obviously the function argument is not the same thing as the key stored
in the dictionary, so even at first inspection this looks incorrect.
The key is supplied (much higher up) from a param list, because the pdfi
code uses C param lists, where the data is stored in a single large
allocation, it is not possible to free an individual key and causes a
crash.
Ghostscript gets away with this for two reasons; firstly it uses a
stack param list (which is basically a ref param list) where each key
is stored in its own allocation. Secondly the key is not actually
allocated, its an entry in the interpreter name table. So when the
code in cos_dict_put_copy 'frees' the memory, nothing actually happens,
the memory manager just notes that the memory is unused now. This
avoids double freeing the memory which would otherwise happen.
So essentially this code is wrong, and we've been getting away with by
sheer luck for decades.
I tested the modification extensively, including memory leak checks with
many files run through pdfwrite and can find no problems with simply
removing the line of code.
2020-09-21 22:16:34 +0100
Chris Liddell <chris.liddell@artifex.com>
bbd106e8f9345296cb5b5a452487bda603d54173
oss-fuzz 23637: Fix error code confusion
Confusion of error codes meant we were allocating space for glyph data,
but never copying the data into it. Thus the memory sanitizer error.
2020-09-21 15:14:55 +0100
Chris Liddell <chris.liddell@artifex.com>
42480ab92d9d31e7dc204e8f916165cc02480387
Fix segfaults in UFST - use correct font name
Omission from commit: a10a03a4c9713b38c4cfcd07f0ba3c722778aae0
2020-09-20 16:35:41 +0100
Ken Sharp <ken.sharp@artifex.com>
7aff7d6a30544929de9d2f4bd775fb17303b86ff
Fix Coverity ID 362083 & 362084
After the fixes for crashes with invalid filenames, Coverity can now
detect a potential NULL stream pointer (would have been uninitialised
previously).
Prevent the code trying to write to that stream, thereby dereferencing
it.
2020-09-18 23:18:41 -0700
Michael Vrhel <michael.vrhel@artifex.com>
ef118c5edc71ac6575260918d062e91ed3f8f067
XPSWrite: Fix memory leaks and page resource relations
The page resource relations information tells which of the
resources are used for each page. The information was not
getting written out correctly for the multi-page case. The
Microsoft viewer is very fussy about this and would not
display some pages, even though the item is in the resources.
Made sure that each page writes out the proper relations to the
resources and that no duplicate relations are written.
Also fixed memory leaks from the zip file information not getting
freed as well as some TIFF client information.
2020-09-18 15:53:27 +0100
Ken Sharp <ken.sharp@artifex.com>
4dcbbd26d92a25705a1b835573faada8aa225448
Fix a compiler warning by initialising a variable
2020-09-18 15:16:46 +0100
Peter Cherepanov <sphinx.pinastri@gmail.com>
5425a7f56d0cb424370af82f18c3416a728f18ff
PDF interpreter & pdfwrite - better detection of per-page output
Bug #702791 "%d vs. %03d and pdfmark destination page ... points beyond the last ..."
The PostScript code in the PDF interpreter which looks for
file-per-page output, in order to drop Outlines and Dests was
only checking for %d not variants liek %03d. This could lead
to warnings about the Destination being dropped.
The code provided by Peter checks for an odd number of '%'
characters instead. This isn't the same test as pdfwrite uses
but that is in C and not immediately available in PostScript.
Since we plan eventually to drop the PostScript implementation
of the PDF interpreter and move to a C version, this is fine
for the interim.
2020-09-18 14:17:00 +0100
Ken Sharp <ken.sharp@artifex.com>
4c58ce8f26096122eff7783da38a679a3ecd96c4
pdfwrite - fix a number of seg faults when opening output file fails
While investigating bug #702791 I discovered a number of ways to make
the opening of the output file fail (combinations of illegal characters)
which subsequently caused pdfwrite to seg fault.
This commit addresses these.
2020-09-17 16:37:43 +0100
Robin Watts <Robin.Watts@artifex.com>
cf49e978b9324866f61acce6b3cf399b356af6fb
Fix tesseract traineddata links in documentation.
2020-09-17 15:34:02 +0100
Ken Sharp <ken.sharp@artifex.com>
d5494de2cab28b91ba360d15b8afffef50a3f421
PDF interpreter with pdfwrite fix non-square scaling stroked text
Bug #702900 "pdfwrite device causes bold text output"
The PDF interpreter has special code for dealing with line widths and
stroked text, this is because we do not preserve the CTM in the input
through to the output in pdfwrite.
What we need to do is figure out what line width with an identity CTM
would draw a line the same width as the current line width and CTM.
Normally pdfwrite takes care of this itself, but until relatively
recently it did not have access to the textmatrix, only the CTM. But for
text, by the time we get to the point of emitting the text,, the CTM
already includes the Text matrix (Tm).
So the PDF interpreter (which does have the CTM before the TM is
applied) calculates a line width and sets that before sending the text.
However, when the scaling was non-square we were not doing that, leading
pdfwrite to emit the unscaled linewidth. Intriguingly we have no files
in the test suite for which this is a problem, all the files where the
CTM is non-square it is also close to the identity so not visibly
incorrect.
The file here, however, has a non-identity CTM which is slightly
non-square when the text is rendered, and very far from the identity.
Since we can't tell which scaling to use for the linewidth we 'fudge'
it by using the transformed x and y values of the linewidth, as two
sides of a triangle, then calculating the hypotenuse. Obviously this
won't work for seriously skewed matrices but it seems unlikely we
could calculate a reasonable linewidth for that anyway.
2020-08-26 16:50:51 -0700
Michael Vrhel <michael.vrhel@artifex.com>
b81a73c34e48a547dd881f07aa046646a472e13c
C# API: Fix a few minor issues related to printing
2020-09-16 10:05:51 +0100
Ken Sharp <ken.sharp@artifex.com>
c035cc51926dbda7f013b7611d0cdddda986a47d
Clarify documentation
It wasn't clear that the PJL implementation of pdfmark and
setdistillerparams required the PJL line to terminate with a linefeed
(specifically a linefeed, not a carriage return). Update the document
to make this clear.
2020-09-16 07:48:47 +0100
Chris Liddell <chris.liddell@artifex.com>
d9369a388ae987b63d66fdd557f95b0073547846
Bug 702904: Another fix to check for shared libjpeg/libtiff
We cannot combine shared and not shared libjpeg and libtiff - they either both
need to be "local" or both shared, and configure checks that and fails when
the two are incompatible.
However, that check would fail when either libjpeg or libtiff were not being
included at all. Since it is libtiff that is the "problem" for this
compatibility, now check if TIFF is included, and if not, skip the check.
2020-08-25 16:47:10 +0100
ChrisL <cliddell@salvor-openbsd.lan>
24808eae80f0def1aeb7f727980d5e0852d3d0e0
Fix the OpenBSD build
Whilst hopefully not breaking the buildroot build.
2020-09-14 16:52:22 +0100
Chris Liddell <chris.liddell@artifex.com>
7d08c3225879c0714217a7defd6f57f8a16ef615
Bug 702901: initialize directory for tiff configure
Previously the directory in which to run the libtiff configure script was
initialised to an empty string, but that, in some toolchains, resulted in an
error due to "unsafe header/library path used in cross-compilation".
So initialise it something benign instead.
2020-09-14 11:12:16 +0100
Chris Liddell <chris.liddell@artifex.com>
996d05b6f5010afda4b47b20ed4b8e1ee364402b
oss-fuzz 25486: Initialise device colors in graphics state
Not all devices/color models require all the entries in a device color, so
sometimes they don't get set, in this case, the "phase" entry. Trouble is,
the clist code uses phase in a conditional.
Initialise the dev_color so, in such cases, we're not hitting a UMR condition.
2020-09-11 18:33:42 +0100
Chris Liddell <chris.liddell@artifex.com>
19ed8a965c016eda56057e29dfc373d1af87ca55
oss-fuzz 25485: Validate Type 1 font hinting paramters.
BlueValues, OtherBlues, FamilyBlues and FamilyOtherBlues are all made of up
pairs of values packed into arrays. Obviously, valid arrays for those must have
an even number of entries.
Ensuring they do, and erroring out should they not, prevents us from accessing
off the end of the valid values, and encountering a UMR condition.
2020-09-11 15:08:55 +0100
Chris Liddell <chris.liddell@artifex.com>
542e32e6aa630ad909c39304ba4e48870695781e
oss-fuzz 25480: CFF - cope with "empty" float number.
If a CFF stream encoded a fractional number with no content (i.e. starting op
code, imediately followed by an ending op code), we were still trying to
parse meaning out of the emtpy temporary buffer. So, check we have actually
decoded bytes from the stream, before converting to a floating point value.
2020-09-11 14:45:04 +0100
Chris Liddell <chris.liddell@artifex.com>
f4aae0832544e76d148db9eb52a24c34a416b56c
oss-fuzz 25474: Check the length of Coords in shading dict
We weren't checking if the length of Coords array for shading was valid, meaning
we could end up using uninitialised entries in an array.
Check it, and throw an error if it's invalid.
2020-09-14 14:32:23 +0100
Ken Sharp <ken.sharp@artifex.com>
378e2071d77fad65ba0fe3beed974d1efbe180ac
Fix crashes with pdfwrite, TrueType input fonts and Windows 64-bit build
With the change to 64-bits unconditionally for gs_glyph we can now
define GS_MIN_CID_GLYPH in 64-bit terms.
Previously we were using the architecture size of a long_long to
determine which define to use, and we do not define long_long on Windows
leading to us using an essentially 32-bit definition. This caused
indexing off the end of an array in copied_glyph_slot()
2020-09-14 09:40:30 +0100
Chris Liddell <chris.liddell@artifex.com>
f0d19bf181a156d011dba422ae4d165b36b0af7e
Bug 702897: Fix shared libtiff/libjpeg check
For various reasons we cannot combine shared and not shared libjpeg and
libtiff - they either both need to be "local" or both shared.
But the check for that compatibility was triggered during the recursive
configure call when setting up for cross compiling.
Skip the check for that recursive configure call.
2020-09-10 16:18:10 +0100
Chris Liddell <chris.liddell@artifex.com>
98379bb2752c64f47cc1de9f6f3c973b2c69562c
Bring changelog changes onto master from gs9.53.0
(Tweak History9.htm with jbig2dec updates)
2020-09-10 17:27:47 +0100
Robin Watts <Robin.Watts@artifex.com>
24cfe91c81b831d6d23fe0a1008285407a7adeb2
Fix Coverity issue 361428.
Don't strlen a possibly NULL path. Shouldn't ever be a problem,
but doesn't hurt to be safe.
2020-09-10 17:25:02 +0100
Robin Watts <Robin.Watts@artifex.com>
1bd520eff4d5b8474d5aa962434dd398beb65dcc
Fix Coverity issue 361836.
Check return code.
2020-09-10 17:23:06 +0100
Robin Watts <Robin.Watts@artifex.com>
367dec7fb70f08603e37de5e1e07731a21fb4b73
Fix Coverity issue 361837.
Check return codes properly.
2020-09-10 17:19:34 +0100
Robin Watts <Robin.Watts@artifex.com>
198846d0d28b0f462dc84d12f00f82d3d1d069db
Fix Coverity issue 361838.
All destructors should accept NULL.
2020-09-10 22:47:09 +0800
Sebastian Rasmussen <sebras@gmail.com>
a4a8406ff4618234095fc8ed4d6e8b313a5260e4
Bug 702884: Require jbig2dec 0.19 when building ghostscript.
In practice this has been required since commit
9b5008aa2bc1c6a6acb2c6f90d1ef8d6bad9e66a.
2020-09-10 22:41:20 +0800
Sebastian Rasmussen <sebras@gmail.com>
224ffe421044b6cff107bcb3e0460aac7e029c56
Update jbig2dec stuff for 0.19 release.
2020-09-10 15:42:49 +0100
Ken Sharp <ken.sharp@artifex.com>
89ff7003acfdc52e3d3bcca930de6961f33ae927
pdfwrite - fix image downsampling when the input is a 16-bit image
Bug #702868 "Segmentation fault when using dPDFSETTINGS"
The problem is to do with image downsampling, and 16 bit images. When
the input image has 16 bits per component, and is sufficiently high
resolution on output that it triggers image downsampling, in this case
the image downsampling setup can't deal with the input. In addition we
*already* deal with 16-bit input by explicitly adding a filter to
reduce the input from 16 bits to 8, so its not necessary for the
downsampling code to do this.
So fix it simply by altering the colour depth form 16 to 8 in the
params we pass to the setup code.
2020-08-18 10:23:13 +0100
Chris Liddell <chris.liddell@artifex.com>
3441872e7e7e5e269d242605dbc0f47c024120a9
Bring master up to date with 9.53.0 doc changes
Update docs, version, dates, product family
for 9.53.0 RC1
Fox typos and stuff in the release highlights
Update dates'n'docs for 9.53.0.RC2
Docs and dates for 9.53.0
2020-09-10 11:58:13 +0100
Robin Watts <Robin.Watts@artifex.com>
12ca7092b5b1cdd9e9d1fe3497e033bb01751a1a
Correct fix for stack smashing.
Commit 4d9fa68df "Fix stack smashing in blending code." was the
wrong fix (and indeed didn't work in the weekly tests).
We therefore back that out, and add the correct fix.
When using a temporary array to allow us to Hue blend, we need
that array to be large enough to cope with all the components
we might have, including spots.
2020-09-09 15:05:19 +0100
Chris Liddell <chris.liddell@artifex.com>
b2b45b74b4272092ca46d0210b0076a618b7979a
Strip trailing whitespace from html files
2020-09-09 14:47:30 +0100
Robin Watts <Robin.Watts@artifex.com>
6a23ca3a97bcef0663d8855dc26f1a5041f2a5d4
Strip trailing whitespace from makefiles.
2020-09-09 18:40:56 +0100
Robin Watts <Robin.Watts@artifex.com>
4d9fa68df46a876e60d9677eafee66b0c596d8ab
Fix stack smashing in blending code.
Page 17 of:
gs -Ilib -sOutputFile=out%d.psd -dGraphicsAlphaBits=4
-dTextAlphaBits=4 -dMaxBitmap=400000000 -sDEVICE=psdcmyk
-r72 -Z: -sDEFAULTPAPERSIZE=letter -dNOPAUSE -dBATCH -K2000000
-dClusterJob -dJOBSERVER
../tests_private/comparefiles/Altona_Technical_v20_x4.pdf
crashes, due to do_pdf14_copy_alpha_color calling
art_blend_luminosity_cmyk_8 and art_blend_saturation_cmyk_8
with a temporary array of size 4, with n_chan=5.
The reason for this is because we are forgetting to allow for the tag
plane. Fixed here.
2020-09-09 14:12:57 +0100
Robin Watts <Robin.Watts@artifex.com>
9695dd9f5352abc2ba49174447824f474f06ada6
Remove prototype for non-existent function.
2020-09-09 12:46:51 +0100
Robin Watts <Robin.Watts@artifex.com>
81a0e93a723fe057d9ba56a2bf072e6b7adc2a7e
Strip trailing whitespace from .c and .h files.
2020-09-09 11:50:12 +0100
Robin Watts <Robin.Watts@artifex.com>
9bd47d0ed0d012301e28e288a366408fa6aba386
Bug 702871: Fix GraphicsAlphaBits + Fill/Stroke issue.
When we flush the alphabuffer, mapped_start and mapped_height are
both set to zero. When we refill it, mapped_height is set to
non-zero. USUALLY mapped_start is set to non-zero too, but it can
be set to zero when we are close to the bottom of the page.
Hence we should test for mapped_height != 0, rather than both
mapped_height and mapped_start being non-zero.
So the 'quick hack' that Chris used is actually correct.
2020-09-07 19:19:10 +0100
Robin Watts <Robin.Watts@artifex.com>
7222ff74e7d1249c06c163bc8b33ef5b485e8864
Remove deprecated device-like image handling procedures.
22 years is probably long enough warning.
2020-09-07 18:53:00 +0100
Robin Watts <Robin.Watts@artifex.com>
8f8e7df3adf63221d70cfff54aec9c56ffbd5385
Rejig PCL/PXL to call graphics library rather than device functions.
Also remove pl_begin_image2/pl_image_data2/pl_end_image2 etc
functions - might as well just call direct. This leaves pldraw.c and
pldraw.h empty, so remove them.
Also, take the opportunity to fix some potential cleanup problems.
2020-09-08 14:24:10 +0100
Ken Sharp <ken.sharp@artifex.com>
8b805ceb6fe15bd835a48dac227b85da401d7a81
pdfwrite - fix error handling with broken type 3 fonts
The test file tests_private\pdf\customer394\problems\normal_537.pdf has
a Type 3 font with a CharStrings entry where the value is not a
dictionary, it is the null object.
When trying to capture the outlines of the glyphs in order to rebuild a
type 3 font in the output PDF file, pdfwrite detects the error. However
due to an oversight when writing the code, the graphics state is not
correctly preserved.
This is because if an error occurs in gs_text_process it unwinds the
graphics state stack back to the level stored in the text enumerator
at the start of the text processing. But complete_charproc() then
proceeds to do another gs_grestore (and the code incorrectly did yet
another gs_grestore as well!). This results in the graphics save level
being different on exit form text processing to the state on entry.
Remarkably this doesn't seem to cause a problem, except for the new pdfi
interpreter, where the gs_grestore restores back to a point before the
type 3 font was present in the graphics state. This leads to the type
3 font having a reference count of 1 at the end of processing and the
font and all its contents leaking.
Fix it by updating the 'level' stored in the enumerator actually being
used by gs_text_process (which, because this is for capturing glyphs,
is not the same enumerator as used by pdf_text_process). Also remove
the spurious extra gs_grestore in the error clause.
2020-09-07 19:58:09 +0100
Robin Watts <Robin.Watts@artifex.com>
e8a6f1d98300fd06965dbdccd82a746adeb05b72
Fix type slipup in OCR params handling.
2020-09-07 09:54:28 +0100
Ken Sharp <ken.sharp@artifex.com>
2202026393550166416b4fd28daaa4f667a77301
Fix memory leak with clip device and image width/height = 0
When rendering masked images we can create a clip device in order to do
the actual masking before passing the result to the final device.
After creating the device we store it in a 'gs_image_common_enum' for
later use. We then proceed to initialise the main image enumerator in
gs_image_common_init().
As an optimisation, if the image width or height is 0, we don't waste
any time processing it but simply end the image and exit.
However, if we had created a clip device, we did not free that device
leading to a memory leak.
This commit simply 'un-retains' the device causing it to be freed.
2020-09-03 16:20:34 +0100
Ken Sharp <ken.sharp@artifex.com>
2c2fab370060e84b55c74c1c99fa1a8046a5b4f8
Font copying - fix memory leak
When copying a glyph for a copied font, if we encountered the same glyph
twice, with the same name, we simply replaced the name in the name table
of the copied font. If there was already an entry then it would leak.
Note that a second instance of the glyph with a different name would
end up in the extra names table and doesn't leak.
Fix the leak by freeing the existing string copy if we have a new one.
2020-09-02 13:50:44 +0100
Ken Sharp <ken.sharp@artifex.com>
bc0403425e55309fbf372a7ebc66037d74e140d8
pdfwrite - add a new method to detect pdfmark-capable devices
The existing method to determine if the current device is capable of
processing pdfmark operations only works in PostScript. Since pdfmark
is a PostScript operator this isn't unreasonable, but we need a way for
the pdfi interpreter to know that a device is capable of handling
pdfmarks, because some information from the current interpreter is
passed that way (eg DOCINFO).
Add a new parameter "PdfmarkCapable" which can be retrieved via a
spec_op. Any device capable of handling pdfmarks (via put_param calls)
must return true for this parameter.
Update the current PDF interpreter to use this instead of the PostScript
method.
Note: the ps2write device is *not* PdfmarkCapable.
2020-08-31 14:29:57 +0100
Chris Liddell <chris.liddell@artifex.com>
54304275c68abdf131d2e4f511bcc7475f611b30
oss-fuzz 23113: Bounds check buffer in gs_scan_token()
To handle malformed/multiply negated numbers (e.g. "---1") in PDF files,
the number scanning code skips over multiple leading minus signs (*only* for
PDFs), but code skipping the minus signs did not bounds check the buffer, so
could rattle off the end.
Unfortunately, where this happens, there is no way for us to differentiate
between a (malformed) token that straddles a buffer boundary, or a (strange!)
token that is the entire buffer.
As the code in question is only active for PDF interpreting, and the Postscript
PDF interpreter uses the "token" operator to tokenize stream contents, we can
assume (in this case) the buffer is the entire token.
So, in the event we hit the end of the buffer without reaching something other
than a '-' then reset the buffer pointer, and "retry" it as a name.
2020-08-31 09:39:02 +0100
Chris Liddell <chris.liddell@artifex.com>
86f8c00204342436a09d7fac2ea6d0bb551b9118
CID 361525: Protect from NULL pointer deref (z_fontenum)
In reality, the NULL pointer dereference here is not actually possible (barring
memory corruption issues), but the checks are trivial, the code only runs
at most once per job, enumerating the fonts is the slow part of the process,
rather than the linked list management, and it seems easiest to just placate
Coverity.
2020-08-31 13:48:57 +0100
Ken Sharp <ken.sharp@artifex.com>
0b9dbbc38d1d0e5593452337b6a45431053a1ba0
Fix crash with copied TrueType fonts and pdfwrite
When freeing a copied font we now test for the data pointer being
non-NULL instead of checking the size of the string. This was because
we would still create strings for glyphs with a length of 0 and using
the size meant we would not free those strings, leading to a memory
leak.
However this causes problems (only for 0 length data) with TrueType
fonts regarding ownership. We avoid this by not allocating any memory
for 0 length string data.
We do need to fill in the remaining elements of the copied glyph though.
2020-08-28 08:56:23 +0100
Peter Cherepanov <sphinx.pinastri@gmail.com>
0ab8e25b94c837c6128fff791b2a99486b1ee73c
Bug 702620: Fix linked list creation in z_fontenum
Fixes memory leak.
2020-08-28 09:31:58 +0100
Ken Sharp <ken.sharp@artifex.com>
9bd1cdde34a49e6c0b885db5e258a41a4fccda52
Bug 702837 typo in warning message
Thanks to Herbert Voss for spotting this. Fixed the typo and updated the
version number in the warning from 9.53 to 9.53.0 to match the actual
version and patch number of the release (the decision to add the patch
level was taken after the original commit)
2020-08-27 20:35:06 -0700
Ray Johnston <ray.johnston@artifex.com>
1f6172705bb2811986175d72484705d68995fdd1
Bug 700404: Make Windows usertime be CPU time, not elapsed time.
Thanks to Peter Cherepanov for this patch (and his patience in having
it accepted). Tested with VS 2005, 2008, 2015 and 2019.
WIth this change Windows operates like linux. Note that usertime always
returns 0 the first time it is called (refer to commit cc156631). This
is a bit confusing, but is intentional.
2020-08-27 12:19:53 -0700
Nancy Durgin <nancy.durgin@artifex.com>
49c4fa7e6c1a750ed976c7f1f46e3f8474249993
Fix pdfwrite memory leak in pattern clists
This is for non-GC interpreters only.
This code is very convoluted, but I think the ->retained flag can be
used to see if it's okay to safely free the memory.
In the case of patterns, for at least some cases the ctile wasn't
in the cache so it didn't free anything in gx_pattern_cache_free_entry().
2020-08-27 13:54:33 -0700
Ray Johnston <ray.johnston@artifex.com>
94c344c43b274c86f529916085e02d7dc50d5edb
Bug 702785: Add UTF-8 encoding for strings in Info dict to pdf_info.ps
Thanks to Peter Cherepanov for this change.
2020-08-26 10:15:58 -0700
Ray Johnston <ray.johnston@artifex.com>
d7a70f69851a071eb9dfe7a968e2cb2f6302f1ba
Bug 702806: Performance decreases throughout file, PS to PDF
A sample file of 1,000 pages from the customer allowed us to reproduce
the issue. The file creates MANY fonts (3,398 over the 1,000 pages),
and the font_cache list (not really a cache) would have the newest
created fonts at the head of the list, but later pages would use
fonts created earlier that were at the end of the list.
Fix this by moving the found font to the head of the list (MRU).
On this file, the time on a fast machine went from 152 to 65 seconds
and the times for pages does not show the growth seen originally.
2020-08-27 15:31:19 +0100
Ken Sharp <ken.sharp@artifex.com>
225de4d2960f187a49521097a4235872d94a8fb3
pdfwrite - fix memory leak in copied font
This really should have been fixed by an earlier commit, but it had a
dumb error. We were freeing cfdata->names after we'd checked the
first entry in the table, instead of checking *every* entry in the
table first. In fact the memory was already freed blow so we didn't
need this at all.
In addition the code to free extra_names was inside the loop and didn't
need to be as its a linked list not an array. So move it outside where
it will only execute once. Should be a tiny bit faster.
2020-08-27 14:11:06 +0100
Ken Sharp <ken.sharp@artifex.com>
53c10bd88f272c25fc5475dc63ea55140b9616db
pdfwrite - fix several memory leaks with colour spaces
The colour space creation code uses pdf_string_to_cos_name() quite
frequently, and it often then passes the resulting cos_value_t to
functions such as cos_array_put and cos_dict_put.
The basic 'put' functions actually copy scalar objects when they are
put in an array or dictionary (but they don't copy other composite
objects!) so we need to free the object created by
pdf_string_to_cos_name() after we've 'put' it.
The only function to do that is cos_value_free() but that (unreasonably)
requires a cos_object_t parameter, even though the cos_value may not
be in a cos_object. Since the only use for the cos_object is to
retrieve a memory_t pointer in order to free the data used, we can
simply replace the cos_object_t * with a gs_memory_t * and use that
directly.
This meant a few places needed to change where cos_value_free() was
already being used.
After that I rationalised the code in gdevpdfc.c to some extent. Instead
of the existing mixture of *_put() and *_put_no_copy() calls I've chosen
to use *_put() calls throughout and then explicitly free the data which
has supposedly been copied.
We could have used _nop_copy() throughout but that would have meant
checking the return value and freeing the original data if the copy
failed. It seems simpler just to unconditionally free the original
data.
In one place we also need to check that the original data was not NULL
and that it was a scalar type. This is because (as noted above) if it
isn't a scalar type the *_put() functions *don't* copy the value, so we
don't want to free the original data in this case as it has been
transferred to the cos_object.
Nancy did most of the original work on discovering the actual memory leak
here, and suggesting the basic fix, so many thanks!
2020-08-27 14:00:56 +0100
Ken Sharp <ken.sharp@artifex.com>
73856faec1a4e1ed7d4099ec4a05f30d53c7c429
pdfwrite - fix memory leak when allocation of a base font fails
When the allocation of a PDF base font (pbfont) fails we were only
freeing the memory used by the structure, not any of the components
stored in it.
There are quite a few subsidiary elements which need to be free and
there is already code to handle this, but its bundled up in
pdf_font_descripto_free(). So to make this easier, break out the code
to free the base font from pdf_fotn_descriptor_free() into its own
routine, pdf_base_font_free() and call that from both
pdf_font_descriptor_free() and pdf_base_font_alloc().
2020-08-27 13:57:21 +0100
Ken Sharp <ken.sharp@artifex.com>
346ea731a43062662e57038aceea28859de51be6
pdfwrite - fix memory leak when gs_copy_font fails
If we can't copy the /.notdef glyph into a font we fail (its a
requirement for a valid font in a PDF file to have at least a /.notdef).
If that happened we did not free the newly made copy of the font. Fix
that by freeing the copy.
2020-08-25 15:17:45 +0100
Robin Watts <Robin.Watts@artifex.com>
367c3858886d1c43b75e3ea48f770d80db800d15
Add OCREngine parameter.
2020-08-27 12:33:35 +0100
Robin Watts <Robin.Watts@artifex.com>
30c56c669b05dd09518fad60a8f0ae8de4bcf186
Add runtests to clustermaster.pl
2020-08-26 16:11:27 -0700
Robin Watts <Robin.Watts@artifex.com>
a5a9da62c49f1881186b2528f45f3ef846ad70ed
Add Makefile for api_test
2020-08-26 12:44:03 -0700
Robin Watts <Robin.Watts@artifex.com>
a69fc03408010df05732af7da229b64a181b7edf
Fix api_test.c for compiling on Linux.
2020-08-25 14:17:50 -0700
Nancy Durgin <nancy.durgin@artifex.com>
99a34d86e93eb482c12c2143a31cfc227042dcf9
Fix memory leak in pdfwrite images with errors in them.
This was only a problem in non-GC interpreters (e.g. pdfi)
This was an error that specifically affected images that got an
error during the first row (so data_height == 0).
Added pdf_end_abort_image() to abort an image without writing it.
Also make sure to clean up the streams.
Sample file: Bug 688023 test_out.pdf
Also: tests/pdf/Jbig2_042_13.pdf
2020-08-24 17:43:05 -0700
Ray Johnston <ray.johnston@artifex.com>
3812280c5b021b16cce184b7aa6981d51a6ee5be
Bug 702761: Improve handline of PS file with many large ReusableStreams
This file, with its original, non-optimal, method collected 1,000 ReusableStream
files, each of which was 7.5Mb, stored as 1,000 arrays of 180 40,000 byte strings.
As the file progressed, the load on the GC (garbage collector) to mark-and-sweep
all of those strings got slower and slower.
This change collects the strings in the array of strings into a single large
string (up to max_string_size, currently 16Mb), so the load on the GC is cut
down to finding and freeing the array-of-strings since the last GC, and the
(at most) 1,000 strings, one for each ReusableStreamDecode "file" object.
The submitter has already accepted the change to avoid storing the expanded
raw Image data, but there are other usages of ReusableStreamDecode that may
be used with large files (e.g. streamed PDF input files) that can benefit
from not loading down the GC.
2020-08-25 12:16:10 +0100
Ken Sharp <ken.sharp@artifex.com>
e9104765e434280d4de3c781dfa5b9bebd5a524f
pdfwrite - fix another memory leak
When we close down pdfwrite we check the stack of saved gstates to
see if there are any dash patterns to be freed. We must check the
entire potential stack, not just to the current level, in case we
allocated a dash pattern copy at a deeper level than we were at when
we exited.
Because dash_patttern is allocated in non-gc memory this leak affects
all interpreters.
2020-08-25 12:13:49 +0100
Ken Sharp <ken.sharp@artifex.com>
e59bed1d7e3481e74168fdaa0b3e1293acc30d2b
pdfwrite - more memory leak fixes with fonts
When we free a font copy we need to:
1) Free the client_data 'names' array as well as the strings it contains
2) Free the extra_names linked list.
2020-08-24 22:41:41 -0700
Michael Vrhel <michael.vrhel@artifex.com>
fc3184789d23b42ba7ded18b2626c59e7d176624
C# API demo. Make printing (creation of XPS content) a different process
Since we are limited to one instance, we will go ahead and launch a different
process which will be handed arguments to do the printing, which involves the
creation of XPS content via the xpswrite device which is then fed through
the Windows XPS printing pipeline.
2020-08-24 10:01:58 -0700
Michael Vrhel <michael.vrhel@artifex.com>
e7d5f25fc87573361cf5ec3a533021562659bff2
C# API. Minor cleanup of viewer demo application.
2020-08-24 18:55:30 +0100
Robin Watts <Robin.Watts@artifex.com>
ad0678d3d34948eb7c316b5511ffdb098e3afab2
Fix Tesseract traineddata file loading.
If it was finding any Tesseract data in ROM it was then not looking
for files.
2020-08-21 18:44:33 +0100
Robin Watts <Robin.Watts@artifex.com>
f26bb372f3c2d8e564074c08943b60682bc8ed8c
Fix gs_main_set_language_param to escape encapsulation.
If we are running in JOBSERVER mode, then postscript can't set stuff
into systemdict while in a job. We need to exit the encapsulation,
set the param, then reenter.
(Contrary to my memory, dnit_job does not exit the encapsulation - or
rather it does, but it unsets the device, and then immediately reenters
encapsulation again.)
Thanks are due to Ray for identifying the problem, and to Chris
for being a sounding board.
2020-08-21 18:57:41 +0100
Chris Liddell <chris.liddell@artifex.com>
302aa9db9f03c2d0795ec8a8c249571bf86cd555
Tidy up setting user params for PDF processing
2020-08-21 18:50:55 +0100
Chris Liddell <chris.liddell@artifex.com>
6153b859d1fd3780cb95d20f678843ab1ba470a1
PDF interp: Consolidate disabling of page handler device
2020-08-24 09:24:31 +0100
Chris Liddell <chris.liddell@artifex.com>
9daf042fd7bb19e93388d89d9686a2fa4496f382
Coverity 361429: move "break" to correct place.
We had to add the outputfile to the "control" file permission list (as well
as write), but for the "pipe" case, I accidentally added the call after the
break out of loop that checks for a pipe.
2020-08-20 18:31:00 +0100
Robin Watts <Robin.Watts@artifex.com>
2e3540010069071c8f9d52d2486067940a23b6e3
Rejig gs_pattern1_make_pattern TilingType != 2 behaviour.
Firstly, we change the rounding on bbw so as to give minimum
distortion to the pattern size.
Secondly, we scale the contents to avoid either nasty gaps around
the edges, or lost content around the edges.
2020-08-20 17:46:13 +0100
Robin Watts <Robin.Watts@artifex.com>
fb6a8352a2ba5b1c5b866b27638db4eaf2acac0f
Whitespace/Layout changes to gs_pattern1_make_pattern.
2020-08-19 19:24:19 +0100
Robin Watts <Robin.Watts@artifex.com>
3e74ad126ee3983c634b8254dec0fc3b6544f0bd
Rejig internals of gs_pattern1_make_pattern.
Previously we called "compute_inst_matrix" once at the start, then
maybe either called it again (if we ADJUST_SCALE_BY_GS_TRADITION)
or manually did part of it (retransforming the bbox) (if we
ADJUST_AS_ADOBE).
Due to the vagaries of floating point, we can't be sure that
retransforming the bbox will give exactly the same result (as
our attempt to move the bbox onto a pixel origin may result
in future transformations may give x +/- epsilon rather x,
for example). Consequently, when we retransform, follow the
same procedure as we did before.
This produces some diffs. We choose to accept these (minor) diffs
to give us consistent results.
2020-08-19 19:15:00 +0100
Robin Watts <Robin.Watts@artifex.com>
a3e7fa93b5f6afe7d74bf7c654dec1cff1adb76d
Simplify parameter passing in compute_inst_matrix.
2020-08-24 14:40:01 +0100
Ken Sharp <ken.sharp@artifex.com>
65942618d083d49467f3dd6d9a802e94c6ae0796
pdfwrite - fix another type 3 memory leak this time with CharProcs
CharProcs are a cos object, not a simple byte array, so when we free
them we need to use cos_free() not gs_free_object().
2020-08-24 14:38:38 +0100
Ken Sharp <ken.sharp@artifex.com>
2fdd3c0b9140dd8bd5a9b9bfdcc5ba4683a6eea0
pdfwrite - fix memory leak with type 3 fonts
When freeing type 3 font *resources* (ie the copy pdfwrite keeps to
write into the PDF file) we were not freeing some of the allocated
objects, the 'cached' array and the Resources (which are a dictionary
and so need to be freed by cos_free).
Include gdevpdfo.h for the definition of cos_free()
2020-08-24 09:01:35 +0100
Ken Sharp <ken.sharp@artifex.com>
a7cd4bbf979f2ecbaf19485cbfef42dcb179a927
pdfwrite - fix some typos in comments
2020-08-24 09:01:02 +0100
Ken Sharp <ken.sharp@artifex.com>
c5ae29c5b4ae5d4d9488842275d229b39f445bf1
Coverity ID 361427 fix uninitialised variable.
2020-08-22 13:57:58 +0100
Ken Sharp <ken.sharp@artifex.com>
3f04eaa6230cfe22b944bde4eaeed6c3087d5189
pdfwrite - fix numerous font-related memory leaks
The pdfwrite device was originally written to do all its memory
management via garbage collection, Unfortunately this leads to numerous
memory leaks when using an interpreter which doesn't implement a
garbage collecting memory model. Currently that's everything except
the PostScript interpreter.
Many of these leaks cannot be exercised by anything except the
PostScript interpreter (and the new pdfi interpreter) but I think some
certainly could be.
Don't increment the 'subst' structure when copying a TrueType CIDFont,
this leads to the structure never being freed.
The code to free the 'subst' CID when freeing a TrueType CIDFont was
incorrect, leading to memory crashes (previously it was simply never
executed, and leaked).
When increasing the size of the CIDMap entry for a TrueType CIDFont,
free the memory used by the original map after copying the data and
before overwriting the stored pointer.
When freeing a copied font, if the font is a TrueType CIDFont decrement
the 'subst_CID_on_WMode' member so that it gets freed.
When freeing a copied font, use the copied glyph data 'data' member
rather than the 'size' member to decide if we should free the data.
Sometimes we allocate memory for a size of 0.
When freeing a copied font, if we created a names array for the glyphs
we need to free the string copies of the names we created as well.
When freeing a copied font, if the CIDFMap entry has been created we
must free that too.
When dropping a 'complete' font copy because we won't be using it, do
not simply set the pointer to NULL but actually call code to free the
copied font properly.
When freeing a pdfwrite copy of a base font, if the CIDSet member has
been allocated we need to free it.
When adding to the pdfwrite font cache, if the glyph_usage and
real_widths members have already been allocated we must free them before
assigning newly allocated memory.
2020-08-21 12:16:26 -0700
Michael Vrhel <michael.vrhel@artifex.com>
8fcc3e370c3aca71691d48c92d57d7c2ca80672d
C# API: Addition of gsapi_get_param and gsapi_set_param
Preliminary use of these. Which has revealed issues in GPDL with first page
last page use for PDF files.
2020-08-21 11:13:33 +0100
Ken Sharp <ken.sharp@artifex.com>
d55c0edd6c1671d3a09a6061a81e25c0d414cc3f
More version number fixes
The code to retrieve the Ghostscript paths from the Windows Registry
was generating a key based on the version number, but since we added the
patch the generation was incorrect.
Since this is the third (!) case of this, scan the code for any usage of
gs_version, gs_version_number, GS_VERSION, GS_VERSION_NUMBER,
gs_revision, gs_revision_number, GS_REVISION and GS_REVISION_NUMBER.
This reveals two more places, neither serious but we might as well fix
them while we're here.
Thanks to Akira Kakuto for finding this problem and suggesting a patch.
I chose to use the code we were already using in two other places, just
for consistency, but the supplied patch was equally good.
2020-08-20 14:46:07 -0700
Nancy Durgin <nancy.durgin@artifex.com>
34259c34410f7903981d61f1fc9c0b00fd9b3ed1
Fix memory leak in freeing dash_pattern from pdfwrite device state
The vgstack_depth = 0 still means that the entry needs to be freed.
(off by one error)
This was a leak in both gs and pdfi
2020-08-20 18:33:00 +0100
Chris Liddell <chris.liddell@artifex.com>
fae04c94708feb693e7582a9707ca2791e30334e
Delete binary files from lcms2mt tree
There were left over binary libraries, remove them.
2020-08-20 17:19:09 +0100
Chris Liddell <chris.liddell@artifex.com>
3920a727fb19e19f597e518610ce2416d08cb75f
Fix pdfwrite "%d" mode with file permissions
Firstly, in gx_device_delete_output_file the iodev pointer was being passed
to the delete_method incorrectly (passing a pointer to that pointer). Thus
when we attempted to use that to confirm permission to delete the file, it
crashed. Credit to Ken for finding that.
Secondly, due to the way pdfwrite works, when running with an output file per
page, it creates the current output file immediately it has completed writing
the previous one. Thus, it has to delete that partial file on exit.
Previously, the output file was not added to the "control" permission list,
so an attempt to delete it would result in an error. So add the output file
to the "control" as well as "write" list.
2020-08-13 09:47:09 -0700
Nancy Durgin <nancy.durgin@artifex.com>
cb93fa6079796d99b3fb3cfbdd0b919f57d34f58
Fix memory leaks associated with pdfwrite, type3x images
These leaks are only an issue for non-GC interpreters such as pdfi.
2020-08-19 14:31:50 -0700
Nancy Durgin <nancy.durgin@artifex.com>
ac67c85c93703d6883f6d32a6996f33a51293640
Bug702727 -- Fix rc counting of penum->pcs for image1 and image4
This relates to the structure gx_image_enum_s which is used by image1
and image4.
The fix is unfortunately scattered around the code, but I think I found
appropriate places. It is ugly because type1 and type4 images
apparently share a lot of the same code, so the module layers are not
as they should be.
Need to increment and decrement the rc since the enum struct wants to
keep it around (especially in gs where it literally goes back out into
the gs interpreter between when the enum is built and when it is
used!).
This is part of cleaning up memory leaks for non-GC interpreters
(pdfi).
Changed the pcs entry in the enum struct to not be const, since it
needs to be reference counted.
Cleaned up an unrelated compiler warning in gxidata.c
There are also some unrelated whitespace changes.
2020-08-20 13:53:59 +0100
Ken Sharp <ken.sharp@artifex.com>
d434639da425b6172fe1230bbc331ec057daff6f
Trim trailing white space
2020-08-20 12:12:38 +0100
Ken Sharp <ken.sharp@artifex.com>
3808bc680a35b6a19b75555539f66fdd874138f5
txtwrite - improve CIDFont handling
The calculation of the font size for modes 0 & 1 was incorrect when the
font was a CIDFont. The size calculation relied upon the FontMatrix of
the type 0 font and did not consider the descendant.
For PDF files we can ignore the type 0 font and simply use the
descendant font matrix. For PostScript input we will probably have to
be more careful so this is an interim fix for PDF input only.
2020-08-20 12:10:23 +0100
Ken Sharp <ken.sharp@artifex.com>
39a9388184d1788d48e35c47a3e92a4411d106f7
PDF interpreter - reject non-dictionary /Annots array entries
Bug #702745 "Error: /typecheck in --runpdf--"
The PDF file has an invalid /Annots array entry:
5 0 obj
<</Annots[5 0 41 0 R]
The entries should be dictionaries or indirect references to
dictionaries, integers aren't valid. This causes a typecheck error when
trying to read keys from the dictionary.
This commit checks that the entry is a dictionary before trying to
process it; if it isn't we raise a warning and ignore it.
2020-08-20 09:12:12 +0100
Ken Sharp <ken.sharp@artifex.com>
c935055b6b5d20fceb6175877bee9b529dddb199
Fix PDF /Producer for new patch level
Bug #702772 "Strange /Producer attribute"
The change to include a patch level for Ghostscript in the gs_revision
value wasn't being reflected in the code to generate the version
number used in the PDF /Producer string.
Copied the code from printf_program_ident() in base/gsmisc.c to the
code in pdf_store_default_Producer() and commented both pieces of code
to note the existence of each other so that in future hopefully we won't
forget to keep them in sync.
Thanks to Peter Cherepanov for spotting the flaw.
2020-08-19 11:49:39 -0700
Nancy Durgin <nancy.durgin@artifex.com>
d07b9485b2bb3a70552aee9407fcff8fa52698df
Fix memory leak in pdf_begin_typed_image()
Need to decrement the ColorSpace before overwriting it.
2020-08-19 11:38:03 -0700
Nancy Durgin <nancy.durgin@artifex.com>
99e437e619fbd3d91242cba98cc462dadb9a5b8e
Fix some compiler warnings
This also has some whitespace changes -- not my fault! :)
2020-08-18 14:49:41 -0700
Nancy Durgin <nancy.durgin@artifex.com>
a111d7316b0cb2dea8f840e8387fc47b9e252c36
Refactor pdf_begin_typed_image()
Mainly just cleaning up the error handling so it all exits at the
bottom.
Reduced the amount of duplicate code.
Fixed a bunch of memory leaks that would only happen on error
paths.
Broke out the Eps2Write code to reduce size of main function a bit.
2020-08-18 11:15:26 -0700
Nancy Durgin <nancy.durgin@artifex.com>
4ccf8a357a8fce8998ad8d4ab5abb3a4c6b63374
Fix one of several memory leaks in pdfwrite images
The leak is in non-GC interpreters such as pdfi.
This is a 1600 line function. I think it is in drastic need of
refactoring in order to be maintainable.
2020-08-19 18:21:01 +0100
Robin Watts <Robin.Watts@artifex.com>
cc90efbe4abce945e36a68876218a46606b84015
Tweak type1 pattern code to remove some needless fabs.
2020-08-18 23:23:40 -0700
Ray Johnston <ray.johnston@artifex.com>
ec2699f50aa3ada4ef2c477c7577331a3950bcc8
Fix Bug 702381: Hang due to cyclic PDF resources.
The loop is caused by a circular /ParentResources attribute.
This branch of code is triggered by an error in the sample file:
misplaced /Form resources in a Type 3 font. This font has /Resource
dictionaries added to /CharProcs entries rather than the font dictionary.
Note that this patch fixes the hang issue, but does not correct the
issue of not being able to find the correct resource (in the CharProc)
so that the file still output does not match Adobe (mupdf has that
same issue).
Thanks to Peter Cherepanov for this patch.
2020-08-17 15:44:01 +0100
Robin Watts <Robin.Watts@artifex.com>
9619c8fc8d1e2548c737adfb7f6b8b15d49d20a4
Bug 702744: Add windows utf-8 handling for unlink and rename.
To do this, we introduce gp_unlink and gp_rename, and call those
as appropriate.
Also, make gp_open_scratch_file add the file to the permit list.
When such a file is closed, it will be deleted from the permit list.
It will also be removed from the permit list if the file is deleted
using the PS deletefile operator.
On closedown, if scratch files haven't been deleted, then we'll
delete them as part of the closedown of gs_lib_ctx.
This means that 'purging' the control lists must not remove scratch
file paths from the list.
Also, ensure that gsapi callers can't maliciously (or accidentally)
remove scratch path paths from the list so as to leave them around
after closedown.
2020-08-18 10:18:11 +0100
Chris Liddell <chris.liddell@artifex.com>
df245b46c1a5290239b2932e2a5d1bdeae710c48
Bump version number
2020-09-28 12:54:48 +0100
Chris Liddell <chris.liddell@artifex.com>
5f75977a0da7b8e92f2b8241440c43cc44863f63
Docs/dates/version for 9.53.3
2020-09-24 08:19:27 +0100
Chris Liddell <chris.liddell@artifex.com>
c876777dcadbb0acbc8cc887e94360c6f5adbc0d
WhatIsGS.htm updates from Lisa F
2020-09-29 20:16:10 +0100
Chris Liddell <chris.liddell@artifex.com>
be33716b4a6d42f9bd5a5485514dbaeb9e9524b2
Bug 702948: Ensure initial bitmap cache sizes are properly aligned
Now that the allocations from the bitmap cache are aligned to the platform's
required alignment, see commit:
260c443bc14cdffa4d94e14c3a57e35bebee3a5b
We also want the initial size of the memory pool used by the cache to be
"aligned".
This is so that code that attempts to identify cache entries to evict by
requesting a size equal to the entire size of cache memory pool doesn't get an
unexpected failure, because we've rounded up that allocation request to a value
larger than the entire size of the memory pool.
Because we don't expect an error to be possible at that point, a crash can
occur.
Of the "normal" platforms we use, this only exhibits on Win32 because that is
the only platform where the align_bitmap_mod we use is less than the
obj_align_mod used for the memory managers.
2020-09-28 20:10:16 +0100
Chris Liddell <chris.liddell@artifex.com>
27824a749775a233725cf3f302ce8156c478f7e1
Fix icc profile reference counting in transparency compositor
Found during Windows testing for a release.
The full test file for
https://bugs.ghostscript.com/show_bug.cgi?id=693365
would cause Ghostscript to crash due to an ICC profile being freed whilst a
reference was still being held for it. That was not counting up a reference
count when restoring the device profile back to a previous value.
Fixing that introduced a leak for other profiles. And that turned out to be
not decrementing the reference count when replacing a device profile.
2020-09-28 10:21:47 +0100
Chris Liddell <chris.liddell@artifex.com>
d2fa2e186a6cdbdc011a44275532e2f1071111ec
Work around for (I think) a VS2019 optimiser bug
VS2019 release builds crash with the input file from bug 702916 and several
other files, in copied_glyph_slot() because the pointer retrieved and stored
in *pslot is non-sensical.
Debug/Profile builds and optimised builds with earler VS versions don't show
the problem.
Adding debug code to assign the calculated index to an interim unsigned integer
variable also cause the problem to go away.
So, use that as a workaround.
2020-09-28 10:20:26 +0100
Chris Liddell <chris.liddell@artifex.com>
cd36db788b73674e9a18803f451ed910ddd66dba
Fix some casting confusion for special glyph CID/index values
And a whitespace/indentation issue.
Noticed in passing....
2020-09-25 13:03:40 -0700
Ray Johnston <ray.johnston@artifex.com>
787be772d87089ee8224b17ba50ac4adccc75ffe
Fix Bug 702941 - Mispelled PDF interpreter variable name.
s/RepiredAnError/RepairedAnError/ A simple typo that was missed because
we did not have a test file with a format error to trigger this code.
2020-09-25 08:41:03 +0100
Chris Liddell <chris.liddell@artifex.com>
4f9cce5953cae92014ef6652894c183080dd5d19
Version, doc and date updates for 9.53.2
2020-09-25 12:40:01 +0100
Chris Liddell <chris.liddell@artifex.com>
167c75d35336fcfe7c94cf5fb0258406443cdc6b
Bug 702938: Allocating cached glyphs, account for alignment
For efficiency, the glyph cache allocates "large" blocks of memory into which
it parcels out offsets for individual glyph cache bitmaps, as required.
Since cached glyphs are usually fairly small, and potentially can be short
lived, this saves the overheads of "full" memory for every cached glyph.
Unfortunately, in calculating the offsets for the cached glyph, it was failing
to account for the required alignment of the system. In any environment that
strictly enforces aligned memory accesses, this will potentially cause a bus
error.
In this case, it was switching the gs_glyph type to a 64 bit type that triggered
the issue. But any changed to the contents of the cached_char struct could have
resulted in it happening.
2020-09-24 19:08:25 +0100
Chris Liddell <chris.liddell@artifex.com>
104dffc4aec03598257c14ab33b292c8e7149d59
Remove links to ghostscript.com/release_history.html
That page is now gone.
2020-09-24 17:10:21 +0100
Chris Liddell <chris.liddell@artifex.com>
b1c4631aa8910f6da923367984491fc2b883d7a0
Remove dead end links from Readme.htm
2020-09-23 20:20:59 +0100
Chris Liddell <chris.liddell@artifex.com>
334f24a4a8529f8476dfe74dd2b47f1274269263
Bug 702920: Fix type confusion in new param type code.
In a few cases we were using the wrong element in the union to read the
value back from the param list (and to range check the values).
2020-09-15 08:51:08 -0700
Ray Johnston <ray.johnston@artifex.com>
ab2505e19cf36ffc780f6824a50c8e7eacf7af8f
Fix problem with BGPrint and multi-threaded rendering caused by commit cca27988
The unconditional call to enable multi-threaded rendering during set up of the
gx_device_printer as a clist caused the SEGV of bug 702181, but enabling
multi-threaded rendering here isn't correct since it is usually done when we
output the page (gdev_prn_output_page_aux). The problem is that BGPrint would
setup a new clist device to render the page, but needs to enable multi-threaded
rendering for the background clist device. Do this if NumRenderThreads > 0.
2020-09-22 13:10:04 -0700
Ray Johnston <ray.johnston@artifex.com>
a7d7b4f9ea347de35cbbec69a58c3a0a43fda447
Fix gp_file allocations to use thread_safe_memory.
The gpmisc.c does allocations for gp_file objects and buffers used by
gp_fprintf, as well as gp_validate_path_len. The helgrind run with
-dBGPrint -dNumRenderingThreads=4 and PCL input showed up the gp_fprintf
problem since the clist rendering would call gp_fprintf using the same
allocator (PCL's chunk allocator which is non_gc_memory). The chunk
allocator is intentionally not thread safe (for performance).
2020-09-23 07:39:04 -0700
Ray Johnston <ray.johnston@artifex.com>
7a3f5d5ab9cc94ee433dafb5331519855f6671e6
Temporarily disable BGPrint for pcl, xps and gpdl.
In order to safely allow for a 9.53.2 patch release that fixes BGPrint
with NumRenderingThreads while the issues with PCL and friends are
fixed, just ignore BGPrint in pcl/pl/plmain.c
2020-09-16 07:48:47 +0100
Chris Liddell <chris.liddell@artifex.com>
7250256e29355b1ceccd06b3b937b7d0e739d1f7
Bug 702904: Another fix to check for shared libjpeg/libtiff
We cannot combine shared and not shared libjpeg and libtiff - they either both
need to be "local" or both shared, and configure checks that and fails when
the two are incompatible.
However, that check would fail when either libjpeg or libtiff were not being
included at all. Since it is libtiff that is the "problem" for this
compatibility, now check if TIFF is included, and if not, skip the check.
2020-08-25 16:47:10 +0100
ChrisL <cliddell@salvor-openbsd.lan>
1264b6debb1d48e2b9ea0eae8fda86c04f4def9d
Fix the OpenBSD build
Whilst hopefully not breaking the buildroot build.
2020-09-14 16:52:22 +0100
Chris Liddell <chris.liddell@artifex.com>
6011a3d8096c51ae795b436f17b141cceba4d77b
Bug 702901: initialize directory for tiff configure
Previously the directory in which to run the libtiff configure script was
initialised to an empty string, but that, in some toolchains, resulted in an
error due to "unsafe header/library path used in cross-compilation".
So initialise it something benign instead.
2020-08-24 09:01:02 +0100
Ken Sharp <ken.sharp@artifex.com>
0712379d88c2697fef35e60107bf0201a5f1a790
Coverity ID 361427 fix uninitialised variable.
2020-09-14 14:12:23 +0100
Chris Liddell <chris.liddell@artifex.com>
09763e4d082755436bb36bbef912193357058535
Update docs for 9.53.1 release
2020-09-14 14:32:23 +0100
Ken Sharp <ken.sharp@artifex.com>
6d1440b2dabde655a2fe48ddbf0c09a82de4d423
Fix crashes with pdfwrite, TrueType input fonts and Windows 64-bit build
With the change to 64-bits unconditionally for gs_glyph we can now
define GS_MIN_CID_GLYPH in 64-bit terms.
Previously we were using the architecture size of a long_long to
determine which define to use, and we do not define long_long on Windows
leading to us using an essentially 32-bit definition. This caused
indexing off the end of an array in copied_glyph_slot()
2020-09-14 09:40:30 +0100
Chris Liddell <chris.liddell@artifex.com>
e54e9c5eaebc0bf06e57f754a3c16278de412459
Bug 702897: Fix shared libtiff/libjpeg check
For various reasons we cannot combine shared and not shared libjpeg and
libtiff - they either both need to be "local" or both shared.
But the check for that compatibility was triggered during the recursive
configure call when setting up for cross compiling.
Skip the check for that recursive configure call.
2020-09-10 16:18:10 +0100
Chris Liddell <chris.liddell@artifex.com>
f157ed49512438c95635e6340933bbcb14cea524
Tweak History9.htm with jbig2dec updates
2020-09-10 22:47:09 +0800
Sebastian Rasmussen <sebras@gmail.com>
9a5ace846c8af91d047e59c87722d0c36e79e5d3
Bug 702884: Require jbig2dec 0.19 when building ghostscript.
In practice this has been required since commit
9b5008aa2bc1c6a6acb2c6f90d1ef8d6bad9e66a.
2020-09-10 22:41:20 +0800
Sebastian Rasmussen <sebras@gmail.com>
53db58bd227c80375f00135045d36b66868732f4
Update jbig2dec stuff for 0.19 release.
2020-09-10 08:49:46 +0100
Chris Liddell <chris.liddell@artifex.com>
1af88d327daa9392f5c6542dc7e247ddab7c9b0b
Docs and dates for 9.53.0
2020-09-09 11:50:12 +0100
Robin Watts <Robin.Watts@artifex.com>
45884ca68488ac470b894702bdd8da232743d8e4
Bug 702871: Fix GraphicsAlphaBits + Fill/Stroke issue.
When we flush the alphabuffer, mapped_start and mapped_height are
both set to zero. When we refill it, mapped_height is set to
non-zero. USUALLY mapped_start is set to non-zero too, but it can
be set to zero when we are close to the bottom of the page.
Hence we should test for mapped_height != 0, rather than both
mapped_height and mapped_start being non-zero.
So the 'quick hack' that Chris used is actually correct.
2020-08-28 09:31:58 +0100
Ken Sharp <ken.sharp@artifex.com>
4ba6aa1d7253e8ecd7cd796c95306f1203f70879
Bug 702837 typo in warning message
Thanks to Herbert Voss for spotting this. Fixed the typo and updated the
version number in the warning from 9.53 to 9.53.0 to match the actual
version and patch number of the release (the decision to add the patch
level was taken after the original commit)
2020-08-27 09:35:15 +0100
Chris Liddell <chris.liddell@artifex.com>
bd6b59984ad713d2b1d48f3b81bf1e631bf9ee2b
Update dates'n'docs for 9.53.0.RC2
2020-08-24 18:55:30 +0100
Robin Watts <Robin.Watts@artifex.com>
197eb511b5d81a662f801333709199495abe61cf
Fix Tesseract traineddata file loading.
If it was finding any Tesseract data in ROM it was then not looking
for files.
2020-08-24 09:24:31 +0100
Chris Liddell <chris.liddell@artifex.com>
cb279d8a0e356542f6829ed429269ce07ec838a9
Coverity 361429: move "break" to correct place.
We had to add the outputfile to the "control" file permission list (as well
as write), but for the "pipe" case, I accidentally added the call after the
break out of loop that checks for a pipe.
2020-08-21 18:50:55 +0100
Chris Liddell <chris.liddell@artifex.com>
bad72741aad21b17a3965673f3e7949a2fc7c256
PDF interp: Consolidate disabling of page handler device
2020-08-21 11:13:33 +0100
Ken Sharp <ken.sharp@artifex.com>
60bbe61efc97c208f31c2d2d617753232ed1881d
More version number fixes
The code to retrieve the Ghostscript paths from the Windows Registry
was generating a key based on the version number, but since we added the
patch the generation was incorrect.
Since this is the third (!) case of this, scan the code for any usage of
gs_version, gs_version_number, GS_VERSION, GS_VERSION_NUMBER,
gs_revision, gs_revision_number, GS_REVISION and GS_REVISION_NUMBER.
This reveals two more places, neither serious but we might as well fix
them while we're here.
Thanks to Akira Kakuto for finding this problem and suggesting a patch.
I chose to use the code we were already using in two other places, just
for consistency, but the supplied patch was equally good.
2020-08-21 08:14:49 +0100
Chris Liddell <chris.liddell@artifex.com>
45baf1a5b71c2ddad8e16ae2f895c4244e6af9e6
Fox typos and stuff in the release highlights
2020-08-20 18:33:00 +0100
Chris Liddell <chris.liddell@artifex.com>
58ea17fd3032584e04f4e844e2d9991af87f114e
Delete binary files from lcms2mt tree
There were left over binary libraries, remove them.
2020-08-20 17:19:09 +0100
Chris Liddell <chris.liddell@artifex.com>
2ddd9d68bb0831ec8c9dd5e4e2e94bb44f8e5028
Fix pdfwrite "%d" mode with file permissions
Firstly, in gx_device_delete_output_file the iodev pointer was being passed
to the delete_method incorrectly (passing a pointer to that pointer). Thus
when we attempted to use that to confirm permission to delete the file, it
crashed. Credit to Ken for finding that.
Secondly, due to the way pdfwrite works, when running with an output file per
page, it creates the current output file immediately it has completed writing
the previous one. Thus, it has to delete that partial file on exit.
Previously, the output file was not added to the "control" permission list,
so an attempt to delete it would result in an error. So add the output file
to the "control" as well as "write" list.
2020-08-18 10:23:13 +0100
Chris Liddell <chris.liddell@artifex.com>
a12a526799a32c9fc17c7f6c5f37e21246e2d4e7
Update docs, version, dates, product family
for 9.53.0 RC1
2020-08-20 09:12:12 +0100
Ken Sharp <ken.sharp@artifex.com>
f797ac99d0b0a337b5a57c37cdd026f4a9dbf897
Fix PDF /Producer for new patch level
Bug #702772 "Strange /Producer attribute"
The change to include a patch level for Ghostscript in the gs_revision
value wasn't being reflected in the code to generate the version
number used in the PDF /Producer string.
Copied the code from printf_program_ident() in base/gsmisc.c to the
code in pdf_store_default_Producer() and commented both pieces of code
to note the existence of each other so that in future hopefully we won't
forget to keep them in sync.
Thanks to Peter Cherepanov for spotting the flaw.
2020-08-18 23:23:40 -0700
Ray Johnston <ray.johnston@artifex.com>
ec82d2aa95dc8eb764483ff9011585bfc47a0f1b
Fix Bug 702381: Hang due to cyclic PDF resources.
The loop is caused by a circular /ParentResources attribute.
This branch of code is triggered by an error in the sample file:
misplaced /Form resources in a Type 3 font. This font has /Resource
dictionaries added to /CharProcs entries rather than the font dictionary.
Note that this patch fixes the hang issue, but does not correct the
issue of not being able to find the correct resource (in the CharProc)
so that the file still output does not match Adobe (mupdf has that
same issue).
Thanks to Peter Cherepanov for this patch.
2020-08-17 15:44:01 +0100
Robin Watts <Robin.Watts@artifex.com>
a01320e4d57d984f5bf65126534dbb3c33b416a4
Bug 702744: Add windows utf-8 handling for unlink and rename.
To do this, we introduce gp_unlink and gp_rename, and call those
as appropriate.
Also, make gp_open_scratch_file add the file to the permit list.
When such a file is closed, it will be deleted from the permit list.
It will also be removed from the permit list if the file is deleted
using the PS deletefile operator.
On closedown, if scratch files haven't been deleted, then we'll
delete them as part of the closedown of gs_lib_ctx.
This means that 'purging' the control lists must not remove scratch
file paths from the list.
Also, ensure that gsapi callers can't maliciously (or accidentally)
remove scratch path paths from the list so as to leave them around
after closedown.
Changelog
2020-09-28 12:54:48 +0100
Chris Liddell <chris.liddell@artifex.com>
1da1144e165aa1643a440e45f238c2301982bf79
Docs/dates/version for 9.53.3
Resource/Init/gs_init.ps
base/version.mak
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Internal.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
2020-09-29 20:16:10 +0100
Chris Liddell <chris.liddell@artifex.com>
ae7767cd15946cd4058037acf965848a5bd5cb33
Bug 702948: Ensure initial bitmap cache sizes are properly aligned
Now that the allocations from the bitmap cache are aligned to the platform's
required alignment, see commit:
260c443bc14cdffa4d94e14c3a57e35bebee3a5b
We also want the initial size of the memory pool used by the cache to be
"aligned".
This is so that code that attempts to identify cache entries to evict by
requesting a size equal to the entire size of cache memory pool don't get an
unexpected failure, because we've rounded up that allocation request to a value
larger than the entire size of the memory pool.
Because we don't expect an error to be possible at that point, a crash can
occur.
Of the "normal" platforms we use, this only exhibits on Win32 because that is
the only platform where the align_bitmap_mod we use is less than the
obj_align_mod used for the memory managers.
base/gxccman.c
base/gxclist.c
base/lib.mak
2020-09-28 20:10:16 +0100
Chris Liddell <chris.liddell@artifex.com>
27824a749775a233725cf3f302ce8156c478f7e1
Fix icc profile reference counting in transparency compositor
Found during Windows testing for a release.
The full test file for
https://bugs.ghostscript.com/show_bug.cgi?id=693365
would cause Ghostscript to crash due to an ICC profile being freed whilst a
reference was still being held for it. That was not counting up a reference
count when restoring the device profile back to a previous value.
Fixing that introduced a leak for other profiles. And that turned out to be
not decrementing the reference count when replacing a device profile.
base/gdevp14.c
2020-09-28 10:21:47 +0100
Chris Liddell <chris.liddell@artifex.com>
d2fa2e186a6cdbdc011a44275532e2f1071111ec
Work around for (I think) a VS2019 optimiser bug
VS2019 release builds crash with the input file from bug 702916 and several
other files, in copied_glyph_slot() because the pointer retrieved and stored
in *pslot is non-sensical.
Debug/Profile builds and optimised builds with earler VS versions don't show
the problem.
Adding debug code to assign the calculated index to an interim unsigned integer
variable also cause the problem to go away.
So, use that as a workaround.
devices/gxfcopy.c
2020-09-28 10:20:26 +0100
Chris Liddell <chris.liddell@artifex.com>
cd36db788b73674e9a18803f451ed910ddd66dba
Fix some casting confusion for special glyph CID/index values
And a whitespace/indentation issue.
Noticed in passing....
base/gsccode.h
2020-09-25 13:03:40 -0700
Ray Johnston <ray.johnston@artifex.com>
787be772d87089ee8224b17ba50ac4adccc75ffe
Fix Bug 702941 - Mispelled PDF interpreter variable name.
s/RepiredAnError/RepairedAnError/ A simple typo that was missed because
we did not have a test file with a format error to trigger this code.
Resource/Init/pdf_base.ps
2020-09-25 08:41:03 +0100
Chris Liddell <chris.liddell@artifex.com>
6b2b35fbbc230be106190c3948b14553410c29e0
Version, doc and date updates for 9.53.2
Resource/Init/gs_init.ps
base/version.mak
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Internal.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
2020-09-25 12:40:01 +0100
Chris Liddell <chris.liddell@artifex.com>
167c75d35336fcfe7c94cf5fb0258406443cdc6b
Bug 702938: Allocating cached glyphs, account for alignment
For efficiency, the glyph cache allocates "large" blocks of memory into which
it parcels out offsets for individual glyph cache bitmaps, as required.
Since cached glyphs are usually fairly small, and potentially can be short
lived, this saves the overheads of "full" memory for every cached glyph.
Unfortunately, in calculating the offsets for the cached glyph, it was failing
to account for the required alignment of the system. In any environment that
strictly enforces aligned memory accesses, this will potentially cause a bus
error.
In this case, it was switching the gs_glyph type to a 64 bit type that triggered
the issue. But any changed to the contents of the cached_char struct could have
resulted in it happening.
base/gxbcache.c
base/lib.mak
2020-09-24 17:10:21 +0100
Chris Liddell <chris.liddell@artifex.com>
b1c4631aa8910f6da923367984491fc2b883d7a0
Remove dead end links from Readme.htm
doc/Readme.htm
2020-09-23 20:20:59 +0100
Chris Liddell <chris.liddell@artifex.com>
334f24a4a8529f8476dfe74dd2b47f1274269263
Bug 702920: Fix type confusion in new param type code.
In a few cases we were using the wrong element in the union to read the
value back from the param list (and to range check the values).
base/gsparam.c
2020-09-15 08:51:08 -0700
Ray Johnston <ray.johnston@artifex.com>
ab2505e19cf36ffc780f6824a50c8e7eacf7af8f
Fix problem with BGPrint and multi-threaded rendering caused by commit cca27988
The unconditional call to enable multi-threaded rendering during set up of the
gx_device_printer as a clist caused the SEGV of bug 702181, but enabling
multi-threaded rendering here isn't correct since it is usually done when we
output the page (gdev_prn_output_page_aux). The problem is that BGPrint would
setup a new clist device to render the page, but needs to enable multi-threaded
rendering for the background clist device. Do this if NumRenderThreads > 0.
base/gdevprn.c
2020-09-22 13:10:04 -0700
Ray Johnston <ray.johnston@artifex.com>
a7d7b4f9ea347de35cbbec69a58c3a0a43fda447
Fix gp_file allocations to use thread_safe_memory.
The gpmisc.c does allocations for gp_file objects and buffers used by
gp_fprintf, as well as gp_validate_path_len. The helgrind run with
-dBGPrint -dNumRenderingThreads=4 and PCL input showed up the gp_fprintf
problem since the clist rendering would call gp_fprintf using the same
allocator (PCL's chunk allocator which is non_gc_memory). The chunk
allocator is intentionally not thread safe (for performance).
base/gpmisc.c
2020-09-23 07:39:04 -0700
Ray Johnston <ray.johnston@artifex.com>
7a3f5d5ab9cc94ee433dafb5331519855f6671e6
Temporarily disable BGPrint for pcl, xps and gpdl.
In order to safely allow for a 9.53.2 patch release that fixes BGPrint
with NumRenderingThreads while the issues with PCL and friends are
fixed, just ignore BGPrint in pcl/pl/plmain.c
pcl/pl/plmain.c
2020-09-16 07:48:47 +0100
Chris Liddell <chris.liddell@artifex.com>
7250256e29355b1ceccd06b3b937b7d0e739d1f7
Bug 702904: Another fix to check for shared libjpeg/libtiff
We cannot combine shared and not shared libjpeg and libtiff - they either both
need to be "local" or both shared, and configure checks that and fails when
the two are incompatible.
However, that check would fail when either libjpeg or libtiff were not being
included at all. Since it is libtiff that is the "problem" for this
compatibility, now check if TIFF is included, and if not, skip the check.
configure.ac
2020-08-25 16:47:10 +0100
ChrisL <cliddell@salvor-openbsd.lan>
1264b6debb1d48e2b9ea0eae8fda86c04f4def9d
Fix the OpenBSD build
Whilst hopefully not breaking the buildroot build.
Makefile.in
base/freetype.mak
configure.ac
2020-09-14 16:52:22 +0100
Chris Liddell <chris.liddell@artifex.com>
6011a3d8096c51ae795b436f17b141cceba4d77b
Bug 702901: initialize directory for tiff configure
Previously the directory in which to run the libtiff configure script was
initialised to an empty string, but that, in some toolchains, resulted in an
error due to "unsafe header/library path used in cross-compilation".
So initialise it something benign instead.
configure.ac
2020-08-24 09:01:02 +0100
Ken Sharp <ken.sharp@artifex.com>
0712379d88c2697fef35e60107bf0201a5f1a790
Coverity ID 361427 fix uninitialised variable.
base/gdevflp.c
2020-09-14 14:32:23 +0100
Ken Sharp <ken.sharp@artifex.com>
6d1440b2dabde655a2fe48ddbf0c09a82de4d423
Fix crashes with pdfwrite, TrueType input fonts and Windows 64-bit build
With the change to 64-bits unconditionally for gs_glyph we can now
define GS_MIN_CID_GLYPH in 64-bit terms.
Previously we were using the architecture size of a long_long to
determine which define to use, and we do not define long_long on Windows
leading to us using an essentially 32-bit definition. This caused
indexing off the end of an array in copied_glyph_slot()
base/gsccode.h
2020-09-14 09:40:30 +0100
Chris Liddell <chris.liddell@artifex.com>
e54e9c5eaebc0bf06e57f754a3c16278de412459
Bug 702897: Fix shared libtiff/libjpeg check
For various reasons we cannot combine shared and not shared libjpeg and
libtiff - they either both need to be "local" or both shared.
But the check for that compatibility was triggered during the recursive
configure call when setting up for cross compiling.
Skip the check for that recursive configure call.
configure.ac
2020-09-10 22:47:09 +0800
Sebastian Rasmussen <sebras@gmail.com>
9a5ace846c8af91d047e59c87722d0c36e79e5d3
Bug 702884: Require jbig2dec 0.19 when building ghostscript.
In practice this has been required since commit
9b5008aa2bc1c6a6acb2c6f90d1ef8d6bad9e66a.
configure.ac
2020-09-10 22:41:20 +0800
Sebastian Rasmussen <sebras@gmail.com>
53db58bd227c80375f00135045d36b66868732f4
Update jbig2dec stuff for 0.19 release.
jbig2dec/CHANGES
jbig2dec/jbig2.h
jbig2dec/jbig2dec.1
2020-09-09 11:50:12 +0100
Robin Watts <Robin.Watts@artifex.com>
45884ca68488ac470b894702bdd8da232743d8e4
Bug 702871: Fix GraphicsAlphaBits + Fill/Stroke issue.
When we flush the alphabuffer, mapped_start and mapped_height are
both set to zero. When we refill it, mapped_height is set to
non-zero. USUALLY mapped_start is set to non-zero too, but it can
be set to zero when we are close to the bottom of the page.
Hence we should test for mapped_height != 0, rather than both
mapped_height and mapped_start being non-zero.
So the 'quick hack' that Chris used is actually correct.
base/gdevabuf.c
2020-08-28 09:31:58 +0100
Ken Sharp <ken.sharp@artifex.com>
4ba6aa1d7253e8ecd7cd796c95306f1203f70879
Bug 702837 typo in warning message
Thanks to Herbert Voss for spotting this. Fixed the typo and updated the
version number in the warning from 9.53 to 9.53.0 to match the actual
version and patch number of the release (the decision to add the patch
level was taken after the original commit)
Resource/Init/pdf_main.ps
2020-08-24 18:55:30 +0100
Robin Watts <Robin.Watts@artifex.com>
197eb511b5d81a662f801333709199495abe61cf
Fix Tesseract traineddata file loading.
If it was finding any Tesseract data in ROM it was then not looking
for files.
base/tessocr.cpp
2020-08-24 09:24:31 +0100
Chris Liddell <chris.liddell@artifex.com>
cb279d8a0e356542f6829ed429269ce07ec838a9
Coverity 361429: move "break" to correct place.
We had to add the outputfile to the "control" file permission list (as well
as write), but for the "pipe" case, I accidentally added the call after the
break out of loop that checks for a pipe.
base/gslibctx.c
2020-08-21 18:50:55 +0100
Chris Liddell <chris.liddell@artifex.com>
bad72741aad21b17a3965673f3e7949a2fc7c256
PDF interp: Consolidate disabling of page handler device
Resource/Init/pdf_main.ps
2020-08-21 11:13:33 +0100
Ken Sharp <ken.sharp@artifex.com>
60bbe61efc97c208f31c2d2d617753232ed1881d
More version number fixes
The code to retrieve the Ghostscript paths from the Windows Registry
was generating a key based on the version number, but since we added the
patch the generation was incorrect.
Since this is the third (!) case of this, scan the code for any usage of
gs_version, gs_version_number, GS_VERSION, GS_VERSION_NUMBER,
gs_revision, gs_revision_number, GS_REVISION and GS_REVISION_NUMBER.
This reveals two more places, neither serious but we might as well fix
them while we're here.
Thanks to Akira Kakuto for finding this problem and suggesting a patch.
I chose to use the code we were already using in two other places, just
for consistency, but the supplied patch was equally good.
base/gp_wgetv.c
devices/gdevpdfimg.c
devices/gdevpng.c
2020-08-21 08:14:49 +0100
Chris Liddell <chris.liddell@artifex.com>
45baf1a5b71c2ddad8e16ae2f895c4244e6af9e6
Fox typos and stuff in the release highlights
doc/History9.htm
doc/News.htm
2020-08-20 18:33:00 +0100
Chris Liddell <chris.liddell@artifex.com>
58ea17fd3032584e04f4e844e2d9991af87f114e
Delete binary files from lcms2mt tree
There were left over binary libraries, remove them.
lcms2mt/Lib/MS/lcms2_fast_float_plugin.lib
lcms2mt/Lib/MS/lcms2_static.lib
lcms2mt/Lib/MS/lcms2mt_fast_float_plugin.lib
lcms2mt/Lib/MS/lcms2mt_static.lib
2020-08-20 17:19:09 +0100
Chris Liddell <chris.liddell@artifex.com>
2ddd9d68bb0831ec8c9dd5e4e2e94bb44f8e5028
Fix pdfwrite "%d" mode with file permissions
Firstly, in gx_device_delete_output_file the iodev pointer was being passed
to the delete_method incorrectly (passing a pointer to that pointer). Thus
when we attempted to use that to confirm permission to delete the file, it
crashed. Credit to Ken for finding that.
Secondly, due to the way pdfwrite works, when running with an output file per
page, it creates the current output file immediately it has completed writing
the previous one. Thus, it has to delete that partial file on exit.
Previously, the output file was not added to the "control" permission list,
so an attempt to delete it would result in an error. So add the output file
to the "control" as well as "write" list.
base/gsdevice.c
base/gslibctx.c
2020-08-18 10:23:13 +0100
Chris Liddell <chris.liddell@artifex.com>
dee56822c0c9989fdf0115dab79842ad116c14f3
Update version, dates, product family
for 9.53.0 RC1
base/gscdefs.h
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Internal.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
2020-08-20 09:12:12 +0100
Ken Sharp <ken.sharp@artifex.com>
f797ac99d0b0a337b5a57c37cdd026f4a9dbf897
Fix PDF /Producer for new patch level
Bug #702772 "Strange /Producer attribute"
The change to include a patch level for Ghostscript in the gs_revision
value wasn't being reflected in the code to generate the version
number used in the PDF /Producer string.
Copied the code from printf_program_ident() in base/gsmisc.c to the
code in pdf_store_default_Producer() and commented both pieces of code
to note the existence of each other so that in future hopefully we won't
forget to keep them in sync.
Thanks to Peter Cherepanov for spotting the flaw.
base/gsmisc.c
devices/vector/gdevpdfu.c
2020-08-18 23:23:40 -0700
Ray Johnston <ray.johnston@artifex.com>
ec82d2aa95dc8eb764483ff9011585bfc47a0f1b
Fix Bug 702381: Hang due to cyclic PDF resources.
The loop is caused by a circular /ParentResources attribute.
This branch of code is triggered by an error in the sample file:
misplaced /Form resources in a Type 3 font. This font has /Resource
dictionaries added to /CharProcs entries rather than the font dictionary.
Note that this patch fixes the hang issue, but does not correct the
issue of not being able to find the correct resource (in the CharProc)
so that the file still output does not match Adobe (mupdf has that
same issue).
Thanks to Peter Cherepanov for this patch.
Resource/Init/pdf_base.ps
Resource/Init/pdf_main.ps
2020-08-17 15:44:01 +0100
Robin Watts <Robin.Watts@artifex.com>
a01320e4d57d984f5bf65126534dbb3c33b416a4
Bug 702744: Add windows utf-8 handling for unlink and rename.
To do this, we introduce gp_unlink and gp_rename, and call those
as appropriate.
Also, make gp_open_scratch_file add the file to the permit list.
When such a file is closed, it will be deleted from the permit list.
It will also be removed from the permit list if the file is deleted
using the PS deletefile operator.
On closedown, if scratch files haven't been deleted, then we'll
delete them as part of the closedown of gs_lib_ctx.
This means that 'purging' the control lists must not remove scratch
file paths from the list.
Also, ensure that gsapi callers can't maliciously (or accidentally)
remove scratch path paths from the list so as to leave them around
after closedown.
base/gp.h
base/gp_mswin.c
base/gp_os2.c
base/gp_os2fs.c
base/gp_os2pr.c
base/gp_unifs.c
base/gp_vms.c
base/gp_winfs.c
base/gpmisc.c
base/gsiodev.c
base/gslibctx.c
base/gslibctx.h
base/mkromfs.c
base/winlib.mak
pcl/pl/pjparse.c
psi/imain.c
psi/zfile.c
xps/xpsjxr.c
xps/xpstop.c
2020-08-11 14:41:28 +0100
Chris Liddell <chris.liddell@artifex.com>
0e98e2a27ed19fcc138215afe17ab1a173aeed7b
Add patch version to version number
This makes it easier to issue patch releases for security problems.
Resource/Init/gs_init.ps
base/gsmisc.c
base/version.mak
devices/gdevtifs.c
2020-08-17 13:14:18 +0100
Chris Liddell <chris.liddell@artifex.com>
7cfa8d364797aed267285124a32b5cc5e1cd4794
Bug 702360: Allow @loader_path on darwin so build
As this is change in behaviour, it's optional. The configure script now
uses (if set) a environment variable called "DARWIN_LDFLAGS_SO_PREFIX" -
included "DARWIN" because it only applies to DARWIN derived systems.
This allows the caller to use:
./configure DARWIN_LDFLAGS_SO_PREFIX="@loader_path/"
Thus meaning the build will use loader_path rather than "@executable_path".
Configuring/building without that environment variable will retain the current
behaviour.
configure.ac
2020-08-15 11:10:02 +0100
Ken Sharp <ken.sharp@artifex.com>
ffbd883cd13883ace8fb424a8a7c447084ea5fac
Enhance First/LastPage processing
Previously the FirstPage and LastPage processing device did not allow
any means to reset the PageCount. This was because Ghostscript's
command line processing does not permit changing non-PostScript
controls (interpreter and some device parameters) after the first file
has been run.
GPDL however, has a new mechanism 'set_param' which can be used
programmatically, and that does permit for device and interpreter
parameters to be altered after the initial file has been processed.
To allow for this the gdevflp device now processes parameters itself
instead of relying on the underlying device to do so. The parameters
FirstPage, LastPage, PageList and DisablePageHandler now all reset the
page count to 0 when they are encountered. This means that, using gpdl,
it is possible to select a set of pages from one file, then select a
different set of pages from a second file. Sending any of these
parameters (except, obviously DisablePageHandler) also now automatically
enables the device again ie it sets DisablePageHandler to false.
It is not, unfortunately, possible to load the gdevflp device at any
time except when the underlying device is initially opened. This means
that if any file is to be processed using gdevflp the first file must
use one of the parameters, in order to load gdevflp. The simplest
solution is simply to set -dFirstPage=1 which will load the device and
run all the pages from the file.
This commit also includes a minor change to the PDF interpreter. Because
the PDF interpreter (currently) handles subsets of pages itself, it
does not want the first/last page device to be active, so it
disables the device by sending a 'DisablePageHandler' to it. However
(because of the GS command line, as described in the first paragraph) it
did not bother to re-enable the device. So here we add a line to
re-enable the device after processing is complete.
This is probably superfluous now that sending the params will re-enable
the gdevflp device anyway, but it should make the intention plain.
Resource/Init/pdf_main.ps
base/gdevflp.c
2020-08-14 10:47:04 -0700
Michael Vrhel <michael.vrhel@artifex.com>
604646154201c1ecd7000a04fd33778d95b6aeac
Bug 702725 Maintain spot colors when overprint mismatch in process CS
If the process color space does not match the source color space (for example
drawing an RGB image to a CMYK device) and overprint is true, then we should
still retain the spot colorants assuming the device supports them.
base/gscspace.c
base/gscspace.h
base/gsicc.c
base/lib.mak
2020-08-14 12:40:37 +0100
Julian Smith <jules@op59.net>
a02c4496e0c41f5db492e3e549ad06254676dd0e
demos/python/gsapi.py: match new handling of bool by gsapi_set_param().
demos/python/gsapi.py
2020-08-14 16:32:52 +0100
Robin Watts <Robin.Watts@artifex.com>
99c90d8d20d4be6113016154119dc102c18c986b
Update api_test.
Fix proper expectation of return codes when setting params.
Fix alignment of memory buffers for display buffer test. md5sums
of generated files now match properly.
demos/c/api_test.c
2020-08-14 16:30:37 +0100
Robin Watts <Robin.Watts@artifex.com>
067b1ee4b45ee31d251bb796b30079866465ce42
Fix stray error during param to string conversions.
base/gsparaml.c
2020-08-14 13:14:26 +0100
Robin Watts <Robin.Watts@artifex.com>
8eaac9486822db53d3a903ec8638dd83f6677782
Add a couple of files missing from VS Solution.
windows/ghostscript.vcxproj
windows/ghostscript.vcxproj.filters
2020-08-14 13:05:14 +0100
Robin Watts <Robin.Watts@artifex.com>
043a9629cfc27d743b5125584753fd15e462d772
Update gsapi_set_params to use an "int *" for booleans.
doc/API.htm
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/plmain.h
psi/iapi.c
psi/iapi.h
2020-08-14 11:10:27 +0100
Chris Liddell <chris.liddell@artifex.com>
d7e8ea24060997ea5f4be1808b45117fe59b9ead
Bug 702611: Fix tiff_from_filep to handle subclassing
tiff_from_filep() creates a tiffio structure, which contains a pointer to the
tiff device. If the device has been subclassed, however, that is the transient
copy of the tiff device, and not the memory used by the "real" device, as
pointed to by the graphics state.
Since we only use the device to get to the gs_memory_t pointer, just store that
instead.
base/gstiffio.c
2020-08-13 11:15:01 -0700
Nancy Durgin <nancy.durgin@artifex.com>
ae3d32942f4f976e89faff65c4e2fbcf4c6d5068
Fix memory leak associated with pdfwrite, type3x images
This leak is only an issue for non-GC interpreters such as pdfi
devices/vector/gdevpdfi.c
2020-08-13 10:38:45 +0100
Ken Sharp <ken.sharp@artifex.com>
3f2408d5ac786ac1c0a837b600f4ef3be9be0332
graphics library- clean up streams used as DataSource for functions
The graphics library doesn't close streams which are supplied as
the DataSource for type 0 functions, leading to a memory leak in pdfi
because we create memory streams (and hence allocate buffers) for this
kind of input.
Add code to close the stream (if present) when the type 0 function is
freed. There may be future work required here and in other function
types.
base/gsfunc0.c
2020-08-12 15:15:25 -0700
Michael Vrhel <michael.vrhel@artifex.com>
0694e6e708ccab305524b64692403308f62f2652
More API.htm fixes
Found by Ethan Vrhel.
doc/API.htm
2020-08-11 13:53:07 +0100
Ken Sharp <ken.sharp@artifex.com>
5066e260483660b8c13caab141fd34f5844298c7
Improve client memory handling for colour spaces and patterns
Colour spaces have had a client_data member for some time (only used
with Pantone colour replacement) but no means to signal to the client
that a colour space was going to be freed.
In addition, its terribly hard for an interpreter which uses complex
colour spaces (such as Separation and DeviceN, for Patterns see below)
to reliably track when a colour space is freed.
This commit adds a new 'interpreter_data' pointer to hold data allocated
by the interpreter which is associated with a colour space. We also add
an 'interpreter_free_cspace_proc' to be called when a colour space is
about to be freed. This gives the interpreter an opportunity to clean
up the memory it has associated with the colour space.
Similarly pattern instances (as opposed to Pattern colour spaces) have
long had a client_data member, which was previously stored in the
'template' (which is a terrible misnomer) for both type 1 and type 2
patterns. However there was no procedure to notify the client when the
pattern was freed! The PCL interpreter (which was the only one using
this type of pattern) dealt with this by replacing the 'free' routine
in the structure with its own routine which first freed the client data
and then called the original free routine. This seems like a hack.
This commit moves the client_data out of the pattern instance and into
the pattern structure proper. It also adds a 'notfy_free' member which
holds a pointer to a function to be called when a pattern is freed. This
gives the client a reliable opportunity to clean up the client_data.
These changes involve updating the PostScript, PCL and XPS interpreters
to point to the new location of the client_data, as well as similar
changes in the graphics library. pixmap patterns now use the notify_free
functio0n instead of patching over the structure's free routine.
base/gscspace.c
base/gscspace.h
base/gspcolor.c
base/gspcolor.h
base/gsptype1.c
base/gsptype1.h
pcl/pxl/pxink.c
psi/zpcolor.c
psi/zshade.c
xps/xpstile.c
2020-08-12 10:46:32 +0100
Robin Watts <Robin.Watts@artifex.com>
e0529567af14fbbbd397b79ad9579d97799abfa5
Update Makefiles for new MSVC version.
base/msvclib.mak
psi/msvc.mak
2020-08-11 16:09:48 -0700
Michael Vrhel <michael.vrhel@artifex.com>
2228dad8c8649a120fd68d707824be1a06c87ee8
Fix missing bits and errors in API.htm
doc/API.htm
2020-08-08 10:02:18 -0700
Ray Johnston <ray.johnston@artifex.com>
e52f3fccbbb81a4cc0e26837dea4359bda774d3c
Fix Bug 702472: Array contents scrambled with writeobject/printobject
Thanks to Peter Cherepanov for this patch.
The mix-up of the nested arrays was caused by depth-first traversal of
the array tree and assignment of offsets to subsidiary arrays that assumed
width-first traversal. Switching to width-first traversal in all cases is
the easiest way to fix the problem.
Additionally, access to the list of arrays is now implemented with the
-index- operator that has constant complexity, rather than with -roll-
that has linear complexity. So the whole process now has linear complexity
rather than quadratic.
The total number of arrays in the exported object is arbitrarily limited to
64K. This prevents memory exhaustion when exported object has circular
references, but should not hinder real world usage, if any.
Following the original implementation, equal names are not merged and
exported separately.
NOTE:
A Ghostscript extension, support of dictionaries in binary object sequence
has been removed. Following the recent trend of cleaning up non-standard
features.
Dictionary support is not yet removed from the C part. Contrary to PLRM,
Adobe can parse binary object sequences with a non-zero tag in the top
object. This feature is not yet added. Sequences that contain zero
length names can be exported but cannot be imported due a conflict with
accessing the user name index. This is a design flaw in PostScript.
Resource/Init/gs_btokn.ps
2020-08-10 13:51:43 +0100
Julian Smith <jules@op59.net>
9ff6690610a44be40b938ac948d2d0e96852fac2
demos/python/gsapi.py: added support for gsapi_get_param() and gsapi_enumerate_params().
Also:
Wrote some very crude tests of new fns.
Extended gsapi_set_param() to take optional <type_> arg.
Fixed error in handling of word size on 64-bit Windows.
demos/python/gsapi.py
2020-08-11 16:13:55 +0100
Robin Watts <Robin.Watts@artifex.com>
fbe65ad97b583611ad854941927aa4b5a6642c55
Swap order of arguments in gsapi_set_param/gsapi_get_param.
This should play nicer with python.
demos/c/api_test.c
doc/API.htm
doc/GPDL.htm
pcl/pl/plapi.c
pcl/pl/plapi.h
psi/iapi.c
psi/iapi.h
psi/imainarg.c
2020-08-10 18:29:17 +0100
Robin Watts <Robin.Watts@artifex.com>
4a98669de4caf9ac9598ba28633979c78f31d884
Fix gsapi_get_param behaviour on 'not found'.
Now we return gs_error_undefined if a value is not found.
doc/API.htm
pcl/pl/plapi.h
pcl/pl/plmain.c
psi/iapi.c
psi/iapi.h
2020-08-07 18:07:08 -0700
Ray Johnston <ray.johnston@artifex.com>
826f4411a7e879f0891728c0d38c82c516ae34d7
Bug 702607: Fix (and IMPROVE the maintainability of) EPSFitPage
Thanks to Peter Cherepanov for this excellent PostScript code to perform
the scale and rotate FitPage. It is well designed and well documented and
much more understandable than the previous.
Resource/Init/gs_epsf.ps
2020-08-07 18:29:16 +0100
Robin Watts <Robin.Watts@artifex.com>
18caff3cdf2158e7642ded330bbaf14469863c7e
Update .def files with new gsapi functions.
psi/gsdll2.def
psi/gsdll32.def
psi/gsdll32metro.def
psi/gsdll64.def
psi/gsdll64metro.def
psi/gsdllARM32metro.def
2020-08-04 19:45:27 +0100
Robin Watts <Robin.Watts@artifex.com>
4f5692b9c78f0a9fb92c2019d509b80e08a19636
Update api_test: test enumeration of parameters.
demos/c/api_test.c
2020-08-07 18:01:37 +0100
Robin Watts <Robin.Watts@artifex.com>
e66ab52ed2d65ad6989e73b8c6c797faced8343a
Improve gs_param to string functions.
size_t's and int64_t's were being displayed wrong due to a typo
in my use of the PRI macros.
Allow strings to be returned as human readable strings rather than
hexstrings.
base/gsparaml.c
2020-08-07 15:18:07 +0100
Robin Watts <Robin.Watts@artifex.com>
c5b0d528b9e3cbbeadeaba4e7f2e6958cc2a99a6
Add gsapi_enumerate_params functions.
doc/API.htm
pcl/pl/pl.mak
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/plmain.h
psi/iapi.c
psi/iapi.h
psi/iminst.h
psi/psapi.c
2020-08-08 09:32:59 +0100
Robin Watts <Robin.Watts@artifex.com>
0c2e9b65fbc6a7b813fbf96e59d01bd8ffc776e4
Coverity 361226: Add missing break.
psi/imainarg.c
2020-08-07 18:00:58 +0100
Robin Watts <Robin.Watts@artifex.com>
d65d008f20c1cefb27f9ee2f40bcde268050cd6e
Fix typo in default param handling.
PageList should be a string, not a name.
base/gsdparam.c
2020-08-06 07:44:07 -0700
Nancy Durgin <nancy.durgin@artifex.com>
249da10b83dd8ed287877e6d21fa3ca3658aadea
Add gstate param to client callback
This is needed for the pdfi interpreter.
base/gsstate.c
base/gxstate.h
pcl/pcl/pctop.c
pcl/pxl/pxgstate.c
psi/zgstate.c
2020-08-04 19:45:27 +0100
Robin Watts <Robin.Watts@artifex.com>
419fe20af3bdf203f980f41bd92189c7a76b32ba
Update api_test.
Test param getting, and resolution changing.
demos/c/api_test.c
2020-08-06 15:23:50 +0100
Robin Watts <Robin.Watts@artifex.com>
d01489255d8b5e1733ac1d664cbc1fbf206319e9
Fix bug in param array coercion.
If we're going to autoconvert an int array to a float array,
make sure we label the final array as being floats, otherwise
we run the risk of converting it again!
base/gscparam.c
2020-08-06 13:30:45 +0100
Robin Watts <Robin.Watts@artifex.com>
afac1313514a34b47bd7f3f441c6ec0ef169fccc
Tidy printing of floating point numbers in get_params.
base/gsparaml.c
2020-08-06 13:30:22 +0100
Robin Watts <Robin.Watts@artifex.com>
afbecca968cf0701da25cc7ec8ceba9075aad0f8
Parse #xx in param names correctly (for gsapi_set_param).
base/gsparaml.c
2020-08-06 12:02:59 +0100
Robin Watts <Robin.Watts@artifex.com>
783049405b39fb48f84d4ddee478e4ea10631c3d
Support arrays of names in the param passing code.
base/gsparaml.c
2020-08-05 18:48:59 +0100
Robin Watts <Robin.Watts@artifex.com>
d1d44a90cf94338fec8ccf73338767ddb07a2254
Update docs for set_param/get_param and -p.
doc/API.htm
doc/Use.htm
2020-08-05 16:16:39 +0100
Robin Watts <Robin.Watts@artifex.com>
34703d722359c7547c532a3e24d2cd81c3f332f5
Trigger an initgraphics on every usage of -p within gs.
This enables us to set the resolution and have it reflected.
psi/iapi.c
psi/imainarg.c
psi/int.mak
2020-08-05 13:44:51 +0100
Robin Watts <Robin.Watts@artifex.com>
932dc770a270ff7c70e899f953df9e9c72620d47
Update gpdl to accept -d/-s/-p after filenames.
pcl/pl/plmain.c
2020-08-05 13:18:00 +0100
Robin Watts <Robin.Watts@artifex.com>
4d94506a1a9442bd3cc51b94eb5f6a16a12588f2
Add -pNAME=STRING options to gs and gpdl to accept parsed params.
This means we no longer need to rely on using -c and passing
postscript fragments to configure (for example) pdfwrite.
pcl/pl/plmain.c
pcl/pl/plmain.h
psi/imainarg.c
2020-08-04 19:44:23 +0100
Robin Watts <Robin.Watts@artifex.com>
fe0c022fbc1906a48b5a03704d9337751b26be8a
Add gsapi_get_param
base/gsparam.h
base/gsparam2.c
base/gsparaml.c
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/plmain.h
psi/iapi.c
psi/iapi.h
psi/psapi.c
psi/psapi.h
2020-08-05 16:52:06 +0100
Robin Watts <Robin.Watts@artifex.com>
3a8f4eca0284294c05a471a99263d22032db84b6
Bug 702606: Fix downsampler failing to initialise with pdfwrite.
Some of the params were being left unset. My mistake when I added
them.
devices/vector/gdevpsdi.c
2020-08-03 12:53:26 -0700
Ray Johnston <ray.johnston@artifex.com>
c935b86d261d91ee04b5bf5f95028473d4af3735
Fix infinite loop in ialloc_validate_memory tracing the freelist.
Found in a DEBUG build running the file from Bug 702586 using:
-sDEVICE=ppmraw -o x.ppm Bug702586.pdf
Hangs after printing the error message:
GPL Ghostscript GIT PRERELEASE 9.53: Unrecoverable error, exit code 1
Fixed by adding a check for self-reference and break out of the loop.
At some point, someone may want to look at how we get this freelist
problem.
psi/ilocate.c
2020-08-04 12:32:20 +0100
Robin Watts <Robin.Watts@artifex.com>
ae588a57abccc598d74cb664c117ef339a42c1ba
Coverity 361222: Add missing break.
psi/imain.c
2020-08-03 13:57:39 +0100
Robin Watts <Robin.Watts@artifex.com>
341da1a6c41d71344f7ea32505f9ce82c1177e99
Avoid gsapi_set_param within a gsapi_runstring.
Also, avoid gsapi_run_file within a gsapi_runstring.
pcl/pl/plmain.c
psi/iminst.h
psi/psapi.c
2020-08-03 13:17:30 +0100
Robin Watts <Robin.Watts@artifex.com>
d1337dc425e1d032c0eeef26d530b096930432f4
Update header dependencies
base/lib.mak
base/tiff.mak
devices/dcontrib.mak
devices/devs.mak
devices/gdevpdfimg.h
psi/int.mak
2020-07-30 19:16:13 +0100
Robin Watts <Robin.Watts@artifex.com>
bf6884134c244c4766d13c76264fa4372eab4056
gsapi_set_param improvements.
Allow for a 'parsed' param type; this leverages the functions in
gsparaml.c to parse an input string into a param list, coping
with dictionaries and arrays.
We update those functions to improve behaviour on more exotically
formed numbers ("- 0.3e-10" etc), on 'tricksy' inputs (e.g.
"<< /Foo (>>) >>" etc) and to cope without relying on whitespace
(e.g. "<</Foo/Bar/Baz[1 0]/Fizz<1234>/Bang(A)>>" etc).
Update pl_implementation set_param entrypoint so that the language
interface itself is based upon param lists, rather than typed
params.
Update both implementations of gsapi_set_params so that if
we are too early in the setup process stuff goes into the list
and is held until we have devices/languages to pass it to. Also
add a flag to allow for 'more to come' so that we can effectively
set multiple params at once.
base/gsparam.h
base/gsparaml.c
demos/c/api_test.c
demos/c/api_test.vcxproj
gpdl/psitop.c
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/plmain.h
pcl/pl/pltop.c
pcl/pl/pltop.h
psi/iapi.c
psi/iapi.h
psi/imain.c
psi/imain.h
psi/iminst.h
psi/psapi.c
psi/psapi.h
2020-07-31 10:13:27 -0700
Ray Johnston <ray.johnston@artifex.com>
49a4fede913a12a61fd6649898cf5999030f4b69
Fix Bug 702598: Ghostscript will not open SECURED PDF that Adobe opens.
It's not really clear that this is a valid PDF since it does not conform to
one comment in the spec related to AuthEvent with StmF and StrF /Identity,
but since Adobe opens this we now open PDF's with AuthEvent specified as
something other than /DocOpen and BOTH StrF and StmF /Identity. We look
in the /CF "StdCF" dictionary for the AuthEvent. As per the spec., if
AuthEvent is not present, assume DocOpen, and if StmF or StrF are not
present, we default to /Identity.
Thanks to Ken Sharp for the initial work on this.
Resource/Init/pdf_sec.ps
2020-07-30 14:23:23 -0700
Nancy Durgin <nancy.durgin@artifex.com>
e3c4d64fe28ffc1361995de034beaeb2a9a7b206
Fix warning message re: gs_smoothness
base/gsstate.c
base/lib.mak
2020-07-30 14:22:09 -0700
Nancy Durgin <nancy.durgin@artifex.com>
28452533cab466bef9437ee393140695dabc5f9c
Fix memory leak with non-GC overprint device
This memory leak only matters in non-GC (reference-counted) interpreters
such as pdfi.
There was an extra reference count after creating and then setting the
overprint device. This change decrements the rc so that it will be 1
when exiting this function, allowing it to be properly freed later.
base/gsstate.c
2020-07-30 16:18:44 +0100
Julian Smith <jules@op59.net>
a1441168f346cefd28e6336f6fbb3b310540dbff
Changed gsapi.py to raise exceptions instead of returning error number
gsapi.py:
Generate exceptions instead of returning error codes.
Added python versions of gs_error_* codes.
examples.py:
Updated to match new API.
Re-raise import error if 'import gsapi' fails.
Patched up calls of run_gpdl() to pass in_filename because passing None
caused underlying C to return an error.
Marked as executable.
Look for input files relative to top of ghospdl checkout (found using
__file__).
demos/python/examples.py
demos/python/gsapi.py
2020-07-29 17:27:31 +0100
Julian Smith <jules@op59.net>
868200752e41adacc9d027092eba7be2db572b00
demos/python/gsapi.py: added detection of OS to import correct libgs.so/gpdldll*.dll.
demos/python/gsapi.py
2020-07-29 07:25:58 +0100
Julian Smith <jules@op59.net>
54842402fafb0bfc9e4ab2031dbe82e7593f5d08
devices/vector/gdevtxtw.c: Added TextFormat=4 for extract system.
We now retain glyph advance values, and fixed handling of extra widths.
Added .Advs arrays to text_list_entry_s and textw_text_enum_s so that
we can store the original width of glyph before any additions due to
TEXT_ADD_TO_ALL_WIDTHS. E.g. this allows one to determine whether glyphs are
actually not adjacent.
Added TextFormat=4 for generating data suitable for extract system.
txtwrite_process_plain_text:
Don't preserve gs_point dpt across iterations - this was cumlatively
adding additions from TEXT_ADD_TO_SPACE_WIDTH, giving incorrect
positioning. Instead we reset dpt back to {0,0} at the start of each
iteration.
extract_text_output():
New, implements TextFormat=4. Writes similar information to
decorated_text_output() with TextFormat=0, but also specifies advance value
for each char.
devices/vector/gdevtxtw.c
2020-07-29 13:19:02 -0700
Michael Vrhel <michael.vrhel@artifex.com>
7e28caf03348229390e8aa3cf6395e3a13fab0b3
Fix minor items in python demo
Remove ;'s at some line endings (a hard habit to break).
Add try catch around import process. Update README
demos/python/README.txt
demos/python/examples.py
2020-07-29 14:39:46 +0100
Robin Watts <Robin.Watts@artifex.com>
d802303d48d2cb7ac7be157865588b2416e8e633
Add gs_param list parsing functions.
Actually, steal the existing functions from the PJL code,
move them into the graphics library, and refactor slightly.
2 functions; the first one, gs_param_list_add_tokens reads
a string of key/value pairs and adds them to the list.
The second one, gs_param_list_add_parsed_value takes a key
and a string for the value, and just adds that pair to the
list.
base/gsparam.h
base/gsparaml.c
base/lib.mak
pcl/pl/plparams.c
windows/ghostscript.vcxproj
windows/ghostscript.vcxproj.filters
2020-07-29 11:29:31 +0100
Robin Watts <Robin.Watts@artifex.com>
423a04cd8bb7f12ffc127bfb30630348d98694b4
Coverity 361150: Check return values for abuf_flush().
I foolishly checked the return value from abuf_flush() in new
code, which has made Coverity wake up and start complaining
about these older ones.
base/gdevabuf.c
2020-07-25 08:29:31 +0100
Chris Liddell <chris.liddell@artifex.com>
89bba350f5724b034753c4febfc559afad835d5c
Defeat ICC component validation for nullpage device
Further to commit 4a3441bdde7060ecc9048bf391977412a82063a8, it turns out that,
in practice, we can't completely ignore the ICC profile device parameters,
parameters that have an immediate effect on the device are also validated during
put_params and thus, for those, validation can still fail.
Using gxdso_supports_devn allows us to defeat the profile component validation,
but nullpage is not a DeviceN device, hence that could cause confusion.
Using a dedicated gxdso_skip_icc_component_validation allows us to be more
selective about when to short circuit those tests, and avoid confusion.
This is required for gpdl as Postscript initialisation is slightly different
compared to regular Ghostscript - the nulldevice remains in play all through
Postscript initialisation (rather than being replaced with the device
specified by the command arguments part way through initialisation).
base/gdevmpla.c
base/gdevnfwd.c
base/gdevp14.c
base/gsicc_manage.c
base/gxclrect.c
base/gxdevsop.h
devices/gdevcmykog.c
devices/gdevdsp.c
devices/gdevpsd.c
devices/gdevtsep.c
2020-07-27 12:46:02 +0100
Chris Liddell <chris.liddell@artifex.com>
9beae99074655cf78729d5e26862f00cea11b109
Ensure we can call dev_spec_op as soon as device is created
Since we can legitimately want to interrogate a device for its capabilities and
preferences right from its creation, ensure the dev_spec_op is valid as soon
as the device is created.
base/gsdevice.c
2020-07-28 21:36:11 -0700
Michael Vrhel <michael.vrhel@artifex.com>
6179b719348c1622352b55d66599ba26cfba9d3d
Add Python examples and README
Also fix typos in C# README
demos/csharp/README.txt
demos/python/README.txt
demos/python/examples.py
demos/python/gsapi.py
2020-07-28 17:52:11 +0100
Robin Watts <Robin.Watts@artifex.com>
c001ce438ef9fd0171104ac49afa110e39edb03e
Bug 702587: Fix alpha buffer issue with fill/stroke operations.
The "alphabits" devices work by an alpha buffer being inserted
into the device chain before graphical operations. This intercepts
drawing device calls, 'saves' the color, and then converts the
call into a fill of a monochrome mask.
Only a small 'window' of mask is ever held in memory at once. When
the drawing moves out of the range of that window, the window is
flushed (conceptually the mask is scaled down, and then that scaled
representation is filled with the saved color).
Any "stragglers" (i.e. unwritten back bits of mask) are flushed at
the end of the graphical operation.
When using fill/stroke, the existing code fails to notice the
color in use being changed. This means the last 'window' of
fill can end up being written in the color intended for 'stroke'.
We therefore update the fill/stroke logic to check for the color
changing. (We check for 'unflushed data' and 'color has changed').
base/gdevabuf.c
2020-07-27 12:43:38 +0100
Ken Sharp <ken.sharp@artifex.com>
45b122117e937bb36da2ef03ea590c90ebcd2de9
pdfwrite - free ICCBased profile streams to prevent memory leak
An oversight in memory cleanup in pdfwrite.
ICCBased colour space arrays contain a reference (must be a reference)
to a stream dictionary where the stream data is the profile. Because the
stream dictionary is a reference, it must have an ID (a pdf index). This
means that when we free the colour space array we do not free the stream
dictionary element contained within it.
We don't free objects with a non-zero ID because these are assumed to be
a type of resource, and tracked via the resource chains, but in the
case of ICC profiles we were not adding them to a resource chain.
Fixed here by adding ICC profile streams to the 'resourceOther' chain
so that they are freed on exit.
devices/vector/gdevpdfk.c
2020-07-25 10:52:24 +0100
Ken Sharp <ken.sharp@artifex.com>
55088a6e12775eeae1d19bf9a6db641566ea0c8f
pdfwrite - review use of sclose().
The stream interface essentially leaves the buffer management in the
hands of the creator; sclose() does not free the stream buffer, but it
does set the pointer in the stream state to NULL.
This can be problematic; if the only reference we have to the original
buffer is the pointer in the stream state, then we must copy the pointer
before calling sclose() and then free the buffer afterwards.
s_close_filters() does this BUT it can't know whether a given buffer
was allocated in memory, from the C heap or some other fixed allocation.
It simply frees all the buffers. Obviously this can cause problems if
we use it indiscriminately.
I've reviewed all the places pdfwrite uses sclose() and where we can
use s_close_filters() I've modified the code to do so (to avoid memory
leaks in non-GC memory allocators). Where we must not attempt to free
the buffer I've left the sclose() but commented on the reason.
devices/vector/gdevpdf.c
devices/vector/gdevpdfc.c
devices/vector/gdevpdfo.c
devices/vector/gdevpdfu.c
2020-07-22 09:57:54 -0700
Ray Johnston <ray.johnston@artifex.com>
5d499272b95a6b890a1397e11d20937de000d31b
Bug 702582, CVE 2020-15900 Memory Corruption in Ghostscript 9.52
Fix the 'rsearch' calculation for the 'post' size to give the correct
size. Previous calculation would result in a size that was too large,
and could underflow to max uint32_t. Also fix 'rsearch' to return the
correct 'pre' string with empty string match.
A future change may 'undefine' this undocumented, non-standard operator
during initialization as we do with the many other non-standard internal
PostScript operators and procedures.
psi/zstring.c
2020-07-24 14:03:51 +0100
Julian Smith <jules@op59.net>
f77f99702c9c8418b9516056d5f4280105beafc4
demos/python/gsapi.py: improved encoding/decoding of strings.
Set global _encoding to the encoding passed to gsapi_set_arg_encoding(), and
use it where expected by the underlying C code.
gsapi_set_stdio():
Pass bytes object to stdout and stderr callbacks for convenience, and
document what expectations are.
gsapi_run_string*():
Accept str or bytes; encode the former into bytes using utf-8 encoding.
demos/python/gsapi.py
2020-07-22 18:41:05 +0100
Julian Smith <jules@op59.net>
269f880585dd2c6b3f716668b05f4c911214356b
configure.ac: avoid pathological shell glob expansion in CFLAGS_SANITIZE.
Specifying a command-line arg with lots of '*' characters that aren't intended
to match any filenames, can stress the shell's glob code.
OpenBSD's ksh gets very slow, for example (e.g. 20m vs 45s in bash).
configure.ac
2020-07-24 17:52:05 +0100
Ken Sharp <ken.sharp@artifex.com>
dd1114e8ac0508ada6959c7ffcf6433b5bebe0cf
make pdf_end_encrypt static
devices/vector/gdevpdfx.h
2020-07-24 15:26:27 +0100
Ken Sharp <ken.sharp@artifex.com>
0752757bca7979ed23e6e4fc3cf0772a49fb86c2
pdfwrite - fix memory leak with sclose
The stream code is hideous and full of surprised to trap the unwary. In
this case sclose() has the unexpected side-effect of setting the stream
buffer to NULL before returning, so we cannot free it afterwards.
s_close_filters deals with this for us by taking a pointer to the
buffer and calling gs_free_object on it after the stream is closed, so
we really need to do that (or mimic the same thing ourselves).
We could do s_close_filters(s, s->strm) to just close each filter in
turn, but I've chosen to just walk down the filter chain for each
filter we added, and then close them all up to that point.
This means changing pdf_end_encrypt() so that instead of closing the
stream (with the potential memory leak) we just signal whether the
calling code should close the encryption filter.
devices/vector/gdevpdfu.c
devices/vector/gdevpdfx.h
devices/vector/gdevpdti.c
2020-07-24 09:42:10 +0100
Chris Liddell <chris.liddell@artifex.com>
4837ddb473d3109fe2108b2ac2aa12a8bf5a0b4e
Have gsapi_run_file() handle access controls
Previously, gsapi_run_file() required the caller to add the file to be
processed to the permit read file list. We'll now add the file to the permit
read list, execute the file, and remove it from the list without the caller
having to do so.
pcl/pl/plapi.c
psi/imainarg.c
2020-07-22 14:01:14 -0700
Nancy Durgin <nancy.durgin@artifex.com>
3244573621b1daa2997fbea0c13ce7f891b42203
Fix pdfwrite memory leak when doing multi-page output
When doing multiple page output (i.e. page-%0d.pdf or whatever) there
was a memory leak because it was attempting to short-circuit things and
just delete the last (blank) page, but there was a ton of stuff that
never got freed in that case.
This change sets a flag for the condition and then processes the whole
page (which hopefully doesn't do much because it is empty), including
freeing everything. Then it just deletes the file at the end instead
of at the beginning of the function.
This function (pdf_close()) is over 1000 lines and really needs to be
refactored for maintainability.
devices/vector/gdevpdf.c
2020-07-22 12:24:05 -0700
Nancy Durgin <nancy.durgin@artifex.com>
90f0f92bf6bf9c346cd3f74adaa42a7c8a3702cb
Fix memory leak in pdfwrite device
This appears to only be a memory leak for non-garbage-collected interpreters
such as pdfi.
sclose() calls s_disable() which sets s->cbuf to 0.
But it also calls client callbacks that might do things with cbuf first, so
it will crash if we free it before calling sclose().
Side-effects galore! :(
Anyway, we save the pointer before doing the sclose() so we can
properly free it afterwards.
devices/vector/gdevpdfu.c
2020-07-23 12:51:20 +0100
Chris Liddell <chris.liddell@artifex.com>
4a3441bdde7060ecc9048bf391977412a82063a8
Have nullpage ignore ICC parameters
We want nullpage to be (largely) a bitbucket device, but ICC profile
parameters that require a specific color model could cause it to error.
Force nullpage to ignore changes to the device ICC profiles. Since it cannot
ever produce output, it has no effect in normal operation.
base/gdevnfwd.c
2020-07-23 13:15:20 +0100
Robin Watts <Robin.Watts@artifex.com>
a0288377aa1952f8bb3c3739e0d119635280f31c
gpdl: Don't report -h or --help as failures.
pcl/pl/plmain.c
2020-07-21 14:50:13 +0100
Julian Smith <jules@op59.net>
36bec547acf7b799d09f0433b25b059153712839
demos/python/gsapi.py: removed requirement for python-3.7.
Removed use of collections module, and instead use hand-written classes, which
are clearer and don't require python-3.7.
demos/python/gsapi.py
2020-07-21 08:19:04 +0100
Ken Sharp <ken.sharp@artifex.com>
1d2b10ba71b40f261350e4ffc1f808381e81544d
Fix Coverity ID 360929
Remove some pointless code, over-enthusiastic copy/paste error.
base/gsstate.c
2020-07-20 16:41:37 -0700
Michael Vrhel <michael.vrhel@artifex.com>
e2efdde6b718098f0d35763bb094833a766af479
Fix two minor issues in python API demo
demos/python/gsapi.py
demos/python/jlib.py
2020-07-20 16:32:42 -0700
Michael Vrhel <michael.vrhel@artifex.com>
217b8d292a1098ee56ab52b57bce3e32920b55d4
Demo Viewers: Add readme for csharp example.
Also minor fixes in Windows application.
demos/csharp/README.txt
demos/csharp/api/ghostnet.cs
demos/csharp/windows/ghostnet_wpf_example/MainWindow.xaml.cs
2020-07-20 16:02:31 -0700
Michael Vrhel <michael.vrhel@artifex.com>
4aa0fb2f264f196bb9a07f9d03f7b2da3e89abec
Linux Demo Viewer : Fix few issues found with testing
Race condition between gs thread and ui thread. Also
issues with zoom factors.
demos/csharp/api/ghostmono.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs
demos/csharp/linux/gtk_viewer/src/MainZoom.cs
2020-07-20 14:42:17 -0700
Michael Vrhel <michael.vrhel@artifex.com>
b6622b9b2e95e20febe283035328569211413ac4
Demo Viewer: Delete unused file. Minor code fix in wpf viewer.
demos/csharp/linux/gtk_viewer/src/gsIO.cs
demos/csharp/linux/gtk_viewer/src/gsOutput.xaml.cs
demos/csharp/windows/ghostnet_wpf_example/MainWindow.xaml.cs
2020-07-20 14:32:59 -0700
Michael Vrhel <michael.vrhel@artifex.com>
4c6a3e9b8c87aadc6a50c457d8cf7190fafef59c
Linux Demo Viewer: Complete various lingering tasks
Add proper closure of current file. Add launching of new
process when another file is opened. Fix issue in
distilling process.
demos/csharp/api/ghostapi.cs
demos/csharp/api/ghostmono.cs
demos/csharp/linux/gtk_viewer/src/MainRender.cs
demos/csharp/linux/gtk_viewer/src/MainThumbRendering.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs
2020-07-20 11:14:42 +0100
Ken Sharp <ken.sharp@artifex.com>
ed82512ecb34f9b51461383755e061e881c269c9
graphics library - initialise more members of the graphics state
When creating a graphics state and when calling gs_initgraphics() the
code was not initialising several members of the graphics state. Mainly
these were the new members introduced some time back to allow the PDF
interpreter to track the PDF graphics state.
For consistency, and simpler implementation in pdfi, its better to
specifically initialise the state, especially those members which
should not default to 0.
This causes a few tiny diffs with XPS (because the XPS interpeter,
unlike the PS and PDF interpreters) did not set a couple of members
which are, nevertheless, used when rendering (smoothness and
accuratecurves). Smoothness (which affects gradient fills) is now
initialised to 0.02 instead of 1 (so much smoother) and accuratecurves
is now true instead of false.
base/gsstate.c
base/gxgstate.h
2020-07-19 23:21:25 -0700
Michael Vrhel <michael.vrhel@artifex.com>
45d1994b40289b4ca7bf2d6504081ddcc4d68f14
Linux Demo Viewer: Distiller work.
Everything is hooked in and running. For some odd reason the tmp
file generated in the distilling process is 0 bytes. Will
dig further to see why the file is not getting written. API
seems happy as can be... very odd.
demos/csharp/api/ghostapi.cs
demos/csharp/api/ghostmono.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs
2020-07-18 17:02:46 -0700
Michael Vrhel <michael.vrhel@artifex.com>
6466211fec0c44ce29e7cd094465d2ed4f351ef1
Linux Demo Viewer: Progress at last.
Many thing that should have been simple were complicated
in the poorly documented world of C# mono development.
Just need to do a bit more clean up and hook in the
distilling option for PS.
demos/csharp/api/ghostmono.cs
demos/csharp/linux/gtk_viewer/gtk_viewer.csproj
demos/csharp/linux/gtk_viewer/gtk_viewer.sln
demos/csharp/linux/gtk_viewer/src/MainRender.cs
demos/csharp/linux/gtk_viewer/src/MainThumbRendering.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs
demos/csharp/linux/gtk_viewer/src/MainZoom.cs
demos/csharp/linux/gtk_viewer/src/Program.cs
demos/csharp/linux/gtk_viewer/src/gsOutput.cs
2020-07-15 16:48:25 -0700
Michael Vrhel <michael.vrhel@artifex.com>
0f59de6b3daab30d405ee5c5c4ac943c26721622
Linux Demo Viewer: Various updates to try to get threading working
demos/csharp/linux/gtk_viewer/src/DocPage.cs
demos/csharp/linux/gtk_viewer/src/MainRender.cs
demos/csharp/linux/gtk_viewer/src/MainThumbRendering.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs
demos/csharp/linux/gtk_viewer/src/MainZoom.cs
demos/csharp/linux/gtk_viewer/src/Program.cs
2020-07-15 16:42:57 -0700
Michael Vrhel <michael.vrhel@artifex.com>
42b49069c0f87406dcd796183ba719d45dd8ce69
Mono GTK requires a different type of threading call
In Windows .NET one can use the BackgroundWorker event handler.
Unfortunately the completed event does not call back on the
correct thread. This one uses methods suggested by the mono
GTK documentation. Keeping both versions for examples.
demos/csharp/api/ghostmono.cs
2020-07-17 13:44:59 +0100
Ken Sharp <ken.sharp@artifex.com>
69593c399cbd445b51b4a7bf7d1ccc36604f2c37
graphics library - initialise some gstate members appropriately
The members are (I think) all part of the PDF graphics state rather than
the PostScript graphics state. These members are normally initialised
by the (PostScript) PDF interpreter but when we are running the new
pdfi interpreter inside Ghostscript we want to inherit the contents of
the graphics state, not overwrite them, so we do not initialise these.
This leads to problems; because the values are never initialised in this
case, and (for example) the text horizontal scaling remains at 0 when
it should be 100. Since we set the Text Rendering Matrix partially by
multiplying by that value, this can lead to a degenerate matrix and
cause text not to appear. In addition it causes ps2write output to be
incorrect and throw an error.
This commit does nothing with regular Ghostscript, but with GS+pdfi it
fixes hundreds of errors in ps2write tests and results in at least some
files drawing some content. At least one of these files is still not
correct (it is with pdfi alone) so there is clearly more to do here.
This reduces the number of errors testing GS+pdfi to 475 which is
447 errors less than Ghostscript alone.
base/gxgstate.h
2020-07-08 10:51:21 -0700
Nancy Durgin <nancy.durgin@artifex.com>
c735180bed16fa7e0525640670a4ee082700b770
Change default pdfwrite.params.OPM to be 0
It is already set this way by gs distillerparams, but this makes it
match to make it easier for pdfi.
(This is just a hack at this point, need a general solution for pdfi)
devices/vector/gdevpsdf.h
2020-07-16 09:15:34 +0100
Chris Liddell <chris.liddell@artifex.com>
630d427ab701c582c576a54f2b02f44ddae4a3f6
Bug 702560: Honour PDFSTOPONERROR with broken form dict
Commit 409db64c5519 added support for form XObject dictionaries with a /Contents
key for the content stream, rather than the form dict being the stream dict.
As that is contrary to the spec, this commit makes that case trigger an error
when -dPDFSTOPONERROR is used.
Resource/Init/pdf_draw.ps
2020-07-16 08:14:38 +0100
Chris Liddell <chris.liddell@artifex.com>
409db64c55198b0126c4afebd74eb26d8d7d57ed
Bug 702560: Cope with (broken) form with "Contents"
The file for this bug has a form which contains a /Contents key for the content
stream, rather than the /Form dictionary being a stream dictionary itself.
This is contrary to the spec, but Acrobat displays it without complaint.
Note: Acrobat pre-flight lists the resource to reference the form object
as "missing", and yet renders the form contents anyway.
Also note: we have a test file in the test suite that also includes "/Contents"
key, which is a metadata string, so we have to explicitly check that the value
for the "/Contents" key is a stream dictionary.
Resource/Init/pdf_draw.ps
2020-07-14 14:03:41 -0700
Ray Johnston <ray.johnston@artifex.com>
c184fcbcc23a196a6d6a26648e52d9f3372ac46b
Fix problem introduced by commit 6a3c36f8 with multi-threaded rendering.
That commit changed the allocation requirement in clist_init_states, but didn't
change the corresponding calculation that is supposed to match. Make this a
function so that both will agree going forward.
base/gxclist.c
base/gxclist.h
base/gxclthrd.c
2020-07-15 15:25:10 +0100
Ken Sharp <ken.sharp@artifex.com>
3786f7cb0c4ccf3442beafdf186dbc6835da8ae3
pdfwrite - write FontMatrix for FDArray of a CFF CIDFont
Bug #702556 "pdfwrite produces an invalid pdf file"
The description is incorrect here, the PDF file is not invalid. The
input PostScript file has been created by converting a PDF file using
Poppler.
The original PDF file contains a number of CIDFonts, all with CFF
outlines, and the conversion, for reasons best known to itself, moves
the FontMatrix out of the CFF font and into the CIDFont. This isn't
possible with PDF, so pdfwrite is forced to move the FontMatrix from
the CIDFont back into the CFF font.
Unfortunately we were not writing the FontMatrix out at the FDArray
level of the CFF CIDFont, leading to text 1000 times too large.
Fixed here by writing the FontMatrix for each font in the FDArray.
devices/vector/gdevpsf2.c
2020-07-14 13:56:24 -0700
Ray Johnston <ray.johnston@artifex.com>
5ec2c321c890114af532cb69e913462d56fd4f4f
Fix bug 702559: Patterns + overprint on 16 bit-per-component devicen devices.
The 'blank_unmasked_bits' needed to handle 16 bit per component (deep) planes.
base/gxpcmap.c
2020-07-14 13:52:45 -0700
Ray Johnston <ray.johnston@artifex.com>
d23a584e66c103f43a1de2b1d327bcf196c5972a
Fix bug 702557: oknown missing in paint_form check for Group.
Yet another case where indirect objects were not being handled.
Resource/Init/pdf_draw.ps
2020-07-14 10:42:54 +0100
Ken Sharp <ken.sharp@artifex.com>
868b71c7df45571088e2ff7fcde666b2534d03f0
pdfwrite - move TwoByteToUnicode variable out of union
Discovered while working on the new PDF interpreter and the test file
BCL_Easy.pdf with pdfwrite.
The TwoByteToUnicode flag was stored in the 'simple' structure in the
encoding union. However, that flag is altered by the addition of
ToUnicode code points, and that is *not* limited to simple encodings,
we also alter it for CIDFonts. If we alter the flag we are, in effect,
corrupting members of the union in the case where we are using a
different structure in the union.
This showed up as corrupting the CMapName member of the type0 structure
when built for 64-bit. It didn't exhibit with regular Ghostscript
because that uses the ToUnicode CMap from the input, and only has a
2-byte Unicode value, the pdfi version currently returns a 4-byte
code point.
Nevertheless, this clearly shows that the potential for problems is
there, so to avoid this in future move the flag out of the union and
into the main pdf_font_resource_s structure.
devices/vector/gdevpdte.c
devices/vector/gdevpdtf.c
devices/vector/gdevpdtf.h
devices/vector/gdevpdtw.c
2020-07-14 10:35:53 +0100
Ken Sharp <ken.sharp@artifex.com>
bb1fcf280916311b4e38dfc438399aaebf9c8698
Move declaration of a variable to function prolog.
base/simscale.c
2020-06-03 06:38:12 -0400
Ken Brown <kbrown@cornell.edu>
8690eed13e3f343fde0d78a5c9bb0108b7f88d41
Bug 702464: Fix Cygwin build
Commit 327dc89 made many changes to the Cygwin build of ghostscript,
most of which were wrong. (They treated Cygwin as though it were
Windows.) One of those changes caused the problem on x86_64 Cygwin
reported here:
https://sourceware.org/pipermail/cygwin/2020-June/245070.html
This patch restores the Cygwin build to its former state and also
makes a couple of small tweaks.
configure.ac
2020-07-10 09:44:19 +0100
Chris Liddell <chris.liddell@artifex.com>
857b4a2c5cb7d8ce8798caf623134b77e9f5c447
Bug 702553: Broken handling of 1.0 TTF cmap case
A (clearly!) fairly little used path through the TTF cmap table handling code
for PDF files had bitrotted to the point where we ended up trying to create
a Type 42 font (from a TTF) which didn't have a CharStrings dictionary.
Specifically, this is the case where we're using a 1.0 cmap table, and the
source PDF font's Encoding object does not contain a Differences key.
Resource/Init/gs_ttf.ps
2020-07-09 22:20:32 -0700
Michael Vrhel <michael.vrhel@artifex.com>
13c04693416d0fbf0d614509cabce71e7399207e
WPF demo: Make changes introduced due to needs of mono project
demos/csharp/windows/ghostnet_wpf_example/MainRender.cs
demos/csharp/windows/ghostnet_wpf_example/MainThumbRendering.cs
demos/csharp/windows/ghostnet_wpf_example/MainWindow.xaml.cs
demos/csharp/windows/ghostnet_wpf_example/ghostnet_simple_viewer.csproj
2020-07-09 22:08:08 -0700
Michael Vrhel <michael.vrhel@artifex.com>
279f4835e1ab58653665e9024aaf58032c0591d7
Linux Demo Viewer: Pages now rendering.
AA working. Need to add zoom, page navigation, track down a few
crashing issues.
demos/csharp/api/ghostnet.cs
demos/csharp/linux/gtk_viewer/gtk-gui/gtk_viewer.src.gsOutput.cs
demos/csharp/linux/gtk_viewer/gtk_viewer.csproj
demos/csharp/linux/gtk_viewer/src/DocPage.cs
demos/csharp/linux/gtk_viewer/src/MainRender.cs
demos/csharp/linux/gtk_viewer/src/MainThumbRendering.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs
demos/csharp/linux/gtk_viewer/src/gsOutput.cs
2020-07-08 22:36:25 -0700
Michael Vrhel <michael.vrhel@artifex.com>
2260ba90c0e70f38f2fef96baf8b1b972eef2940
Linux Demo Viewer: StdIO output working
Thumbnail images created. Need to populate into UI next.
demos/csharp/linux/gtk_viewer/src/MainThumbRendering.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs
demos/csharp/linux/gtk_viewer/src/gsOutput.cs
2020-07-08 17:42:56 -0700
Michael Vrhel <michael.vrhel@artifex.com>
fcef740cdba16732a16f83a180404c458a075abc
Progress on the UI design.
Made design similar to what was done for the WPF application.
stdio callbacks from GS are working so hopefully will have pages
rendered shortly.
demos/csharp/linux/gtk_viewer/gtk-gui/gtk_viewer.src.gsOutput.cs
demos/csharp/linux/gtk_viewer/gtk_viewer.csproj
demos/csharp/linux/gtk_viewer/src/MainThumbRendering.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs
demos/csharp/linux/gtk_viewer/src/gsOutput.cs
2020-07-07 21:54:08 -0700
Michael Vrhel <michael.vrhel@artifex.com>
057a39eb4e3f859d293c1e98e1005c82da31024c
csharp/linux: Initial commit of mono gtk csharp project
Many of the files are variants of the wpf project from windows.
These projects share the same API files to ghostscript, but the
mono UI related objects have to change since mono does not support
WPF. This is just an initial commit to get something in place.
demos/csharp/linux/gs_mono.sln
demos/csharp/linux/gtk_viewer/Properties/AssemblyInfo.cs
demos/csharp/linux/gtk_viewer/gtk-gui/generated.cs
demos/csharp/linux/gtk_viewer/gtk-gui/gtk_viewer.src.gsOutput.cs
demos/csharp/linux/gtk_viewer/gtk-gui/gui.stetic
demos/csharp/linux/gtk_viewer/gtk_viewer.csproj
demos/csharp/linux/gtk_viewer/src/DocPage.cs
demos/csharp/linux/gtk_viewer/src/MainRender.cs
demos/csharp/linux/gtk_viewer/src/MainThumbRendering.cs
demos/csharp/linux/gtk_viewer/src/MainWindow.cs
demos/csharp/linux/gtk_viewer/src/MainZoom.cs
demos/csharp/linux/gtk_viewer/src/Program.cs
demos/csharp/linux/gtk_viewer/src/TempFile.cs
demos/csharp/linux/gtk_viewer/src/gsIO.cs
demos/csharp/linux/gtk_viewer/src/gsOutput.cs
demos/csharp/linux/gtk_viewer/src/gsOutput.xaml.cs
2020-07-09 11:14:46 +0100
Robin Watts <Robin.Watts@artifex.com>
e88ba0a1ee23911172222ee6ad7c2e3c9ea205a4
Fix Coverity issue: sizeof(byte **) vs sizeof(byte *)
*Apparently* sizeof(byte *) and sizeof(byte **) might be different.
I can't think of a case where that's true, but I am indeed using
the wrong one.
Fix it here.
pcl/pl/plmain.c
2020-07-08 16:41:11 +0100
Robin Watts <Robin.Watts@artifex.com>
da755f7ee3da900a504a3265c64fb08c93a41eac
Bug 688990: Reimplementation of image mask scaling.
Aiming for a better match to Adobe's reference implementation.
Patch supplied by Peter Cherepanov. Many Thanks!
base/lib.mak
base/simscale.c
base/simscale.h
base/simscale_foo.c
base/simscale_foo.h
2020-07-08 18:52:44 +0100
Robin Watts <Robin.Watts@artifex.com>
cc596ad6dd030f192416086370bd54e8059589d4
lgtm.com issue: Fix potential overflow in mkromfs.
We know that we only ever call this splitting the ROMFS into 4,
so it's never going to overflow, but lgtm.com can't know that.
Add a check to keep the number down to a sane size to keep it
happy.
base/mkromfs.c
2020-07-08 15:50:11 +0100
Robin Watts <Robin.Watts@artifex.com>
b0c208a555ed89139395a6ed0d8dce70d81cde09
Bug 691452: Add missing dependencies.
Patch from Peter Cherepanov. Many thanks!
base/lib.mak
2020-07-08 07:22:06 -0700
Robin Watts <Robin.Watts@artifex.com>
000de1419225213fce7d06de0f1982cd79e4e141
Update CAL makefile to pass correct compiler flags.
base/cal.mak
2020-07-08 00:03:56 +0100
Robin Watts <Robin.Watts@artifex.com>
79d9c45db7ce0ee075254bbfa8235d2996869fb1
Bug 702517: Fix overenthusiastic checking for NULL.
Patch from Peter Cherepanov. Many thanks.
devices/gdevmgr.c
2020-07-03 17:16:10 +0100
Robin Watts <Robin.Watts@artifex.com>
6c5a246ebe922e94df2e5f5cdd7d01ca86762cb3
Rename displaydev_test to api_test.
Move it into the new "demos" directory, and expand it to cope
with testing run_string too.
demos/c/ReadMe.txt
demos/c/api_test.c
demos/c/api_test.vcxproj
demos/c/api_test.vcxproj.filters
toolbin/displaydev_test.vcxproj.filters
2020-07-07 12:55:42 +0100
Robin Watts <Robin.Watts@artifex.com>
db8f3a277d0ae43cf5cffea16ee1c9149d4eb3de
Extend gpdl to cope with being fed PDFs via run_string.
More generally, we can now cope with any language implementation
requesting that data being fed in via run_string should be
buffered up and then fed in via run_file instead, so formats that
require seeking can cope.
We add a new gs_error_NeedFile error code. If a run_string
implementation returns this, the calling gpdl layers captures
the unused incoming data into an internal "buffered_file" object.
When we reach run_string_end, we then register a new filing
system with gs_add_fs() to allow this buffered file to be found.
We then run that file using the standard run_file mechanism.
Then we remove that filing system, and free the buffered file.
The only implementation that currently uses this is the
postscript one, which is amended to skip over leading whitespace
and comments, looking for a PDF header.
XPS already has a mechanism in it for collating data
into a file using run_string, but this was broken (due to
process_eof not being called). Fixed here, but still using its
own mechanism rather than gs_error_NeedFile for now.
base/gserrors.h
doc/GPDL.htm
gpdl/psitop.c
pcl/pl/plmain.c
2020-07-07 16:09:18 +0100
Robin Watts <Robin.Watts@artifex.com>
6eb675b18b8234256bb37190fd35243eab369e36
Tweak gsapi for gpdl to match gs.
The gpdl implementation of gsapi differed in the "run_string"
arguments from the original gs implementation. Add the extra
parameters here to make the two look identical.
doc/GPDL.htm
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/realmain.c
2020-07-07 14:56:23 +0100
Robin Watts <Robin.Watts@artifex.com>
24c9b3834b29e8a0eaa6dd78712ef1306049b479
Tweak gp_file veneers.
This allows for implementations to have more NULL function pointers,
and hence to be simpler.
base/gp.h
2020-07-06 11:04:52 -0700
Ray Johnston <ray.johnston@artifex.com>
0a9ec5e7fa81cf3f67f001bfcac2575611e49d85
Fix bug 702530: Spurious circular reference error message from PDF interpreter
The safe_recursive function comments described popping the copy of the dict
made for recursion (to allow multiple references at the same level), but the
code did not implement that.
Resource/Init/pdf_base.ps
2020-07-06 15:44:41 +0100
Chris Liddell <chris.liddell@artifex.com>
f2e2e3c1bb24887bce699821a3da1f8b3bbd12be
Remove the dmprt device
It has code which triggers security warnings, it has not built as it stands
since before 8.71 (so >10 years) and has significant (segfaulting) problems
when modified to successfully build.
Since it cannot have been used (and no one has complained) in over ten years,
we're removing it.
contrib/contrib.mak
contrib/japanese/dmp_init.ps
contrib/japanese/dmp_site.ps
contrib/japanese/doc/gdevdmpr.txt
contrib/japanese/dviprlib.c
contrib/japanese/escp_24.src
contrib/japanese/gdevdmpr.c
2020-07-03 13:52:02 +0100
Chris Liddell <chris.liddell@artifex.com>
61cbcfe94512ebd9316ff3c0d7ffaee06e226bc2
Add/fix documentation for .begintransparencymaskgroup/.endtransparencymask
doc/Language.htm
2020-07-06 12:13:09 +0100
Robin Watts <Robin.Watts@artifex.com>
0296da79f0f215322a1445c35f7343344806c08b
Fix spot color handling of display device.
The device icc_struct needs to be initialised before we try to
use it.
devices/devs.mak
devices/gdevdsp.c
2020-07-07 12:51:45 +0100
Robin Watts <Robin.Watts@artifex.com>
2398bdb09fa80498a57ab54815e85d326506b509
Fix silly typo in gs_remove_fs.
base/gslibctx.c
2020-07-07 12:51:01 +0100
Robin Watts <Robin.Watts@artifex.com>
dbe3a897df38c94c0c2af5b6ad5c4ee9a1c0ffe5
Add a 'const' to gp_file_alloc.
This enables it to be called in some circumstances where we only
have a const gs_memory_t.
base/gp.h
base/gpmisc.c
2020-07-06 12:35:01 +0100
Robin Watts <Robin.Watts@artifex.com>
87be031c6039d5f6d9bc960a9aefd442dded3e92
Fix Coverity 360266: Unchecked return value.
By the time we get here, we are guaranteed to be fatally failing.
Checking the return value can't alter what we are returning.
pcl/pl/plmain.c
2020-07-03 18:37:13 +0100
Robin Watts <Robin.Watts@artifex.com>
8549a5c5af77ee512dea0a43a82bf7612a861237
Fix stray change in doc/API.htm
doc/API.htm
2020-07-03 18:29:48 +0100
Robin Watts <Robin.Watts@artifex.com>
aafbb943f1298a75058485fc0c277edfd7ef4048
Fixes for displaydev_test.
In 64bit builds, we expect the display device to fail when asked
to align to a multiple of 4.
Also, correct detection of failures.
toolbin/displaydev_test.c
2020-07-03 17:14:52 +0100
Robin Watts <Robin.Watts@artifex.com>
5410cc1d64a2082dcd0e037d1ccefdbf68894198
Fix infinite recursion in display device.
If the device was a clist device, and was opened/closed repeatedly,
the wrong 'base' dev_spec_op could be stored.
devices/gdevdsp.c
2020-07-03 15:45:49 +0100
Robin Watts <Robin.Watts@artifex.com>
c2b0b6d61e62b9d490e9e3fcc24efb64c06f2a14
Fix gpdl run_string API to properly detect language.
pcl/pl/plmain.c
2020-07-03 12:06:17 +0100
Ken Sharp <ken.sharp@artifex.com>
a3cf573c2e72daf75c64d7b3a09e544f6e027244
pdfwrite - when copying clip path, cater for differing allocators
This is for pdfi when run under Ghostscript; the pdfwrite device keeps
a copy of the current clip path when it writes it to the output. But
the code (gx_cpath_to_path) relies on gx_path_asign_preserve and that
function specifically states that the allocators for the two paths
must be the same.
In the case of pdfi under GS, the path is created using the pdfi memory
allocator (its created by the pdfi interpreter), but the copied path
is allocated using the device allocator, which is derived from the
PostScript interpreter. The result of this is that pdfwrite can still
be pointing to a path which was allocated by pdfi and can disappear
when the pdfi interpreter exits, leaving a dangling pointer. Since the
path is subject to garbage collection (allocated with the PostScript
interpreter allocator) this causes a crash as soon as any kind of
grbage collection takes place.
Fortunately there's a simple function call 'gx_path_unshare' which will
copy the segments after assignment and we can check the allocators to
see if they are the same and us this function if they are not.
Fixes the remaining (currently) seg faults with pdf when running inside
Ghostscript.
devices/vector/gdevpdfd.c
2020-07-02 15:38:27 -0700
Michael Vrhel <michael.vrhel@artifex.com>
20757da77706d4227cd7268113bbffbe7716a6fc
Introduce demos folder with csharp and python API examples
Current csharp demo shows creation of wpf viewer. Goal will
be to next show a Linux viewer using mono and the same API file.
Python demo/API brought over from toolbin.
demos/csharp/api/ghostapi.cs
demos/csharp/api/ghostnet.cs
demos/csharp/windows/ghostnet.sln
demos/csharp/windows/ghostnet_wpf_example/About.xaml
demos/csharp/windows/ghostnet_wpf_example/About.xaml.cs
demos/csharp/windows/ghostnet_wpf_example/App.config
demos/csharp/windows/ghostnet_wpf_example/App.xaml
demos/csharp/windows/ghostnet_wpf_example/App.xaml.cs
demos/csharp/windows/ghostnet_wpf_example/DocPage.cs
demos/csharp/windows/ghostnet_wpf_example/MainPrint.cs
demos/csharp/windows/ghostnet_wpf_example/MainRender.cs
demos/csharp/windows/ghostnet_wpf_example/MainThumbRendering.cs
demos/csharp/windows/ghostnet_wpf_example/MainWindow.xaml
demos/csharp/windows/ghostnet_wpf_example/MainWindow.xaml.cs
demos/csharp/windows/ghostnet_wpf_example/MainZoom.cs
demos/csharp/windows/ghostnet_wpf_example/PrintControl.xaml
demos/csharp/windows/ghostnet_wpf_example/PrintControl.xaml.cs
demos/csharp/windows/ghostnet_wpf_example/Properties/AssemblyInfo.cs
demos/csharp/windows/ghostnet_wpf_example/Properties/Resources.Designer.cs
demos/csharp/windows/ghostnet_wpf_example/Properties/Resources.resx
demos/csharp/windows/ghostnet_wpf_example/Properties/Settings.Designer.cs
demos/csharp/windows/ghostnet_wpf_example/Properties/Settings.settings
demos/csharp/windows/ghostnet_wpf_example/TempFile.cs
demos/csharp/windows/ghostnet_wpf_example/XPSprint.cs
demos/csharp/windows/ghostnet_wpf_example/ghostnet_simple_viewer.csproj
demos/csharp/windows/ghostnet_wpf_example/gsIO.cs
demos/csharp/windows/ghostnet_wpf_example/gsOutput.xaml
demos/csharp/windows/ghostnet_wpf_example/gsOutput.xaml.cs
demos/python/gsapi.py
demos/python/gsapiwrap.py
demos/python/jlib.py
2020-07-02 15:02:48 -0700
Michael Vrhel <michael.vrhel@artifex.com>
ade938cc74549ffc8d58b0c1fd5e9be7f5429855
Add missing methods to API.htm
doc/API.htm
2020-07-02 12:21:33 -0700
Michael Vrhel <michael.vrhel@artifex.com>
62d83a31f7f20910eeb5938873c62e890c9d2b3a
Make -dSimulateOverprint=false work with transparency
When the source file has transparency and overprint, avoid doing
the compatible overprint mode if overprint is specified to
be disabled. Thanks to Ray Johnston for helping with the PS
in pdf_main.ps
Resource/Init/pdf_main.ps
base/gdevp14.c
2020-06-25 10:52:19 -0700
Nancy Durgin <nancy.durgin@artifex.com>
00e7143ce97a3d983a223c7d69f74f995d8e267d
Pass memory to clist_make_accum_device()
Change function args to propagate the memory type of the graphics
state to clist_make_accum_device to create device with it.
Also, make sure the dev->bandlist_memory (used for freeing 'data') is
allocated in the mem->non_gc_memory instead of the parent device's
(fixes crash in gpdl/pcl that was introduced).
That will mean pdfi and gs/pdfi get non-gc, and gs gets gc.
There was a bug in gs/pdfi where the clist-pattern device was in gc
memory and it was getting freed when pdfi was still using it.
This should fix a segfault in: tests_private/comparefiles/Bug688396.pdf
base/gxclist.c
base/gxclist.h
base/gxpcmap.c
2020-07-01 17:16:41 +0100
Julian Smith <jules@op59.net>
60d740278fc7f7b719482ae0dd4a59743025444d
toolbin/gsapi.py: fixed stray ';' character.
toolbin/gsapi.py
2020-07-01 14:00:17 +0100
Julian Smith <jules@op59.net>
07047636c74555d22c87fd7f05535b57e681a35d
toolbin/gsapi.py: added example of how to build .so and run.
toolbin/gsapi.py
2020-07-01 13:59:56 +0100
Julian Smith <jules@op59.net>
9900ecb043f3c138160f7d78d32af9967ea09b64
devices/vector/gdevtxtw.c: fixed build if TRACE_TXTWRITE defined.
devices/vector/gdevtxtw.c
2020-06-30 15:38:24 +0100
Chris Liddell <chris.liddell@artifex.com>
f3c50e50d6ffd9b4fd98f0215e78d7659bf0bdc3
Whitespace fixes
doc/API.htm
psi/dw32c.def
psi/dw64c.def
psi/dwmain32.def
psi/dwmain64.def
psi/dwsetup.def
psi/dwuninst.def
psi/gsdll32.def
psi/gsdll32metro.def
psi/gsdll64.def
psi/gsdll64metro.def
psi/gsdllARM32metro.def
psi/gsos2.def
toolbin/gsapi.py
2020-06-30 13:58:11 +0100
Chris Liddell <chris.liddell@artifex.com>
a1cf59357b6945fdac87afa76e2afd56bb3c1206
Slight tweak to the FAPI API
The previous Font API update had a slight mistake: for non-CID fonts, we'd pass
GS_NO_GLYPH in place of the actually CID/GID into the "fapi_set_cache" call
back.
That worked fine because, for Postscript (and currrent PDF) non-CID fonts use
the glyph name, not a character code, and the other interpreters do not
need a character for that callback.
We'll now pass the glyph index for non-CID fonts, and the
glyph index + GS_MIN_CID_GLYPH (as is conventional for gs) - and that allows
the fapi_set_cache call back to differentiate between CID and non-CID fonts.
For the new PDF interpreter (pdfi) we actually do need the character code, to
correctly handle Truetype fonts. So fixing the graphics lib and associated code
on master, so the pdfi branch can also work.
base/gxfapi.c
psi/zfapi.c
2020-06-30 09:27:41 +0100
Ken Sharp <ken.sharp@artifex.com>
71d0b343a3f20d298b9abbe6261bcb01ecb48dcb
Improve eps2write
Bug #702521 "eps2write hygiene enhancements"
If processing a multi-page input file, throw an error on the second
page and write a message explaining the problem.
Encapsulate the 'global configuration' switches which affect the prolog
processing, and are written from the ps2write device, in a dictionary
because EPS files should not affect the current dictionary. Read those
parameters back from the dictionary when establishing the EPS file's
own dictionary, ensuring that a dictionary is actually present.
Use the global configuration to determine whether to install a custom
error handler. If its an EPS file, then don't.
devices/vector/gdevpdf.c
devices/vector/gdevpdfu.c
devices/vector/opdfread.ps
2020-06-29 12:04:05 -0700
Michael Vrhel <michael.vrhel@artifex.com>
d286e365c298b30fc8f0d74979779c18cf4d28f5
A few more changes to the API.htm docs.
doc/API.htm
2020-06-29 10:51:57 -0700
Michael Vrhel <michael.vrhel@artifex.com>
50a60d8421f3e64828790ec4588727fdc41c4d58
Fix minor issues in API.htm
doc/API.htm
2020-06-29 13:15:35 +0100
Chris Liddell <chris.liddell@artifex.com>
95e5e879c3a3fea42a97e942b53a6914ed7ccfc2
int_gstate_alloc() error handling
If we fail to allocate even the graphics libaray graphics state, bail out
immediately.
psi/zgstate.c
2020-06-23 09:22:03 +0100
Chris Liddell <chris.liddell@artifex.com>
ea7818b8bb62b1df4f81e4dc752ccda54cc3d59c
UMR fix: parameters for overprint compositor
Discovered while investigating (red herring) indeterminacy problems with
eci_altona-test-suite-v2_technical2_x4.pdf
Reported by both valgrind and MSAN.
base/gsptype1.c
2020-06-26 20:05:36 +0100
Robin Watts <Robin.Watts@artifex.com>
71962c6ed1e0bdf41e604a8014b93889f9d07ee5
Squash warnings seen in Windows 64 bit build.
base/gp_msprn.c
base/gp_mswin.c
base/gp_winfs.c
base/gsalloc.c
base/gsmemory.c
base/gxclist.c
base/gxi12bit.c
base/gxicolor.c
devices/gdevcdj.c
devices/gdevupd.c
devices/vector/gdevpdtb.c
ijs/ijs_exec_win.c
psi/idict.c
psi/inamedef.h
2020-06-26 19:11:06 +0100
Robin Watts <Robin.Watts@artifex.com>
b68604731130f5493d2ecd5ae627b1bae9624c64
Update Makefile for new version of tesseract.
base/tesseract.mak
2020-06-26 19:08:39 +0100
Robin Watts <Robin.Watts@artifex.com>
ad2418e6dc8afa7c7278d6687c77791026f98228
Fix callouts being allocated/deallocated with the wrong gs_memory_t.
This didn't matter for gs, but for gpdl, it could cause problems
on shutdown.
base/gslibctx.c
2020-06-02 16:29:32 -0700
Michael Vrhel <michael.vrhel@artifex.com>
135f2ceaa84fb0a058ba781a451c65b95230e49a
Have bmpcmp return EXIT_FAILURE if it can not compare
toolbin/bmpcmp.c
2020-06-26 16:15:43 +0100
Robin Watts <Robin.Watts@artifex.com>
c022554c30f680c464f1026dc96c2450867da73c
Remove displaydev_test project from GhostPDL.sln.
It should never have been added in git. I added it locally and
then it slipped through and got committed by accidently.
windows/GhostPDL.sln
2020-06-26 16:12:33 +0100
Robin Watts <Robin.Watts@artifex.com>
622f4ea8ecc9b677165121d0c093632b9ea00c67
Don't let psapi_new_instance trample libctx->stdio functions.
For GS builds this doesn't matter, as psapi_new_instance is called
before users of the API get to set their own versions. With GPDL
builds, the call to psapi_new_instance is deferred to the point
where the API user may have already set their own functions.
psi/psapi.c
2020-06-26 16:10:42 +0100
Robin Watts <Robin.Watts@artifex.com>
4f886898e23483e82866148d6b564faf281490ba
Avoid using bool in gslibctx.h.
Ghostscript relies on bool being 'int'. Unfortunately, this header
is included from various C++ files that use bool as char. Accordingly
the easiest fix is to avoid using bool in these structure definitions.
base/gslibctx.h
2020-06-25 12:29:01 -0700
Nancy Durgin <nancy.durgin@artifex.com>
969370ba1dbcf767bae97fda6a3c066b04439c76
Fix refcnt's on the colorspace in clist
In the case where the colorspace was modified (read_set_color_space)
there was a memory leak.
This was because the old code just freed pcs, but if the color had
changed, then gs_state.color[0].color_space and [1].color_space are no
longer the same. This way we track the references to them separately
and free them separately.
pcs doesn't get its own ref, because it is always the same as
gs_gstate.color[0].color_space.
This fixes memory leaks that only show up in the case that the memory
is not garbage-collected, such as in pdfi.
base/gxclrast.c
2020-06-25 19:15:28 +0100
Robin Watts <Robin.Watts@artifex.com>
305b9fa7334fc0cd1f45585b8449b0c2c7517559
Fix leak of non-deregistered callback handlers on shutdown.
base/gslibctx.c
2020-06-25 17:08:23 +0100
Robin Watts <Robin.Watts@artifex.com>
59bd5d853cec55497486ad4fb2f253a92e4da3cc
Fix typos in GPDL.htm.
doc/GPDL.htm
2020-06-25 16:39:01 +0100
Robin Watts <Robin.Watts@artifex.com>
1615ace33ebb93d8c5faae8a440ab96f06f5f0fe
Add documentation for GPDL.
doc/GPDL.htm
2020-06-25 15:13:47 +0100
Robin Watts <Robin.Watts@artifex.com>
35f6a9d9e2838069b5ba250cf26d016bc5ad3635
GPDL whitespace fixes.
pcl/pl/pjparsei.c
pcl/pxl/pxtop.c
xps/xpstop.c
2020-06-25 15:12:40 +0100
Robin Watts <Robin.Watts@artifex.com>
a9bd94535682bd75bbaa18da42129e49046f3838
Remove unused remnants from gpdl/pngtop.c
gpdl/pngtop.c
2020-06-25 15:12:26 +0100
Robin Watts <Robin.Watts@artifex.com>
f5b28fa033b4837f3cc28943f5c022bf48ca39d4
GPDL: Remove "min_input_size" from pl_interp_characteristics_t
Never used.
gpdl/jbig2top.c
gpdl/jp2ktop.c
gpdl/jpgtop.c
gpdl/pngtop.c
gpdl/psitop.c
gpdl/pwgtop.c
gpdl/tifftop.c
pcl/pcl/pctop.c
pcl/pl/pjparsei.c
pcl/pl/pltop.h
pcl/pxl/pxtop.c
xps/xpstop.c
2020-06-23 10:56:22 +0100
Robin Watts <Robin.Watts@artifex.com>
ae5bcb6df4b9aa4337a93d5ce8c8152ea4494941
Simple test app for driving the display device.
toolbin/displaydev_test.c
toolbin/displaydev_test.vcxproj
toolbin/displaydev_test.vcxproj.filters
windows/GhostPDL.sln
2020-06-16 14:31:40 +0100
Robin Watts <Robin.Watts@artifex.com>
eed3bad23510e59278bdaa5f7d0ab01fc1a1c21b
Display device revamp.
Move display device over to being based upon a "clist_mutatable"
device. Existing claimants won't see any difference.
New claimants can provide additional callbacks so they can drive
it in 'rectangle request' mode.
devices/gdevdsp.c
devices/gdevdsp.h
devices/gdevdsp2.h
doc/API.htm
2020-06-12 13:00:01 +0100
Robin Watts <Robin.Watts@artifex.com>
04e937862eaa7e66bb9a87109874112cd354bf6f
Remove clist "is_printer" field.
Currently, the clist has an "is_printer" field, which is used to
tell it how to forward dev_spec_op calls. This seems evil to me;
a base class should not really need to know what class is being
derived from it to know how to behave.
Instead, introduce a function pointer that says where
dev_spec_ops should be forwarded to.
base/gdevprn.c
base/gxclist.c
base/gxclist.h
base/gxclrect.c
2020-06-11 12:47:58 +0100
Robin Watts <Robin.Watts@artifex.com>
f697ed393a3f0cfffbf82b1f679cf6667b06611c
Refactor 'clist mutatable devices' from prn ones.
Devices that have to mutate to be clist ones need to be setup
in a particular way. After the standard gx_device header, they
are padded out to a large enough size that the clist header
fields can fit in. Then the device specific fields follow.
gdev_prn devices are the standard example of this. In order
to more easily allow other devices to work in the same way,
we refactor the padding/clist specific fields out into new
macros.
base/gdevprn.c
base/gdevprn.h
base/gxclist.c
base/gxclist.h
devices/gdevbit.c
2020-06-11 12:04:03 +0100
Robin Watts <Robin.Watts@artifex.com>
aae141b7849700a3b99a9222e09ed6ebaff5c61b
Refactor gdev_space_params slightly.
The gdev_space_params structure is also known as gdev_prn_space_params,
which is slightly misleading as there is nothing prn specific about
it.
Rename all uses of gdev_prn_space_params within the code to be
gdev_space_params. Leave gdev_prn_space_params defined as a typedef
so that any customer code will not be affected.
Rename compare_gdev_prn_space_params to be gdev_space_params_cmp
to better reflect its non-prn-specific nature. Make it non-static
and move it to gsdevice.c.
base/gdevprn.c
base/gdevprn.h
base/gsdevice.c
base/gxdevcli.h
cups/gdevcups.c
devices/gdevcdj.c
devices/gdevijs.c
2020-06-22 10:06:58 +0100
Robin Watts <Robin.Watts@artifex.com>
8f40f4b1aca7a7f75ecf83469892478311ca21e1
Update Planar device to allow for easy "interleaved" operation.
base/gdevmem.c
base/gdevmpla.c
base/gdevmpla.h
base/gxdevmem.h
2020-06-19 19:04:53 +0100
Robin Watts <Robin.Watts@artifex.com>
22f5f898d49443df82c13bd683fbff61005485c2
Improve get_bits_rectangle for planar case.
The implementation of get_bits_rectangle to read planar data from
a planar device, only implements GB_RETURN_POINTER. If this isn't
in the request (i.e. the caller uses GB_RETURN_COPY to get a copy
of the data in its own buffers), then it cannot cope.
Here we extend the routine to try to use a GB_RETURN_POINTER
request internally, and to copy the returned data into the
callers buffers.
Callers are of course already free to do this operation themselves,
but this avoids the needless repetition of the code in every
caller.
base/gdevmpla.c
2020-06-04 19:27:15 +0100
Robin Watts <Robin.Watts@artifex.com>
4438e3e5bc4dfc9e46fc86d86d912171ec582a4e
Rework display device "DisplayHandle" passing.
Add gsapi_{,de}register_callout API. This allows integrators
to register handlers for "callouts" from gs devices.
The first example of such a callout is the display device.
Previously, this has relied on the gsapi_set_display_callback
API to pass a pointer to a structure into the core, from where
it was hackily poked into the display device structure.
Instead, we now have the display device "callout" to registered
handlers to get the structure and the handle to use.
The legacy API is maintained by the API level implementing
a handler to return the display callback in response to the
devices callout.
The code to do the 'poking' of the display device has therefore
been removed, and replaced by code that checks to see if an
opened device needs reopening after init, if so, opens/closes it.
base/gsdevice.c
base/gslibctx.c
base/gslibctx.h
base/gxdevcli.h
base/gxdevsop.h
devices/gdevdsp.c
devices/gdevdsp.h
devices/gdevdsp2.h
doc/API.htm
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plmain.c
psi/gsdll2.def
psi/gsdll32.def
psi/gsdll32metro.def
psi/gsdll64.def
psi/gsdll64metro.def
psi/gsdllARM32metro.def
psi/iapi.c
psi/iapi.h
psi/idisp.c
psi/idisp.h
psi/imain.c
psi/int.mak
2020-06-22 17:04:02 +0100
Robin Watts <Robin.Watts@artifex.com>
7e427246abb151cde9154783775acfaa776b502e
Simple Spot color test file.
examples/spots.ps
2020-06-19 15:05:34 +0100
Robin Watts <Robin.Watts@artifex.com>
63d4ce589086609178160857452dbe3ca6ec0361
Tweak mem device; use NULL rather than 0.
base/gdevmem.c
2020-06-20 19:08:20 -0700
Ray Johnston <ray.johnston@artifex.com>
5123260e329a44db83edf4b1378cb7101632f7eb
Fix Bug 701852. Problems with the plane_extract device.
First, the plane_begin_typed_image function used the gs_gstate_copy_temp,
but since this was allocated as a st_gs_gstate, and the reference counts
were not handled (as the comment describes), freeing that object would
decrement the ref_counts, causing premature free of objects.
Remove this dangerous function.
Change to use gs_gstate_copy so we have a proper gs_gstate structure.
Using gs_gstate_copy from a clist playback gstate requires that we have
client colors and device colors in the color[0] and color[1] elements.
Allocate, and initialize these, then free upon exit from clist_playback.
Also, the mem device underlying the plane_extract device needs to be
retained so that it is not prematurely freed.
base/gdevplnx.c
base/gsgstate.c
base/gxclrast.c
base/gxgstate.h
base/lib.mak
2020-06-24 15:57:18 +0100
Robin Watts <Robin.Watts@artifex.com>
2d69b876807bb66889e7d89ad39649aded72901e
Tweak gpdl parameter handling.
Reorder some bits (to make checking against gs easier).
Add handling for --help (same as -h).
Add handling for -v. List languages supported in version
and usage output.
Add handling for -q. Rely on the fact that -q is the same as -dQUIET.
pcl/pl/plmain.c
2020-06-24 13:45:30 +0100
Robin Watts <Robin.Watts@artifex.com>
8433ecd5c9bee10a767293c886644fc91f6d7d4d
Fix gs command line parsing to handle --unknown
Previously "--unknown" would have been treated like "--".
psi/imainarg.c
2020-06-23 16:34:14 +0100
Chris Liddell <chris.liddell@artifex.com>
a50c9e8d1819c5273a5f6d46137dc527382fabb1
Typo: ps2weite -> ps2write
doc/VectorDevices.htm
2020-06-23 01:36:02 +0800
Sebastian Rasmussen <sebras@gmail.com>
ea495beece2c461d6561e3d5780d40e77603abc9
jbig2dec: Free result object upon error allocating referred to segments.
jbig2dec/jbig2_segment.c
2020-06-23 01:27:25 +0800
Sebastian Rasmussen <sebras@gmail.com>
e0c1b3c8162898eaa46640cae98be34642704e3c
jbig2dec: Fix memory leak caused by failing to allocate arithmetic coding context.
jbig2dec/jbig2_text.c
2020-06-18 22:02:27 -0700
Ray Johnston <ray.johnston@artifex.com>
554b67a6f3ba5e6c78b35f94ab3f57e96b1a3dee
Bug 702505. Annotations with BlendMode (/BM) failed as PDF is opened.
The check for transparency in the page would fail with 'typecheck' because
the operand stack was not properly cleaned once the /BM was detected.
Resource/Init/pdf_main.ps
2020-06-19 07:55:05 +0100
Chris Liddell <chris.liddell@artifex.com>
c287d823671769a45c3b0c4a7f16a10fc5e7cb5a
Coverity 359871, 359872: un-init variable and conditional always true
A return code could remain unset in an otherwise successful completion of the
function.
The new FAPI interface switch from using a signed value of -1 to the "standard"
special value of GS_NO_CHAR, and I missed a case of that - since GS_NO_CHAR is
positive, the existing test of >= 0 was flagged as always true.
psi/zfapi.c
2020-06-18 19:34:33 +0100
Chris Liddell <chris.liddell@artifex.com>
57885b1ab496d12d4b6e7ee6a98144e5b040afa1
Allow the First/LastPage device page count to be reset
If we get a DisablePageHandler parameter setting to "false" (i.e. enabling the
filtering) then start counting pages from there.
This allows more intuitive control over extracting specific pages from multiple
input files.
base/gdevflp.c
2020-06-18 19:26:57 +0100
Chris Liddell <chris.liddell@artifex.com>
99d5046ebd2998eb550a66677142186b00071b73
Improve PageList device param handling
The error handing when reading the PageList parameter did not match the rest of
the code in gx_default_put_params() - record the error, but carry on.
Secondly, the original implementation never accounted for the possibility of
"unsetting" the PageList. This is possible by sending an empty string.
base/gsdparam.c
2020-06-16 19:01:25 +0100
Julian Smith <jules@op59.net>
e21dc926e2a2214ab8ae830b984057994d139a1c
toolbin/gsapi.py: python version of psi/iapi.h, using ctypes.
toolbin/gsapi.py
2020-05-25 12:50:32 +0100
Julian Smith <jules@op59.net>
74d47eada1e07862c3af7bbb214edd6cf94e0164
In clusterpush, exclude sodebugobj and /build.
toolbin/localcluster/clusterpush.pl
2020-05-15 11:41:30 +0100
Julian Smith <jules@op59.net>
e29a4c0affe3e7b66ff19d70e0d2abbc1e7fdf21
Added experimental swig wrapper for gsapi.
toolbin/gsapiwrap.py
toolbin/jlib.py
2020-05-21 18:16:28 +0100
Julian Smith <jules@op59.net>
31157290172feea1817d6e69c5064d025a9ab45c
Changed gsapi_set_default_device_list() to take const char* arg, not char*.
This allows SWIG to work, and also tightens up the API.
pcl/pl/plapi.c
pcl/pl/plapi.h
psi/iapi.c
psi/iapi.h
2020-05-21 14:48:12 +0100
Julian Smith <jules@op59.net>
9b953e588fb74a73b997d11412a2878f4cdfcdfb
Improve test for error in s_stdout_write_process().
Detect error case where outwrite() incorrectly returns > count, so we can avoid
incrementing pr->ptr beyond bounds of array.
psi/ziodevsc.c
2020-06-09 19:17:55 +0100
Julian Smith <jules@op59.net>
fcd9967f93151c49cefe437f6f0bdb1f047d68cc
Avoid leak in pcl_process() by calling pcl_complete_raster() if returning error.
Fixes:
MEMENTO_FAILAT=18536 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ../tests_private/pcl/pcl5cfts/fts.2180
pcl/pcl/pcparse.c
pcl/pcl/pcparse.c
2020-06-04 16:14:20 +0100
Chris Liddell <chris.liddell@artifex.com>
0a4f6d6cb3efda8f0b334c0b04457362b00dac1b
Revisions to FAPI (error handling etc).
A lot of the FAPI methods made no account for errors (i.e. a call to return an
unsigned 16 bit value would return an unsigned short int). In various places
that meant we ended up using unlikely (in practice, impossible, yet still
"valid") values to indicate an error condition.
This commit changes those calls to have a conventional Ghostscript "int"
return value and (mostly) take pointer to the storage into which they should
write their value. We can now return meaninful error codes.
Secondly, in several places, the FAPI methods and code used integers to store
character codes, cids, gids etc. This is less than ideal because we potentially
have to handle 4 byte codes (especially for gids), and we also use some
special 64 bit values (when available) for specific meanings. There were
several workarounds for that, in various places.
This commit also changes the FAPI API and code to the gs_glyph type for all
such values, removing the need for those workarounds
base/fapi_ft.c
base/fapibstm.c
base/fapiufst.c
base/gxfapi.c
base/gxfapi.h
base/write_t1.c
base/write_t2.c
pcl/pl/plfapi.c
psi/zfapi.c
xps/xpsfapi.c
2020-05-28 11:04:24 +0100
Chris Liddell <chris.liddell@artifex.com>
8384e88e02cefa3de112546838a752d7f0a7a5c1
Make gs_char and gs_glyph explicitly 64 bit types
base/gsccode.h
base/lib.mak
2020-06-16 16:50:38 +0100
Chris Liddell <chris.liddell@artifex.com>
0339cbecea80d8a835b316b56d1c75a6fb850e52
oss-fuzz 23440: check string lengths for PDF decryption
to avoid Use-of-uninitialized-value problems.
psi/zpdf_r6.c
2020-06-11 11:54:32 +0100
Chris Liddell <chris.liddell@artifex.com>
889df15d7c69e1fc90c6491f574352cacf9bc065
oss-fuzz 22182: validate glyph offset/length values
Check if the glyph offset and offset + length are larger than the size of the
font stream before we can use it.
psi/zfapi.c
2020-06-11 11:53:13 +0100
Chris Liddell <chris.liddell@artifex.com>
e61000344e40930aa229be5aa5cb9d31958bcb6d
Truetype: Tweak a conditional for signed/unsigned compare
base/gstype42.c
2020-06-16 14:14:33 +0100
Chris Liddell <chris.liddell@artifex.com>
0e50ac9dfcff795ec69cb646eea151bd57f0dd1c
Fix letter `te` in in Nimbus Sans Bold(Italic)
Update from URW++ (2020/05/26).
See:
https://github.com/ArtifexSoftware/urw-base35-fonts/issues/28
https://bugs.launchpad.net/ubuntu/+source/fonts-urw-base35/+bug/1871377
The glyph outline was much too wide, as well as the advance width being too
large.
Note: a number of test files show tiny rounding differences - this is normal
when these fonts get regenerated.
Resource/Font/NimbusSans-BoldItalic
Resource/Font/NimbusSans-Italic
2020-06-15 18:37:57 +0200
Till Kamppeter <till.kamppeter@gmail.com>
a189c020b1eb34a043c086b89bbb1caa86cc01f5
When building on arm64 with gcc, disable libpng's neon optimizations.
Bug 702486 - Ghostscript 9.52 does not build on arm64
Ghostscript 9.52 with the libraries which it is including builds
perfectly on i386, amd64, s390x, and armhf, but not on ppc64el
and arm64. Problem are internal optimizations in the libpng
shipped with Ghostscript.
For ppc64el the problem was already solved after the 9.52
release:
http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=1c9bd8e0aa4
https://bugs.ghostscript.com/show_bug.cgi?id=702236
This fix is for arm64 is Based on this and on a similar fix for
arm64 on another free software project
https://github.com/imagemin/optipng-bin/issues/97
This makes it also build on arm64, but it is not tested whether
it still correctly works on arm64 after the fix.
configure.ac
2020-06-13 12:11:23 +0100
Ken Sharp <ken.sharp@artifex.com>
9984b482e5c41427f69be32752b649d44eccd3cd
More work on gs_get_colorname_string
Commit 14c70d4e9 was, unfortunately, insufficient for the new PDF
interpreter. The gs_lib_ctx pointer does not give us access back to the
interpreter context, only to the *PostScript* interpreter name table.
So instead we now pass a graphics state pointer to
gs_get_colorname_string(). This is only used for halftones currently,
and even future use seems likely to be limited to objects like colour
spaces, which are of course contained in a graphics state, so this
seems relatviely future proof.
For PostScript the graphics state contains a memory_t pointer which we
can use to get to the PostScript name table. For the PDF interpreter
we already store some state in the 'client_data' of the graphics state
and we will extend that to include a pointer to the interpreter context
which will allow us to get the string from its name table.
base/gscspace.h
base/gsncdummy.c
base/gxht.h
devices/vector/gdevpdfg.c
psi/zht2.c
psi/zht2.h
2020-06-12 10:37:00 +0100
Ken Sharp <ken.sharp@artifex.com>
14c70d4e91db4b13273a48004fada094e8f8090d
Improve usage of 'get_colorname_string'
This function is supplied to a couple of places, and stored. Its
purpose is to retrieve a string for a colour plane, given an 'index'.
The index is an entry in the interpreter's name table.
The implementations of get_colorname_string take a memory_t pointer
and then use that to get a pointer to the interpreter, which they need
because the interpreter context is where the name table is stored.
The problem with the existing usage is that we were supplying the
device's memory_t pointer. However, if the halftone or colour space had
been created by a different interpreter to the device (which can happen
if we are running the PDF interpreter inside the PostScript interpreter)
then the interpreter context would be incorrect.
We can solve this easily enough by using the colour space or halftone
memory pointer. This is much safer since we can reasonably assume that
the interpreter which created the object is the same one which stored
the colour name in its name table.
base/gsncdummy.c
devices/vector/gdevpdfg.c
2020-06-10 10:38:18 +0100
Chris Liddell <chris.liddell@artifex.com>
825d6807a72b68a2faf11fc37f89b1b75967d727
Bug 702476: Don't rely on null terminated strings
gs strings are not necessarily null terminted (especially so when created by the
Postscript interpreter). So, when parsing a file name and deciding whether it's
a "device" (e.g. "%ram%") or a device + file name/path, don't rely on the string
being null terminate.
base/gsfname.c
2020-06-08 09:25:57 +0100
Chris Liddell <chris.liddell@artifex.com>
0ae681ab1fd3475995418d00da1ccfe374f069cc
oss-fuzz 22752: handle broken loca table.
Previously, the code did not differentiate between an empty loca table, a
missing loca table and a broken loca table.
We'll now do so and, in particular, with a broken loca table (in this case,
one with only 1 entry) we'll initialize the single entry to avoid later code
accessing unitialized memory.
base/gstype42.c
base/gxfont42.h
psi/zfapi.c
2020-06-08 14:49:04 +0100
Chris Liddell <chris.liddell@artifex.com>
9e85e7a9518aa19964f1f8d30d3175ef8c3b950f
oss-fuzz 21643: Bounds check a pointer before accessing it.
In this case, immediately after a buffer refill, (as is "normal" for gs stream
buffers) the pointers starts one byte *before* the actual buffer, the state on
reentry meant we'd drop straight to trying dereference the pointer.
This just ensures the pointer gets moved on before we try to use it.
base/seexec.c
2020-06-10 10:16:10 +0100
Ken Sharp <ken.sharp@artifex.com>
a4edd8320a5076bb52d1be7c061910b3b78718e0
pdfwrite - don't error out on skipped images
Bug #702471 "eps to pdf OK in 9.50, but failed in 9.51 and 9.52"
Some encode filters, in this case DCTEncode, can throw an error on exit
(premature EOD) if we never write any data to them. This can happen
when pdfwrite sets up to write an image to the output file, but we
never actually write the image, because it is being 'skipped'.
Images can be skipped because they are fully clipped out, unfortunately
we can't detect this before we execute begin_typed_image or we could
avoid a lot of setup.
Anyway, when we get to end_image, if we skipped the image then don't
take any notice of errors when closing the filters used to write the
image data to the PDF file.
devices/vector/gdevpdfi.c
2020-06-09 15:14:02 +0100
Robin Watts <Robin.Watts@artifex.com>
d68f56e25110ba3baf03553c2d1839febc02dbdb
Add docs for missing parts of gsapi.
Add docs for gsapi_set_param (and update the code to cope with
long/int64_t/size_t's in line with the core code).
Add docs for path control functions.
doc/API.htm
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/pltop.h
psi/iapi.h
psi/psapi.c
psi/psapi.h
2020-06-08 20:36:34 +0100
Robin Watts <Robin.Watts@artifex.com>
b9a4616cdf710c79f575adb33b331cb495461d93
Add documentation for gsapi_set_{stdio,poll}_with_handle.
Missed from earlier commit.
doc/API.htm
2020-06-07 09:45:57 -0700
ray <Ray.Johnston@artifex.com>
748edd2fd75c684d63486eded71ad20254de6f4c
Fix Bug 702383 - Segfault due to mis-use of PostScript transparency.
The fix for Bug 698306 fixed that case, but this case showed that the double
calls to .pushpdf14devicefilter still could cause problems. Another patch
already resolved calling transparency operations WITHOUT pushing the pdf14
device (for Bug 702327).
Also undefine the PostScript transparency operators to (maybe) prevent
misuse if -dALLOWPSTRANSPARENCY is not specified.
Resource/Init/pdf_main.ps
psi/ztrans.c
2020-06-05 14:51:00 +0100
Chris Liddell <chris.liddell@artifex.com>
560ff82b0bc782465aa4591b2953954d7cf5608c
Fix a bounds check in FAPI
Using less than or equal to should have been less than.
Found while investigating an oss-fuzz issue.
psi/zfapi.c
2020-06-04 16:57:01 +0100
Robin Watts <Robin.Watts@artifex.com>
7502a26f082e71e05df33dcd1dff66655f088673
Add documentation for OCR devices.
doc/Devices.htm
2020-05-25 13:32:26 +0100
Robin Watts <Robin.Watts@artifex.com>
eb492c353084600d94877f7157840d24dd7f9301
Update lcms2mt to lcms2-2.10rc2.
lcms2mt/AUTHORS
lcms2mt/COPYING
lcms2mt/ChangeLog
lcms2mt/Lib/MS/lcms2_fast_float_plugin.lib
lcms2mt/Lib/MS/lcms2_static.lib
lcms2mt/Lib/MS/lcms2mt_fast_float_plugin.lib
lcms2mt/Lib/MS/lcms2mt_static.lib
lcms2mt/Makefile.am
lcms2mt/Makefile.in
lcms2mt/Projects/BorlandC_5.5/lcms2mt.rc
lcms2mt/Projects/BorlandC_5.5/lcmsdll.lk
lcms2mt/Projects/VC2013/lcms2mt.rc
lcms2mt/Projects/VC2013/lcms2mt.sln
lcms2mt/Projects/VC2013/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2015/lcms2mt.rc
lcms2mt/Projects/VC2015/lcms2mt.sln
lcms2mt/Projects/VC2015/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2015/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters
lcms2mt/Projects/VC2015/lcms2mt_static/lcms2mt_static.vcxproj
lcms2mt/Projects/VC2015/lcms2mt_static/lcms2mt_static.vcxproj.filters
lcms2mt/Projects/VC2017/lcms2mt.rc
lcms2mt/Projects/VC2017/lcms2mt.sln
lcms2mt/Projects/VC2017/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2017/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters
lcms2mt/Projects/VC2017/lcms2mt_static/lcms2mt_static.vcxproj
lcms2mt/Projects/VC2017/lcms2mt_static/lcms2mt_static.vcxproj.filters
lcms2mt/Projects/VC2019/jpegicc/jpegicc.vcxproj
lcms2mt/Projects/VC2019/jpegicc/jpegicc.vcxproj.filters
lcms2mt/Projects/VC2019/lcms2mt.rc
lcms2mt/Projects/VC2019/lcms2mt.sln
lcms2mt/Projects/VC2019/lcms2mt_DLL/lcms2mt_DLL.vcxproj
lcms2mt/Projects/VC2019/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters
lcms2mt/Projects/VC2019/lcms2mt_static/lcms2mt_static.vcxproj
lcms2mt/Projects/VC2019/lcms2mt_static/lcms2mt_static.vcxproj.filters
lcms2mt/Projects/VC2019/linkicc/linkicc.vcxproj
lcms2mt/Projects/VC2019/linkicc/linkicc.vcxproj.filters
lcms2mt/Projects/VC2019/psicc/psicc.vcxproj
lcms2mt/Projects/VC2019/psicc/psicc.vcxproj.filters
lcms2mt/Projects/VC2019/resource.h
lcms2mt/Projects/VC2019/testbed/testbed.vcxproj
lcms2mt/Projects/VC2019/testbed/testbed.vcxproj.filters
lcms2mt/Projects/VC2019/tiffdiff/tiffdiff.vcxproj
lcms2mt/Projects/VC2019/tiffdiff/tiffdiff.vcxproj.filters
lcms2mt/Projects/VC2019/tifficc/tifficc.vcxproj
lcms2mt/Projects/VC2019/tifficc/tifficc.vcxproj.filters
lcms2mt/Projects/VC2019/transicc/transicc.vcxproj
lcms2mt/Projects/VC2019/transicc/transicc.vcxproj.filters
lcms2mt/Projects/cppcheck/lcms2mt.cppcheck
lcms2mt/Projects/mac/LittleCMS/LittleCMS.xcodeproj/project.pbxproj
lcms2mt/README.1ST
lcms2mt/aclocal.m4
lcms2mt/config.guess
lcms2mt/configure
lcms2mt/configure.ac
lcms2mt/doc/LittleCMS2.10 API.pdf
lcms2mt/doc/LittleCMS2.10 Plugin API.pdf
lcms2mt/doc/LittleCMS2.10 tutorial.pdf
lcms2mt/doc/LittleCMS2.9 API.pdf
lcms2mt/doc/LittleCMS2.9 Plugin API.pdf
lcms2mt/doc/LittleCMS2.9 tutorial.pdf
lcms2mt/doc/WhyThisFork.txt
lcms2mt/include/Makefile.in
lcms2mt/include/lcms2mt.h
lcms2mt/include/lcms2mt_plugin.h
lcms2mt/plugins/README.1ST
lcms2mt/plugins/fast_float/COPYING.GPL3
lcms2mt/plugins/fast_float/Makefile
lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin.vcxproj
lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin.vcxproj.filters
lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin.vcxproj.user
lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin_testbed.vcxproj
lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin_testbed.vcxproj.filters
lcms2mt/plugins/fast_float/Projects/VC2019/lcms2mt_fast_float_plugin_testbed.vcxproj.user
lcms2mt/plugins/fast_float/doc/LittleCMS fast float extensions 1.0.pdf
lcms2mt/plugins/fast_float/include/Makefile.am
lcms2mt/plugins/fast_float/include/lcms2mt_fast_float.h
lcms2mt/plugins/fast_float/src/Makefile.am
lcms2mt/plugins/fast_float/src/fast_16_tethra.c
lcms2mt/plugins/fast_float/src/fast_8_curves.c
lcms2mt/plugins/fast_float/src/fast_8_matsh.c
lcms2mt/plugins/fast_float/src/fast_8_tethra.c
lcms2mt/plugins/fast_float/src/fast_float_15bits.c
lcms2mt/plugins/fast_float/src/fast_float_15mats.c
lcms2mt/plugins/fast_float/src/fast_float_cmyk.c
lcms2mt/plugins/fast_float/src/fast_float_curves.c
lcms2mt/plugins/fast_float/src/fast_float_internal.h
lcms2mt/plugins/fast_float/src/fast_float_matsh.c
lcms2mt/plugins/fast_float/src/fast_float_separate.c
lcms2mt/plugins/fast_float/src/fast_float_sup.c
lcms2mt/plugins/fast_float/src/fast_float_tethra.c
lcms2mt/plugins/fast_float/testbed/Makefile.am
lcms2mt/plugins/fast_float/testbed/fast_float_testbed.c
lcms2mt/plugins/fast_float/testbed/test0.icc
lcms2mt/plugins/fast_float/testbed/test1.icc
lcms2mt/plugins/fast_float/testbed/test2.icc
lcms2mt/plugins/fast_float/testbed/test3.icc
lcms2mt/plugins/fast_float/testbed/test5.icc
lcms2mt/src/Makefile.am
lcms2mt/src/Makefile.in
lcms2mt/src/cmsalpha.c
lcms2mt/src/cmscam02.c
lcms2mt/src/cmscgats.c
lcms2mt/src/cmscnvrt.c
lcms2mt/src/cmserr.c
lcms2mt/src/cmsgamma.c
lcms2mt/src/cmsgmt.c
lcms2mt/src/cmshalf.c
lcms2mt/src/cmsintrp.c
lcms2mt/src/cmsio0.c
lcms2mt/src/cmsio1.c
lcms2mt/src/cmslut.c
lcms2mt/src/cmsmd5.c
lcms2mt/src/cmsmtrx.c
lcms2mt/src/cmsnamed.c
lcms2mt/src/cmsopt.c
lcms2mt/src/cmspack.c
lcms2mt/src/cmspcs.c
lcms2mt/src/cmsplugin.c
lcms2mt/src/cmsps2.c
lcms2mt/src/cmssamp.c
lcms2mt/src/cmssm.c
lcms2mt/src/cmstypes.c
lcms2mt/src/cmsvirt.c
lcms2mt/src/cmswtpnt.c
lcms2mt/src/cmsxform.c
lcms2mt/src/lcms2_internal.h
lcms2mt/src/lcms2mt.def
lcms2mt/testbed/Makefile.am
lcms2mt/testbed/Makefile.in
lcms2mt/testbed/new.icc
lcms2mt/testbed/testcms2.c
lcms2mt/testbed/testcms2.h
lcms2mt/testbed/testplugin.c
lcms2mt/testbed/zoo_icc.c
lcms2mt/utils/common/utils.h
lcms2mt/utils/common/vprf.c
lcms2mt/utils/jpgicc/Makefile.am
lcms2mt/utils/jpgicc/Makefile.in
lcms2mt/utils/jpgicc/jpgicc.c
lcms2mt/utils/linkicc/Makefile.am
lcms2mt/utils/linkicc/Makefile.in
lcms2mt/utils/linkicc/linkicc.c
lcms2mt/utils/psicc/Makefile.am
lcms2mt/utils/psicc/Makefile.in
lcms2mt/utils/psicc/psicc.c
lcms2mt/utils/samples/Makefile.am
lcms2mt/utils/tificc/Makefile.am
lcms2mt/utils/tificc/Makefile.in
lcms2mt/utils/tificc/tifdiff.c
lcms2mt/utils/tificc/tificc.c
lcms2mt/utils/transicc/Makefile.am
lcms2mt/utils/transicc/Makefile.in
lcms2mt/utils/transicc/transicc.c
2020-06-03 19:41:31 +0100
Robin Watts <Robin.Watts@artifex.com>
a83716a1657df0a63aafa6582f47a93315aa61a6
Add skew detection/correction to downscaler.
base/cal.mak
base/gxdownscale.c
base/gxdownscale.h
2020-06-04 14:21:24 +0100
Robin Watts <Robin.Watts@artifex.com>
7867660a69bcc8624f0524ab56d86001d79e5b8d
Update doc/gdevds32.c to track updated downscaler API.
doc/gdevds32.c
2020-06-04 13:20:40 +0100
Ken Sharp <ken.sharp@artifex.com>
1db215120db50db418b199ff364e17feba681f14
Fix a couple of benign compiler warnings
Firstly a missing include file.
Secondly we were using a utility function from pdfwrite, and obviously
not including the .h file. We really shouldn't be hauling in bits of
pdfwrite, so instead duplicate the (miniscule) bit of functionality we
want.
devices/vector/gdevtxtw.c
2020-05-25 17:36:24 +0100
Ken Sharp <ken.sharp@artifex.com>
278f9a53ed507f9109380ee4210fb860b35b1811
txtwrite - better processing of text in type 3 fonts
Previously we were not able to accumulate the widths of text in a type
3 font. This code leverages (again) off the code in pdfwrite to exit
to the interpreter, run the type 3 CharProc, and pick up the glyph
advance width in setcachedevice.
This gives us better output for type 3 fonts, as we no longer
think that consecutive text is in the same position.
devices/vector/gdevtxtw.c
2020-06-03 16:54:41 +0100
Robin Watts <Robin.Watts@artifex.com>
feee7e6afd34ff3c1fa0c30ec024be25f1a61c1e
Rework downscaler initialisation.
Pass the downscaler parameters into the downscaler init routines,
rather than explicit values.
This reduces the size of the API, and means that future additions
to the structure will automatically be passed through.
base/gxdownscale.c
base/gxdownscale.h
devices/gdevchameleon.c
devices/gdevjpeg.c
devices/gdevocr.c
devices/gdevpdfimg.c
devices/gdevpng.c
devices/gdevpsd.c
devices/gdevtifs.c
devices/gdevtifs.h
devices/gdevtsep.c
2020-04-24 14:13:39 +0100
Robin Watts <Robin.Watts@artifex.com>
7322ef87546c55b29056c1d96d8bdbb7f3ba53ef
Tesseract based OCR devices.
pdfocr8/24/32, ocr and hocr devices.
Use OCRLanguage to set languages to use ("eng" by default).
Makefile.in
base/endianness.h
base/gsiorom.c
base/gxiodev.h
base/leptonica.mak
base/lib.mak
base/msvccmd.mak
base/ocr.mak
base/tess_version.h
base/tesseract.mak
base/tessocr.cpp
base/tessocr.h
base/unix-gcc.mak
base/winlib.mak
configure.ac
devices/devs.mak
devices/gdevocr.c
devices/gdevpdfimg.c
devices/gdevpdfimg.h
devices/gdevpdfocr.c
psi/msvc.mak
windows/ghostscript.vcxproj
windows/ghostscript.vcxproj.filters
2020-06-03 18:32:56 +0100
Robin Watts <Robin.Watts@artifex.com>
ff02973645a9aff2caf1bcd3032f119995e0d63f
Fix coverity 359151.
Check ds->dev is non NULL before dereferencing it.
base/gxdownscale.c
2020-06-02 19:24:50 +0100
Robin Watts <Robin.Watts@artifex.com>
89f3dba59d801dd7c586d81d996ea8d641e1018a
Add yet another version of nmake to makefile.
psi/msvc.mak
2020-06-02 19:23:30 +0100
Robin Watts <Robin.Watts@artifex.com>
df31667a82d8320d25c15f9eaf14fbb33a4ba0a1
Bug 702446: Fix CAL halftoning.
Looks like cal was interpretting halftone X phase in the wrong
direction.
base/gximono.c
2020-06-02 12:09:53 -0700
Michael Vrhel <michael.vrhel@artifex.com>
0006f8715f5f5d83a7823dc9f41c76a1bdf9b0f7
Add lcms2mt files into build_bmpcmp.sh
toolbin/build_bmpcmp.sh
2020-06-02 11:59:44 -0700
Michael Vrhel <michael.vrhel@artifex.com>
b9916ac2feec23b6c91e4c5d425dde0a73b1462d
Add missing line feeds on error messages in bmpcmp
toolbin/bmpcmp.c
2020-06-01 22:47:36 -0700
Michael Vrhel <michael.vrhel@artifex.com>
e3bbb3b93bcdade889b36641508f25929968089e
Add CIELAB comparison to bmpcmp
Adding the option -l will perform the difference in CIELAB
color space, provided the application was built with a CMM and
the source files were tiff files that had embedded ICC profiles.
It is necessary to use a threshold > 0 and a window > 1.
The threshold should be interpreted as dE^2 (a Euclidean norm squared
term is used as opposed to the L infinity norm used for the other
color spaces)
As a rule of thumb, dE^2 = 9 is barely noticeable in a side by side
solid color. Colors in complex images are going to require a larger
threshold.
This adds lcms2mt to the visual studio project. COLOR_MANAGED
toolbin/bmpcmp.c
toolbin/bmpcmp.vcxproj
2020-05-29 17:30:45 +0100
Robin Watts <Robin.Watts@artifex.com>
bb9959b60a9b3947c091ab867616385ac3fc7794
Refactor downscaler.
Originally the downscaler would just get the bits it wanted from
either get_bits or get_bits_rectangle.
Then we extended the downscaler to integrate ClapTrap, which means
it may have to get its scanlines from that. This was done hackily.
Now, we are pondering integrating scan/skew, which means there will
be a third possible source, and they might be used in different
combinations.
To simplify everything we introduce a "gx_downscaler_liner" mechanism
which wraps up getting a single line of data, and move to using
that everywhere. Adding scan/skew should then plug in using this
much more neatly.
base/gxdownscale.c
base/gxdownscale.h
2020-05-29 17:22:40 +0100
Robin Watts <Robin.Watts@artifex.com>
ba2fdf5517af3bcd8a613fda84c532307d1e7024
Fix memory leaks in tiffsep.
Calling TIFFCleanup doesn't close the underlying tiffio. Call
TIFFClose instead.
Now the tiff io close handler is actually called, be careful
not to close the underlying file twice.
Finally, actually remember to close the comp file.
base/gstiffio.c
devices/gdevtifs.c
devices/gdevtsep.c
2020-05-29 17:16:00 +0100
Robin Watts <Robin.Watts@artifex.com>
052a91b91d3d339dca3ce69bcb81faee9b8ff647
Claptrap: Fix us overrunning components in the planar case.
base/claptrap-planar.c
2020-05-30 19:38:38 +0100
Ken Sharp <ken.sharp@artifex.com>
2e4f5bdc708eaceecbce264184bc31f9b5fec107
Coverity ID 359131 and 359130
Remove some dead code after the commit which removed the ancient
Acrobat 4 & 5 compatibility hacks.
devices/vector/gdevpdfd.c
2020-05-27 11:50:08 +0100
Julian Smith <jules@op59.net>
a608d40b2d6d4a062857e23060c243a4b10aac69
Hacky fix for Memento leak in pcl_execute_macro().
Fixes the six remaining leaks after prev commit in:
MEMENTO_FAILAT=15796 ./ghostpdl/membin/gpcl6 -sDEVICE=pbmraw -o /dev/null tests_private/pcl/pcl5cfts/fts.2180
pcl/pcl/pcmacros.c
2020-05-29 16:19:46 +0100
Julian Smith <jules@op59.net>
be333874ffd55024ce640bf8d4347dabff162be1
Improvements to pcl_do_resets().
From Henry; we now do pcl_reset_permanent on all items if we get an error.
This fixes all but 6 of the memento leaks in:
MEMENTO_FAILAT=15796 ./ghostpdl/membin/gpcl6 -sDEVICE=pbmraw -o /dev/null tests_private/pcl/pcl5cfts/fts.2180
pcl/pcl/pcommand.c
2020-05-28 13:07:55 +0100
Ken Sharp <ken.sharp@artifex.com>
3156b0aa8ac4e9ef440c169799658da249eb41c9
pdfwrite - remove Acrobat 4 & 5 work arounds
Acrobat 4 had a limit of around =/- 16,320 on real numbers (despite the
reference stating it was +/- 32,7670, Acrobat 5 had a limit of 32,767.
These are implementation limits, not architectural limits, and since
co-ordinates are expressed as real numbers they place limits on the
position of objects on the page.
Its clear from Bug #702436 that the clamping used by pdfwrite is not
comprehensive; several paths are emitted that use co-ordinates outside
the permitted range.
Since the implementation is flawed, and the newest of the 2 versions
(Acrobat 5) has been obselete for 15 years, it seems pointless to try
and improve this clamping. Instead this commit removes it entirely.
This removes a number of places where we test values and do some
multiplication, so there should be a (probably immeasurable) performance
gain from this. In addition the accuracy should be (very slightly)
improved because there should be less problems with rounding errors.
This causes a large number of files to demonstrate single pixel shifts
of a few glyphs, due to changes in rounding. In general these are very
minor progressions, though a few could be seen to be equally minor
regressions. Since these mostly (and in the case of regressions,
entirely) occur at low resolution I believe this is acceptable.
One file, Bug694385, when sent to ps2write, exhibits a marked
progression. This is because the clamping wasn't limited to the pdfwrite
device, even though it was inappropriate to limit the ps2write output
this way. A good deal of content is now included, where it was previously
elided.
devices/vector/gdevpdfd.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfi.c
devices/vector/gdevpdfx.h
devices/vector/gdevpdts.c
2020-05-27 16:53:33 +0100
Ken Sharp <ken.sharp@artifex.com>
f8a0afa4029b33d3174a31fd562a0102644c9c9e
pdfwrite - fix clamping for Acrobat 4 and 5 limits
Bug #702436 "With -dCompatibilityLevel=1.4, gs -sDEVICE=pdfwrite corrupts the contents"
This isn't 'corruption'. Acrobat 4 and 5 have some serious limitations
on the maximum value a real number can take. Since co-ordinates are real
numbers this limits the area which can be addressed on the media.
The example file is very large and, using the default resolution of 720
dpi, some of the content has co-ordinates outside the region which can
be addressed by old versions of Acrobat.
In practice we can see that many parts of our output no longer limit
themselves to these values anyway, so we shjould remove this archaic
limitation.
In the meantime we can work around this specific case by noting that the
clip is rectangular, and will be emitted as a 're' operation, so
clamping all 4 co-ordinates is inappropriate. We need to clamp the llx
and lly co-ordinates, but then its the width and height we need to limit
rather than the urx and ury co-ordinates.
devices/vector/gdevpdfd.c
2020-05-26 18:57:30 +0100
Ken Sharp <ken.sharp@artifex.com>
b53ad834b8cddfc55e2297e3d34ff834926a25ff
documentation - update man/ps2pdf.1
Replace reference to ps2pdf.htm with VectorDevices.htm
man/ps2pdf.1
2020-05-26 13:04:09 +0100
Julian Smith <jules@op59.net>
6667495f56bc670322f607de419fe7e48434d3c6
Fix memento leak in hpgl_process_buffer().
The fix is to make hpgl_free_stick_fonts() call
pl_font_glyph_width_cache_remove_nodes().
Fixes:
MEMENTO_FAILAT=22007 ./ghostpdl/membin/gpcl6 -sDEVICE=pbmraw -o /dev/null tests_private/pcl/pcl5cfts/fts.1640
Also fixes many later leaks.
pcl/pcl/pglabel.c
2020-05-25 18:41:24 +0100
Julian Smith <jules@op59.net>
1e8dd08e6c9e721c993d28bb36e107f81d16ce0a
Fix leak after error in accum_fill_rectangle()
Fixes:
./ghostpdl/membin/gpcl6 -sDEVICE=pbmraw -o /dev/null tests_private/pcl/pcl5cfts/fts.1552
base/gxacpath.c
2020-05-25 11:59:52 +0100
Julian Smith <jules@op59.net>
776cf430dd1a96a7da33c0d33af9a6dd42bffec0
Fix memory leak on error in bitmap_paint() and its callers.
Previously, bitmap_paint() would free its 'gs_image_enum * pen' arg, but caller
image_PaintProc() could also attempt to free this in one error path.
So have changed bitmap_paint() to only free what it allocates - call
gs_image_cleanup() instead of gs_image_cleanup_and_free_enum(); and patched
its two callers, mask_PaintProc() and image_PaintProc(), to add calls to
gs_free_object(pen).
Fixes leak in:
MEMENTO_FAILAT=15601 ./ghostpdl/membin/gpcl6 -sDEVICE=pbmraw -o /dev/null tests_private/pcl/pcl5cfts/fts.0954
base/gsptype1.c
2020-05-25 11:59:19 +0100
Julian Smith <jules@op59.net>
815cbc244257f224eca799413ee64b17b62ffb4a
Fix error handling in image_render_interpolate_icc().
Need to return gs_error_VMerror if gs_alloc_bytes() returns NULL.
Fixes segv in:
MEMENTO_FAILAT=15601 ./ghostpdl/membin/gpcl6 -sDEVICE=pbmraw -o /dev/null tests_private/pcl/pcl5cfts/fts.0954
base/gxiscale.c
2020-05-22 08:26:34 -0700
Ray Johnston <ray.johnston@artifex.com>
3227677f842a1060d29acc53465c6a9c76f7d48b
Fix Bug702327: PS transparency operations before PUSH_DEVICE causes problems.
Add check to make sure PUSH_DEVICE is the first pdf14 compositor action
before allowing any other operation for page mode and clist mode.
base/gdevp14.c
base/gxclist.c
base/gxclist.h
2020-05-23 14:16:51 +0100
Ken Sharp <ken.sharp@artifex.com>
b4310ff9719fdafb840972649a4eb94a88165e66
ps2write - ignore (most) text rendering modes with type 3 fonts
Bug #702233 "ps2 stroked text mitre problem"
The PDF specification says that Tr (text rendering modes) are not
applied to type 3 fonts.
The PDF interpreter normally caters for this by not converting the
glyphs to paths and applying the operation(s) but simply rendering the
text.
However, when the destination is pdfwrite or ps2write, we don't apply
the text rendering mode operations, we simply leave it up to the device
to deal with. Ordinarily this works well, but ps2write had no provision
for the special handling of type 3 fonts, and so was applying the text
rendering mode to those fonts too, resulting in incorrect output.
This commit adds code to the PostScript output of ps2write; this checks
the font type and does not apply the text rendering mode if the font
type is 3. With one exception; if the text rendering mode is 3 (neither
stroke nor fill) then we *do* apply it, because Acrobat does and if we
don't apply it then we draw text that Acrobat does not.
devices/vector/opdfread.ps
2020-05-22 11:25:43 -0700
Michael Vrhel <michael.vrhel@artifex.com>
4d3ca982177aff19331b72a226664e281feede2c
Fix tiff bmpcmp to organize image data upside right for windows
toolbin/bmpcmp.c
2020-05-22 13:38:23 +0100
Chris Liddell <chris.liddell@artifex.com>
e1354dbd1cfc7692b7559a3f4c7f86900e513edc
Bug 702431: Don't cast a unsigned long to an unsigned int
When allocating the pixmap for a display device, we were casting the unsigned
long bitmap size to an unsigned int, meaning on LP64 (where a long is 64 bits)
we could end up truncating the value.
Change it to cast to a size_t.
Ultimately, we'll want to change the display device structure to store a size_t
rather than unsigned long, but that will mean changing the display device's
public API.
devices/gdevdsp.c
2020-05-21 11:12:14 +0100
Chris Liddell <chris.liddell@artifex.com>
b4cda2ee4cbdf045e05b9832fd93f6a1a5cc3bb6
Remove the last of TURBO C support.
Most of the TURBO C support went away years ago, and we've had no complaints,
so remove the rest.
base/malloc_.h
base/memory_.h
base/stdpre.h
psi/store.h
2020-05-22 14:24:39 +0100
Ken Sharp <ken.sharp@artifex.com>
7d6d69ff17c43664482fe0dc34676a46ba551d93
pdfwrite - rewrite the PSPageOptions code to use non-GC memory
Bug #702370 "PSPageOption injecting unwanted characters"
As Peter rightly comments in the bug this is due to the contents of the
param_string_array not being enumerated when the array pointer is
enumerated.
This seems to be a general problem, but we seem to get away with it for
NeverEmbed and AlwaysEmbed (which are handled in a much more complex
fashion) so I've chosen to leave those alone for now.
For PSPageOptions this commit creates a new gs_param_string_array and
new strings for each of the strings in the param_list. These are
allocated in non-GC memory and the pdfwrite device has complete control
over their lifetime now.
We no longer numerate the member for GC (because it should not be GC'ed)
and we free the array and its contents when we close the device.
This resolves the problem for me.
devices/vector/gdevpdf.c
devices/vector/gdevpsdf.h
devices/vector/gdevpsdp.c
2020-05-21 16:24:41 -0700
Michael Vrhel <michael.vrhel@artifex.com>
548fa474def31ddeb2864554ad0698bd53b13ea0
Add shell script to build bmpcmp with tiff and png support
toolbin/build_bmpcmp.sh
2020-05-20 18:15:40 +0100
Robin Watts <Robin.Watts@artifex.com>
6955a325826e84c77723bab03046c801930801df
Extend gsapi interface with _with_handle variants for callbacks.
This allows us to specify specific caller_handles for each
callback type rather than using a default one specified at
gs instance creation time. The old functions still work.
base/gp_mspol.c
base/gslibctx.c
base/gslibctx.h
base/strmio.c
pcl/pl/plapi.c
pcl/pl/plapi.h
psi/gsdll2.def
psi/gsdll32.def
psi/gsdll32metro.def
psi/gsdll64.def
psi/gsdll64metro.def
psi/gsdllARM32metro.def
psi/iapi.c
psi/iapi.h
psi/psapi.c
psi/ziodevsc.c
2020-05-21 08:21:05 +0100
Chris Liddell <chris.liddell@artifex.com>
b0d2c264eb53c1838957151f1e18abfd1f17dd54
Bug 702225(pt2): Check fontconfig is new enough.
Turns out FC_VARIABLE is a fairly new addition to fontconfig's search
parameters (<= 2.12.6 doesn't have it >=2.13.1 does), so add preprocessor
conditions so we'll only use when fontconfig is new enough.
base/gp_unix.c
2020-05-20 16:23:12 +0100
Chris Liddell <chris.liddell@artifex.com>
627942b74af81c1b9b76b07dba6e4ce6234a4ab6
Fix the Windows top makefile when using UFST
If the user chose to specify the build flags for using UFST directly on the
nmake command line (rather than using the predefined UFST build target), we'd
end up disabling Freetype, which has not been supported for some time.
psi/msvc.mak
2020-05-20 15:17:10 +0100
Robin Watts <Robin.Watts@artifex.com>
619e7f46c9c760879409f9efaa4b3e798986538e
lgtm.com fixes: float * float -> double.
Make casting explicit. Ideally we'd cast one of the floats to a
double to start with, so the multiplication happens in doubles,
but that produces lots of diffs.
base/gspaint.c
2020-05-20 11:39:08 -0700
Michael Vrhel <michael.vrhel@artifex.com>
e27d7babcbbbee07fe9c458228d941ce3b4f8890
Fix typo introduced in copy/paste
base/gdevp14.c
2020-05-19 12:18:29 -0700
Michael Vrhel <michael.vrhel@artifex.com>
c9142412c3ec52e2fcb42053706352a9ee5d9a74
Add tiff to bmpcmp
This upgrades the VS solution to 2019 for the bmpcmp project. Fixes a couple
minor issues that existed with some of the project configurations and add
tiff support.
toolbin/bmpcmp.c
toolbin/bmpcmp.sln
toolbin/bmpcmp.vcproj
toolbin/bmpcmp.vcxproj
2020-05-20 14:45:15 +0100
Robin Watts <Robin.Watts@artifex.com>
cf15813c35a75067e828608c665dae30999f8dd5
Update Acrobat2Tiff to VS2019
toolbin/Acrobat2Tiff/Acrobat2Tiff.sln
toolbin/Acrobat2Tiff/Acrobat2Tiff/Acrobat2Tiff.vb
toolbin/Acrobat2Tiff/Acrobat2Tiff/Acrobat2Tiff.vbproj
toolbin/Acrobat2Tiff/Acrobat2Tiff/Acrobat2Tiff/Application.Designer.vb
toolbin/Acrobat2Tiff/Acrobat2Tiff/Acrobat2Tiff/Resources.Designer.vb
toolbin/Acrobat2Tiff/Acrobat2Tiff/Acrobat2Tiff/Settings.Designer.vb
2020-05-20 16:02:07 +0100
Ken Sharp <ken.sharp@artifex.com>
8c7bd787defa071c96289b7da9397f673fddb874
txtwrite - address memory problems
Bug #702229 " txtwrite: use after free in 9.51 on some files (regression from 9.50)"
Also bug #702346 and the earlier report #701877.
The problems occur because its possible for a single character code in
a PDF file to map to more than a single Unicode code point. In the case
of the file for 701877 the character code maps to 'f' and 'i' (it is an
fi ligature).
The code should deal with this, but we need to ensure we are using the
correct index. In addition, if we do get more Unicode code points than
we expected, we need to set the widths of the 'extra' code points to
zero (we only want to consider the width of the original character).
This does mean increasing the size of the Widths array to cater for
the possibility of more entries on output than there were on input.
While working on it I noticed that the Unicode remapping on little-
endian machines was reversing the order of the Unicode values, when
there was more than a single code point returned, so fixed that at
the same time.
devices/vector/gdevtxtw.c
2020-05-20 12:44:45 +0100
Robin Watts <Robin.Watts@artifex.com>
be741930a01176ba8cfea1310866a1a1c69fa71c
Add yet another nmake version to the MSVC makefile.
psi/msvc.mak
2020-05-20 11:23:18 +0100
Robin Watts <Robin.Watts@artifex.com>
a10a03a4c9713b38c4cfcd07f0ba3c722778aae0
Rejig plftable.h
Rather than repeatedly including the same header to get multiple
versions of the font table built in, build the font table just
once with all the information in it.
This should be smaller (fractionally), and stop lgtm.com complaining.
pcl/pcl/pcfontpg.c
pcl/pcl/pcfsel.c
pcl/pl/plftable.c
pcl/pl/plftable.h
pcl/pl/pllfont.c
2020-05-20 12:15:12 +0100
Chris Liddell <chris.liddell@artifex.com>
ffbaace78bacb0421ae11c5a8fdef51cbd829218
Tweak fapiufst code to build with UFST 7.1.x
base/fapiufst.c
2020-05-19 16:20:49 +0100
Chris Liddell <chris.liddell@artifex.com>
7e7fa21f9e378303df8d8529cc3a94676e433f40
Exclude "variable fonts" from fontconfig search
Since we cannot used (and later skip over errors caused by) TTF variable
fonts (a sort of illigitimate offspring of Multiple Master and TTF!) we
may as well filter them out of our fontconfig search criteria.
Patch suggested by zdohnal@redhat.com
base/gp_unix.c
2020-05-19 18:43:48 +0100
Robin Watts <Robin.Watts@artifex.com>
9f1b19d0634ad611dc73a8c05c13c88f42cb8730
lgtm fixes: float * float -> double
When we do float * float, and then use the result in a context
where a double is expected, we implicitly cast the result of the
multiplication to be a double. This means we can overflow
the range of floats during the initial multiplication, when the
result would quite easily fit into a float.
It's better to cast to double to start with, then do the
multiplication (at the cost of potentially being slower - but
not really that much slower these days).
In some cases I've opted NOT to change the operations (merely to
make the casting explicit) so as to minimise diffs.
base/gdevp14.c
base/gshtscr.c
base/gxshade.c
base/gxstroke.c
pcl/pxl/pxpaint.c
2020-05-19 19:45:03 +0100
Robin Watts <Robin.Watts@artifex.com>
173e301c9908cf4656c462a89a146f7f1f5664f8
Fix "integer constant overflow" warning.
base/gsptype1.c
2020-05-18 13:16:20 +0100
Ken Sharp <ken.sharp@artifex.com>
ef0bc2a843783af2e5d76dadf801063ab6c785ef
Improve font copying for new PDF interpeter with pdfwrite
Since this commit:
http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=12c071547d
The 'copied font' stored by pdfwrite has maintained a pointer to the
interpreter's 'dir' (FontDirectory) and used it to mark the names in
the interpreter name table during GC pointer enumeration.
This doesn't work if the interpreter is pdfi and its working inside
the Ghostscript PostScript interpreter, because the enumeration can
take place after the pdfi interpreter has been destroyed. Its also not
necessary in this case, because the pdfi name table can't be relocated.
But for complex reasons (see the lengthy comment in the code) it has a
small but useful benefit when pdfwrite is being driven directly by the
PostScript interpreter.
In order to avoid losing that benefit, we now only store a pointer to
the interpreter's 'dir' member, and only mark the names during
enumeration, if the memory allocator of the font is a garbage-collecting
allocator.
devices/gxfcopy.c
2020-05-18 13:20:10 +0100
Robin Watts <Robin.Watts@artifex.com>
63df5adcad39572f94a0448c09598641c89f58db
lgtm.com fix: int * int may overflow before being converted to size_t.
base/gxdownscale.c
2020-05-15 13:06:19 +0100
Robin Watts <Robin.Watts@artifex.com>
c170fa2fc7dfe79dced44d7b628129e5bc7dd045
lgtm.com fixes: Don't define external functions in local scope.
base/gxpcmap.c
pcl/pxl/pxfont.c
2020-05-15 12:54:35 +0100
Robin Watts <Robin.Watts@artifex.com>
f8529a27e1c1768bd79ff19dfa7a29790ce9e275
lgtm.com: Add comment to empty conditional block to stop warning.
base/mkromfs.c
2020-05-15 12:36:00 +0100
Robin Watts <Robin.Watts@artifex.com>
53b712ea02903910a19980b28fbf8ae6fc5bdade
lgtm.com fixes: Avoid shadowing params with local vars.
base/ets.c
base/gdevmem.c
base/gsfcmap1.c
pcl/pcl/rtraster.c
pcl/pl/pjparse.c
psi/imain.c
psi/zchar.c
2020-05-15 11:43:13 -0700
Ray Johnston <ray.johnston@artifex.com>
8d9df30a48ac272e92666d52fef62580aacabfd7
Bug 702248: Spelling problem in error message.
Resource/Init/pdf_rbld.ps
2020-05-15 11:48:54 +0100
Robin Watts <Robin.Watts@artifex.com>
349d37844880567be4630e07c0518f6671300fc6
lgtm.com: Fix "comparison is always false" warning.
psi/ziodev.c
2020-05-15 11:48:07 +0100
Robin Watts <Robin.Watts@artifex.com>
2f768243df42031a3f37f256678e34c1ac97fdde
lgtm.com fixes: Multiplication of narrow type in wider context.
base/claptrap-init.c
base/gdevdrop.c
base/gdevprn.c
base/gsfunc.c
base/gsicc_monitorcm.c
base/gxccache.c
base/gxclip2.c
base/gxclipm.c
base/gxclread.c
base/gxclrect.c
base/gxdownscale.c
base/gxfapi.c
base/gxhtbit.c
base/gxidata.c
base/gxipixel.c
base/gxshade4.c
base/sjbig2.c
base/sjbig2.h
pcl/pcl/pcsfont.c
pcl/pl/plchar.c
pcl/pxl/pximage.c
psi/zfapi.c
xps/xpsimage.c
xps/xpsjxr.c
xps/xpspng.c
xps/xpszip.c
2020-05-14 21:00:34 +0100
Robin Watts <Robin.Watts@artifex.com>
b380ebb41878645d0d7bb2b07155667acac4fa99
lgtm.com fixes: Fix cases where comparisons are constant.
base/gdevdflt.c
base/gdevp14.c
base/gen_ordered.c
base/gscsepr.c
base/gsmisc.c
base/gstiffio.c
base/gxcmap.c
base/gxdownscale.c
base/mkromfs.c
base/ttfmain.c
pcl/pl/realmain.c
pcl/pxl/pxfont.c
pcl/pxl/pxink.c
psi/imain.c
psi/ireclaim.c
psi/iscannum.c
psi/zcolor.c
psi/zfont.c
psi/zfsample.c
psi/zfunc4.c
2020-05-13 16:52:42 -0700
Ray Johnston <ray.johnston@artifex.com>
d578f2517bbc6261a0cf31f8e2e88b2990241c0a
Fix 702400: Indeterminate SEGV due to GC confusion.
The GC 'clump_locate' macro relied on PTR_BETWEEN (yes, also a macro)
but on Windows MSC_VER caused pointers to be compared using only the
low 32-bits (unsigned long is 32-bits on Windows, even 64-bit).
Depending on addresses, and when the GC ran, this could result in the
GC logic being confused about addresses. This change works with 32-bit
Windows as well as 64-bit (and may not work with TURBOC on an OLD
CPU with segment+offset addresses, but so what?).
base/stdpre.h
2020-05-13 10:20:29 -0700
Nancy Durgin <nancy.durgin@artifex.com>
d703f355af5292e61dcd641332e249873ab5fb8a
Bug702398 -- Fix several annotation w/no AP bugs
1) In the case of an annotation with no BS or Border, the code was simply
incorrect, causing an error that meant the annotation didn't render.
2) annotation wasn't rendering if atan got error
Found this for a PolyLine case, but also fixed it for Line, just in case.
3) Fix 1st LE in Polyline
It was calculating dx,dy backwards, so the angle was off by 180 degrees.
4) Set the color for PolyLine annotation
Resource/Init/pdf_draw.ps
2020-05-13 11:31:57 +0100
Robin Watts <Robin.Watts@artifex.com>
d767c9e3297623e6708fe1c6dcab0583989ef63c
Assuage C++'s demands for whitespace in string literal concats.
base/stdint_.h
2020-05-11 18:05:50 +0100
Robin Watts <Robin.Watts@artifex.com>
0ccf0e77b1ee8e10335c2a80ddb180c9b5a4f5b6
lgtm.com fixes: Narrow multiply -> wider result.
base/gsfcmap.c
base/gxhintn.c
2020-05-12 13:58:30 +0100
Ken Sharp <ken.sharp@artifex.com>
bad9f11895cbb4c0f53b7b0ef8f3502789d81315
graphics library - improve gx_cpath_copy
This function does not, currently, appear to be called from anywhere.
For the new PDF interpreter we'd like to use it to copy the clip path(s)
from the PostScript environment to the PDF environment, but there's a
problem.
The problem is that the structures defining the list of rectangles are
allocated using the same memory allocator as the source clip path, but
when we come to free them, the destructor uses the memory allocator of
the clip list. So if the destination clip path was using a different
allocator from the source clip path, we will use the wrong allocator to
try and free the memory.
Chris thinks this may be an attempt to cope with stack-based allocations
of the clip path where the allocator is NULL. So to cope with that
we use the existing code (allocator from the source clip path) if the
destination clip path's allocator is NULL (stack based) and we use the
destination clip path's allocator otherwise.
base/gxcpath.c
2020-05-11 11:08:26 -0700
Michael Vrhel <michael.vrhel@artifex.com>
ae6b0b0e768f618728f66580227fffc92896903c
Remove "magic numbers" from profile type selection
base/gdevp14.c
base/gscms.h
base/gsequivc.c
base/gsicc.c
base/gsicc_cache.c
base/gsicc_manage.c
base/gstext.c
base/gxclthrd.c
base/gxcmap.c
base/gxiscale.c
devices/gdevjpeg.c
devices/gdevpdfimg.c
devices/gdevpng.c
devices/gdevtfnx.c
devices/gdevtifs.c
devices/gdevtsep.c
devices/vector/gdevxps.c
psi/zicc.c
2020-05-07 10:43:54 -0700
Michael Vrhel <michael.vrhel@artifex.com>
2bb52bc877645068977c17c8a433e5b959b51eba
Spot overprint in RGB Blend color spaces
If the blending color space is RGB based,
special consideration must be made for doing
overprint with separation and devicen color spaces.
In particular if we are going out to a separation
device we could have RGB+spot support but not
if the separation color was a process name like
Cyan.
Also implement the missing gxdso_pdf14_sep_device
special operation.
base/gdevdflt.c
base/gdevp14.c
base/gscdevn.c
base/gscspace.h
base/gsstate.c
base/gstext.c
base/gxblend.c
base/lib.mak
2020-05-11 15:41:09 +0100
Robin Watts <Robin.Watts@artifex.com>
a7def309186f123008dcedfc0a6b07b6328c9c13
lgtm.com: configuration file fixes.
.lgtm.yml
2020-05-11 00:57:18 +0100
Robin Watts <Robin.Watts@artifex.com>
4f03b3f51957fcaab6b953ba79bb32d2096ad49b
lgtm.com fixes: Avoid narrow mult cast to longer type.
Avoid masking overflows through relying on implicit casting.
base/gdevabuf.c
base/gdevdflt.c
base/gdevp14.c
base/gen_ordered.c
base/gsfcmap.c
base/gsfunc0.c
base/gsht.c
base/gshtscr.c
base/gsicc_create.c
base/gsptype1.c
base/gxblend1.c
base/gxdownscale.c
base/gxht_thresh.c
base/gxicolor.c
base/gximono.c
base/gxiscale.c
base/gxpcmap.c
base/sidscale.c
base/siscale.c
base/sjpx_openjpeg.c
devices/gdevdm24.c
devices/vector/gdevpdfg.c
devices/vector/gdevpsds.c
pcl/pcl/pglfill.c
pcl/pxl/pxpaint.c
xps/xpstiff.c
2020-05-10 12:31:02 +0100
Robin Watts <Robin.Watts@artifex.com>
4c305cb14b76bebfe0e147bcd90f4cc2ec7482ac
Add lgtm configuration file.
.lgtm.yml
2020-05-10 12:19:48 +0100
Robin Watts <Robin.Watts@artifex.com>
9b89ef860f52a6ca9696559c39104feba41e1de8
lgtm.com fixes: gpdl tweaks.
gpdl/jpgtop.c
gpdl/pngtop.c
gpdl/psitop.c
gpdl/tifftop.c
2020-05-09 17:42:37 +0100
Robin Watts <Robin.Watts@artifex.com>
b778f827810b9f14c758334dd94f3f8df4d27bd4
lgtm.com fix: Use | not || when combining bitflags.
base/gxclpath.c
2020-05-09 17:49:36 +0100
Robin Watts <Robin.Watts@artifex.com>
c2dbf6acdc8b86cc0d74ff74d222720558ceb397
lgtm.com fix: Remove code for duplicated "if" condition.
toolbin/halftone/ETS/ipview.html
2020-05-09 17:45:01 +0100
Robin Watts <Robin.Watts@artifex.com>
d9b37029db10bdeaf5eaee00bac2eb0653644c77
lgtm.com tweak: Make it clear that something isn't a typo.
Use "INTERPATCH_PADDING != 0" rather than "INTERPATCH_PADDING" to
avoid the appearance of a typo.
base/gxshade6.c
2020-05-09 17:38:24 +0100
Robin Watts <Robin.Watts@artifex.com>
8836aca9a03b99fc6f0ceb3994dbb78d442d634a
lgtm.com: Miscellaneous fixes in support scripts.
Remove unused local variables, correct semicolon usage. Avoid
"return fn()" where fn always returns None.
pcl/tools/check_deps.py
pcl/tools/makeromttf.py
pcl/tools/pxlasm.py
pcl/tools/pxldis.py
pcl/tools/revlist.py
psi/msvc.mak
toolbin/gitlog2changelog.py
toolbin/halftone/ETS/ipview.html
toolbin/ocheck.py
2020-05-09 12:35:27 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
8620f18686d3350590894590264f4cd71ef3dccb
Bug 697545 : Prevent SEGV during pjl_set_init_from_defaults.
Prevent SEGV by propagating all error codes.
Error created using :-
MEMENTO_FAILAT=25933 ./membin/gpcl6 -sDEVICE=pbmraw -dMaxBitmap=2000 -o /dev/null ./tests_private/pcl/pcl5efts/fts.0051
pcl/pl/pjparse.c
pcl/pl/pjparse.h
pcl/pl/pjparsei.c
2020-05-08 21:50:30 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
9e553991e4c99814eb342d83b4fb42b5af457390
Bug 697545 : Prevent numerous memory leaks.
Prevent memory leaks by propagating error codes and freeing loose objects.
Also resolve some compiler warnings.
Error created using :-
MEMENTO_FAILAT=19484 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5efts/fts.0051
base/gscspace.c
base/gxclrast.c
base/gxcpath.c
2020-05-08 14:50:08 +0100
Robin Watts <Robin.Watts@artifex.com>
a0a3ac239e990a76e937710dce75f3ace1e25be7
lgtm.com issue: Add some missing "repeat include" guards.
base/gximdecode.h
contrib/lips4/gdevlips.h
contrib/lips4/gdevlprn.h
devices/rinkj/evenbetter-rll.h
devices/rinkj/rinkj-byte-stream.h
devices/rinkj/rinkj-config.h
devices/rinkj/rinkj-device.h
devices/rinkj/rinkj-dither.h
devices/rinkj/rinkj-epson870.h
devices/rinkj/rinkj-screen-eb.h
devices/vector/gdevagl.h
devices/vector/gdevpdfg.h
ijs/ijs.h
ijs/ijs_client.h
jbig2dec/jbig2.h
lcms2mt/include/lcms2mt.h
lcms2mt/include/lcms2mt_plugin.h
lcms2mt/src/lcms2_internal.h
pcl/pcl/pgfdata.h
pcl/pl/plfapi.h
pcl/pl/plparams.h
pcl/pl/plufstlp.h
pcl/pl/plvocab.h
pcl/pxl/pxbfont.h
xps/ghostxps.h
xps/xpsfapi.h
2020-05-08 12:23:26 +0100
Robin Watts <Robin.Watts@artifex.com>
1883e1010c35da56bc47ad439b9e45401a3060da
lgtm.com fix: Remove duplicate keys from enumeration.
pcl/tools/pxlasm.py
pcl/tools/pxldis.py
2020-05-07 18:30:02 +0100
Robin Watts <Robin.Watts@artifex.com>
95fe80c3c670f1f5200c21ea8df3e6139b711acc
lgtm.com fixes: Fix comparison of narrow loop var with wider limit.
base/gxcmap.c
base/ttfmain.c
2020-05-07 18:14:23 +0100
Robin Watts <Robin.Watts@artifex.com>
7592dd988af75e40f0e449e17905751a5117e4f5
Fix implicit declaration of var in ETS support script.
toolbin/halftone/ETS/ipview.html
2020-05-07 18:12:30 +0100
Robin Watts <Robin.Watts@artifex.com>
de1f4bc1918fe1a972c3e8119f3c24266aff4cc4
Fix missing comma in pxlasm.py
pcl/tools/pxlasm.py
2020-05-07 17:48:08 +0100
Robin Watts <Robin.Watts@artifex.com>
fa4eb803adf41c0353fd7efbb4b45321eb2dec06
Tweak stream.h to avoid the use of "template".
"template" is a reserved word in C++, and so this header won't
compile when included from a .cpp file.
base/stream.h
2020-05-06 18:01:07 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
efd0b47fe66a99097e200d76be1a4846ae2ef692
Bug 697545 : Prevent memory leak in gx_path_assign_free.
Prevent memory leak by freeing path on all errors.
Error created using :-
MEMENTO_FAILAT=16246 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.2120
base/gxpath.c
2020-05-06 12:11:05 +0100
Robin Watts <Robin.Watts@artifex.com>
6d7c22dd453515d3f3f74af695a08abed26f657b
lgtm.com fixes for ghostscript.
Avoid using the same header include guard in more than one file.
Use the correct format specifier in a printf-like error string
in lcms2mt.
contrib/gdevbjc_.h
lcms2mt/src/cmsio0.c
2020-05-03 19:04:42 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
1ad7ac685aa07b1dceb0bf9e28e68a47492fb920
Bug 697545 : Prevent SEGV in hpgl_LB.
Prevent SEGV by cleanly freeing stick fonts on all errors.
Error created using :-
MEMENTO_FAILAT=15422 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.1920
pcl/pcl/pglabel.c
2020-05-04 10:29:06 -0700
Michael Vrhel <michael.vrhel@artifex.com>
c34c60394ebf68356866c6160fd0f7dfa1c4d0ce
Coverity 957905
base/gdevp14.c
2020-05-04 08:31:43 +0100
Ken Sharp <ken.sharp@artifex.com>
54e26f03a7403112463ad69874be9ab66cc4c863
PDF interpreter - minor fixes
Remove what looks like a left-over debugging print, make a couple of
indenting fixes.
Resource/Init/pdf_ops.ps
2020-05-02 23:31:30 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
92dc0f411477a0b920eea64ab305e60d2755ac9d
Bug 697545 : Prevent memory leaks in hpgl_fill_polyfill_background.
The code has been refactored to always call grestore to balance the gsave.
Error created using :-
MEMENTO_FAILAT=19724 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.1890
pcl/pcl/pgdraw.c
2020-05-02 12:58:21 -0700
Michael Vrhel <michael.vrhel@artifex.com>
160d2d57ebbe610b770206f6f9773d9300ca97f9
Coverity 357907
base/gdevp14.c
2020-05-02 12:25:59 -0700
Michael Vrhel <michael.vrhel@artifex.com>
5b96425e2414dfb130490bf0da2a5e03da099951
Fix mistake in debug print variable count
base/gstrans.c
2020-05-02 09:26:05 -0700
Michael Vrhel <michael.vrhel@artifex.com>
1407aa54f6c2df62d432a9b895a0001e62defcd8
Coverity 357906
base/gdevp14.c
2020-05-02 13:33:04 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
339ddd9dba998b82d4b71bdaee456ee80408c24f
Bug 697545 : Prevent memory leaks in hpgl_print_symbol_mode_char.
The code has been refactored to always call grestore to balance the gsave. The label buffer must
always be destroyed if it was successfully initialised.
Error created using :-
MEMENTO_FAILAT=18349 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.1850
pcl/pcl/pglabel.c
2020-05-01 16:24:38 -0700
Michael Vrhel <michael.vrhel@artifex.com>
8c432810d36e24613b84f8506ab3929f9d13e612
Squashed commit of the page_group branch
The issue this branch is trying to solve is to ensure
that the alpha blending occurs in the proper page group
color space. If the page group is CMYK and the device is
RGB then the final alpha blend must occur prior to the
color conversion. Currently with the head code this is
not the case. This work required a significant rework
of how the transparency group pop occurred since if it
is the final group, the blend will not occur until the
put_image operation. The group color handling was
completely reworked and simplified. The reworked code
now maintains a group_color object that is related to
its own color rather than the parent as before.
In addition, during the push_device operation, a buffer
is not created. Previously an entire page buffer was
created. If we have a page group that is smaller than
the whole page, this will save us in space. The downside
of this is that we need to ensure we have a buffer in place
when the first drawing operation occurs.
There were several issues with the bitrgbtags devices as
well as the pngalpha and psdcmyk16 devices that had to
be considered during the put_image operation.
operation
base/gdevdflt.c
base/gdevp14.c
base/gdevp14.h
base/gsicc_cache.c
base/gstparam.h
base/gstrans.c
base/gstrans.h
base/gxblend.h
base/gxblend1.c
base/gxdevsop.h
devices/devs.mak
devices/gdevpng.c
devices/vector/gdevpdft.c
2020-05-01 12:17:18 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
d41990615baaee9bba6ce7ae3e5a025a71744c51
Bug 697545 : Prevent SEGV in pcl_pattern_RF.
The call to pl_dict_put will free the pattern if an error occurs so the pcl_pattern_free_pattern
is not required. Freeing the pattern data is now handled here to prevent leaks and also to
prevent double freeing.
Two typos were also cleared up.
Error created using :-
MEMENTO_FAILAT=15000 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.1816
pcl/pcl/pcuptrn.c
pcl/pcl/pglfill.c
2020-04-29 20:43:17 +0100
Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
8ba1ead91f1c051df75302dc49531d9f2497ef51
Bug 697545 : Prevent SEGV in hpgl_LB.
Update code to propagate error codes correctly and and clean up stick fonts.
Error created using :-
MEMENTO_FAILAT=17298 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5cfts/fts.1640
pcl/pcl/pglabel.c
2020-04-30 08:33:48 +0100
Ken Sharp <ken.sharp@artifex.com>
2844006034232cb95fdd295d7fedf5fed8390a8e
PDF interpreter Ignore non-array Annots
Yet another customer file, so no bug report.
The supplied file is badly broken in several different ways. Most of
these Ghostscript already coped with but the file contains a new fault
we haven't seen before. The same object is referenced by different pages
once as a Font dictionary and once as an Annots array.
Since the object is actually a font dictionary, the page referencing it
as an array fails with an error, because it has the wrong type.
This commit simply ignores such errors and carries on, emitting the
usual warning. Its a little involved as there are several places where
we need to check the type of the object.
Resource/Init/pdf_main.ps
2020-04-28 14:49:14 +0100
Julian Smith <jules@op59.net>
45920485627a943f07eea0c5b1243b5eb540b498
clusterpush.pl: added excludes for mupdf's mupdfwrap.py.
Also add mudrawpy product.
toolbin/localcluster/clusterpush.pl
2020-04-27 11:04:57 +0100
Chris Liddell <chris.liddell@artifex.com>
1b4c3669a20cb2b63e49300b03082b189acfe347
Bug 702364: Fix missing echogs dependencies
contrib/contrib.mak
2020-04-27 10:36:11 +0100
Chris Liddell <chris.liddell@artifex.com>
9d2de2ee4c3858095d8dfb05cc7d113bf40d81c1
Rename devices/contrib.mak to devices/dcontrib.mak
because we also have contrib/contrib.mak
Makefile.in
base/unix-gcc.mak
base/winlib.mak
devices/dcontrib.mak
toolbin/headercompile.pl
2020-04-27 10:20:00 +0100
Chris Liddell <chris.liddell@artifex.com>
f210e4c009f7d401767336a264c2e4b9cf668216
Bug 702349: Fix symbol clash between lcms2mt and lcms2
Shared library (libgs) with lcms2mt could clash if the calling app also
included lcms2.
Using gcc (or compatible) this builds lcms2mt using the -fvisibility=hidden
option, so symbols are not exported.
Makefile.in
base/lcms2mt.mak
configure.ac
2020-04-23 18:23:17 -0700
Ray Johnston <ray.johnston@artifex.com>
7c96228899ea05b40cdb31dc5a4c3f61aa0d39e6
Fix Bug 702014: ps2epsi problems (regression?).
The ps2epsi and ps2epsi.ps were quite a mess, and relied on non-standard
operators only available with -dNOSAFER since we made SAFER the default.
Even running ps2epsi with -dNOSAFER (by export GS_OPTIONS=-dNOSAFER)
had problems -- it could not even convert examples/colorcir.ps to EPSI
(throwing an error about colorcirsave). Both of the aforementioned
files are replaced with this commit, and the ps2epsi.bat and ps2epsi.cmd
are updated to use the new ps2epsi.ps file
Also, input files with multiple pages were never correct since the preview
was derived only from the first page. The ps2epsi.ps checks if the file is
already an EPSF, then don't use eps2write on the input, but warn if the
%%Pages comment indicates that there is more than a single page.
Note that -dNOOUTERSAVE is needed in the invocation so that if we use
eps2write, the 'restore' will close the device and write the tempfile
with the EPSF.
Then ps2epsi.ps reads the input file, capturing the BBox, stops after
%%EndComments, removes any existing preview, constructs a new preview
using the 'bit' device with appropriate parameters, writes the preview
in the EPSI Preview format (using writehexstring) and then copies the
remainder of the EPSF file to the output.
The ps2epsi.ps has some checking for valid invocation, since someone
may try to use it without the scripts.
Since all of the actual conversion is done by the ps2epsi.ps, this change
makes windows and linux produce equivalent files.
lib/ps2epsi
lib/ps2epsi.bat
lib/ps2epsi.cmd
lib/ps2epsi.ps
2020-04-23 18:22:15 -0700
Ray Johnston <ray.johnston@artifex.com>
01b1eb1ef43952026ed8bf8728744522abfbfc19
Fix gssetgs.bat to use either 32 or 64 bit executables (64-bit preferred).
lib/gssetgs.bat
2020-04-24 14:13:54 +0100
Robin Watts <Robin.Watts@artifex.com>
f69f7a2c8b05c3f8a4e14d30453dcb599ca8b64d
Update msvc.mak to allow for new nmake version.
psi/msvc.mak
2020-04-23 11:42:57 +0100
Chris Liddell <chris.liddell@artifex.com>
6a46e31d5005cf136679ac7c54cb91d91654710d
Document that gsapi_set_stdio doesn't affect devices
Using -sOutputFile=%stdout (counterintuitively) does not direct device output
to the stdout handler callback set by gsapi_set_stdio().
doc/API.htm
2020-04-17 16:22:06 +0800
Sebastian Rasmussen <sebras@gmail.com>
60a535f9f49fece2761a1c0c8069f87f7514182c
Bug 702335: jbig2dec: Refill input buffer upon failure to parse segment header.
Before commit 2b2dcf4ccf401ed210f03c858b304994749fd2b3 there was
a debug message when attempting to parse a a segment header and
the data supplied to jbig2dec was not enough. Commit 2b2dcf4
incorrectly changed the debug message into a fatal error message,
due misinterpreting the message text as something that warranted
a fatal error.
When data was supplied in chunks to jbig2_data_in() in repeated
calls such that a segment header's referred-to segment numbers
field straddled a chunk boundary then jbig2dec would indicate a
fatal error. The file in bug 702335 caused this to happen.
Instead jbig2dec should be asking the caller for more data so
that the entire segment header can be parsed during a single call
to jbig2_data_in().
By convering the fatal error back to a a debug message the problem
is resolved. The message itself is also rewored to clearly
indicate that the situation is non-fatal and that the caller will
be asked to provide more data.
jbig2dec/jbig2_segment.c
2020-04-16 05:05:21 -0700
Robin Watts <Robin.Watts@artifex.com>
85b1119bb3493608b1e84acfaa7b27a6e5259b43
Fix URF filter configuration code.
I was missing some quoting.
configure.ac
2020-04-15 10:22:05 +0100
Ken Sharp <ken.sharp@artifex.com>
d845756b28a9cdadaf5374cc4fa130963ea65adc
PDF interpreter - reject insane Tc values early
No bug report, the file is from a customer and confidential.
The file has been created by a bfo.com product, but then additionally
modified by an unknown application. The problem is that the file
contains this sequence:
1 0 0 0.999999 21.6 9.900086 cm
/R3 9 Tf -2147483647 Tc -0.39301 Tw
4.8 -21.95 Td
[( )]TJ
The parameter supplied to Tc is clearly mad. Not invalid but it attempts
to move the current point (after drawing the space) by 2,147,483,647
unscaled text units. This works out at around 471 miles. Given that this
value is the maximum negative 32-bit integer (0xFFFFFFFF) I doubt this
is actually intentional.
The scaling by the CTM causes a limitcheck error when trying to draw
the text. We could fix this by running the TJ in a stopped context
but that would be expensive performance-wise because TJ is a very common
operator.
Instead this commit checks that the result of Tc, when scaled by the
CTM, will fit into our fixed-point representation. If it does not then
we throw an error there and then. The PDF interpreter then catches that
during the Tc operator (which is less commonly used than TJ) and emits
a warning, while ignoring the Tc value.
This may, of course, result in incorrect output, though it seems
unlikely given the size of the numbers involved, which is why we give
the user a warning.
Resource/Init/pdf_ops.ps
base/gsstate.c
2020-04-10 15:35:02 -0700
ray <Ray.Johnston@artifex.com>
b503c46c124cf5aaa82a71e28f624f2ef2b71e71
Bug 702320: Valgrind complains about UMR.
The file for this bug does show that the stroke_color stack based struct
in not initialized. Init fill_color and stroke_color. This is probably a
bug tail from the fill_stroke commit.
Also explicitly set 'zeros' to 0 to clarify the expected contents.
base/gxclbits.c
base/gxclrast.c
2020-04-10 18:04:14 +0100
Chris Liddell <chris.liddell@artifex.com>
1b08043d16bb10d939e858ea8d650807301d6e05
Remove some errant remains of Google analytics
The GA runes are now added by Apache when files are served from casper.
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Internal.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
2020-04-10 11:11:15 +0100
Chris Liddell <chris.liddell@artifex.com>
8f52736b546329ae2e3ad760f722eac0dec6994e
Update/augment ETS source copyrights
base/ets.c
base/ets.h
base/ets_tm.h
2020-04-09 18:07:01 +0100
Chris Liddell <chris.liddell@artifex.com>
cbb82ba4baaa2a9da11c603d742a58a51c4e50e1
Update copyright to 2020
Resource/CIDFont/ArtifexBullet
Resource/ColorSpace/DefaultCMYK
Resource/ColorSpace/DefaultGray
Resource/ColorSpace/DefaultRGB
Resource/ColorSpace/TrivialCMYK
Resource/ColorSpace/sGray
Resource/ColorSpace/sRGB
Resource/Decoding/FCO_Dingbats
Resource/Decoding/FCO_Symbol
Resource/Decoding/FCO_Unicode
Resource/Decoding/FCO_Wingdings
Resource/Decoding/Latin1
Resource/Decoding/StandardEncoding
Resource/Decoding/Unicode
Resource/Encoding/CEEncoding
Resource/Encoding/ExpertEncoding
Resource/Encoding/ExpertSubsetEncoding
Resource/Encoding/NotDefEncoding
Resource/Encoding/Wingdings
Resource/Init/FCOfontmap-PCLPS2
Resource/Init/Fontmap.GS
Resource/Init/gs_agl.ps
Resource/Init/gs_btokn.ps
Resource/Init/gs_cff.ps
Resource/Init/gs_cidcm.ps
Resource/Init/gs_ciddc.ps
Resource/Init/gs_cidfm.ps
Resource/Init/gs_cidfn.ps
Resource/Init/gs_cidtt.ps
Resource/Init/gs_cmap.ps
Resource/Init/gs_cspace.ps
Resource/Init/gs_dbt_e.ps
Resource/Init/gs_diskn.ps
Resource/Init/gs_dps1.ps
Resource/Init/gs_dps2.ps
Resource/Init/gs_dscp.ps
Resource/Init/gs_epsf.ps
Resource/Init/gs_fapi.ps
Resource/Init/gs_fntem.ps
Resource/Init/gs_fonts.ps
Resource/Init/gs_frsd.ps
Resource/Init/gs_icc.ps
Resource/Init/gs_il1_e.ps
Resource/Init/gs_init.ps
Resource/Init/gs_lev2.ps
Resource/Init/gs_ll3.ps
Resource/Init/gs_mex_e.ps
Resource/Init/gs_mgl_e.ps
Resource/Init/gs_mro_e.ps
Resource/Init/gs_pdf_e.ps
Resource/Init/gs_pdfwr.ps
Resource/Init/gs_res.ps
Resource/Init/gs_resmp.ps
Resource/Init/gs_setpd.ps
Resource/Init/gs_statd.ps
Resource/Init/gs_std_e.ps
Resource/Init/gs_sym_e.ps
Resource/Init/gs_trap.ps
Resource/Init/gs_ttf.ps
Resource/Init/gs_typ32.ps
Resource/Init/gs_typ42.ps
Resource/Init/gs_type1.ps
Resource/Init/gs_wan_e.ps
Resource/Init/pdf_base.ps
Resource/Init/pdf_draw.ps
Resource/Init/pdf_font.ps
Resource/Init/pdf_main.ps
Resource/Init/pdf_ops.ps
Resource/Init/pdf_rbld.ps
Resource/Init/pdf_sec.ps
Resource/SubstCID/CNS1-WMode
Resource/SubstCID/GB1-WMode
Resource/SubstCID/Japan1-WMode
Resource/SubstCID/Korea1-WMode
arch/arch_autoconf.h.in
arch/windows-arm-msvc.h
arch/windows-x64-msvc.h
arch/windows-x86-msvc.h
base/all-arch.mak
base/assert_.h
base/bench.c
base/bobbin.c
base/bobbin.h
base/claptrap-impl.h
base/claptrap.c
base/claptrap.h
base/ctype_.h
base/dirent_.h
base/dos_.h
base/echogs.c
base/errno_.h
base/ets.h
base/ets_tm.h
base/expat.mak
base/fapi_bs.mak
base/fapi_ft.c
base/fapibstm.c
base/fapiufst.c
base/fcntl_.h
base/freetype.mak
base/gconf.c
base/gconf.h
base/gdbflags.h
base/gdebug.h
base/gdevabuf.c
base/gdevbbox.c
base/gdevbbox.h
base/gdevdbit.c
base/gdevdcrd.c
base/gdevdcrd.h
base/gdevddrw.c
base/gdevddrw.h
base/gdevdevn.c
base/gdevdevn.h
base/gdevdevnprn.h
base/gdevdflt.c
base/gdevdgbr.c
base/gdevdrop.c
base/gdevdsha.c
base/gdevemap.c
base/gdevepo.c
base/gdevepo.h
base/gdevflp.c
base/gdevflp.h
base/gdevhit.c
base/gdevkrnlsclass.c
base/gdevkrnlsclass.h
base/gdevm1.c
base/gdevm16.c
base/gdevm2.c
base/gdevm24.c
base/gdevm32.c
base/gdevm4.c
base/gdevm40.c
base/gdevm48.c
base/gdevm56.c
base/gdevm64.c
base/gdevm8.c
base/gdevmem.c
base/gdevmem.h
base/gdevmpla.c
base/gdevmpla.h
base/gdevmplt.c
base/gdevmplt.h
base/gdevmr1.c
base/gdevmr2n.c
base/gdevmr8n.c
base/gdevmrop.h
base/gdevmrun.c
base/gdevmrun.h
base/gdevmx.c
base/gdevnfwd.c
base/gdevoflt.c
base/gdevoflt.h
base/gdevp14.c
base/gdevp14.h
base/gdevpccm.c
base/gdevpccm.h
base/gdevpipe.c
base/gdevplnx.c
base/gdevplnx.h
base/gdevppla.c
base/gdevppla.h
base/gdevprn.c
base/gdevprn.h
base/gdevpxat.h
base/gdevpxen.h
base/gdevpxop.h
base/gdevrops.c
base/gdevsclass.c
base/gdevsclass.h
base/gdevvec.c
base/gdevvec.h
base/gen_ordered.c
base/gen_ordered.h
base/genarch.c
base/genconf.c
base/gendev.c
base/genht.c
base/gp.h
base/gp_dosfe.c
base/gp_dosfs.c
base/gp_dvx.c
base/gp_getnv.c
base/gp_mktmp.c
base/gp_msdll.c
base/gp_msdos.c
base/gp_mshdl.c
base/gp_mslib.c
base/gp_mspol.c
base/gp_msprn.c
base/gp_mswin.c
base/gp_mswin.h
base/gp_nsync.c
base/gp_ntfs.c
base/gp_nxpsprn.c
base/gp_os2.c
base/gp_os2.h
base/gp_os2fs.c
base/gp_os2pr.c
base/gp_os9.c
base/gp_paper.c
base/gp_psync.c
base/gp_stdia.c
base/gp_stdin.c
base/gp_strdl.c
base/gp_unifn.c
base/gp_unifs.c
base/gp_unix.c
base/gp_upapr.c
base/gp_vms.c
base/gp_wgetv.c
base/gp_win32.c
base/gp_winfs.c
base/gp_winfs2.c
base/gp_wpapr.c
base/gp_wsync.c
base/gp_wutf8.c
base/gp_wxpsprn.cpp
base/gpcheck.h
base/gpgetenv.h
base/gpmisc.c
base/gpmisc.h
base/gpsync.h
base/gs.mak
base/gs_dll_call.h
base/gs_mgl_e.h
base/gs_mro_e.h
base/gsalloc.c
base/gsalloc.h
base/gsargs.c
base/gsargs.h
base/gsbitcom.c
base/gsbitmap.h
base/gsbitops.c
base/gsbitops.h
base/gsbittab.c
base/gsbittab.h
base/gsccode.h
base/gsccolor.h
base/gscdef.c
base/gscdefs.h
base/gscdevn.c
base/gscdevn.h
base/gscedata.c
base/gscedata.h
base/gscencs.c
base/gscencs.h
base/gschar.c
base/gschar.h
base/gschar0.c
base/gscicach.c
base/gscicach.h
base/gscie.c
base/gscie.h
base/gsciemap.c
base/gscindex.h
base/gsclipsr.c
base/gsclipsr.h
base/gscms.h
base/gscolor.c
base/gscolor.h
base/gscolor1.c
base/gscolor1.h
base/gscolor2.c
base/gscolor2.h
base/gscolor3.c
base/gscolor3.h
base/gscompt.h
base/gscoord.c
base/gscoord.h
base/gscparam.c
base/gscpixel.c
base/gscpixel.h
base/gscpm.h
base/gscrd.c
base/gscrd.h
base/gscrdp.c
base/gscrdp.h
base/gscrypt1.c
base/gscrypt1.h
base/gscscie.c
base/gscsel.h
base/gscsepr.c
base/gscsepr.h
base/gscspace.c
base/gscspace.h
base/gscssub.c
base/gscssub.h
base/gsdcolor.h
base/gsdevice.c
base/gsdevice.h
base/gsdevmem.c
base/gsdll.h
base/gsdllwin.h
base/gsdparam.c
base/gsdps1.c
base/gsdsrc.c
base/gsdsrc.h
base/gsequivc.c
base/gsequivc.h
base/gserrors.h
base/gsexit.h
base/gsfcid.c
base/gsfcid2.c
base/gsfcmap.c
base/gsfcmap.h
base/gsfcmap1.c
base/gsflip.c
base/gsflip.h
base/gsfname.c
base/gsfname.h
base/gsfont.c
base/gsfont.h
base/gsfont0.c
base/gsfont0c.c
base/gsform1.h
base/gsftopts.h
base/gsfunc.c
base/gsfunc.h
base/gsfunc0.c
base/gsfunc0.h
base/gsfunc3.c
base/gsfunc3.h
base/gsfunc4.c
base/gsfunc4.h
base/gsgc.h
base/gsgcache.c
base/gsgcache.h
base/gsgdata.c
base/gsgdata.h
base/gsgstate.c
base/gsgstate.h
base/gshsb.c
base/gshsb.h
base/gsht.c
base/gsht.h
base/gsht1.c
base/gsht1.h
base/gshtscr.c
base/gshtx.c
base/gshtx.h
base/gsicc.c
base/gsicc.h
base/gsicc_cache.c
base/gsicc_cache.h
base/gsicc_cms.h
base/gsicc_create.c
base/gsicc_create.h
base/gsicc_lcms2.c
base/gsicc_lcms2mt.c
base/gsicc_manage.c
base/gsicc_manage.h
base/gsicc_monitorcm.c
base/gsicc_nocm.c
base/gsicc_profilecache.c
base/gsicc_profilecache.h
base/gsicc_replacecm.c
base/gsimage.c
base/gsimage.h
base/gsimpath.c
base/gsinit.c
base/gsio.h
base/gsiodev.c
base/gsiodevs.c
base/gsiodisk.c
base/gsioram.c
base/gsiorom.c
base/gsiorom.h
base/gsipar3x.h
base/gsiparam.h
base/gsiparm3.h
base/gsiparm4.h
base/gsjconf.h
base/gsjmorec.h
base/gslib.c
base/gslib.h
base/gslibctx.c
base/gslibctx.h
base/gsline.c
base/gsline.h
base/gslparam.h
base/gsmalloc.c
base/gsmalloc.h
base/gsmatrix.c
base/gsmatrix.h
base/gsmchunk.c
base/gsmchunk.h
base/gsmd5.c
base/gsmd5.h
base/gsmdebug.h
base/gsmemory.c
base/gsmemory.h
base/gsmemraw.h
base/gsmemret.c
base/gsmemret.h
base/gsmisc.c
base/gsnamecl.c
base/gsnamecl.h
base/gsncdummy.c
base/gsncdummy.h
base/gsnogc.c
base/gsnogc.h
base/gsnotify.c
base/gsnotify.h
base/gsovrc.c
base/gsovrc.h
base/gspaint.c
base/gspaint.h
base/gsparam.c
base/gsparam.h
base/gsparam2.c
base/gsparams.c
base/gsparams.h
base/gsparamx.c
base/gsparamx.h
base/gspath.c
base/gspath.h
base/gspath1.c
base/gspath2.h
base/gspcolor.c
base/gspcolor.h
base/gspenum.h
base/gspmdrv.c
base/gspmdrv.h
base/gspmdrv.rc
base/gsptype1.c
base/gsptype1.h
base/gsptype2.c
base/gsptype2.h
base/gsrect.h
base/gsrefct.h
base/gsromfs0.c
base/gsrop.c
base/gsrop.h
base/gsroprun.c
base/gsroprun1.h
base/gsroprun24.h
base/gsroprun8.h
base/gsropt.h
base/gsroptab.c
base/gsserial.c
base/gsserial.h
base/gsshade.c
base/gsshade.h
base/gssprintf.h
base/gsstate.c
base/gsstate.h
base/gsstrl.h
base/gsstrtok.h
base/gsstruct.h
base/gsstype.h
base/gstext.c
base/gstext.h
base/gstiffio.c
base/gstiffio.h
base/gstparam.h
base/gstrans.c
base/gstrans.h
base/gstrap.c
base/gstrap.h
base/gstype1.c
base/gstype1.h
base/gstype2.c
base/gstype42.c
base/gstypes.h
base/gsuid.h
base/gsutil.c
base/gsutil.h
base/gswin.rc
base/gsxfont.h
base/gx.h
base/gxacpath.c
base/gxalloc.h
base/gxalpha.h
base/gxarith.h
base/gxband.h
base/gxbcache.c
base/gxbcache.h
base/gxbitfmt.h
base/gxbitmap.h
base/gxbitops.h
base/gxblend.c
base/gxblend.h
base/gxblend1.c
base/gxccache.c
base/gxccman.c
base/gxcdevn.h
base/gxchar.c
base/gxchar.h
base/gxchrout.c
base/gxchrout.h
base/gxcht.c
base/gxcid.h
base/gxcie.h
base/gxcindex.h
base/gxclbits.c
base/gxcldev.h
base/gxclfile.c
base/gxclimag.c
base/gxclio.h
base/gxclip.c
base/gxclip.h
base/gxclip2.c
base/gxclip2.h
base/gxclipm.c
base/gxclipm.h
base/gxclipsr.h
base/gxclist.c
base/gxclist.h
base/gxcllzw.c
base/gxclmem.c
base/gxclmem.h
base/gxclpage.c
base/gxclpage.h
base/gxclpath.c
base/gxclpath.h
base/gxclrast.c
base/gxclread.c
base/gxclrect.c
base/gxclthrd.c
base/gxclthrd.h
base/gxclutil.c
base/gxclzlib.c
base/gxcmap.c
base/gxcmap.h
base/gxcolor2.h
base/gxcomp.h
base/gxcoord.h
base/gxcpath.c
base/gxcpath.h
base/gxcspace.h
base/gxctable.c
base/gxctable.h
base/gxcvalue.h
base/gxdcconv.c
base/gxdcconv.h
base/gxdcolor.c
base/gxdcolor.h
base/gxdda.h
base/gxdevbuf.h
base/gxdevcli.h
base/gxdevice.h
base/gxdevmem.h
base/gxdevndi.c
base/gxdevrop.h
base/gxdevsop.h
base/gxdht.h
base/gxdhtres.h
base/gxdhtserial.c
base/gxdhtserial.h
base/gxdither.h
base/gxdownscale.c
base/gxdownscale.h
base/gxdtfill.h
base/gxfapi.c
base/gxfapi.h
base/gxfapiu.c
base/gxfapiu.h
base/gxfarith.h
base/gxfcache.h
base/gxfcid.h
base/gxfcmap.h
base/gxfcmap1.h
base/gxfill.c
base/gxfill.h
base/gxfillsl.h
base/gxfilltr.h
base/gxfillts.h
base/gxfixed.h
base/gxfmap.h
base/gxfont.h
base/gxfont0.h
base/gxfont0c.h
base/gxfont1.h
base/gxfont42.h
base/gxfrac.h
base/gxftype.h
base/gxfunc.h
base/gxgetbit.h
base/gxgstate.h
base/gxhintn.c
base/gxhintn.h
base/gxhintn1.c
base/gxhldevc.c
base/gxhldevc.h
base/gxht.c
base/gxht.h
base/gxht_thresh.c
base/gxht_thresh.h
base/gxhtbit.c
base/gxhttile.h
base/gxhttype.h
base/gxi12bit.c
base/gxi16bit.c
base/gxiclass.h
base/gxicolor.c
base/gxidata.c
base/gxifast.c
base/gximag3x.c
base/gximag3x.h
base/gximage.c
base/gximage.h
base/gximage1.c
base/gximage3.c
base/gximage3.h
base/gximage4.c
base/gximask.c
base/gximask.h
base/gximdecode.c
base/gximono.c
base/gxiodev.h
base/gxiparam.h
base/gxipixel.c
base/gxiscale.c
base/gxline.h
base/gxlum.h
base/gxmatrix.h
base/gxmclip.c
base/gxmclip.h
base/gxobj.h
base/gxoprect.c
base/gxoprect.h
base/gxp1fill.c
base/gxp1impl.h
base/gxpaint.c
base/gxpaint.h
base/gxpath.c
base/gxpath.h
base/gxpath2.c
base/gxpcache.h
base/gxpcmap.c
base/gxpcolor.h
base/gxpcopy.c
base/gxpdash.c
base/gxpflat.c
base/gxrplane.h
base/gxsample.c
base/gxsample.h
base/gxsamplp.h
base/gxscanc.c
base/gxscanc.h
base/gxshade.c
base/gxshade.h
base/gxshade1.c
base/gxshade4.c
base/gxshade4.h
base/gxshade6.c
base/gxstate.h
base/gxstdio.h
base/gxstroke.c
base/gxsync.c
base/gxsync.h
base/gxtext.h
base/gxtmap.h
base/gxttf.h
base/gxttfb.c
base/gxttfb.h
base/gxtype1.c
base/gxtype1.h
base/gxxfont.h
base/gzacpath.h
base/gzcpath.h
base/gzht.h
base/gzline.h
base/gzpath.h
base/gzspotan.c
base/gzspotan.h
base/gzstate.h
base/ijs.mak
base/instcopy
base/jbig2.mak
base/jerror_.h
base/jmemcust.c
base/jmemcust.h
base/jpeg.mak
base/jpegxr.mak
base/lcms2.mak
base/lcms2mt.mak
base/lcups.mak
base/lcupsi.mak
base/ldf_jb2.mak
base/lib.mak
base/locale_.h
base/lwf_jp2.mak
base/malloc_.h
base/math_.h
base/memento.c
base/memento.h
base/memory_.h
base/mkromfs.c
base/msvccmd.mak
base/msvclib.mak
base/msvctail.mak
base/openjpeg.mak
base/openvms.mak
base/openvms.mmk
base/pack_ps.c
base/pcwin.mak
base/pipe_.h
base/png.mak
base/png_.h
base/ramfs.c
base/ramfs.h
base/sa85d.c
base/sa85d.h
base/sa85x.h
base/saes.c
base/saes.h
base/sarc4.c
base/sarc4.h
base/sbcp.c
base/sbcp.h
base/sbtx.h
base/scanchar.h
base/scantab.c
base/scf.h
base/scfd.c
base/scfdgen.c
base/scfdtab.c
base/scfe.c
base/scfetab.c
base/scfparam.c
base/scfx.h
base/scommon.h
base/sdcparam.c
base/sdcparam.h
base/sdct.h
base/sdctc.c
base/sdctd.c
base/sdcte.c
base/sddparam.c
base/sdeparam.c
base/seexec.c
base/setjmp_.h
base/sfilter.h
base/sfilter1.c
base/sfilter2.c
base/sfxboth.c
base/sfxcommon.c
base/sfxfd.c
base/sfxstdio.c
base/shc.c
base/shc.h
base/sidscale.c
base/sidscale.h
base/siinterp.c
base/siinterp.h
base/simscale.c
base/simscale.h
base/siscale.c
base/siscale.h
base/siscale_cal.c
base/sisparam.h
base/sjbig2.c
base/sjbig2.h
base/sjbig2_luratech.c
base/sjbig2_luratech.h
base/sjpeg.h
base/sjpegc.c
base/sjpegd.c
base/sjpege.c
base/sjpx_luratech.c
base/sjpx_luratech.h
base/sjpx_none.c
base/sjpx_openjpeg.c
base/sjpx_openjpeg.h
base/slzwc.c
base/slzwd.c
base/slzwe.c
base/slzwx.h
base/smd5.c
base/smd5.h
base/smtf.h
base/spdiff.c
base/spdiffx.h
base/spngp.c
base/spngpx.h
base/spprint.c
base/spprint.h
base/spsdf.c
base/spsdf.h
base/srdline.h
base/srld.c
base/srle.c
base/srlx.h
base/ssha2.c
base/ssha2.h
base/sstring.c
base/sstring.h
base/stat_.h
base/std.h
base/stdint_.h
base/stdio_.h
base/stdpre.h
base/stream.c
base/stream.h
base/strimpl.h
base/string_.h
base/strmio.c
base/strmio.h
base/stub.mak
base/szlibc.c
base/szlibd.c
base/szlibe.c
base/szlibx.h
base/szlibxx.h
base/tiff.mak
base/time_.h
base/ttcalc.c
base/ttcalc.h
base/ttcommon.h
base/ttconf.h
base/ttconfig.h
base/ttfinp.c
base/ttfinp.h
base/ttfmain.c
base/ttfmemd.c
base/ttfmemd.h
base/ttfoutl.h
base/ttfsfnt.h
base/ttinterp.c
base/ttinterp.h
base/ttload.c
base/ttload.h
base/ttmisc.h
base/ttobjs.c
base/ttobjs.h
base/tttables.h
base/tttype.h
base/tttypes.h
base/ugcclib.mak
base/unistd_.h
base/unix-aux.mak
base/unix-dll.mak
base/unix-end.mak
base/unix-gcc.mak
base/unixansi.mak
base/unixhead.mak
base/unixinst.mak
base/unixlink.mak
base/valgrind.h
base/version.mak
base/vms_x_fix.h
base/vmsmath.h
base/windows_.h
base/winlib.mak
base/winplat.mak
base/winrtsup.cpp
base/winrtsup.h
base/wrfont.c
base/wrfont.h
base/write_t1.c
base/write_t1.h
base/write_t2.c
base/write_t2.h
base/x_.h
base/zlib.mak
configure.ac
contrib/gdevadmp.c
devices/contrib.mak
devices/devs.mak
devices/gdev3852.c
devices/gdev4081.c
devices/gdev8510.c
devices/gdev8bcm.c
devices/gdev8bcm.h
devices/gdevatx.c
devices/gdevbit.c
devices/gdevbj10.c
devices/gdevbjc.h
devices/gdevbjcl.c
devices/gdevbjcl.h
devices/gdevbmp.c
devices/gdevbmp.h
devices/gdevbmpc.c
devices/gdevccr.c
devices/gdevcdj.c
devices/gdevcfax.c
devices/gdevchameleon.c
devices/gdevcif.c
devices/gdevclj.c
devices/gdevcljc.c
devices/gdevcmykog.c
devices/gdevcslw.c
devices/gdevdfax.c
devices/gdevdjet.c
devices/gdevdjtc.c
devices/gdevdljm.c
devices/gdevdljm.h
devices/gdevdm24.c
devices/gdevdsp.c
devices/gdevdsp.h
devices/gdevdsp2.h
devices/gdevepsc.c
devices/gdevepsn.c
devices/gdevescp.c
devices/gdevfax.c
devices/gdevfax.h
devices/gdevfpng.c
devices/gdevhl7x.c
devices/gdevicov.c
devices/gdevijs.c
devices/gdevimgn.c
devices/gdevjbig2.c
devices/gdevjpeg.c
devices/gdevjpx.c
devices/gdevl31s.c
devices/gdevlbp8.c
devices/gdevlj56.c
devices/gdevlp8k.c
devices/gdevlxm.c
devices/gdevmeds.c
devices/gdevmeds.h
devices/gdevmgr.c
devices/gdevmgr.h
devices/gdevmiff.c
devices/gdevn533.c
devices/gdevo182.c
devices/gdevokii.c
devices/gdevpbm.c
devices/gdevpcl.c
devices/gdevpcl.h
devices/gdevpcx.c
devices/gdevpdfimg.c
devices/gdevpe.c
devices/gdevperm.c
devices/gdevphex.c
devices/gdevpjet.c
devices/gdevplan.c
devices/gdevplib.c
devices/gdevplib.h
devices/gdevpm.h
devices/gdevpng.c
devices/gdevpsd.c
devices/gdevpsd.h
devices/gdevpsim.c
devices/gdevpxut.c
devices/gdevpxut.h
devices/gdevrinkj.c
devices/gdevsj48.c
devices/gdevsnfb.c
devices/gdevsppr.c
devices/gdevstc.c
devices/gdevstc.h
devices/gdevstc1.c
devices/gdevstc2.c
devices/gdevstc3.c
devices/gdevstc4.c
devices/gdevtfax.c
devices/gdevtfax.h
devices/gdevtfnx.c
devices/gdevtifs.c
devices/gdevtifs.h
devices/gdevtknk.c
devices/gdevtrac.c
devices/gdevtsep.c
devices/gdevupd.c
devices/gdevwpr2.c
devices/gdevx.c
devices/gdevx.h
devices/gdevxalt.c
devices/gdevxcf.c
devices/gdevxcmp.c
devices/gdevxcmp.h
devices/gdevxini.c
devices/gdevxres.c
devices/gxfcopy.c
devices/gxfcopy.h
devices/minftrsz.c
devices/minftrsz.h
devices/rinkj/evenbetter-rll.c
devices/rinkj/evenbetter-rll.h
devices/rinkj/rinkj-byte-stream.c
devices/rinkj/rinkj-byte-stream.h
devices/rinkj/rinkj-config.c
devices/rinkj/rinkj-config.h
devices/rinkj/rinkj-device.c
devices/rinkj/rinkj-device.h
devices/rinkj/rinkj-dither.c
devices/rinkj/rinkj-dither.h
devices/rinkj/rinkj-epson870.c
devices/rinkj/rinkj-epson870.h
devices/rinkj/rinkj-screen-eb.c
devices/rinkj/rinkj-screen-eb.h
devices/vector/gdevagl.c
devices/vector/gdevagl.h
devices/vector/gdevpdf.c
devices/vector/gdevpdfb.c
devices/vector/gdevpdfb.h
devices/vector/gdevpdfc.c
devices/vector/gdevpdfc.h
devices/vector/gdevpdfd.c
devices/vector/gdevpdfe.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfg.h
devices/vector/gdevpdfi.c
devices/vector/gdevpdfj.c
devices/vector/gdevpdfk.c
devices/vector/gdevpdfm.c
devices/vector/gdevpdfo.c
devices/vector/gdevpdfo.h
devices/vector/gdevpdfp.c
devices/vector/gdevpdfr.c
devices/vector/gdevpdft.c
devices/vector/gdevpdfu.c
devices/vector/gdevpdfv.c
devices/vector/gdevpdfx.h
devices/vector/gdevpdt.c
devices/vector/gdevpdt.h
devices/vector/gdevpdtb.c
devices/vector/gdevpdtb.h
devices/vector/gdevpdtc.c
devices/vector/gdevpdtd.c
devices/vector/gdevpdtd.h
devices/vector/gdevpdte.c
devices/vector/gdevpdtf.c
devices/vector/gdevpdtf.h
devices/vector/gdevpdti.c
devices/vector/gdevpdti.h
devices/vector/gdevpdts.c
devices/vector/gdevpdts.h
devices/vector/gdevpdtt.c
devices/vector/gdevpdtt.h
devices/vector/gdevpdtv.c
devices/vector/gdevpdtv.h
devices/vector/gdevpdtw.c
devices/vector/gdevpdtw.h
devices/vector/gdevpdtx.h
devices/vector/gdevpsdf.h
devices/vector/gdevpsdi.c
devices/vector/gdevpsdp.c
devices/vector/gdevpsds.c
devices/vector/gdevpsds.h
devices/vector/gdevpsdu.c
devices/vector/gdevpsf.h
devices/vector/gdevpsf1.c
devices/vector/gdevpsf2.c
devices/vector/gdevpsfm.c
devices/vector/gdevpsft.c
devices/vector/gdevpsfu.c
devices/vector/gdevpsfx.c
devices/vector/gdevpsu.c
devices/vector/gdevpsu.h
devices/vector/gdevpx.c
devices/vector/gdevtxtw.c
devices/vector/gdevxps.c
devices/vector/opdfread.ps
devices/vector/whitelst.c
devices/vector/whitelst.h
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Internal.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
gpdl/gpdl.mak
gpdl/jbig2top.c
gpdl/jp2ktop.c
gpdl/jpgtop.c
gpdl/pngtop.c
gpdl/psitop.c
gpdl/pspcl6_gcc.mak
gpdl/pspcl6_msvc.mak
gpdl/pwgtop.c
gpdl/tifftop.c
ijs/Makefile.am
ijs/configure.ac
ijs/ijs.c
ijs/ijs.h
ijs/ijs_client.c
ijs/ijs_client.h
ijs/ijs_client_example.c
ijs/ijs_exec_unix.c
ijs/ijs_exec_win.c
ijs/ijs_server.c
ijs/ijs_server_example.c
ijs/unistd_.h
ios/ios_arch-arm.h
ios/ios_arch-x86.h
jbig2dec/config_win32.h
jbig2dec/jbig2.c
jbig2dec/jbig2.h
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith.h
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_arith_iaid.h
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_arith_int.h
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_generic.h
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_halftone.h
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_huffman.h
jbig2dec/jbig2_hufftab.c
jbig2dec/jbig2_hufftab.h
jbig2dec/jbig2_image.c
jbig2dec/jbig2_image.h
jbig2dec/jbig2_image_pbm.c
jbig2dec/jbig2_image_png.c
jbig2dec/jbig2_image_rw.h
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_mmr.h
jbig2dec/jbig2_page.c
jbig2dec/jbig2_page.h
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_refinement.h
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_segment.h
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_symbol_dict.h
jbig2dec/jbig2_text.c
jbig2dec/jbig2_text.h
jbig2dec/jbig2dec.c
jbig2dec/memcmp.c
jbig2dec/os_types.h
jbig2dec/pbm2png.c
lib/FCOfontmap-PCLPS3
lib/FCOfontmap-PS3
lib/Fontmap.ATB
lib/Fontmap.ATM
lib/Fontmap.OS2
lib/Fontmap.SGI
lib/Fontmap.Sol
lib/Fontmap.Ult
lib/Fontmap.VMS
lib/align.ps
lib/caption.ps
lib/cat.ps
lib/cid2code.ps
lib/docie.ps
lib/font2pcl.ps
lib/gs_ce_e.ps
lib/gs_il2_e.ps
lib/gs_kanji.ps
lib/gs_ksb_e.ps
lib/gs_lgo_e.ps
lib/gs_lgx_e.ps
lib/gs_wl1_e.ps
lib/gs_wl2_e.ps
lib/gs_wl5_e.ps
lib/gslp.ps
lib/gsnup.ps
lib/image-qa.ps
lib/jispaper.ps
lib/lines.ps
lib/mkcidfm.ps
lib/pdf2dsc.ps
lib/pdf_info.ps
lib/pfbtopfa.ps
lib/ppath.ps
lib/pphs.ps
lib/prfont.ps
lib/ps2ai.ps
lib/ps2epsi.ps
lib/rollconv.ps
lib/stcinfo.ps
lib/stcolor.ps
lib/stocht.ps
lib/traceimg.ps
lib/traceop.ps
lib/uninfo.ps
lib/viewcmyk.ps
lib/viewgif.ps
lib/viewmiff.ps
lib/viewpbm.ps
lib/viewpcx.ps
lib/viewps2a.ps
lib/viewraw.ps
lib/viewrgb.ps
lib/winmaps.ps
lib/zeroline.ps
pcl/pcl/pcbiptrn.c
pcl/pcl/pcbiptrn.h
pcl/pcl/pccid.c
pcl/pcl/pccid.h
pcl/pcl/pccolor.c
pcl/pcl/pccoord.h
pcl/pcl/pccprint.c
pcl/pcl/pccsbase.c
pcl/pcl/pccsbase.h
pcl/pcl/pcdict.h
pcl/pcl/pcdither.c
pcl/pcl/pcdither.h
pcl/pcl/pcdraw.c
pcl/pcl/pcdraw.h
pcl/pcl/pcfont.c
pcl/pcl/pcfont.h
pcl/pcl/pcfontpg.c
pcl/pcl/pcfontst.h
pcl/pcl/pcfrgrnd.c
pcl/pcl/pcfrgrnd.h
pcl/pcl/pcfsel.c
pcl/pcl/pcfsel.h
pcl/pcl/pcht.c
pcl/pcl/pcht.h
pcl/pcl/pcident.c
pcl/pcl/pcident.h
pcl/pcl/pcimpl.c
pcl/pcl/pcindxed.c
pcl/pcl/pcindxed.h
pcl/pcl/pcjob.c
pcl/pcl/pcl.mak
pcl/pcl/pcl_top.mak
pcl/pcl/pclookup.c
pcl/pcl/pclookup.h
pcl/pcl/pcmacros.c
pcl/pcl/pcmisc.c
pcl/pcl/pcmtx3.c
pcl/pcl/pcmtx3.h
pcl/pcl/pcommand.c
pcl/pcl/pcommand.h
pcl/pcl/pcpage.c
pcl/pcl/pcpage.h
pcl/pcl/pcpalet.c
pcl/pcl/pcpalet.h
pcl/pcl/pcparam.h
pcl/pcl/pcparse.c
pcl/pcl/pcparse.h
pcl/pcl/pcpatrn.c
pcl/pcl/pcpatrn.h
pcl/pcl/pcpattyp.h
pcl/pcl/pcpatxfm.c
pcl/pcl/pcpatxfm.h
pcl/pcl/pcrect.c
pcl/pcl/pcsfont.c
pcl/pcl/pcstate.h
pcl/pcl/pcstatus.c
pcl/pcl/pcsymbol.c
pcl/pcl/pcsymbol.h
pcl/pcl/pctext.c
pcl/pcl/pctop.c
pcl/pcl/pctop.h
pcl/pcl/pctpm.h
pcl/pcl/pcuptrn.c
pcl/pcl/pcuptrn.h
pcl/pcl/pcursor.c
pcl/pcl/pcursor.h
pcl/pcl/pcwhtidx.c
pcl/pcl/pcwhtidx.h
pcl/pcl/pcxfmst.h
pcl/pcl/pgchar.c
pcl/pcl/pgcolor.c
pcl/pcl/pgconfig.c
pcl/pcl/pgdraw.c
pcl/pcl/pgdraw.h
pcl/pcl/pgfdata.c
pcl/pcl/pgfdata.h
pcl/pcl/pgfont.c
pcl/pcl/pgfont.h
pcl/pcl/pgframe.c
pcl/pcl/pggeom.c
pcl/pcl/pggeom.h
pcl/pcl/pginit.c
pcl/pcl/pginit.h
pcl/pcl/pglabel.c
pcl/pcl/pglfill.c
pcl/pcl/pgmand.h
pcl/pcl/pgmisc.c
pcl/pcl/pgmisc.h
pcl/pcl/pgparse.c
pcl/pcl/pgpoly.c
pcl/pcl/pgstate.h
pcl/pcl/pgvector.c
pcl/pcl/rtgmode.c
pcl/pcl/rtgmode.h
pcl/pcl/rtmisc.c
pcl/pcl/rtmisc.h
pcl/pcl/rtraster.c
pcl/pcl/rtraster.h
pcl/pcl/rtrstcmp.c
pcl/pcl/rtrstcmp.h
pcl/pcl/rtrstst.h
pcl/pl/pjparse.c
pcl/pl/pjparse.h
pcl/pl/pjparsei.c
pcl/pl/pjtop.c
pcl/pl/pjtop.h
pcl/pl/pl.mak
pcl/pl/plalloc.c
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plchar.c
pcl/pl/plchar.h
pcl/pl/pldebug.h
pcl/pl/pldict.c
pcl/pl/pldict.h
pcl/pl/pldraw.c
pcl/pl/pldraw.h
pcl/pl/plfapi.c
pcl/pl/plfapi.h
pcl/pl/plfont.c
pcl/pl/plfont.h
pcl/pl/plftable.c
pcl/pl/plftable.h
pcl/pl/plht.c
pcl/pl/plht.h
pcl/pl/plimpl.c
pcl/pl/pllfont.c
pcl/pl/pllfont.h
pcl/pl/plmain.c
pcl/pl/plmain.h
pcl/pl/plparams.c
pcl/pl/plparams.h
pcl/pl/plparse.h
pcl/pl/plromfs.mak
pcl/pl/plsymbol.c
pcl/pl/plsymbol.h
pcl/pl/pltop.c
pcl/pl/pltop.h
pcl/pl/pluchar.c
pcl/pl/plufont.c
pcl/pl/plufstlp.c
pcl/pl/plufstlp.h
pcl/pl/plufstlp1.c
pcl/pl/plulfont.c
pcl/pl/plvalue.c
pcl/pl/plvalue.h
pcl/pl/plvocab.c
pcl/pl/plvocab.h
pcl/pl/plwimg.c
pcl/pl/plwimg.h
pcl/pl/plwmainc.c
pcl/pl/plwreg.c
pcl/pl/plwreg.h
pcl/pl/plwres.h
pcl/pl/realmain.c
pcl/pxl/pxasm.ps
pcl/pxl/pxattr.h
pcl/pxl/pxbfont.c
pcl/pxl/pxbfont.h
pcl/pxl/pxbfont.ps
pcl/pxl/pxcet.txt
pcl/pxl/pxdict.h
pcl/pxl/pxdiff.txt
pcl/pxl/pxenum.h
pcl/pxl/pxerrors.c
pcl/pxl/pxerrors.h
pcl/pxl/pxffont.c
pcl/pxl/pxfont.c
pcl/pxl/pxfont.h
pcl/pxl/pxfts.txt
pcl/pxl/pxgstate.c
pcl/pxl/pxgstate.h
pcl/pxl/pximage.c
pcl/pxl/pximpl.c
pcl/pxl/pxink.c
pcl/pxl/pxl.mak
pcl/pxl/pxlib.txt
pcl/pxl/pxoper.h
pcl/pxl/pxpaint.c
pcl/pxl/pxparse.c
pcl/pxl/pxparse.h
pcl/pxl/pxptable.c
pcl/pxl/pxptable.h
pcl/pxl/pxpthr.c
pcl/pxl/pxpthr.h
pcl/pxl/pxsessio.c
pcl/pxl/pxspec.txt
pcl/pxl/pxstate.c
pcl/pxl/pxstate.h
pcl/pxl/pxstream.c
pcl/pxl/pxsymbol.ps
pcl/pxl/pxsymbol.psc
pcl/pxl/pxsymbol.psh
pcl/pxl/pxtag.h
pcl/pxl/pxtop.c
pcl/pxl/pxvalue.c
pcl/pxl/pxvalue.h
pcl/tools/pxlasm.py
pcl/tools/pxldis.py
pcl/tools/suite.tcl
psi/bfont.h
psi/btoken.h
psi/dmmain.c
psi/dmmain.r
psi/dpmain.c
psi/dscparse.c
psi/dscparse.h
psi/dstack.h
psi/dwdll.c
psi/dwdll.h
psi/dwimg.c
psi/dwimg.h
psi/dwmain.c
psi/dwmain.rc
psi/dwmainc.c
psi/dwnodll.c
psi/dwreg.c
psi/dwreg.h
psi/dwres.h
psi/dwtext.c
psi/dwtext.h
psi/dwtrace.c
psi/dwtrace.h
psi/dxmain.c
psi/dxmainc.c
psi/estack.h
psi/files.h
psi/ghost.h
psi/gs.c
psi/gsdll.c
psi/gsdll2.rc
psi/gsdll32.rc
psi/gserver.c
psi/gsos2.rc
psi/ialloc.c
psi/ialloc.h
psi/iapi.c
psi/iapi.h
psi/iastate.h
psi/iastruct.h
psi/ibnum.c
psi/ibnum.h
psi/ichar.h
psi/ichar1.h
psi/icharout.h
psi/icid.h
psi/icie.h
psi/icolor.h
psi/iconf.c
psi/iconf.h
psi/icontext.c
psi/icontext.h
psi/icremap.h
psi/icsmap.h
psi/icstate.h
psi/iddict.h
psi/iddstack.h
psi/idebug.c
psi/idebug.h
psi/idict.c
psi/idict.h
psi/idictdef.h
psi/idicttpl.h
psi/idisp.c
psi/idisp.h
psi/idosave.h
psi/idparam.c
psi/idparam.h
psi/idsdata.h
psi/idstack.c
psi/idstack.h
psi/ierrors.h
psi/iesdata.h
psi/iestack.h
psi/ifapi.h
psi/ifcid.h
psi/ifilter.h
psi/ifilter2.h
psi/ifont.h
psi/ifont1.h
psi/ifont2.h
psi/ifont42.h
psi/ifrpred.h
psi/ifunc.h
psi/ifwpred.h
psi/igc.c
psi/igc.h
psi/igcref.c
psi/igcstr.c
psi/igcstr.h
psi/igstate.h
psi/iht.h
psi/iimage.h
psi/iinit.c
psi/iinit.h
psi/ilevel.h
psi/ilocate.c
psi/imain.c
psi/imain.h
psi/imainarg.c
psi/imainarg.h
psi/imemory.h
psi/iminst.h
psi/iname.c
psi/iname.h
psi/inamedef.h
psi/inameidx.h
psi/inames.h
psi/inamestr.h
psi/inobtokn.c
psi/inouparm.c
psi/int.mak
psi/interp.c
psi/interp.h
psi/iosdata.h
psi/iostack.h
psi/ipacked.h
psi/iparam.c
psi/iparam.h
psi/iparray.h
psi/ipcolor.h
psi/iplugin.c
psi/iplugin.h
psi/ireclaim.c
psi/iref.h
psi/isave.c
psi/isave.h
psi/iscan.c
psi/iscan.h
psi/iscanbin.c
psi/iscanbin.h
psi/iscannum.c
psi/iscannum.h
psi/isdata.h
psi/isstate.h
psi/istack.c
psi/istack.h
psi/istkparm.h
psi/istream.h
psi/istruct.h
psi/itoken.h
psi/iutil.c
psi/iutil.h
psi/iutil2.c
psi/iutil2.h
psi/ivmem2.h
psi/ivmspace.h
psi/main.h
psi/mkfilelt.cpp
psi/msvc.mak
psi/msvc32.mak
psi/msvc64.mak
psi/nsisinst.nsi
psi/oparc.h
psi/opcheck.h
psi/opdef.h
psi/oper.h
psi/opextern.h
psi/os2.mak
psi/ostack.h
psi/psapi.c
psi/psapi.h
psi/psromfs.mak
psi/store.h
psi/zalg.c
psi/zarith.c
psi/zarray.c
psi/zbfont.c
psi/zbseq.c
psi/zcfont.c
psi/zchar.c
psi/zchar1.c
psi/zchar2.c
psi/zchar32.c
psi/zchar42.c
psi/zchar42.h
psi/zcharout.c
psi/zcharx.c
psi/zcid.c
psi/zcie.c
psi/zcie.h
psi/zcolor.c
psi/zcolor.h
psi/zcolor1.c
psi/zcolor2.c
psi/zcolor3.c
psi/zcontrol.c
psi/zcrd.c
psi/zcsindex.c
psi/zcspixel.c
psi/zcssepr.c
psi/zdevcal.c
psi/zdevice.c
psi/zdevice2.c
psi/zdfilter.c
psi/zdict.c
psi/zdouble.c
psi/zdps1.c
psi/zdscpars.c
psi/zfaes.c
psi/zfapi.c
psi/zfarc4.c
psi/zfbcp.c
psi/zfcid.c
psi/zfcid0.c
psi/zfcid1.c
psi/zfcmap.c
psi/zfdctd.c
psi/zfdcte.c
psi/zfdecode.c
psi/zfile.c
psi/zfile.h
psi/zfile1.c
psi/zfileio.c
psi/zfilter.c
psi/zfilter2.c
psi/zfimscale.c
psi/zfjbig2.c
psi/zfjpx.c
psi/zfmd5.c
psi/zfont.c
psi/zfont0.c
psi/zfont1.c
psi/zfont2.c
psi/zfont32.c
psi/zfont42.c
psi/zfontenum.c
psi/zform.c
psi/zfproc.c
psi/zfrsd.c
psi/zfrsd.h
psi/zfsample.c
psi/zfsha2.c
psi/zfunc.c
psi/zfunc.h
psi/zfunc0.c
psi/zfunc3.c
psi/zfunc4.c
psi/zfzlib.c
psi/zgeneric.c
psi/zgstate.c
psi/zht.c
psi/zht1.c
psi/zht2.c
psi/zht2.h
psi/zicc.c
psi/zicc.h
psi/zimage.c
psi/zimage3.c
psi/ziodev.c
psi/ziodev2.c
psi/ziodevsc.c
psi/zmath.c
psi/zmatrix.c
psi/zmedia2.c
psi/zmisc.c
psi/zmisc1.c
psi/zmisc2.c
psi/zmisc3.c
psi/zncdummy.c
psi/zpacked.c
psi/zpaint.c
psi/zpath.c
psi/zpath1.c
psi/zpcolor.c
psi/zpdf_r6.c
psi/zpdfops.c
psi/zrelbit.c
psi/zshade.c
psi/zstack.c
psi/zstring.c
psi/zsysvm.c
psi/ztoken.c
psi/ztrans.c
psi/ztrap.c
psi/ztype.c
psi/zupath.c
psi/zusparam.c
psi/zutf8.c
psi/zvmem.c
psi/zvmem2.c
psi/zwinutf8.c
toolbin/GenSubstCID.ps
toolbin/afmutil.py
toolbin/color/icc_creator/ICC_Creator/CIELAB.h
toolbin/color/icc_creator/ICC_Creator/ICC_Creator.cpp
toolbin/color/icc_creator/ICC_Creator/ICC_Creator.h
toolbin/color/icc_creator/ICC_Creator/ICC_CreatorDlg.cpp
toolbin/color/icc_creator/ICC_Creator/ICC_CreatorDlg.h
toolbin/color/icc_creator/ICC_Creator/icc_create.cpp
toolbin/color/icc_creator/ICC_Creator/icc_create.h
toolbin/color/icc_creator/README.txt
toolbin/encs2c.ps
toolbin/errlist.tcl
toolbin/extractFonts.ps
toolbin/extractICCprofiles.ps
toolbin/gen_ldf_jb2.py
toolbin/genfontmap.ps
toolbin/gitlog2changelog.py
toolbin/gsmake.tcl
toolbin/halftone/gen_ordered/gen_ordered_main.c
toolbin/halftone/gen_stochastic/gen_stochastic.c
toolbin/headers.tcl
toolbin/jpxtopdf.c
toolbin/leaks.tcl
toolbin/makehist.tcl
toolbin/memory.py
toolbin/ocheck.py
toolbin/pre.tcl
toolbin/precheck.tcl
toolbin/split_changelog.py
toolbin/suite.tcl
toolbin/tests/build_revision.py
toolbin/tests/check_all.py
toolbin/tests/check_comments.py
toolbin/tests/check_dirs.py
toolbin/tests/check_docrefs.py
toolbin/tests/cmpi.py
toolbin/tests/compare_checksumdb.py
toolbin/tests/compare_checksums.py
toolbin/tests/dump_checksum.py
toolbin/tests/dump_checksum_plus.py
toolbin/tests/dump_checksum_raw.py
toolbin/tests/fuzzy.c
toolbin/tests/get_baseline_log.py
toolbin/tests/get_baselines.py
toolbin/tests/gscheck_all.py
toolbin/tests/gscheck_fuzzypdf.py
toolbin/tests/gscheck_pdfwrite.py
toolbin/tests/gscheck_raster.py
toolbin/tests/gscheck_testfiles.py
toolbin/tests/gsconf.py
toolbin/tests/gsparamsets.py
toolbin/tests/gssum.py
toolbin/tests/gstestgs.py
toolbin/tests/gstestutils.py
toolbin/tests/gsutil.py
toolbin/tests/make_baselinedb.py
toolbin/tests/make_testdb.py
toolbin/tests/make_two_pdfversions
toolbin/tests/make_two_versions
toolbin/tests/myoptparse.py
toolbin/tests/rasterdb.py
toolbin/tests/revert_baseline
toolbin/tests/revert_pdfbaseline
toolbin/tests/run_nightly.py
toolbin/tests/run_parallel
toolbin/tests/run_regression.py
toolbin/tests/testdiff.py
toolbin/tests/update_baseline.py
toolbin/tests/update_specific
toolbin/tmake.tcl
xps/ghostxps.h
xps/xps.mak
xps/xpsanalyze.c
xps/xpscff.c
xps/xpscolor.c
xps/xpscommon.c
xps/xpscrc.c
xps/xpsdoc.c
xps/xpsfapi.c
xps/xpsfapi.h
xps/xpsfont.c
xps/xpsglyphs.c
xps/xpsgradient.c
xps/xpshash.c
xps/xpsimage.c
xps/xpsjpeg.c
xps/xpsjxr.c
xps/xpsmem.c
xps/xpsopacity.c
xps/xpspage.c
xps/xpspath.c
xps/xpspng.c
xps/xpsresource.c
xps/xpsromfs.mak
xps/xpstiff.c
xps/xpstile.c
xps/xpstop.c
xps/xpsttf.c
xps/xpsutf.c
xps/xpsvisual.c
xps/xpsxml.c
xps/xpszip.c
2020-04-09 09:40:05 +0100
Chris Liddell <chris.liddell@artifex.com>
87688cd48fb52c305e159b785bd184232426a766
Bug 702322: fix uninitalized data reads
gs_scan_token() keeps a local copy of the scanner state, and copies from and to
the scanner state that is passed into it. There are several code paths that
can leave some important entries in the structure uninitalized when we copy the
local copy to the parameter.
This just ensures those specific entries are always set to *something* sane.
psi/iscan.c
2020-04-09 09:07:38 +0100
Chris Liddell <chris.liddell@artifex.com>
c96962212ed44463b3bd5cf34f3f790e9d14cd0b
Clarify path matching for SAFER controls
Make it explicit that the 'form' of the paths (e.g. absolute vs relative) must
match between --permit-file-* paramters and the actual path used to reference
the file
doc/Use.htm
2020-04-08 16:06:44 +0100
Ken Sharp <ken.sharp@artifex.com>
ebabebad34a3811230b7bfe351eface7f5efc8a9
PostScript interpreter - don't leave A85Decode pdf_rules uninitialised
Bug #702319 "Read of uninitialized value according to valgrind..."
There are a number of other bugs which relate to this particular problem:
690976, 692983 and 693485. The problem has come about as a cumulative
result of working on these bugs.
Starting with commit :
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=e0ecca32ecd12dae3310fac4b65dc224031c85a2
for bug 690976 a new flag 'pdf_rules' was added to the Ascii85Decode
state. This is initialised from the dictionary operand in PostScript
by zA85D() in zfdecode.c. When this flag is true the ASCII85Decode
filter will silently accept just '~' as a valid termination for a string
(should be '~>').
However this is not the only way to initialise an Ascii85Decode filter,
the PostScript token scanner can also use s_A85D_init_inline() which
does not initialise the flag. From this point we have the potential
for testing an unitialised variable in s_A85D_process(), if we get an
encoded string which terminates with a '~' and the filter was
instantiated from PostScript.
When fixing bug 692983, this commit:
http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=d561224d1495321d40012230abbcf835b298f557
Alex specifically added a comment that pdf_rules must not be initialised
in s_A85D_init_inline() but didn't say why! The reason is that the
regular stream initialisation code (s_A85D-init) also uses this inline
function, so if it altered pdf_rules it would overwrite the value
previously set by zA85D().
Since the initialisation is done in two places, the only way to fix this
is to initialise pdf_rules in gs_scan_token() which this commit duly
does. I've also added comments in s_A85D_init_inline to explain more
clearly *why* pdf_rules must not be initialised here.
base/sa85d.h
psi/iscan.c
2020-03-31 08:26:37 -0700
Ray Johnston <ray.johnston@artifex.com>
668917a10e7eada030f7d2dddec9f579fddeed3d
Change MaxLocalVM and MaxGlobalVM to be size_t instead of 'long'
The sizeof long differs between 64-bit Windows and linux, and
Robin changed the Max values for other params to be size_t in
commit d7961033. This change extends that to the other memory
size related params.
Also fix vm_threshold to be int64_t, not size_t since that
corresponds to the parameter setting in zusparam.c. This is
also limited to the max signed value that corresponds to
size_t (MAX_VM_THRESHOLD) in case size_t is < 64 bits.
base/gsalloc.c
base/gsalloc.h
base/std.h
psi/ireclaim.c
psi/ivmem2.h
psi/zusparam.c
psi/zvmem2.c
2020-04-05 12:24:36 +0800
Sebastian Rasmussen <sebras@gmail.com>
d8ed6363166841dcb067d7adc6ad6b52a1b1f90c
jbig2dec: Initiate variable before avoids using uninited data during cleanup.
Fixes OSS-fuzz issue 21571.
Also fixes Coverity CID 355467.
Thanks to OSS-fuzz for reporting.
jbig2dec/jbig2_text.c
2020-03-27 05:41:07 +0800
Sebastian Rasmussen <sebras@gmail.com>
dc6b8098b52db7e1a9b20c1ef6f1006555c04b1b
jbig2dec: Adjust number of bytes consumed by MMR decoder.
The MMR decoder pre-buffers up to 32 bits of encoded input data in a word
buffer before they are consumed by the MMR decoder. Once bits are consumed, the
pre-buffer will be filled up with more input data. When filling up the buffer
the decoder would previously stay clear of reading data belonging to succeeding
segments, but still indicated that it consumed those bytes it never read. Once
finished the MMR decoder lied to the caller by propagating the incorrect number
of consumed bytes. The caller subtracted the consumed number of bytes from the
size and end up in underflow causing the next MMR decoding to first read input
data at the wrong location, later ending up attempting to read outside the MMR
encoded input buffer.
Now, the MMR decoder keeps track of how many bits it has consumed and
accurately rounds this number up to a whole number of bytes to the caller.
Fixes OSS-fuzz issue 17855.
Thanks to OSS-fuzz for reporting.
jbig2dec/jbig2_mmr.c
2020-03-26 14:20:11 +0800
Sebastian Rasmussen <sebras@gmail.com>
f14f35c6e3218554cd351b848447cfa83b3c4256
jbig2dec: Plug leak of image upon error.
Fixes OSS-Fuzz issue 17513.
Thanks to OSS-fuzz for reporting.
jbig2dec/jbig2_text.c
2020-03-25 01:12:52 +0800
Sebastian Rasmussen <sebras@gmail.com>
d293095a593f7106e16027fb9782324ee7bb36f8
jbig2dec: Need to store local copy of error message.
jbig2dec/jbig2dec.c
2020-04-02 13:06:06 +0100
Ken Sharp <ken.sharp@artifex.com>
6728387b7f4b803ea5a26eb220ce24e4ff65e710
PDF interpreter - Fix incorrect CIDFontType2 with Type1C descendants
Customer bug report. The file contains a CIDFont declared like this:
16 0 obj
<<
...
/Subtype /CIDFontType2
...
>>
The /Subtype /CIDFontType2 means that the font is a CIDFont with
TrueType outlines. However the actual font:
10 0 obj
<<
/Subtype /Type1C
/Length 49432
/Length1 49432
>>
is a Type1C (Compact Font Format) font. The PDF file is, quite simply,
incorrect. The Subtype should be /CIDFontType0. Interestingly we already
have code in the CIDFontType2 case to handle an incorrect value of
Subtype being set to /CIDFontType0 so this is the reverse case.
If we discover we are reading a Type1C font, and the parent is a CIDFont
with a Subtype of CIDFontType2, then change the parent dictionary to
have a Subtype of /CIDFOntType0C and read the font as a CIDFont.
Resource/Init/pdf_font.ps
2020-04-01 19:48:03 +0100
Robin Watts <Robin.Watts@artifex.com>
1c363593d7880b305e5da0cae8964bf090af3e61
Speed up gx_get_bits_std_to_native.
We don't need to fetch the color_mapping_procs for every pixel;
just once will do.
base/gdevdgbr.c
2020-04-01 14:27:33 -0700
Michael Vrhel <michael.vrhel@artifex.com>
85225cda5e2b2d557942c6ff13887e418eccb6cc
Remove pgs->alpha
The alpha value in the graphic state is not used and will
only lead to confusion for people working on transparency.
base/gdevp14.c
base/gsalpha.c
base/gsalpha.h
base/gsstate.c
base/gxclpath.c
base/gxcmap.c
base/gxgstate.h
base/lib.mak
windows/ghostscript.vcxproj
windows/ghostscript.vcxproj.filters
2020-03-31 15:17:40 +0100
Robin Watts <Robin.Watts@artifex.com>
295bcef3b977c12885e30fdbae326f63d0771caa
Squash 'set but unused' warning in gdevcups.
cups/gdevcups.c
2020-03-31 14:59:04 +0100
Robin Watts <Robin.Watts@artifex.com>
a32c6fdce5fab7d5918d02d30a4cf6696af58db3
Squash some compiler warnings.
base/gsicc_cache.c
base/gsptype1.c
2020-03-31 13:00:40 +0100
Robin Watts <Robin.Watts@artifex.com>
4dd43e9ca448777bbd585ef3ce97e9cf593f395d
Coverity 355259: Avoid "Failure to restore" warning from coverity.
Coverity complains that pgs->fillconstantalpha isn't restored
before the file exits. While we're not too fussed about what
happens to it in an error condition, simply hoisting a couple
of lines up a bit solves the problem and should shut it up.
base/gdevp14.c
2020-03-30 19:01:10 +0100
Chris Liddell <chris.liddell@artifex.com>
32805b5689be664f9b76502669775baa53f55677
Redefine deprecated .setopacityalpha and .setshapealpha
.setopacityalpha and .setshapealpha have been replaced with
.setfillconstantalpha/.setstrokeconstantalpha and .setalphaisshape, operators
which actually do what PDF requires.
As an interim measure, to allow users that rely on these operators some time
to adjust, define versions of .setopacityalpha and .setshapealpha which
approximate what the old implementations did.
As with the rest of the transparency operators they only exist when gs is
given the -dALLOWPSTRANSPARENCY option. Also, they are in pdf_main.ps just so
they grouped in proximity to where the rest of the ALLOWPSTRANSPARENCY logic is
implemented.
Resource/Init/pdf_main.ps
2020-03-30 09:59:23 +0100
Chris Liddell <chris.liddell@artifex.com>
3ff82b33f24ed54c2d3bb88ec31da7d2f9fd2765
Fail configure with unsupported shared tiff/jpeg combo
With the changes to support consuming the various TIFF input forms, we cannot
support all combinations of mixing share and local libtiff and libjpeg.
For simplicity just reject mixing those configs.
configure.ac
2020-03-25 14:00:55 +0000
Chris Liddell <chris.liddell@artifex.com>
6756b355c238c319fe66087dece15174e62f9f15
Fix shared libtiff and libjpeg build
When building with shared libs, we should not try to include our custom libjpeg
memory management context into the TIFF reader implementation context.
gpdl/gpdl.mak
gpdl/tifftop.c
2020-03-30 14:47:25 -0700
Michael Vrhel <michael.vrhel@artifex.com>
b8bda01581b94e9159533460cfe79436f4d5ac21
Coverity 94826 Add missing offset to buffer size used for clist cmd.
base/gxclpath.c
2020-03-29 15:32:36 -0700
Ray Johnston <ray.johnston@artifex.com>
b09cbe8e577fb14504932dc8d9096187ec4e0840
Fix infinite loop in PDF interpreter 'pagespotcolors' procedure
The file tests_private/pdf/uploads/poc1_pdf_gs.pdf has the single page
Parent object as itself. This only showed up with "DeviceN" devices that
search the PDF for the number of spot colorants on the page.
Note that this file is broken in other respects since it has a /Count
of 9 pages, but only a single page. This change also adds handling for
the //null object returned when a page isn't found since there isn't
actually a second page, and adds an error message when this is the case.
Resource/Init/pdf_main.ps
2020-03-30 12:24:45 -0700
Michael Vrhel <michael.vrhel@artifex.com>
4dde07159da5786570ad4f8d2b7b3c0b828802ab
Coverity 141130 Initialize shape and alpha of group for image.
base/gdevp14.c
2020-03-30 19:51:57 +0100
Robin Watts <Robin.Watts@artifex.com>
baa1a80f7824e26fb31f5f5f782980518b6cbfd9
Coverity 355259: Fix precedence of assignment/comparison.
This was leading to code being thought of as being unreachable.
base/gxstroke.c
2020-03-30 10:45:25 -0700
Michael Vrhel <michael.vrhel@artifex.com>
22a31bda026deb8e3748f25bc2cf3b46263e689c
Update doc to deprecate transparency PS methods
doc/Language.htm
2020-03-27 13:54:02 -0700
Ray Johnston <ray.johnston@artifex.com>
6a3c36f8c5e83448f5d1e5f24ee01c0e80a92877
Fix Bug 702177: VMerrors with some BufferSpace and/or -K limits.
Interestingly, the two examples given in the bug succeed on Windows 64
but don't on linux. The difference is due to an 8 byte difference in the
size of gx_clist_state (the per band writer state). In the case of the
Bug690546.pdf file, the space left in the BufferSpace area after the
logic increased it was only 2,200 bytes on linux, but was 12k bytes on
Windows (it made an extra pass through the automatic "increase space"
loop in gdev_prn_setup_as_command_list. Fix the calculation in
clist_init_states so that the amount of extra space corresponds to the
amount expected by clist command writing (data_bits_size + cmd_largest_size)
rather than the insufficient and arbitrary "100".
Note that although the Bug692057.pdf returned VMerror from cmd_put_list_op, the
'fallback; method of gx_default_strip_tile_rectangle still produces the SAME
raster from psdcmyk16 and does not change the performance or clist file size
Robin's commit cbee0840 fixed this case.
base/gxclist.c
2020-03-27 14:46:05 -0700
Michael Vrhel <michael.vrhel@artifex.com>
d12d2085b5bd08ca1e813d97f3f7f7e630e791a0
Squashed commit of the opacity_shape branch
This commit removes shape.alpha and opacity.alpha from the
graphic state. This involved removal of methods in the
postscript based PDF interpreter, changes in the pdf14 device,
changes in pdfwrite, the XPS interpreter, and the PS
transparency test file that is present in examples and on
the cluster. The goal of this commit was to avoid
confusion and conflicts between shape.alpha opacity.alpha and
the stroke and fill alpha values (CA ca). This change
resulted in progressions in the XPS file. There were changes
in a couple PDF files that required some investigation. In
particular, the change in the dashed lines of Bug694981.pdf. Robin
and I looked at this. Robin determined it was due to
differences in stroke_add and stroke_fill not giving identical results.
In the end, the new output looks closer the what AR provides.
Resource/Init/pdf_draw.ps
Resource/Init/pdf_main.ps
Resource/Init/pdf_ops.ps
base/gdevp14.c
base/gdevp14.h
base/gstparam.h
base/gstrans.c
base/gstrans.h
base/gxblend.c
base/gxclimag.c
base/gxclpath.c
base/gxclpath.h
base/gxclrast.c
base/gxgstate.h
devices/vector/gdevpdft.c
examples/transparency_example.ps
psi/ztrans.c
xps/xpscolor.c
xps/xpsgradient.c
xps/xpsimage.c
xps/xpsopacity.c
xps/xpspath.c
xps/xpstile.c
2020-03-27 15:28:22 +0000
Ken Sharp <ken.sharp@artifex.com>
1241ea6848d254de9a9dbcb8c8edf10a59761d1d
PDF interpreter - cope with Form XObjects leaving junk on the stack
No bug report, customer supplied file. The file has a Form XObject
where the stream ends:
/Image20 Do Q
EMC Tendstream
which is clearly invalid. This leaves a T lying around which gets
converted to a name and remains on the stack. When we come to complete
the form processing we expect that the stack will be clean, because it
isn't we end up corrupting an internal variable, which causes the
*next* Form XObject to fail.
We cope with this here by adding code to check the objects on the stack
and remove them one by one until we get back to a dictionary which
contains a name we expect to find (because we pushed it on entry to the
procedure) or run out of stack objects in which case we will throw an
error.
Resource/Init/pdf_draw.ps
2020-03-26 19:50:51 +0000
Robin Watts <Robin.Watts@artifex.com>
f3e37d28f6a76cb7cfc2a291aeb98b8f1c6ba178
Add murun to the list of products for clusterpush.pl
toolbin/localcluster/clusterpush.pl
2020-03-26 07:21:57 -0700
Ray Johnston <ray.johnston@artifex.com>
3df1313a6ef334d9c6da2fcd78347fb5eb7a3859
Fix CID 355224. Non-zero return code not possible, but Coverity doesn't get it.
base/gsptype1.c
2020-03-24 10:15:39 +0000
Robin Watts <Robin.Watts@artifex.com>
748b5c3c86779dc0cf4ccc144530cf37f692375e
Rejig "fast" stroking of miter joins.
This spins out of Bug 702196, though it's not strictly speaking
related. Bug 702196 deals with lines being incorrectly recognised
as being "thin". Thin lines aren't mitred. When we fix the
erroneous classification of lines as thin, this causes more
lines to be mitre joined than before. This in turn exposes
the bug that we (partially) fix here.
gs -sDEVICE=pdfwrite -o out.pdf tests_private/ps/ps3cet/11-28.PS
gs -sDEVICE=png16m -o out%d.png -r300 -dMaxBitmap=2G out.pdf
Page 4 of the output shows strange mitre extrusions from the edge
of paths.
Investigation shows the file is 'strokepath'ing the path (with
mitre joins), and the stroking the resultant path (again with
mitre joins). The initial 'strokepath' conversion includes little
"wedges" of path internally to give the "underjoin" in the path.
When restroked, due to the mitre join still being set, these
wedges turn into spikes.
The fix, implemented here, is to revise the way we do mitre joins.
For paths stroked using the "fast" code, with miter joins, we
perform slightly more complicated calculations at each join. This
allows us to do the joins by moving the existing points of the
paths 'inline'. This removes the need for the 'wedges', and
actually gives us a much cleaner path overall.
This *should* help with pathological scan conversion cases too,
because it means we will have fewer 'sleepers' in the 'train
tracks' when strokepath is used.
This may not kick in in all cases where we'd like it to, because
for some files, we use 'traditional' stroking, and so don't
execute this code. One way around this would be to change
gs_strokepath to disable 'traditional' filling in the presence
of mitre joins, but that produces strange effects, so we're
leaving it for now.
base/gxstroke.c
2020-03-18 15:11:01 +0000
Robin Watts <Robin.Watts@artifex.com>
9dc0eb31d79bf819c97420aaf2f6fc5cf3a52c10
Bug 702196: Fix incorrect detection of "thin" lines while stroking.
When stroking lines, we spot whether a line is 'thin' (i.e. the
perpendicular width of the line is less than 1 pixel), and handle
those cases specially by using custom 'thin line' routines. This
gives more pleasing results than slavishly following the 'any part
of a pixel' rule.
The current code makes this determination in 2 places. Firstly,
we calculate 'always_thin', by scaling the perpendicular vector
and seeing if all possible lines will be 'thin'. Secondly, in
the case when we aren't 'always_thin', we calculate it for each
line segment in turn by calling 'width_is_thin'.
Unfortunately, the threshold used for the simple early rejection
test in 'width_is_thin' is wrong. Rather than checking against
0.5, we should be checking against sqrt(1/8). This causes lines
near 45 degrees to be improperly treated as thin. This is a
simple fix.
This gives lots of progressions - so many that you wonder how we
never spotted this before.
Unfortunately, buried in these progressions, there are a few files
which, while improved, are still imperfect.
In some files, that use 'non-uniform' scales, (such as
(53 0 0 21 0 0 )) a stroke of constant width can 'pop' between
thick and thin as we move around the path; a near vertical
line segment may be thin, whereas a near horizontal line segment
might be thick due to the difference in scale. This is visually
jarring.
To fix this, therefore, we'd need to modify the width_is_thin
testing in non-uniform cases, so that it gives us the same results
all the way around. Doing this would be complex, and ultimately
actually ends up equivalent to us just relying on "always_thin"
(with the exception of strictly vertical and horizontal line
segements). We therefore disable the non-orthogonal test in
'width_is_thin' entirely.
base/gxstroke.c
2020-03-24 16:49:13 -0700
ray <Ray.Johnston@artifex.com>
d49dbf133ac49d09d626bab08ee92835a50a646a
Fix bug 702182: VMerror due to leaks in pattern cache due to locking.
If the tile being loaded by the clist reader was already in the cache and
was locked, the slot would be re-loaded (with the same tile) without freeing
up the previously loaded tile. It would be nicer to be able to skip reading
the tile in this case, but we need to consume the data from the clist sequence,
so just unlock it so it can be freed, then re-load it (presumably setting the
lock again).
base/gsptype1.c
2020-03-24 18:09:16 +0000
Chris Liddell <chris.liddell@artifex.com>
1258814b0532f06217cbfaffc5254c9645f69b42
Don't delete copied libjpeg source files after use
For reasons I'm not totally convinced are still valid, we copy the libpeg source
files into the build directory (normally 'obj') and compile them from there,
then delete them.
This apparently causes problems with oss-fuzz coverage builds, and it also makes
debugging a pain, because the source files don't exist where the debug info
thinks they should.
base/jpeg.mak
2020-03-24 15:22:01 +0000
Chris Liddell <chris.liddell@artifex.com>
0ec0004cb9366002dbd97f40c32d8da6d33c1904
Remove unused base/gsalphac.[ch]
This was the compositing device used for Display Postscript/NeXT specific
alpha blending. Since we haven't supported DPS properly for many years, and
officially dropped it completely a couple of years ago, and this compositing
device has not been included in the build for several years....
....just delete the files and remove references to them.
base/gsalphac.c
base/gsalphac.h
doc/Develop.htm
windows/ghostscript.vcproj
windows/ghostscript.vcxproj
windows/ghostscript.vcxproj.filters
windows/ghostscript_rt.vcxproj
2020-03-24 15:19:23 +0000
Chris Liddell <chris.liddell@artifex.com>
1c9bd8e0aa41e69c4bd46a6c553320d97af1ce7c
Disable PPC optimisations in libpng
Since we don't include the libpng source file with the PowerPC optimizations
in our build, and it only applies to reading, which we don't rely on, just
disable calling the optimizations.
Cures a linker error on PowerPCle platforms
configure.ac
2020-03-23 15:27:37 -0700
ray <Ray.Johnston@artifex.com>
cca279886b3bbb4d3af5768880565c9f7b372c08
Fix Bug 702181: SEGV when BufferSpace is at or above -K alloc limit
The issue with this file is that one of the pages is done in page mode because
it was so small, but the 'resize' call when doing page 2 was not checking the
allocation request against the limit, so the malloc would succeed, but the very
next (and all subsequent) allocations would fail. The gdev_prn_allocate would
capture the ecode, but would still call the clist_enable_multi_thread_render
resulting in the SEGV.
Add the check in the gs_heap_resize_object function, and make sure and leave
the 'monitor' after failure, then don't call clist_enable_multi_thread if the
resize failed.
base/gdevprn.c
base/gsmalloc.c
2020-03-20 10:26:17 +0000
Chris Liddell <chris.liddell@artifex.com>
886347337de7e121e3e1ffa348aa74856c8290ed
Bug 702190: Set CFLAGS and CFLAGSAUX separately in Makefile
Building with -DGS_NO_FILESYSTEM allows support for environment without a
proper file system, by stubbing out the gp_ calls that would normally access
the file system.
Obviously, for Ghostscript to function, that means it requires its resource
and initialisation files to be built into the binary in the ROMFS.
A problem arises if you include the -DGS_NO_FILESYSTEM CFLAG when building the
mkromfs utility, which creates the ROMFS, since denying it access to the file
system results in an empty ROMFS. Previously, setting CFLAGS to include
-DGS_NO_FILESYSTEM when calling configure resulted in that flag being applied to
the main build, and the auxiliary tools build (including mkromfs), unless the
build specified was a cross-compilation.
This splits the CFLAGS and CFLAGSAUX so they are set separately in the Makefile
so configure can filter out unwanted flags from the auxtools flags.
Currently, the only one being filtered is -DGS_NO_FILESYSTEM
Makefile.in
configure.ac
2020-03-19 16:19:57 +0000
Chris Liddell <chris.liddell@artifex.com>
7710a398e132e13f9e0ff2f83188cbe7d2b59b1f
Bug 702115: use the offical method to detect gcc
In the early days of autoconf there was no defined way to check if the selected
compiler was gcc (or compatible) or not. Projects used the autoconf internal
shell variable ac_cv_prog_gcc to get that info.
autoconf introduced the GCC shell variable as the official way to know (a long
time ago), and we never revised our configure.ac to reflect that.
This does so.
configure.ac
2020-03-19 16:12:46 +0000
Chris Liddell <chris.liddell@artifex.com>
66c2469c7d4543f32d6dc93edf1d649e809b8419
Remove deprecated opvp/oprp devices from default build
They can currently be reinstated with --with-openprinting
That option does not appear in the --help output because we want people to have
to ask us about it, so we know if people actually use opvp/oprp, and still
need them.
configure.ac
2020-03-23 09:07:36 +0000
Chris Liddell <chris.liddell@artifex.com>
fedfb0e00755d9529d15751650864d304708f0e1
Remove analytics stuff.
Analytics and cookie stuff will be added at serve time by Apache.
See /etc/apache2/sites-available/ghostscript.com-le-ssl.conf for more info
doc/API.htm
doc/C-style.htm
doc/Commprod.htm
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Internal.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
2020-03-21 18:08:43 +0800
Sebastian Rasmussen <sebras@gmail.com>
d98ab1f82e64e11db6478c4ff3e3bcffcc69836e
jbig2dec: Cast literal to avoid shifting outside of valid range.
Fixes Coverity CID 355175.
jbig2dec/jbig2_arith_iaid.c
2020-03-21 16:49:33 +0800
Sebastian Rasmussen <sebras@gmail.com>
1677b6c0d7b090ad7691e766d4809f9badeecd20
jbig2dec: Record stream errors in separate struct field.
Previously the number of remaining bytes in a read word (>= 0) and the error
state (< 0) was stored in the same int field. Fixing signedness conversion
warnings changed the type of the field to an unsigned field. The error state
should have been stored separately at that time but it was overlooked. In this
commit the error state is separated out into its own field.
Fixes Coverity CID 355176.
jbig2dec/jbig2_arith.c
2020-03-21 15:59:21 +0800
Sebastian Rasmussen <sebras@gmail.com>
a80f7f12e7a2fb0caa1ea9ac6fa8981cc539a1bc
jbig2dec: Use correct define for maxium value of type.
Fixes Coverity CID 355177.
jbig2dec/jbig2_page.c
2020-03-21 16:20:28 +0800
Sebastian Rasmussen <sebras@gmail.com>
4f0c17451afb66e6fcf3bd453490b4b9d2b06b42
jbig2dec: Fix two overlooked warnings.
While working to fix all warnings seen when -Wsign-conversion is
enabled, these two warnings were accidentally introduced by commit
ff53af0d4ff9291aa5039522f5553a2850dd569d and not noticed in the
avalanche of warnings emitted due to -Wsign-conversion. This commit
changes the indicies to the type of the limit variable, fixing the
warnings.
jbig2dec/jbig2_page.c
2020-03-21 10:00:42 +0000
Ken Sharp <ken.sharp@artifex.com>
a45d7217c8c1578475ee9204d1f4ad46520f44d1
PDF interpreter - swallow errors reading ICC profiles and continue
Bug #702240 "Invalid ICC profile aborts PDF ineterpretation"
The file contains an ICCbased space which references an embedded ICC
profile, which is Flate compressed. The compressed stream has been
corrupted and cannot be decompressed.
This causes the colour space code to throw an ioerror and terminate
interpretation, Acrobat (as usual) doesn't even give a warning.
This commit checks for an error creating the ReusableStreamDecode and
if it fails sets the Data Source in the stream dictionary to null. We
will later use the /N value in the stream dictionary to set a reasonable
fallback space (in this case CMYK).
Resource/Init/pdf_draw.ps
2020-03-12 02:54:08 +0800
Sebastian Rasmussen <sebras@gmail.com>
9b2fc96b3ffc1c9d3d39b3d0ce27bf8abba7b8cf
jbig2dec: Fix signedness conversions.
jbig2dec/jbig2.c
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_priv.h
2020-03-12 00:27:13 +0800
Sebastian Rasmussen <sebras@gmail.com>
f2613ed2159e8efc6b5b593e668a00d8bea9ace8
jbig2dec: Use uint32_t when counting segments.
jbig2dec/jbig2.c
jbig2dec/jbig2_priv.h
2020-03-12 00:26:59 +0800
Sebastian Rasmussen <sebras@gmail.com>
ff53af0d4ff9291aa5039522f5553a2850dd569d
jbig2dec: Always use uint32_t when counting pages.
jbig2dec/jbig2.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h
2020-03-11 20:56:06 +0800
Sebastian Rasmussen <sebras@gmail.com>
6073e803bd652cd8fdb17f6be6beea05a13fd4f0
jbig2dec: Handle errors from reading jbig2 streams.
jbig2dec/jbig2dec.c
2020-03-11 20:55:51 +0800
Sebastian Rasmussen <sebras@gmail.com>
1e9b5185c889266c9a3d6f25c9df558d41335d46
jbig2dec: Use size_t for string length.
jbig2dec/jbig2dec.c
2020-03-11 18:42:26 +0800
Sebastian Rasmussen <sebras@gmail.com>
dc3f780ee3c9e43f34ba1c0b1101b41c58b40710
jbig2dec: Avoid formatting error messages twice in error callback.
jbig2dec/jbig2dec.c
2020-03-11 16:35:53 +0800
Sebastian Rasmussen <sebras@gmail.com>
9b5008aa2bc1c6a6acb2c6f90d1ef8d6bad9e66a
jbig2dec: Pass segment numbers as unsigned values to error callback.
According to the JBIG2 specification segments numbers are 32 bit unsigned
integer. Previously any segment numbers larger than INT32_MAX would be passed
as negative numbers.
Some parts of the decoder do not yet know, or do not have access to the
currently decoded segment number, and this needs to be specially indicated.
Therefore jbig2dec appropriates the unlikely segment number 0xffffffff to
indicate an unknown segment number.
This is a change of the public API.
base/sjbig2.c
gpdl/jbig2top.c
jbig2dec/jbig2.c
jbig2dec/jbig2.h
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_image.c
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_refinement.c
jbig2dec/jbig2_segment.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2dec.c
2019-10-17 01:48:00 +0200
Sebastian Rasmussen <sebras@gmail.com>
ea9b3a676a516a603fabb593085d14a67356db6f
Bug 701721: jbig2dec: Fix under/overflow handling in arithmetic integer decoder.
The previous detection logic caused GCC's -Wlogical-op to trip.
Not only that, but the detection logic never took into account
that underflow is not possible (the worst case is V == INT32_MIN,
but offset is always > 0, so underflow cannot happen), nor take
varying offset values into account (hardcoded limits meant that
the offset was ignored even if it could not cause an overflow),
but instead could cause non-clamped values to be emitted.
This corrected logic adheres to the Annex A. Table A.1 in the specification.
jbig2dec/jbig2_arith_int.c
2019-10-01 18:08:34 +0200
Sebastian Rasmussen <sebras@gmail.com>
92faea67b31570e84b978a77b43c8f38bdad7bd4
jbig2dec: Avoid warning by copying bytes instead of characters.
jbig2dec/jbig2dec.c
2019-09-29 17:10:00 +0200
Sebastian Rasmussen <sebras@gmail.com>
f20fc43d80e31780935be96393800cc1fac8ac50
jbig2dec: Enable warnings for signedness in comparisons.
jbig2dec/configure.ac.in
2019-09-29 12:09:40 +0200
Sebastian Rasmussen <sebras@gmail.com>
5947fb2f1c022982e82406639517ebacae8d5cf6
jbig2dec: Address all signedness comparison issues.
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_arith_iaid.h
jbig2dec/jbig2_halftone.c
jbig2dec/jbig2_halftone.h
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_symbol_dict.c
jbig2dec/jbig2_text.c
2019-09-29 12:09:22 +0200
Sebastian Rasmussen <sebras@gmail.com>
9394be6a45aea026f61900e1cb661a30db192c15
jbig2dec: Remove trailing whitespace.
jbig2dec/CHANGES
jbig2dec/autogen.sh
jbig2dec/configure.ac.in
jbig2dec/msvc.mak
2019-09-29 16:26:53 +0200
Sebastian Rasmussen <sebras@gmail.com>
1899ce3f1844cf941d19c38fc8de8f126bf7419d
jbig2dec: Avoid passing NULL buffer to snprintf().
jbig2dec/jbig2dec.c
2019-09-15 17:07:27 +0200
Sebastian Rasmussen <sebras@gmail.com>
4239ceeb4dd39e2ac183a01877b62761ae13bae4
jbig2dec: Avoid artificially limiting jbig2dec.
Commit 7366747076f3b75def52079bd4d5021539a16394 fixes bug 694949 by
adding an artificial limit (that does not come from the JBIG2
specification) to the sizes of generic regions compared with the image
they will be composed onto. A problem with such artificial limits is
that they are arbitrary. This is exemplified by the changes in
0d21a58ab12b9584faa54baa48ce0dab350af53e to make jbig2dec not error
out on commonly occurring images. It is impossible to know whether
this updated limit is enough, or whether an even large generic region
in a JBIG2 image will be found in the future.
Instead of imposing these kinds of limits, jbig2dec should attempt to
decode any JBIG2 image given to it. If the user wants to limit the
amount of memory jbig2dec may use for decoding any JBIG2 image, this
is a better way of implicitly limiting image sizes.
jbig2dec/configure.ac.in
jbig2dec/jbig2_generic.c
jbig2dec/snprintf.c
2019-09-15 19:01:05 +0200
Sebastian Rasmussen <sebras@gmail.com>
cd1ef5475a3bda7a97851abc679c75e2ee64dec3
Bug 702165: jbig2dec: Treat end of stream as fatal error, and remember errors.
* Treat reading beyond end of stream in arithmetic decoder as a fatal error.
* Remember previously encountered stream errors in arithmetic decoder.
* Ignore trailing bytes after terminating marker code in stream.
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_huffman.c
2019-09-15 18:12:31 +0200
Sebastian Rasmussen <sebras@gmail.com>
30842ee99923fa10a7301494fd08b998e7acf57b
jbig2dec: Add overflow detection for IAID context size.
jbig2dec/jbig2_arith_iaid.c
2019-09-15 17:58:40 +0200
Sebastian Rasmussen <sebras@gmail.com>
17e84cb1a4903fab26b5fc5d2e4805a1097f5a33
jbig2dec: Let arithmetic decoder and the underlying stream report errors.
When a called function indicates an error, the caller should print warnings.
Since the arithmetic decoder now uses the normal way of reporting errors,
the callers of the decoder are changed to report warnings.
jbig2dec/jbig2.c
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith.h
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_huffman.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_refinement.c
2019-09-15 17:31:48 +0200
Sebastian Rasmussen <sebras@gmail.com>
716560bf5f2bc4b821ca6924ec648ca4949826bb
jbig2dec: Handle under-/overflow detection and messaging better.
Previously SYMWIDTH was capped too early in order to prevent underflow
Moreover TOTWIDTH was allowed to overflow.
Now the value DW is checked compared to SYMWIDTH, preventing over
underflow and overflow at the correct limits, and an overflow
check has been added for TOTWIDTH.
jbig2dec/jbig2_symbol_dict.c
2020-03-16 22:56:06 +0800
Sebastian Rasmussen <sebras@gmail.com>
cf43daf9f8381a9accf36d12bad2324d021ec8c6
jbig2dec: Use unsigned suffix when defining UINT32_MAX.
Also move UINT32_MAX/INT32_MAX to internal header so they are defined
(the same) in every jbig2 source code file.
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_image.c
jbig2dec/jbig2_mmr.c
jbig2dec/jbig2_page.c
jbig2dec/jbig2_priv.h
jbig2dec/jbig2_segment.c
2019-09-15 17:19:12 +0200
Sebastian Rasmussen <sebras@gmail.com>
a47257407ee8938051f14da81890869a5ade0c26
jbig2dec: Keep type of index and array length the same.
jbig2dec/jbig2_symbol_dict.c
2019-09-15 16:57:23 +0200
Sebastian Rasmussen <sebras@gmail.com>
b610aebdd36d939a878e336c255c734b4432e023
jbig2dec: Add more references to specification.
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_symbol_dict.c
2019-09-15 15:52:26 +0200
Sebastian Rasmussen <sebras@gmail.com>
d4dc797e4a65871134f6a244cb8421a33fe91360
jbig2dec: Add command line option to limit memory usage.
jbig2dec/jbig2dec.c
2019-09-15 15:52:06 +0200
Sebastian Rasmussen <sebras@gmail.com>
a64ec1a232aa675e75d71da2632c6fca9a7fddcf
jbig2dec: Mention all long options in usage and manpage.
jbig2dec/jbig2dec.1
jbig2dec/jbig2dec.c
2019-09-15 15:45:47 +0200
Sebastian Rasmussen <sebras@gmail.com>
3f01ab3739773db83040d8c2a7c3562b9103ed4e
jbig2dec: Separate command line tool error callback state from parameters.
jbig2dec/jbig2dec.c
2020-03-05 03:31:43 +0800
Sebastian Rasmussen <sebras@gmail.com>
e4dd74c63031c705b3b6938fdac6b69e6317f00a
Propagate errors when closing pipe.
base/gdevpipe.c
2020-03-17 15:52:20 +0000
Chris Liddell <chris.liddell@artifex.com>
97ad9c044a1d3f87b16b2be754e088e49cc1f398
Bring master up to date 9.52 release branch
Add references to the 64 bit windows exes
Release notes for 9.52 release
Version, dates etc for 9.52 release
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Internal.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
2020-03-19 08:12:38 +0000
Chris Liddell <chris.liddell@artifex.com>
c126cabcc5760aec6458b97729c78c821e24d122
Bump version prior to 9.52 release
Resource/Init/gs_init.ps
base/version.mak
2020-03-18 10:40:39 +0000
Robin Watts <Robin.Watts@artifex.com>
7ba3000d394406331c8e49c87e1d6494887c4e98
CID: 355082. Fix comparison of size_t < 0.
Now we're using param_read_size_t, we no longer need to check
for the returned value being < 0. This check is pickled into
the coertion code contained within that function.
base/gsdparam.c
2020-03-17 00:44:02 +0000
Robin Watts <Robin.Watts@artifex.com>
4cbc36fe4546bce70537bc65541f65b4d7259a5b
Bug 702151: Avoid truncating pointers in debug code.
Introduce a PRI_INTPTR and use that to consistently display
pointers. We avoid using %p, as that displays inconsistently
between platforms. Sometimes it does 0x%x, sometimes just %x.
base/gdevdrop.c
base/gdevnfwd.c
base/gdevprn.c
base/gsalloc.c
base/gschar0.c
base/gscie.c
base/gsciemap.c
base/gscspace.c
base/gsfcmap1.c
base/gsfont.c
base/gsht.c
base/gsicc_cache.c
base/gsicc_manage.c
base/gsicc_profilecache.c
base/gsimage.c
base/gsmalloc.c
base/gsmchunk.c
base/gsmemory.c
base/gsmisc.c
base/gsrefct.h
base/gsstate.c
base/gsstruct.h
base/gstrans.c
base/gstype1.c
base/gstype2.c
base/gxacpath.c
base/gxalloc.h
base/gxbcache.c
base/gxccache.c
base/gxccman.c
base/gxclist.c
base/gxclmem.c
base/gxclread.c
base/gxclthrd.c
base/gxclutil.c
base/gxcpath.c
base/gxcpath.h
base/gxfill.c
base/gxfillsl.h
base/gxht.c
base/gxpath.c
base/gxpcmap.c
base/scfd.c
base/scfe.c
base/sfxfd.c
base/sfxstdio.c
base/stdint_.h
base/stream.c
base/szlibc.c
devices/gdevfax.c
devices/gdevx.c
psi/ialloc.c
psi/idebug.c
psi/idict.c
psi/idicttpl.h
psi/idstack.c
psi/igc.c
psi/igcref.c
psi/igcstr.c
psi/iinit.c
psi/ilocate.c
psi/imain.c
psi/imainarg.c
psi/iname.c
psi/interp.c
psi/isave.c
psi/iutil.c
psi/zcie.c
psi/zcontrol.c
psi/zvmem.c
xps/xpshash.c
xps/xpsresource.c
2020-03-12 17:22:36 +0000
Robin Watts <Robin.Watts@artifex.com>
d7961033ee224fc5d2c96a16bea3f3399dd29561
Add support for 64bit and size_t paramaters.
Cope with both int64_t's and size_t's with appropriate
rangechecks when casting will cause problems.
-d values on the command line are read as int64_t's.
If we ever find outselves wanting to assign a size_t where
the 63rd bit matters, then we may have to rethink this :)
We also change various params (such as MaxBitmap, MaxPatternBitmap
etc) to be size_t's. This affects the device structure itself.
base/gsdparam.c
base/gslib.c
base/gsparam.c
base/gsparam.h
base/gsparam2.c
base/gsparams.c
base/gxdevcli.h
base/gxpcache.h
base/gxpcmap.c
base/gxpcolor.h
base/spprint.c
base/spprint.h
base/spsdf.c
devices/vector/gdevpsdp.c
pcl/pl/plmain.c
psi/imainarg.c
psi/iparam.c
2020-03-15 14:48:29 -0700
Ray Johnston <ray.johnston@artifex.com>
e1b322c8ca8f08b5af398a912c511dc041cd9c86
Fix bug 702142: SMask profile 'swap' could cause clist to use wrong profile
The SMask 'swap' of profiles for the 'default' colorspaces in the icc_manager
was not being detected by the clist logic since the colorspace id was still
set to the cs_Device*_id value (1, 3, or 4).
The fix is to have the clist writing check for unknown color_space check BOTH
the color_space.id and the color_space.space, and flag 'unknown' if either
differed. The color_space.space includes the icc_profile info.
This results in a few progressions as well as fixing the file of this bug.
base/gxclimag.c
2020-03-14 15:07:37 +0000
Chris Liddell <chris.liddell@artifex.com>
0fad2491ae5d9dae39807266b6f0f2584a02bdd8
Bug 702217: Reinstate dynamic libs LDFLAGS for MacOS
With the significant revamp of the platform detection functions in configure
the LDFLAGS for building the gs shared library on MacOS went astray. This
puts them back in.
configure.ac
2020-03-16 09:06:16 +0000
Ken Sharp <ken.sharp@artifex.com>
aaf5edb15fceaae962569bae30eb4633480c1d15
Repair device subclassing after fill+stroke commit
Bug 702221 "Ghostscript 9.51 - SIGFPE when -dFirstPage or -dLastPage is set"
The fill+stroke commit had an error with the default method for handling
fill_stroke_path which passed the subclassing device as a parameter to
the child, instead of passing the child device. This caused seg faults,
floating point exceptions, hangs, and possibly other problems.
In addition the object filtering device had been modified to pass the
fill+stroke method to the default handler, instead of checking to see
if vector operations should be dropped.
This commit fixes both problems.
base/gdevoflt.c
base/gdevsclass.c
2020-03-14 10:56:43 +0000
Chris Liddell <chris.liddell@artifex.com>
b5682afdd022f0c1f1a20f83568300655bc27bfe
Add ARCH_MAX_SIZE_T to configure's arch.h prototype
arch/arch_autoconf.h.in
2020-03-14 10:53:15 +0000
Chris Liddell <chris.liddell@artifex.com>
09d359ca87e47cac31c7f1466250b3299818ce86
Don't fail on missing freetype for auxtools run
When cross compiling, we shouldn't fail the recursive call to configure if
there's no freetype - since it's not required for auxtools.
configure.ac
2020-03-13 18:57:30 -0700
Ray Johnston <ray.johnston@artifex.com>
bba815fd5ab0427b96ad2f2d6d96e7d69b4964ad
Bug 702191. Change Tr modes 2 and 6 to use fill_stroke operation.
Thanks to Ken Sharp who made the change to the PDF interpreter pdf_ops.ps.
This showed a few files that had SEGV. This was due to both the fill and
stroke having pattern colors where the pattern bits did not fit in the cache.
The stroke color could eject the fill pattern from the cache. The fix is to
lock the fill pattern in the cache as well as the stroke pattern (and unlock
it as well after the fill_stroke).
Resource/Init/pdf_ops.ps
base/gspaint.c
psi/dwmainc.c
2020-03-13 13:01:23 +0000
Ken Sharp <ken.sharp@artifex.com>
3353e8f68c8b4b13db8f712e3d01503d9043df65
pdfwrite - fix previous commit
commit 2a691356aeb538388ecbf0cafdf422bde771bad0 accidentally left a
debugging hack in place, which would lead to lots of files including
a ToUnicode CMap when that wasn't necessary, fix it here.
devices/vector/gdevpdtw.c
2020-03-13 11:10:50 +0000
Ken Sharp <ken.sharp@artifex.com>
2a691356aeb538388ecbf0cafdf422bde771bad0
pdfwrite - preserve ToUnicode CMaps with non-standard mappings
Bug #702201 "pdfwrite changes ligature"
The title is incorrect, pdfwrite does not 'change ligature'. The PDF
file uses an ffi ligature glyph from the embedded font, but the
ToUnicode CMap does not map that to U+FB03, it maps it to 3 Unicode
code points; f, f and i.
When we emit a simple font we check its Encoding to see if it needs a
ToUnicode CMap, if it doesn't then we don't emit one. Because all the
glyphs in this font are named, and have standard names, we don't need to
emit a ToUnicode CMap and so we don't (keeps the file size down).
However, that means that PDF consumers will map the ligature glyph to a
ligature ffi when copy/pasting (it has no other effect).
Here we check the Unicode code points as they are added to the internal
record. If any of them is not 2 bytes long, then its not a standard
mapping (simple fonts can only map to a single point). In that case we
note the exception and when we come to write the font, in the code that
checks the Encoding to see if we need to write a ToUnicode, we check
this value, if we've seen a multiple code point in the ToUnicode CMap
then we don't elide it, we embed the one we picked up.
This is not actually a bug IMO, there's nothing wrong with the mapping
as it stands because an ffi glyph in the document really should map to
a single Unicode code point ffi ligature. However, the creator of the
PDF file obviously didn't want that, so we;ll now honour it.
NB this only affects the emission of a ToUnicode CMap, which is only
used for copy/paste/search. The PDF contents are not affected by this
commit.
devices/vector/gdevpdte.c
devices/vector/gdevpdtf.c
devices/vector/gdevpdtf.h
devices/vector/gdevpdtw.c
2020-03-13 08:16:34 +0000
Chris Liddell <chris.liddell@artifex.com>
0bb921da9e702375618aa5fe7e85bf589e9a0108
Tiny tweak to release notes
to say "in the 9.50 release notes" rather than "above".
doc/History9.htm
doc/News.htm
2020-02-12 11:37:33 +0000
Chris Liddell <chris.liddell@artifex.com>
6018c8989f1c670d0b8c44d79438faa68dbe5a06
Bring master up to date with 9.51 release branch
Dates etc for 9.51 RC1
Plus prelim changelog
Dates, changelog etc for 9.51rc2
Add mention of deprecating/removing opvp/oprp devices
Dates/logs for 9.51 release candidate 3
Dates, changelog etc for 9.51 release
Makefile.in
base/version.mak
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Internal.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
psi/winint.mak
2020-03-12 17:46:43 +0000
Chris Liddell <chris.liddell@artifex.com>
e61555d8b960f1a87664fc378f4ce63619a762aa
Change 9.28 to 9.50 in the SAFER section
doc/Use.htm
2020-03-11 15:48:13 +0000
Chris Liddell <chris.liddell@artifex.com>
b2d084d01a22261281fc35e990efc46dde6ea8f9
Improve debugging error messages in fontconfig code.
Change the order we retrieve values, so we get FC_FILE (which *should* always
succeed) first. Thus we can use that in subsequent DEBUG messages, giving
slightly more useful diagnostics.
base/gp_unix.c
2020-03-11 13:18:00 +0000
Chris Liddell <chris.liddell@artifex.com>
09a575f0fdc6edde7e42f325167318a1b199839f
(fontconfig) Don't stop enumerating fonts on error.
We only want to finish enumerating the fontconfig fonts list once the list
is exhausted, not when an individual font gives an error.
In the event a font gives an error, skip it and move on.
base/gp_unix.c
2020-03-05 13:12:12 +0000
Chris Liddell <chris.liddell@artifex.com>
32fde6e59a76fa7bcc7c3b977a77b871a740f568
More problems with TTF "notdef" glyphs
The font in this file is questionable according to the spec. The spec says GID 0
in a TTF *must* be the "notdef" glyph which, traditionally, is a hollow
rectangle glyph. This contradicts what Postscript and PDF expect which is that
the .notdef glyph will be non-marking.
The problem is many PDF embedded TTF fonts ignore this, and populate GID 0 with
a "meaningful" glyph rather than an actual notdef.
Previously, the fonts that did this were all ones that used MS Unicode cmap
tables and hence we used that to determine whether to image GID 0 or not in
TTFs.
This file does not use a Unicode cmap, but rather an Apple cmap table. In this
case, the cmap table maps every character code to GID 0, GID 0 being the only
glyph defined in the font.
So, tweak the heuristic so that in the event we have what *looks* like a
notdef, we'll look up the character code in the TTF cmap table, and if
the cmap table maps that code to GID 0, then we'll image the glyph.
Otherwise, we will force it to be non-marking.
(Bug 702167)
Resource/Init/gs_ttf.ps
psi/zfapi.c
2020-03-09 07:08:00 +0000
Ken Sharp <ken.sharp@artifex.com>
3f7832e4b9568e70bdf3bb32c877c4bf5e9dc3b4
PS interpreter - another 64-bit integer fix
Bug #702197 "Integer overflowin --for-- on Windows"
Both the limit and the control variable were being passed to types
which truncated values when long or int were not 64-bit types.
psi/zcontrol.c
2020-03-09 05:22:22 +0000
Ken Sharp <ken.sharp@artifex.com>
9a0c0303127e4dba3fdc244cf3d75684e5cc8358
PS interpreter - fix cvrs with 64-bit integers
Bug #702195 "Integer overflow in cvrs on Windows"
Another 64-bit integer fix, we were casting the result of the radix
calculation through a long which on Windows is not 64-bit (on Linux it
is), leading to truncation o the result.
Fixed by casting through ps_uint instead. We also need to check for
CPSI mode here as we must use a 32-bit intermediate integer if we are in
CPSI mode and emit a rangecheck if the integer overflows 32 bits.
psi/ztype.c
2020-03-08 00:26:16 +0000
Ken Sharp <ken.sharp@artifex.com>
56840269a9df474a029f12ce8e4e41bb2abea313
PS interpreter some 64-bit integer fixes
Bug #702194 "cvi produces incorrect results"
This was simply caused by a cast through long. However its not enough
merely to change the cast, we must also check for running in CPSI mode
and throw an error if the returned integer cannot be represented in a
32-bit word, for compatibility with test suites.
In addition (see bug #702134) when exp throws an undefinedresult error
delay setting the stack variable until after we have tested the result,
so that we do not end up returning a INF on the stack, as is done in
other code paths which check for NaN and INF.
Thirdly; in div cater for the case of an integer divided by a real and
check the result for NaN and INF (as the other cases do). This now
properly throws an error and does not return NaN or INF on the stack.
psi/zarith.c
psi/zmath.c
psi/ztype.c
2020-03-05 09:58:47 +0000
Julian Smith <jules@op59.net>
933a09069dea35d570694e157013f272995ca5c4
Fix Raspbian build failure with mm_constant_zeros.
Moved 'static __m128i mm_constant_zeros' inside MM_SETUP macro definition, so
it only appears if MM_SETUP() is actually used.
base/gsroprun.c
2020-03-03 16:56:59 -0800
Ray Johnston <ray.johnston@artifex.com>
417b80ba6b16de181b2eb2fe5ca2e04565228f5f
Bug 702166: Image pattern phase mismatch when using clist
The gxclimag.c code, when it does 'cmd_put_drawing_color' was not updating
the tile_phase. The Kanji text set the tile_phase to 100, but the begin_image
was supposed to be 0,0 but the writer was not performing the set_tile_phase.
base/gxclimag.c
2020-03-04 17:42:04 +0000
Robin Watts <Robin.Watts@artifex.com>
2a3b9b17cc32401b45382c42e081733d4f6d1a62
Cups device: Windows: avoid using an uninitialised mutex.
cups/libs/cups/globals.c
2020-03-03 16:40:31 +0000
Robin Watts <Robin.Watts@artifex.com>
cbee08400ca895bb5f52de6cf8cb44ba59cc5fd8
Bug 702177: Avoid SEGV on low memory in cmd_put_halftone.
Ensure that cmd_put_list_op cannot return NULL without
setting an error code.
base/gxclutil.c
2020-03-03 11:53:28 +0000
Robin Watts <Robin.Watts@artifex.com>
e9dc0327b8458ed7c3f1ca07870c7e54dbef6aa4
Simplify change to clusterpush.pl for ifilters.
No need to keep filters and ifilters separately as we pass
them through with "filter=" and "ifilter=" intact.
toolbin/localcluster/clusterpush.pl
2020-03-03 10:55:43 +0000
Robin Watts <Robin.Watts@artifex.com>
fa944725e4b3ca01e7a63608a2b5afc320d9a4d2
Add support to clusterpush.pl for ifilter.
Needs tweaks within the cluster too, so don't try using
this immediately!
toolbin/localcluster/clusterpush.pl
2020-03-03 10:02:57 +0000
Julian Smith <jules@op59.net>
ab41133a6852dbb3cecdfd19ccd4737f27d7be28
Avoid potential Memento leak in gs_lib_ctx_set_icc_directory().
Return gs_error_VMerror after alloc failure, not -1. This doesn't fix a
known memento squeeze test case, but returning -1 after alloc failure breaks
gs_main_finit()'s cleanup and leaks blocks.
base/gslibctx.c
2020-03-03 09:47:52 +0000
Julian Smith <jules@op59.net>
a07bf9d0dee6c44865c25ed8c36cf68150301b39
Fixed Memento leak in gs_seticcdirectory().
Return gs_error_VMerror instead of -1, after alloc failure. This enables
gs_main_finit() to clean up properly.
Fixes:
MEMENTO_FAILAT=111090 ./ghostpdl/membin/gs -sDEVICE=bit -o /dev/null examples/text_graphic_image.pdf
base/gsicc_manage.c
2020-03-02 20:05:57 +0000
Julian Smith <jules@op59.net>
05ebf9f3c38ff9b15f54122c682f88ee9dd9d55e
Avoid compiler warning for MM_SETUP() __m128i mm_constant_ones.
This avoids warning about mm_constant_ones being used uninitialised.
Generated code for release build is unchanged.
base/gsroprun.c
2020-02-26 17:12:23 +0000
Julian Smith <jules@op59.net>
612ca06e4a41db0f0023827c878a55423500237e
minor fix to toolbin/squeeze2text.py to cope with no input.
toolbin/squeeze2text.py
2020-03-02 19:13:07 +0000
Robin Watts <Robin.Watts@artifex.com>
968216b16318407a179e7907dd5d6d2ebc54bb25
Fix typo in 16bit saturation blending code.
base/gxblend.c
2020-03-02 17:10:43 +0000
Robin Watts <Robin.Watts@artifex.com>
2c5687fef9709b04dd96957677ff9accd16ee1f7
Fix 16bit blending problem.
Seen with:
gs -sDEVICE=psdcmyk16 -o out%d.psd -r72 -dMaxBitmap=2000M
tests_private/pdf/forms/v1.5/proxy_vol_1_number_1_1.pdf
on page 3.
base/gxblend.c
2020-02-27 12:08:22 +0000
Robin Watts <Robin.Watts@artifex.com>
155894abeb41e90f9e2c8cb942269c2a2e1a6018
Reimplement saturation blendmode.
To test the results of deep color rendering, we ran a psdcmyk vs
psdcmyk16 comparison. This showed differences on page 17 of the
Altona_technical_v20_x4.pdf file in one patch. Simplifying the
file showed that the saturation blend mode was showing a
significant difference in one tile.
Saturation blend mode is defined to not make any changes if we
are writing over a pure grey color (as there is no 'hue' for
it to saturate). You'd expect that the blending function would be
continuous (i.e. that a small peturbation of the background color
should only produce a small peturbation in the output), but this
is NOT the case around pure greys.
The example in the tested file, shows that psdcmyk is called with
7a, 7a, 7a, which therefore leaves the background unchanged. For
psdcmyk16, it's called with 7a01 7a03 7a01, which therefore does
NOT leave the background unchanged. Testing by changing the 8 bit
inputs to 7b 7a 7b (a small peturbation), gives output of 99 64 99
(a large change).
So, actually, the results given seem reasonable in that case.
HOWEVER, in investigating what now seems to be a red herring, I
believe I've spotted a problem in the implementation. The scaling
of the components subtracts y when it should be subtracting minb.
The only way I could actually work that out though, was to completely
reimplement the code, and optimise it. I believe the new code is
slightly clearer (in that it follows the spec more explicitly) and
possibly slightly more performant, so I am committing that rather
than attempting to patch the existing code.
base/gxblend.c
2020-03-02 11:04:32 +0000
Robin Watts <Robin.Watts@artifex.com>
549a133dfcbdf2b3b028134d287d334f8fd623fd
Fix 64bit non-console windows build.
The creation of the text window was truncating the pointer to
long (32bit) size. No idea how we've been getting away with this
in the past. I can only assume this has been exposed by
differences in the runtime lib with vs2019 as compared to
earlier versions.
psi/dwtext.c
2020-02-28 10:34:12 +0000
Ken Sharp <ken.sharp@artifex.com>
1a4e859544336c9034c49bd9f735529401422961
Remove trailing white space from a prior commit
base/gxblend.c
2020-02-26 17:16:26 -0800
Michael Vrhel <michael.vrhel@artifex.com>
fa1bc6dce44b6fc69e9852553aec4b7a419d0d9c
Bug 702155 Alternate tint transform and shadings
Add option to match AR shadings for corner case, which
is not as detailed in the PDF specification.
If the source space is DeviceN or Separation and the
colorants are not supported (i.e. if we are using the alternate tint
transform) the interpolation should occur in the source space to
accommodate non-linear tint transform functions.
e.g. We had a case where the transform function
was an increasing staircase. Including that function in the
gradient smoothness calculation gave us severe quantization. AR on
the other hand is doing the interpolation in device color space
and has a smooth result for that case. So AR is not following the spec. The
bit below solves the issues for Type 4 and Type 5 shadings as
this will avoid interpolations in source space. Type 6 and Type 7 will still
have interpolations in the source space even if pfs->cs_always_linear == true.
So the approach below does not solve those issues. To do that
without changing the shading code, we could make a linear
approximation to the alternate tint transform, which would
ensure smoothness like what AR provides.
base/gxshade.c
2020-02-27 07:46:32 -0800
Ray Johnston <ray.johnston@artifex.com>
55222ef42e6574967810f8591ea308dbfc81b0a4
Fix differences seen between page mode and clist mode exposed by commit b3a73575
The code in gxipixel.c skips gridfitting if fill_adjust is 0, but the clist
writer logic wasn't updating the fill_adjust, so the reader could have the
wrong value. Seen with fts_25_2505 and fts_25_2506 which have an image with
SMask and also have large text (non-cached, so painted with fill) preceding
(drawn under) the image. Text is drawn with fill_adjust 0.
base/gxclimag.c
2020-02-26 09:10:20 -0800
Nancy Durgin <nancy.durgin@artifex.com>
8539dd741abec3d5b8e4417e512ae0847224f7a0
Fixes needed for pdfi after fill/stroke -- check for null pattern
Change to test for pgs->colours.pattern.p_tile to be NULL before
attempting to dereference it.
pdfi has a 'null' pattern frequently, which didn't seem to matter before the
fill/stroke changes, but does matter now.
I think the gs/pdf implementation sets up a specific "null" pattern
that gets around this issue, but currently pdfi does not do this.
Maybe it should?
base/gspaint.c
base/gxclrast.c
2020-02-26 15:22:04 +0000
Robin Watts <Robin.Watts@artifex.com>
b6bd379a249b81213db5fdecf29ed11f2ce00e9e
Fix signed issue in 16bit alpha blending fill_rectangle routines.
As seen by the central spot in the pink region of page 1 of:
gs -sDEVICE=psdcmyk16 -o out%d.psd -dMaxBitmap=2000M
tests_private/pdf/pdf_1.7_ATS_EXXPA1DC_PDFACT.pdf
base/gxblend.c
2020-02-26 15:09:35 +0000
Ken Sharp <ken.sharp@artifex.com>
b942845ee596dbcf37cf2af2381f0b298b962317
pdfwrite - Fix indeterminism with QL shading tests
When creating a new colour space to put in a PDF file we perform various
tests to see if its a space we have already written, to prevent writing
duplicate spaces (we perform similar tests for most resources).
In some cases, when we write the resource to a file, we create an MD5
hash and compare those to see if the resources are the same. In the
case of colour spaces, however, they are retained in memory and so we
use a different method. We 'serialise' the colour space. This is not the
same as writing it to the PDF file, and its a graphics library thing not
a pdfwrite function. Basically this writes out the content of the
various C structures. The stream we use is an in-memory stream.
Unfortunately, for Separation colour spaces, there was a fault in the
function which writes the colour space name, and it was writing out
the bytes forming the address of the name instead of the actual string.
This could, very rarely, mean that we would mis-identify a new colour
space as being the same as an old colour space, and so would reuse the
old space instead of creating a new one.
I've checked the DeviceN code and it does not suffer the same problem.
base/gscsepr.c
2020-02-26 13:03:56 +0000
Robin Watts <Robin.Watts@artifex.com>
988cfb770d12441dfef9002f799757e5cd869e48
Fix the overflow case in 16 bit saturation blending.
As seen with the second apple of the bottom row of page 1
of:
gs -sDEVICE=psdcmyk16 -r72 -o out%d.psd -dMaxBitmap=2000M
../tests_private/pdf/PDF_1.7_ATS/AIX4G1C3.pdf
base/gxblend.c
2020-02-25 17:10:51 +0000
Julian Smith <jules@op59.net>
293e2b7f6298a6049254d18250d4f82f78ac2978
Fix for bug 702150: make pl_main_run_file_utf8() check for error from s_process_read_buf().
Avoids infinite loop in:
./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null .
pcl/pl/plmain.c
2020-02-25 18:24:55 +0000
Julian Smith <jules@op59.net>
342229c7533310f9a46fbfd7a7dd2eaa976746f0
minor improvements to toolbin/squeeze2text.py.
toolbin/squeeze2text.py
2020-02-26 08:25:13 +0000
Robin Watts <Robin.Watts@artifex.com>
dd0961426d3e1718c17fa226f3c2c06f7eb296ce
CID 354310: Remove pointless unsigned comparison with 0.
base/gxblend.c
2020-02-26 08:11:49 +0000
Chris Liddell <chris.liddell@artifex.com>
fae43bf37f78a2eef5a4418f428c41bdfd8a2738
CID 354291: Add error handling for inability to allocate
Coverity complained about setting dash.pattern = NULL and "Passing "&dash"
to "gstate_copy_dash", which dereferences null "dash.pattern" which is either
wrong, or *very* misleading. We assume that it means that gx_set_dash() *may*
access that pointer.
In truth, this can never happen in these circumstances.
Nevertheless, in gx_set_dash() is we have a NULL mem (allocator) pointer and the
dash pattern pointer is NULL at the point we have to copy into it, then throw
an error.
base/gsline.c
2020-02-25 19:59:03 -0800
Ray Johnston <ray.johnston@artifex.com>
b3a7357594634fbd89a4cbf782d094289628acd6
Fix bug 702139 - clist clipping bug.
When characters are filled as paths, the fill_adjust may be set to 0.
Clip paths are supposed to match fill paths, i.e. the 'any part of pixel'
rule, so we need fill_adjust of 0.5 (not 0). The most foolproof way to fix
this is to set it in the reader when processing 'begin_clip' and restore
it when handling the end_clip.
There are many progressions with this change, but it also exposes some
cases where the change in clipping allows other elements to be seen that
were previously hidden. Those few instances are minor and mostly seem to
occur when page mode differs from clist mode. Examination of some of those
cases shows that the clip path with clist mode now matches page mode and
other elements (e.g. images) differ in extent between page and clist mode.
base/gxclrast.c
2020-02-25 19:39:50 +0000
Robin Watts <Robin.Watts@artifex.com>
ea7aa02cc5c540c3332e0d4e81209a920360d45e
Fix gx_default_copy_alpha_hl_color for 16 bit operation.
The code to write the composite data back to buffers to be sent
to copy_alpha was getting the first byte of each 16 bit pair
wrong in the 16bit data case.
Also, when we 'restart' after skipping a zero byte in the 16bit
case we need to skip 2 bytes per pixel, not one.
This can be seen when running:
gs -r72 -o out%d.psd -sDEVICE=psdcmyk16 -dMaxBitmap=2000M
../tests_private/comparefiles/js.pdf
base/gdevdbit.c
2020-02-25 18:19:07 +0000
Robin Watts <Robin.Watts@artifex.com>
d720180603fcd3853436fb002c6ff9c7fc956b27
Fix psdcmyk16 blending issue.
Use uint32_t rather than int to avoid signedness issues.
Seen in the psdcmyk16 page mode rendering of
tests_private/comparefiles/Bug692766.pdf
(bad colors in 4th rgb circle intersection test).
base/gxblend.c
2020-02-25 15:57:36 +0000
Robin Watts <Robin.Watts@artifex.com>
8f038b63bc2fab4a71191583d36b1894ae3576f5
Fix coverity issues 354292 and 354293.
Don't bother testing an unsigned value for clipping against 0.
base/gxblend.c
2020-02-25 08:58:32 +0000
Chris Liddell <chris.liddell@artifex.com>
ed426e9202e04e7d90194d92daedf9a12610b9f9
Replace 0 with NULL for pointer validation/setting.
Also make validation an explicit comparison with NULL i.e.:
"if (mem != NULL)" rather than "if (mem)".
base/gsline.c
2020-02-24 17:30:54 +0000
Julian Smith <jules@op59.net>
b6fc7f2b05fa3cb7b120b05dbfa68a90da731a30
Add support for multiple squeezes in one run.
E.g. MEMENTO_SQUEEZES=115867-1..+3,119928-1..+3 ...
This is equivalent running multiple times with MEMENTO_FAILAT set to 115866,
115867, 11588, 119927, 119928, 119929.
base/memento.c
2020-02-24 10:38:53 +0000
Julian Smith <jules@op59.net>
cc6f92959507212b83130a24dd40b330e8ca9634
Fix for MEMENTO_FAILAT=119928: only call gs_grestoreall_for_restore() if vmsave->gsave not NULL.
Also fix error cleanup in gs_gsave_for_save(), otherwise this fix breaks
previous fix for MEMENTO_FAILAT=115802.
[Thanks to chrisl for this and various other recent fixes.]
Fixes:
MEMENTO_FAILAT=119928 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
base/gsstate.c
psi/isave.c
2020-02-24 11:21:53 +0000
Julian Smith <jules@op59.net>
c2a030517d269b020c99bcf754cefccb556ad7bd
toolbin/squeeze2text.py: improve log output.
With -p, if there is gap in 'Memory squeezing @ <N>' output (because of calls
to free()), output next <N>.
Also flush log output to avoid looking like we've hung.
toolbin/squeeze2text.py
2020-02-24 21:00:21 -0800
Michael Vrhel <michael.vrhel@artifex.com>
bab28178da29dabd691f7dee11ab5de62e329aa7
Fix issue with fts_14_1416.pdf and psdcmyk16
This was missed in the fix. Affected only 16 bit devices.
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=b1ac0686eea6adcf2db8cabf7858796494b4459d
base/gxblend.c
2020-02-24 20:05:49 +0000
Robin Watts <Robin.Watts@artifex.com>
a2d4a7715f465911f174a8e764ab40b40455dd68
Fix Ink names leaking.
The cause of the leak was a typo in gx_final_DeviceN.
Once this is fixed, we hit a problem where ink names are set
to be a pointer to a static empty string, which can't be
freed. Change to using NULL to mean empty ink name.
base/gscdevn.c
2020-02-24 12:01:43 -0800
Robin Watts <Robin.Watts@artifex.com>
6d678da952f7f4a19fb8b9e12f8cb8013d31f04d
Memento/Valgrind tweak.
Ensure we mark the contents of a block readable before we
look for pointers in it, and don't overrun the end.
base/memento.c
2020-02-24 12:57:28 +0000
Robin Watts <Robin.Watts@artifex.com>
44f00686cbaea612747c336dc201ae3f682cc81b
Squash some unused variable warnings.
base/claptrap-planar.c
base/gp_unifs.c
base/gxclpath.c
gpdl/tifftop.c
2020-02-24 12:14:23 +0000
Robin Watts <Robin.Watts@artifex.com>
26c2173179946ec8f70445f5941a4a20e707af88
pdf14_{fill_stroke_path,clist_fill_stroke_path_pattern_setup} cleanups.
Use a nicer method of breaking const (to avoid warnings). Ensure
that we always put everything back as it was when we leave the
functions, even if we have an error.
Remove needless cleanup code to handle functions that can never
return an error to us returning an error.
base/gdevp14.c
2020-02-24 12:35:30 +0000
Robin Watts <Robin.Watts@artifex.com>
a8839dbb536440bce927c4cb4977643495eee26a
pdf14_clist_fill_stroke_path_pattern_setup overprint fix.
Only enable CompatibleOverprint for the stroke part of stroke/fill
patterns if we are in a subtractive space.
base/gdevp14.c
2020-02-24 11:24:28 +0000
Robin Watts <Robin.Watts@artifex.com>
3e84f1e1b0c52bd55145e35f8ddc0d5b8d1b65c5
Squash some warnings with gs_swapcolors_quick breaking const.
At various places in the code, we call gs_swapcolors_quick where
we only have a const pgs.
Properly, we should copy the pgs to a non-const pgs, and then use
that, but that would be a performance hit.
In all cases, we change the graphics state, then restore it before
exit, so effectively it is const over the entire call of the
enclosing procedure.
Rather than having lots of small hacky casts removing const, we
push the const breakage into gs_swapcolors_quick itself where we
do it in the "approved" way using a union.
base/gdevp14.c
base/gsstate.c
base/gxfill.c
base/gxgstate.h
devices/vector/gdevpdfd.c
2020-02-24 10:10:25 +0000
Robin Watts <Robin.Watts@artifex.com>
b61365607b75d456943f95360bff101c288ba555
Avoid floating point in gxblend.c
Use fixed point in preference.
base/gxblend.c
2020-02-24 08:23:59 +0000
Ken Sharp <ken.sharp@artifex.com>
f8cd087b8a7b8c9b5cf5b8fd4d29e237f6103c7b
Implement OPM tracking in pdfwrite
More than somewhat to my surprise, the release testing of 9.51 revealed
that pdfwrite was not tracking the state of overprint mode (OPM). It
could be set by setdistillerparams, and in no other way.
This commit adds tracking the OPM in the graphics state, removes the
old overprint_mode variable from the device, but preserves the ability
to alter the OPM using setdistillerparms.
This also alters the initial state of OPM, the distiller params
reference states that the 'factory default' of OPM is 1, but the PDF
Reference says that the initial state of OPM is 0. We need to start
with the correct setting of OPM so we change it form 1 to 0
in gs_pdfwr.ps.
In passing, cast a const gs_gstate * to a gs_gstate * when used by
gs_swapcolours_quick, in order to avoid a compiler warning.
This causes a small number of progressions in files using OPM (which is
rare, its even rarer to actually alter it during the course of the file)
Resource/Init/gs_pdfwr.ps
devices/vector/gdevpdfb.h
devices/vector/gdevpdfd.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfx.h
2020-02-20 16:24:12 -0800
Michael Vrhel <michael.vrhel@artifex.com>
b1ac0686eea6adcf2db8cabf7858796494b4459d
Bug 702117 Knockout groups containing non-isolated groups
So this ended up being rather complicated. The first issue was that
we were not setting the backdrop properly for non-isolated groups that
reside in knockout groups. When that was fixed, it was revealed that we
were not doing the recompositing operation for non-isolated knockout groups. This meant
that the backdrop was getting applied twice effectively (once in the original
fill and then again when the group was popped). The only file that showed
this issue was the crazy Altona page with the many overlapping groups. Customer
file added to provide a clearer case in the regression tests.
base/gdevp14.c
base/gxblend.c
base/gxblend1.c
2020-02-20 17:09:41 +0000
Julian Smith <jules@op59.net>
4ac299b11d53cf1d174a8351290918b536aa5859
Fix MEMENTO_FAILAT=115867 - segv in i_unregister_root() after failure in i_register_root().
In pl_main_delete_instance(), don't call gs_unregister_root() if
minst->device_root is NULL.
Also in pl_top_create_device(), check return from
gs_register_struct_root(). But this doesn't appear to make any difference to
the handling of the memento error.
Fixes:
MEMENTO_FAILAT=115867 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
pcl/pl/plmain.c
2020-02-20 16:51:56 +0000
Robin Watts <Robin.Watts@artifex.com>
9022073cb754ace5923c08e81d3b8d0be352abd9
Fix deep color group compose issue.
In commit bb7d57e84e9fe I reordered parameters to keep 8/16
branches consistent, and missed one case.
base/gxblend.c
2020-02-20 15:27:07 +0000
Robin Watts <Robin.Watts@artifex.com>
7c8c6c4ba0df88b5cbc4c0e8dab5f643a133603e
Remove needless "isolated" parameter from pdf14_mark_rect routines.
The value was carefully plumbed through (only in the 8bit case) in
a recent commit, but was never actually used. Remove it a) because
it's pointless passing a variable we don't use, and b) because it's
another difference between 8 and 16 bit versions.
base/gxblend.c
2020-02-20 15:21:30 +0000
Robin Watts <Robin.Watts@artifex.com>
c3c922510f0498d68d7a369f0ffd70379e3d5359
Fix typing mistake in 16bit transparency.
When promoting from 8 to 16 bit, shape and src_alpha become
uint16_ts rather than bytes.
base/gxblend.c
2020-02-20 15:06:38 +0000
Robin Watts <Robin.Watts@artifex.com>
713c776695f7a18cfd326e84fdef0b2911770609
Fix more overprint problems with deep color transparency.
Again, overprint changes to the 8 bit paths had not been
pulled across to the 16 bit path.
base/gxblend.c
2020-02-19 07:10:40 +0000
Julian Smith <jules@op59.net>
075abaaa9ffa03af26bed1a32d3e5114511ee786
Added toolbin/squeeze2text.py, for processing output from MEMENTO_SQUEEZEAT=...
An alternative to squeeze2html.pl, outputing just summary information.
toolbin/squeeze2text.py
2020-02-20 11:18:11 +0000
Julian Smith <jules@op59.net>
fbcf5865f688201fba239c5dde0078e6733538c4
Fix for MEMENTO_FAILAT=115802: make gs_gsave_for_save() call gs_gsave() so it can restore after error.
Previously, zsave() called gs_gsave_for_save() then gs_gsave(), but if
gs_gsave() failed we ended up with SEGV in finalise code.
To allow zsave() to restore things after gs_gsave() failure, we would need to
add an include of base/gxgstate.h.
Instead we remove the call of gs_gsave() from zsave() and append it to
gs_gsave_for_save(), where things can be easily restored if it fails.
[There are no other callers of gs_gsave_for_save().]
Fixes:
MEMENTO_FAILAT=115802 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
base/gsstate.c
psi/zvmem.c
2020-02-18 09:44:51 +0000
Julian Smith <jules@op59.net>
356e24a53c60710ecfee991bb91cd503e3d9873b
Avoid leaks if we get alloc failure when closing down (found by memento).
In gs_main_finit(), ignore gs_error_VMerror from interp_reclaim(). Such error
ultimately comes from gs_vmreclaim() calling context_state_load(), but the
missing info doesn't seem to be required for gs_main_finit() to carry on.
Fixes:
MEMENTO_FAILAT=147801 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
psi/imain.c
2020-02-13 17:40:51 +0000
Robin Watts <Robin.Watts@artifex.com>
e1257c1f03a4b16794d0c2df035b7ed8685a4254
Fix image_color_icc_prep to properly align planar buffers.
base/gxicolor.c
2020-02-13 10:50:10 +0000
Robin Watts <Robin.Watts@artifex.com>
5ee682a20c494e8f1c65a7a95470252df6d9cdf4
Enable CAL for gxicolor halftoning.
Looks like the calling code was unfinished, and the build
changes were not done.
Also, squash some warnings.
base/gxicolor.c
base/gximono.c
base/lib.mak
devices/gdevtsep.c
2020-02-17 15:57:47 +0000
Chris Liddell <chris.liddell@artifex.com>
d26e2d1c628d88263c4d946bdaf2145a438a1416
Ensure the memory entry in a cloned gstate is correct.
In theory, we could end up cloning a graphics state with one allocator, then
assigning the "memory" entry in the cloned state to that of the state we are
cloning.
In practice the two have (so far) been the same, but that is not guaranteed.
base/gsstate.c
2020-02-14 11:08:57 +0000
Chris Liddell <chris.liddell@artifex.com>
1faa24d998afa6ce98279f26514fe14edbd62e8e
Fix segfault cleaning up after gstate clone failure.
For me this happens with MEMENTO_FAILAT=112447 and for Julian it happens with
MEMENTO_FAILAT=115905.
Basically, the order of events was that we'd allocate a new gstate, copy the
contents of the existing gstate to the new one, then copy the dash pattern
(which could fail) and copy the "client_data" (which could and, in this case,
did fail). When either of those failed, we'd jump to the error handling and
exit with the error.
The problem is that, by jumping to the "fail" label, we skip over all the code
that fixes up the reference counts (and various other things) to account for
the newly created gstate.
This commit reorders things so we allocate the gstate, copy the client data,
copy the dash pattern, *then* assign the contents of the old gstate to the new
one, and carry on. Thus, by the time the gstate contents are copied, the
function cannot fail, and everything is sure to be correctly setup.
In the event that either the dash pattern or the client data fail to allocate,
the new gstate is still filled with NULLs, except for the subset of
"gs_gstate_parts" which are allocated and setup correctly so we can safely
free the graphics state object before returning the error.
Also, use NULL for pointer validation instead of 0.
base/gsstate.c
2020-02-18 17:43:18 -0800
Michael Vrhel <michael.vrhel@artifex.com>
f51ae6f4bf85dfa5be4b48a1a46ac69c653500c3
Make sure pattern fills use proper alpha settings
Fix for regression of fts_28_2804.pdf pdfwrite output rendering
with fill-stroke commit. This also fixes the rendering of fts_25_2526.pdf
Bug 702033. Required a minor change in the XPS interpreter to make
sure that patterns did not have their opacity double applied.
base/gdevp14.c
xps/xpstile.c
2020-02-19 17:20:09 +0000
Robin Watts <Robin.Watts@artifex.com>
59806f121beba543de6d78a1b5765919bce9b2cb
Bug 702105: Premature EOF Infinite loop in interpolated imagemask stream.
Fix supplied by Peter Cherepanov. Many thanks.
base/simscale.c
2020-02-19 16:58:06 +0000
Robin Watts <Robin.Watts@artifex.com>
f860dbd9e699fcef50018fbd7cf84565237d78a3
Fix "blue gradients" seen with psdrgb device.
Since the fill/stroke commit went in, some files have been showing
gradients in the wrong colours. For instance this one, spotted in
release testing:
gs -sDEVICE=psdrgb -r72 -dMaxBitmap=2000M -o out%d.psd
../tests_private/comparefiles/Layout.pdf
Bisecting the fill/stroke branch back, it seems the commit that
caused it is the one that stops psdrgb using 'devn' colors.
This causes gradients to drop to using the color_info.comp_bits and
comp_shift information, which the psd devices don't fill in.
The fix here is to make psd_prn_open call the standard function for
setting up these values.
devices/gdevpsd.c
2020-02-13 14:48:05 -0800
Nancy Durgin <nancy.durgin@artifex.com>
ddccae87e67a4ea101f289549e2d1692b0230509
Bug701972 -- fix pdfwrite image downscaling bug
Calculate the bits on the row using the input image width,
not the output image width.
I had to add an extra argument to a few functions to propagate the info
down to where it is needed.
Note obscure case involving calling psdf_setup_image_to_mask_filter()
for a Type 4 image and CompatibilityLevel < 1.3. This change just
adds the extra input_width arg, which doesn't change whatever it was
doing before. If there is a bug lurking here, it seems unlikely
anybody cares?
devices/vector/gdevpdfi.c
devices/vector/gdevpsdf.h
devices/vector/gdevpsdi.c
devices/vector/gdevpsds.c
devices/vector/gdevpsds.h
2020-02-12 09:22:55 -0800
Nancy Durgin <nancy.durgin@artifex.com>
4e2eaa8324ee4428de337ae3c31a695e68ede75b
Set the BitsPerComponent for alt stream in pdfwrite
Add this to the image[1] code where it was missing
This fixes bug where compressed images were correct, but if
-dEncodeGrayImages=false was used, then they were truncated.
This is related to trimmed/rescaled image for Bug701972.
See the sample trim-nobug.pdf attached to that bug.
devices/vector/gdevpdfi.c
2020-02-18 19:25:24 +0000
Robin Watts <Robin.Watts@artifex.com>
76fb18bc255a88cab5fbb2410b411e580f53486d
Bug 702131: Fix overprint in additive spaces.
We should only enter CompatibleOverprint blend mode if we
are in an subtractive space. This stops pdf14 trying to honour
drawn_comps even in additive spaces.
base/gdevp14.c
2020-02-14 14:02:24 -0800
Ray Johnston <ray.johnston@artifex.com>
f1b16fe2d0c6f23923fd26d03544030bc285365a
Fix bug 702079: SEGV with clist and PCL caused by wrong color in images.
The clist_image_plane_data function was called with the dev_color for a band
being type <pattern> when the image had type <pure>, but the code was not
calling cmd_put_drawing_color to update the bands for the image because uses_color
was false. Add rop3_uses_S(pgs0>log_op) as well as (||) rop3_uses_T(pgs->log_op)
when CombineWitColor is true.
Note that extra calls to cmd_put_drawing_color before an image are low cost
and do nothing if the current device color is already the same.
base/gxclimag.c
2020-02-18 09:48:07 -0800
Michael Vrhel <michael.vrhel@artifex.com>
646007af056447fefd61eabfcdae85bfd6017d24
Bug 702128 : clist pdf14 overprint state
This change ensures that gxdso_overprint_active
gets the proper state information.
When the clist writer is active with the pdf14 device, the writer maintains
the current overprint state (as the writer has no access to the pdf14 member variables)
and must know what to put in the clist.
When the clist writer is not present (i.e. page mode), the pdf14 device
maintains the information.
base/gdevp14.c
2020-02-18 11:46:45 +0000
Robin Watts <Robin.Watts@artifex.com>
6ace930c11984e64aded98f1ff8db47104424354
Bug 702068 continued: Fix smasked images with masks.
Release testing has shown up another case that needs help.
gs/bin -sDEVICE=ppmraw -o out.ppm -r300 -dMaxBitmap=1G
tests_private/pdf/sumatra/1901_-_tiling_inconsistencies.pdf
This shows horizontal white lines in the "Next" "Up" "Previous"
images at the top of the page.
Investigation shows this is due to the images having Masks as well
as SMasks.
The Mask image is run to a 1 bit memory device, which means that
the gxdso to check if we are in an SMask doesn't work. We work
around this by introducing a new flag to gs_pixel_image_common
that we can set to indicate that we are within an smask. We set
this when we set the masked image up (using the gxdso), and check
it when we come to do the gridfitting.
base/gsiparam.h
base/gxclrast.c
base/gximage.c
base/gximage3.c
base/gxipixel.c
2020-02-17 19:31:50 +0000
Robin Watts <Robin.Watts@artifex.com>
bb7d57e84e9fe615832b2d5811f4c9cd4d443cd1
Sync deep colour blending with recent changes to 8 bit blending.
Release testing reveals problems with deep color blending and
overprint. This is because changes were made to the 8bit
branches of gxblend.c that weren't fully reflected in the
16bit branches.
Reapply those changes here.
While we're at it, address some other minor code cleanups,
including keeping the ordering of parameters the same between 8
and 16 bit to avoid confusion in future.
The command that showed the inital problem was:
bin/gswin32c.exe -o out.psd -sDEVICE=psdcmyk16 tests_private/comparefiles/Bug695916.pdf
where the image of the Earth did not appear.
base/gxblend.c
2020-02-17 13:27:10 +0000
Robin Watts <Robin.Watts@artifex.com>
e51ba18f031c4b5f6a14c0a559391fe30f409dd1
Bug 702130: Fix JPEG memory failure problems.
The SEGV reported by Memento squeezing (which oddly is at 113600
for me, rather than Julian's higher number) is caused by jpeglib
calling 'mem_term' on something that failed to 'mem_init'.
The fix is to use gs_memory_chunk_unwrap rather than target/release,
and to check whether mem == cmem to see whether that actually did
unwrap.
This runs us into a further problem, where we are freeing the
custom memory descriptor using a gc memory pointer, where it was
allocated using a non gc one.
Rather than just changing the free to use the non gc one, we take
the opportunity to ensure that ALL the blocks are in non gc memory.
JPEGlib will take poorly to its memory being gc'd away, and none
of it needs to subject to gc.
Credit goes largely to Chris for this fix.
base/sjpegc.c
2020-02-14 18:44:53 +0000
Robin Watts <Robin.Watts@artifex.com>
55a7a41998f35ae23aedf2fdb83698dde1453d58
Bug 702124 (continued): Avoid FP errors leading to empty pattern cells.
The limited accuracy of floats can cause pattern cells to appear to
be empty when they are not.
Avoid adding the (often large) tx and ty components in until after we
have calculated the width/heights.
base/gsptype1.c
2020-02-14 18:43:00 +0000
Robin Watts <Robin.Watts@artifex.com>
182d5c10ed11570dd08e6203d832e06a73853f17
Bug 702124: Avoid VMerror when a pattern cell height is 0.
We detect buffer_height == 0 and take it to mean that we can't
get a large enough buffer for even a single scanline. Actually
it can mean that the pattern cell was empty, which gives a
spurious error.
base/gxmclip.c
2020-02-14 17:08:12 +0000
Julian Smith <jules@op59.net>
f5b7acb59c4f2e88591aab9f355813e0b7b68db5
Fix segv after memento squeeze in psdf_DCT_filter().
Fixes:
MEMENTO_FAILAT=117152 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
devices/vector/gdevpsdu.c
2020-02-13 14:54:42 +0000
Julian Smith <jules@op59.net>
9fd069e5c91126e78b51625c72d884615370098c
Fixed double free after alloc failure in gs_lib_ctx_set_icc_directory*() (found by memento).
After we've freed p_ctx->profiledir we need to set it to NULL otherwise if we
return an error it will be freed a second time when we close down.
Fixes:
MEMENTO_FAILAT=101810 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
base/gslibctx.c
2020-02-12 11:12:37 +0000
Julian Smith <jules@op59.net>
d86e9d8251e142ab9aae9f50923414c0c18bf1d3
Fixed leak on error in gs_fapi_ufst_init() (found by memento).
Fixes:
MEMENTO_FAILAT=22 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
base/fapiufst.c
2020-02-13 19:48:01 +0000
Robin Watts <Robin.Watts@artifex.com>
d7d68f45bfc227f7c7a6fdd5f8ef078bbf7ca77f
Bug 702121: PCL performance degradation
Henry chased the cause down to commit b399f84, an attempt to
fix Bug 700624. Looking at that code now, it has a silly typo
in it, that was causing it not be triggered in cases when it
should have been. Fixed here.
base/gxpcmap.c
2020-02-13 11:11:40 -0800
Robin Watts <Robin.Watts@artifex.com>
b58e9010ce17bce450e4c042b93bafc460b9d94a
Alternative fix for leaks after error in gs_main_init_with_args01()
When memory squeezing gpdl, Julian found leaks in the gpdl
startup of the postscript interpreter when allocations failed
in gs_main_init_with_args01().
Here, we fix the problem by making the psitop.c layer within gpdl
call the appropriate shutdown code when we catch the error. This
moves gpdl to being consistent with other users of the gs_main
layer.
Memento memory squeezing around the point of failure (event 2035)
now shows this to be OK.
MEMENTO_SQUEEZEAT=2034 ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
gpdl/psitop.c
2020-02-13 18:47:37 +0000
Robin Watts <Robin.Watts@artifex.com>
5fc8e7c0b656d4e2be8f5e316121f06039c35273
Revert "Fix leaks after error in gs_main_init_with_args01() (found by memento)."
This reverts commit f35924926cb35f08be5a12ded4a00eb2f42aed3e.
When memory squeezing gpdl, Julian found leaks in the gpdl
startup of the postscript interpreter when allocations failed
in gs_main_init_with_args01().
The initial fix attempted was to make gs_main_init_with_args01()
closedown the interpreter on such errors. This worked for the
tested cases, but hid problems with non-memory related errors
(such as not being able to open a file specified on the command
line) when called by gs (rather than gpdl).
The change attempted resulted in gs_main_finit() being called
twice as gs (and other users of the gs_main APIs) expect to have
to call gs_main_finit() to shut down after gs_main_init_with_args01()
returns an error code.
The real problem is that gpdl is not doing this in the same way as
other callers.
The gs_main layer has existed for donkeys years, so it's probably
best that we just take it as fixed and don't require callers to
start changing stuff now.
Accordingly, I am reverting the attempted fix here, and will
try a different fix for it that only affects gpdl shortly.
psi/imainarg.c
2020-02-13 16:48:21 -0800
Michael Vrhel <michael.vrhel@artifex.com>
cd5f21df6c710664ff0ba3f100ca5283d9367ed8
Bug 702116 Avoid NULL dereference
In certain cases if the source color space is separation or deviceN
and we are doing image interpolation with the use of fast color option
there was a potential dereference of a NULL pointer since the color
space will not have an ICC profile.
base/gxiscale.c
2020-02-11 16:48:24 -0800
Ray Johnston <ray.johnston@artifex.com>
1f6b351a5048b5a14d52431c833da6ed3386a7bf
Change to improve memory and speed (Bug 702099)
As described in the bug, the patch to disable high-level images in
pattern-clists when Interpolate is true is no longer needed (hasn't
been since 2015), and it causes the memory and performance problems
with this type of file.
base/gxclimag.c
2020-02-12 15:10:54 -0800
Michael Vrhel <michael.vrhel@artifex.com>
c5883877d1dc7abbd7600eb688f7cf4ad34db0cc
Bug 702114 non-isolated group in knockout group
Make sure to use the parents backdrop as our backdrop when we
push a non-isolated group that resides in a knockout group.
Note though that this apparently is not the case if we are
constructing a soft mask.
base/gdevp14.c
2020-02-12 10:54:47 -0800
Michael Vrhel <michael.vrhel@artifex.com>
06a08fca00194531df25652b46eca8f8e4dfd7cc
Bug 702113 Softmask with transfer function
In a couple spots we look at the value of the background value
of the softmask to decide if we really need the softmask in
areas outside the group bounding box. These checks were not
considering the impact of the transfer function.
base/gdevp14.c
2020-02-12 10:22:32 +0000
Chris Liddell <chris.liddell@artifex.com>
6fc5cbc5bc57ae2c47d1276f1ea0c0f16017b4bb
Bump version number pending 9.51 release
Resource/Init/gs_init.ps
base/gscdefs.h
base/version.mak
2020-03-19 08:14:27 +0000
Chris Liddell <chris.liddell@artifex.com>
e49830f8efdbc3a9f4e8acaf708b68a742f515aa
Version, dates etc for 9.52 release
Resource/Init/gs_init.ps
base/version.mak
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Internal.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
2020-03-17 15:54:28 +0000
Chris Liddell <chris.liddell@artifex.com>
0cade062486c0ae9c883970dea1c555a8ffcff84
Release notes for 9.52 release
doc/History9.htm
doc/News.htm
doc/Use.htm
2020-03-17 15:52:20 +0000
Chris Liddell <chris.liddell@artifex.com>
c76b5f64e0525e4ddf9e5c311a1b75fe738298dc
Add references to the 64 bit windows exes
doc/Use.htm
2020-03-14 15:07:37 +0000
Chris Liddell <chris.liddell@artifex.com>
eec073529fb8dc0c3bb6d612b61bf483d135c9cf
Bug 702217: Reinstate dynamic libs LDFLAGS for MacOS
With the significant revamp of the platform detection functions in configure
the LDFLAGS for building the gs shared library on MacOS went astray. This
puts them back in.
configure.ac
2020-03-16 09:06:16 +0000
Ken Sharp <ken.sharp@artifex.com>
a9cd9959372b9f14b493b87df57664ea831c5d80
Repair device subclassing after fill+stroke commit
Bug 702221 "Ghostscript 9.51 - SIGFPE when -dFirstPage or -dLastPage is set"
The fill+stroke commit had an error with the default method for handling
fill_stroke_path which passed the subclassing device as a parameter to
the child, instead of passing the child device. This caused seg faults,
floating point exceptions, hangs, and possibly other problems.
In addition the object filtering device had been modified to pass the
fill+stroke method to the default handler, instead of checking to see
if vector operations should be dropped.
This commit fixes both problems.
base/gdevoflt.c
base/gdevsclass.c
2020-03-14 10:56:43 +0000
Chris Liddell <chris.liddell@artifex.com>
f712440a2f251ae06277ec4a5ffe8ce7599aa4d8
Add ARCH_MAX_SIZE_T to configure's arch.h prototype
arch/arch_autoconf.h.in
2020-03-14 10:53:15 +0000
Chris Liddell <chris.liddell@artifex.com>
214d16924543fb3116a031463052e8b0eff3f1ae
Don't fail on missing freetype for auxtools run
When cross compiling, we shouldn't fail the recursive call to configure if
there's no freetype - since it's not required for auxtools.
configure.ac
2020-03-12 11:49:11 +0000
Chris Liddell <chris.liddell@artifex.com>
b02467bd535d50d221e4f7c371867603f5368f36
Dates, changelog etc for 9.51 release
base/gscdefs.h
base/version.mak
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Internal.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
2020-03-02 17:10:43 +0000
Robin Watts <Robin.Watts@artifex.com>
15f5f8bad503e9d3e63db9c3ca395deffd6b1e20
Fix 16bit blending problem.
Seen with:
gs -sDEVICE=psdcmyk16 -o out%d.psd -r72 -dMaxBitmap=2000M
tests_private/pdf/forms/v1.5/proxy_vol_1_number_1_1.pdf
on page 3.
base/gxblend.c
2020-03-02 11:16:51 +0000
Chris Liddell <chris.liddell@artifex.com>
d5809b79052b20c723700cce75e7e1543a3ddc23
Dates/logs for 9.51 release candidate 3
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Internal.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
2020-03-02 11:04:32 +0000
Robin Watts <Robin.Watts@artifex.com>
f6e3e9238bb5cf7fe44c3c845be286a3314ed905
Fix 64bit non-console windows build.
The creation of the text window was truncating the pointer to
long (32bit) size. No idea how we've been getting away with this
in the past. I can only assume this has been exposed by
differences in the runtime lib with vs2019 as compared to
earlier versions.
psi/dwtext.c
2020-03-02 09:02:51 +0000
Chris Liddell <chris.liddell@artifex.com>
ffe0e5cf33feee7672e5f4281f0c0b0ff66bddda
Add mention of deprecating/removing opvp/oprp devices
doc/History9.htm
doc/News.htm
2020-02-28 08:30:36 +0000
Chris Liddell <chris.liddell@artifex.com>
a1478a72a3ccb8564c2b1c5c87d3dbe23a5ffff2
Dates, changelog etc for 9.51rc2
base/gscdefs.h
base/version.mak
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Internal.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
2020-02-26 15:22:04 +0000
Robin Watts <Robin.Watts@artifex.com>
dbaddcf6e251229a1506f2df33844365df39de44
Fix signed issue in 16bit alpha blending fill_rectangle routines.
As seen by the central spot in the pink region of page 1 of:
gs -sDEVICE=psdcmyk16 -o out%d.psd -dMaxBitmap=2000M
tests_private/pdf/pdf_1.7_ATS_EXXPA1DC_PDFACT.pdf
base/gxblend.c
2020-02-26 15:09:35 +0000
Ken Sharp <ken.sharp@artifex.com>
4ad8020c3cb63345dd76119e8978c3353940a68e
pdfwrite - Fix indeterminism with QL shading tests
When creating a new colour space to put in a PDF file we perform various
tests to see if its a space we have already written, to prevent writing
duplicate spaces (we perform similar tests for most resources).
In some cases, when we write the resource to a file, we create an MD5
hash and compare those to see if the resources are the same. In the
case of colour spaces, however, they are retained in memory and so we
use a different method. We 'serialise' the colour space. This is not the
same as writing it to the PDF file, and its a graphics library thing not
a pdfwrite function. Basically this writes out the content of the
various C structures. The stream we use is an in-memory stream.
Unfortunately, for Separation colour spaces, there was a fault in the
function which writes the colour space name, and it was writing out
the bytes forming the address of the name instead of the actual string.
This could, very rarely, mean that we would mis-identify a new colour
space as being the same as an old colour space, and so would reuse the
old space instead of creating a new one.
I've checked the DeviceN code and it does not suffer the same problem.
base/gscsepr.c
2020-02-26 13:03:56 +0000
Robin Watts <Robin.Watts@artifex.com>
3cb8b3a403450d617b2b96ec0349bb99ce0d8379
Fix the overflow case in 16 bit saturation blending.
As seen with the second apple of the bottom row of page 1
of:
gs -sDEVICE=psdcmyk16 -r72 -o out%d.psd -dMaxBitmap=2000M
../tests_private/pdf/PDF_1.7_ATS/AIX4G1C3.pdf
base/gxblend.c
2020-02-25 17:10:51 +0000
Julian Smith <jules@op59.net>
5d4305e916d3f75492d03dfd79ab1aaedf9545e3
Fix for bug 702150: make pl_main_run_file_utf8() check for error from s_process_read_buf().
Avoids infinite loop in:
./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null .
pcl/pl/plmain.c
2020-02-25 18:24:55 +0000
Julian Smith <jules@op59.net>
2c6efee0f594ad29394bf8a303f21d85dcb1d70a
minor improvements to toolbin/squeeze2text.py.
toolbin/squeeze2text.py
2020-02-26 08:25:13 +0000
Robin Watts <Robin.Watts@artifex.com>
ef5dfe7e3b3858bdfb20c168b4818c4d65fb932f
CID 354310: Remove pointless unsigned comparison with 0.
base/gxblend.c
2020-02-26 08:11:49 +0000
Chris Liddell <chris.liddell@artifex.com>
29335f43967a0f089d6f2f37883a22f1516f7bde
CID 354291: Add error handling for inability to allocate
Coverity complained about setting dash.pattern = NULL and "Passing "&dash"
to "gstate_copy_dash", which dereferences null "dash.pattern" which is either
wrong, or *very* misleading. We assume that it means that gx_set_dash() *may*
access that pointer.
In truth, this can never happen in these circumstances.
Nevertheless, in gx_set_dash() is we have a NULL mem (allocator) pointer and the
dash pattern pointer is NULL at the point we have to copy into it, then throw
an error.
base/gsline.c
2020-02-25 19:59:03 -0800
Ray Johnston <ray.johnston@artifex.com>
1d0889b9fcf3a5d5012fad021b4c53828879016e
Fix bug 702139 - clist clipping bug.
When characters are filled as paths, the fill_adjust may be set to 0.
Clip paths are supposed to match fill paths, i.e. the 'any part of pixel'
rule, so we need fill_adjust of 0.5 (not 0). The most foolproof way to fix
this is to set it in the reader when processing 'begin_clip' and restore
it when handling the end_clip.
There are many progressions with this change, but it also exposes some
cases where the change in clipping allows other elements to be seen that
were previously hidden. Those few instances are minor and mostly seem to
occur when page mode differs from clist mode. Examination of some of those
cases shows that the clip path with clist mode now matches page mode and
other elements (e.g. images) differ in extent between page and clist mode.
base/gxclrast.c
2020-02-25 19:39:50 +0000
Robin Watts <Robin.Watts@artifex.com>
86f81e9b799b66207c699768616a6e3ba3c311c3
Fix gx_default_copy_alpha_hl_color for 16 bit operation.
The code to write the composite data back to buffers to be sent
to copy_alpha was getting the first byte of each 16 bit pair
wrong in the 16bit data case.
Also, when we 'restart' after skipping a zero byte in the 16bit
case we need to skip 2 bytes per pixel, not one.
This can be seen when running:
gs -r72 -o out%d.psd -sDEVICE=psdcmyk16 -dMaxBitmap=2000M
../tests_private/comparefiles/js.pdf
base/gdevdbit.c
2020-02-25 18:19:07 +0000
Robin Watts <Robin.Watts@artifex.com>
635303ca7d8a36b3dabc9afbd9132f4b9a36dce5
Fix psdcmyk16 blending issue.
Use uint32_t rather than int to avoid signedness issues.
Seen in the psdcmyk16 page mode rendering of
tests_private/comparefiles/Bug692766.pdf
(bad colors in 4th rgb circle intersection test).
base/gxblend.c
2020-02-25 15:57:36 +0000
Robin Watts <Robin.Watts@artifex.com>
a00c75369e082798d82202a2b64d8e4b484d0c11
Fix coverity issues 354292 and 354293.
Don't bother testing an unsigned value for clipping against 0.
base/gxblend.c
2020-02-25 08:58:32 +0000
Chris Liddell <chris.liddell@artifex.com>
32f3d6703a7e5c6582c066837783c6697e98b1ca
Replace 0 with NULL for pointer validation/setting.
Also make validation an explicit comparison with NULL i.e.:
"if (mem != NULL)" rather than "if (mem)".
base/gsline.c
2020-02-24 17:30:54 +0000
Julian Smith <jules@op59.net>
6c1002cc251907e702fd5db9dc81365a964816c6
Add support for multiple squeezes in one run.
E.g. MEMENTO_SQUEEZES=115867-1..+3,119928-1..+3 ...
This is equivalent running multiple times with MEMENTO_FAILAT set to 115866,
115867, 11588, 119927, 119928, 119929.
base/memento.c
2020-02-24 10:38:53 +0000
Julian Smith <jules@op59.net>
39557bd53eee75a8b8f762457ce57a5437e79d6c
Fix for MEMENTO_FAILAT=119928: only call gs_grestoreall_for_restore() if vmsave->gsave not NULL.
Also fix error cleanup in gs_gsave_for_save(), otherwise this fix breaks
previous fix for MEMENTO_FAILAT=115802.
[Thanks to chrisl for this and various other recent fixes.]
Fixes:
MEMENTO_FAILAT=119928 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
base/gsstate.c
psi/isave.c
2020-02-24 11:21:53 +0000
Julian Smith <jules@op59.net>
60507d492507817bb5ae14a17a01d19c50d41e0a
toolbin/squeeze2text.py: improve log output.
With -p, if there is gap in 'Memory squeezing @ <N>' output (because of calls
to free()), output next <N>.
Also flush log output to avoid looking like we've hung.
toolbin/squeeze2text.py
2020-02-24 21:00:21 -0800
Michael Vrhel <michael.vrhel@artifex.com>
3a9ea36465e97ce729c5ab26dc8e0d1435b7b246
Fix issue with fts_14_1416.pdf and psdcmyk16
This was missed in the fix. Affected only 16 bit devices.
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=b1ac0686eea6adcf2db8cabf7858796494b4459d
base/gxblend.c
2020-02-24 20:05:49 +0000
Robin Watts <Robin.Watts@artifex.com>
8f3320f9b6214907d24a4a9f77638b199aa95f8e
Fix Ink names leaking.
The cause of the leak was a typo in gx_final_DeviceN.
Once this is fixed, we hit a problem where ink names are set
to be a pointer to a static empty string, which can't be
freed. Change to using NULL to mean empty ink name.
base/gscdevn.c
2020-02-24 12:01:43 -0800
Robin Watts <Robin.Watts@artifex.com>
b28d57e7422d2d4df8c805342ad01dfc6c6e1232
Memento/Valgrind tweak.
Ensure we mark the contents of a block readable before we
look for pointers in it, and don't overrun the end.
base/memento.c
2020-02-24 12:57:28 +0000
Robin Watts <Robin.Watts@artifex.com>
0822ac2a5f1f02315a783504fccf615a55cf494f
Squash some unused variable warnings.
base/claptrap-planar.c
base/gp_unifs.c
base/gxclpath.c
gpdl/tifftop.c
2020-02-24 12:14:23 +0000
Robin Watts <Robin.Watts@artifex.com>
82a2d6356858c0a4ab9ff7fa294c0380d04aa9e3
pdf14_{fill_stroke_path,clist_fill_stroke_path_pattern_setup} cleanups.
Use a nicer method of breaking const (to avoid warnings). Ensure
that we always put everything back as it was when we leave the
functions, even if we have an error.
Remove needless cleanup code to handle functions that can never
return an error to us returning an error.
base/gdevp14.c
2020-02-24 12:35:30 +0000
Robin Watts <Robin.Watts@artifex.com>
b1ff23ccf08707af544de59d6c59971d0c17098c
pdf14_clist_fill_stroke_path_pattern_setup overprint fix.
Only enable CompatibleOverprint for the stroke part of stroke/fill
patterns if we are in a subtractive space.
base/gdevp14.c
2020-02-24 11:24:28 +0000
Robin Watts <Robin.Watts@artifex.com>
389324fd827e1172eb358b616a32af5fcb2633f6
Squash some warnings with gs_swapcolors_quick breaking const.
At various places in the code, we call gs_swapcolors_quick where
we only have a const pgs.
Properly, we should copy the pgs to a non-const pgs, and then use
that, but that would be a performance hit.
In all cases, we change the graphics state, then restore it before
exit, so effectively it is const over the entire call of the
enclosing procedure.
Rather than having lots of small hacky casts removing const, we
push the const breakage into gs_swapcolors_quick itself where we
do it in the "approved" way using a union.
base/gdevp14.c
base/gsstate.c
base/gxfill.c
base/gxgstate.h
devices/vector/gdevpdfd.c
2020-02-24 10:10:25 +0000
Robin Watts <Robin.Watts@artifex.com>
449433ff6689c603a56186dbde5721f6139aa939
Avoid floating point in gxblend.c
Use fixed point in preference.
base/gxblend.c
2020-02-24 08:23:59 +0000
Ken Sharp <ken.sharp@artifex.com>
6badfb362efe0fb4f0c3df106a33ecd5b0265ef7
Implement OPM tracking in pdfwrite
More than somewhat to my surprise, the release testing of 9.51 revealed
that pdfwrite was not tracking the state of overprint mode (OPM). It
could be set by setdistillerparams, and in no other way.
This commit adds tracking the OPM in the graphics state, removes the
old overprint_mode variable from the device, but preserves the ability
to alter the OPM using setdistillerparms.
This also alters the initial state of OPM, the distiller params
reference states that the 'factory default' of OPM is 1, but the PDF
Reference says that the initial state of OPM is 0. We need to start
with the correct setting of OPM so we change it form 1 to 0
in gs_pdfwr.ps.
In passing, cast a const gs_gstate * to a gs_gstate * when used by
gs_swapcolours_quick, in order to avoid a compiler warning.
This causes a small number of progressions in files using OPM (which is
rare, its even rarer to actually alter it during the course of the file)
Resource/Init/gs_pdfwr.ps
devices/vector/gdevpdfb.h
devices/vector/gdevpdfd.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfx.h
2020-02-20 16:24:12 -0800
Michael Vrhel <michael.vrhel@artifex.com>
3dc65600d6d4eb060398f06f148cfe4f07a82439
Bug 702117 Knockout groups containing non-isolated groups
So this ended up being rather complicated. The first issue was that
we were not setting the backdrop properly for non-isolated groups that
reside in knockout groups. When that was fixed, it was revealed that we
were not doing the recompositing operation for non-isolated knockout groups. This meant
that the backdrop was getting applied twice effectively (once in the original
fill and then again when the group was popped). The only file that showed
this issue was the crazy Altona page with the many overlapping groups. Customer
file added to provide a clearer case in the regression tests.
base/gdevp14.c
base/gxblend.c
base/gxblend1.c
2020-02-20 17:09:41 +0000
Julian Smith <jules@op59.net>
416baca7c4bcf0b1794b7b1647250bf09adaee9d
Fix MEMENTO_FAILAT=115867 - segv in i_unregister_root() after failure in i_register_root().
In pl_main_delete_instance(), don't call gs_unregister_root() if
minst->device_root is NULL.
Also in pl_top_create_device(), check return from
gs_register_struct_root(). But this doesn't appear to make any difference to
the handling of the memento error.
Fixes:
MEMENTO_FAILAT=115867 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
pcl/pl/plmain.c
2020-02-20 16:51:56 +0000
Robin Watts <Robin.Watts@artifex.com>
4eb54af16c69ef36371291bd43f853865adea1eb
Fix deep color group compose issue.
In commit bb7d57e84e9fe I reordered parameters to keep 8/16
branches consistent, and missed one case.
base/gxblend.c
2020-02-20 15:27:07 +0000
Robin Watts <Robin.Watts@artifex.com>
a2276988137021618bb3ca440aba50e126160bcd
Remove needless "isolated" parameter from pdf14_mark_rect routines.
The value was carefully plumbed through (only in the 8bit case) in
a recent commit, but was never actually used. Remove it a) because
it's pointless passing a variable we don't use, and b) because it's
another difference between 8 and 16 bit versions.
base/gxblend.c
2020-02-20 15:21:30 +0000
Robin Watts <Robin.Watts@artifex.com>
9ddcae93fe1629e81d36b17b7fec9de787b411cc
Fix typing mistake in 16bit transparency.
When promoting from 8 to 16 bit, shape and src_alpha become
uint16_ts rather than bytes.
base/gxblend.c
2020-02-20 15:06:38 +0000
Robin Watts <Robin.Watts@artifex.com>
7de8fe5a49df0f9154fa707a934e39c012c3cc2a
Fix more overprint problems with deep color transparency.
Again, overprint changes to the 8 bit paths had not been
pulled across to the 16 bit path.
base/gxblend.c
2020-02-19 07:10:40 +0000
Julian Smith <jules@op59.net>
2d3f8c01231d52a5595e2727b31b8044188a5af8
Added toolbin/squeeze2text.py, for processing output from MEMENTO_SQUEEZEAT=...
An alternative to squeeze2html.pl, outputing just summary information.
toolbin/squeeze2text.py
2020-02-20 11:18:11 +0000
Julian Smith <jules@op59.net>
777d79315e0094bef83d241bc0d5683ea6775a55
Fix for MEMENTO_FAILAT=115802: make gs_gsave_for_save() call gs_gsave() so it can restore after error.
Previously, zsave() called gs_gsave_for_save() then gs_gsave(), but if
gs_gsave() failed we ended up with SEGV in finalise code.
To allow zsave() to restore things after gs_gsave() failure, we would need to
add an include of base/gxgstate.h.
Instead we remove the call of gs_gsave() from zsave() and append it to
gs_gsave_for_save(), where things can be easily restored if it fails.
[There are no other callers of gs_gsave_for_save().]
Fixes:
MEMENTO_FAILAT=115802 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
base/gsstate.c
psi/zvmem.c
2020-02-18 09:44:51 +0000
Julian Smith <jules@op59.net>
6db4560f1e31bb92321894e0d008d310aa600097
Avoid leaks if we get alloc failure when closing down (found by memento).
In gs_main_finit(), ignore gs_error_VMerror from interp_reclaim(). Such error
ultimately comes from gs_vmreclaim() calling context_state_load(), but the
missing info doesn't seem to be required for gs_main_finit() to carry on.
Fixes:
MEMENTO_FAILAT=147801 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
psi/imain.c
2020-02-13 17:40:51 +0000
Robin Watts <Robin.Watts@artifex.com>
eb726fb4d2597cfcd4986dd9c105cf1ab71d09e3
Fix image_color_icc_prep to properly align planar buffers.
base/gxicolor.c
2020-02-13 10:50:10 +0000
Robin Watts <Robin.Watts@artifex.com>
e01371e00caa8f5d08ef150a6f594c93ca495be2
Enable CAL for gxicolor halftoning.
Looks like the calling code was unfinished, and the build
changes were not done.
Also, squash some warnings.
base/gxicolor.c
base/gximono.c
base/lib.mak
devices/gdevtsep.c
2020-02-17 15:57:47 +0000
Chris Liddell <chris.liddell@artifex.com>
c4e7cddc4d053f2850e697696e2498180547961a
Ensure the memory entry in a cloned gstate is correct.
In theory, we could end up cloning a graphics state with one allocator, then
assigning the "memory" entry in the cloned state to that of the state we are
cloning.
In practice the two have (so far) been the same, but that is not guaranteed.
base/gsstate.c
2020-02-14 11:08:57 +0000
Chris Liddell <chris.liddell@artifex.com>
239e70cd02491bab1cce9092c07c959427358646
Fix segfault cleaning up after gstate clone failure.
For me this happens with MEMENTO_FAILAT=112447 and for Julian it happens with
MEMENTO_FAILAT=115905.
Basically, the order of events was that we'd allocate a new gstate, copy the
contents of the existing gstate to the new one, then copy the dash pattern
(which could fail) and copy the "client_data" (which could and, in this case,
did fail). When either of those failed, we'd jump to the error handling and
exit with the error.
The problem is that, by jumping to the "fail" label, we skip over all the code
that fixes up the reference counts (and various other things) to account for
the newly created gstate.
This commit reorders things so we allocate the gstate, copy the client data,
copy the dash pattern, *then* assign the contents of the old gstate to the new
one, and carry on. Thus, by the time the gstate contents are copied, the
function cannot fail, and everything is sure to be correctly setup.
In the event that either the dash pattern or the client data fail to allocate,
the new gstate is still filled with NULLs, except for the subset of
"gs_gstate_parts" which are allocated and setup correctly so we can safely
free the graphics state object before returning the error.
Also, use NULL for pointer validation instead of 0.
base/gsstate.c
2020-02-18 17:43:18 -0800
Michael Vrhel <michael.vrhel@artifex.com>
db5b51109ddee39b17b2ff2c2ac12f41a70785ef
Make sure pattern fills use proper alpha settings
Fix for regression of fts_28_2804.pdf pdfwrite output rendering
with fill-stroke commit. This also fixes the rendering of fts_25_2526.pdf
Bug 702033. Required a minor change in the XPS interpreter to make
sure that patterns did not have their opacity double applied.
base/gdevp14.c
xps/xpstile.c
2020-02-19 17:20:09 +0000
Robin Watts <Robin.Watts@artifex.com>
cddd44e1bfcdaba1c289c3d83645613d136e5e3e
Bug 702105: Premature EOF Infinite loop in interpolated imagemask stream.
Fix supplied by Peter Cherepanov. Many thanks.
base/simscale.c
2020-02-19 16:58:06 +0000
Robin Watts <Robin.Watts@artifex.com>
59089ab66b3faaa683bb3aeb0bf856b7aa284f9b
Fix "blue gradients" seen with psdrgb device.
Since the fill/stroke commit went in, some files have been showing
gradients in the wrong colours. For instance this one, spotted in
release testing:
gs -sDEVICE=psdrgb -r72 -dMaxBitmap=2000M -o out%d.psd
../tests_private/comparefiles/Layout.pdf
Bisecting the fill/stroke branch back, it seems the commit that
caused it is the one that stops psdrgb using 'devn' colors.
This causes gradients to drop to using the color_info.comp_bits and
comp_shift information, which the psd devices don't fill in.
The fix here is to make psd_prn_open call the standard function for
setting up these values.
devices/gdevpsd.c
2020-02-13 14:48:05 -0800
Nancy Durgin <nancy.durgin@artifex.com>
25cd0c72b98f9efc6968254d1e3a2f33ec376369
Bug701972 -- fix pdfwrite image downscaling bug
Calculate the bits on the row using the input image width,
not the output image width.
I had to add an extra argument to a few functions to propagate the info
down to where it is needed.
Note obscure case involving calling psdf_setup_image_to_mask_filter()
for a Type 4 image and CompatibilityLevel < 1.3. This change just
adds the extra input_width arg, which doesn't change whatever it was
doing before. If there is a bug lurking here, it seems unlikely
anybody cares?
devices/vector/gdevpdfi.c
devices/vector/gdevpsdf.h
devices/vector/gdevpsdi.c
devices/vector/gdevpsds.c
devices/vector/gdevpsds.h
2020-02-12 09:22:55 -0800
Nancy Durgin <nancy.durgin@artifex.com>
e9523603ac713e365702b81c228edcaaac667dc4
Set the BitsPerComponent for alt stream in pdfwrite
Add this to the image[1] code where it was missing
This fixes bug where compressed images were correct, but if
-dEncodeGrayImages=false was used, then they were truncated.
This is related to trimmed/rescaled image for Bug701972.
See the sample trim-nobug.pdf attached to that bug.
devices/vector/gdevpdfi.c
2020-02-18 19:25:24 +0000
Robin Watts <Robin.Watts@artifex.com>
924f7ea07c7773a3b1510c6206c9a34227e4b39e
Bug 702131: Fix overprint in additive spaces.
We should only enter CompatibleOverprint blend mode if we
are in an subtractive space. This stops pdf14 trying to honour
drawn_comps even in additive spaces.
base/gdevp14.c
2020-02-14 14:02:24 -0800
Ray Johnston <ray.johnston@artifex.com>
d98b553c829fad94cd4338910468d2b1b6ee64f7
Fix bug 702079: SEGV with clist and PCL caused by wrong color in images.
The clist_image_plane_data function was called with the dev_color for a band
being type <pattern> when the image had type <pure>, but the code was not
calling cmd_put_drawing_color to update the bands for the image because uses_color
was false. Add rop3_uses_S(pgs0>log_op) as well as (||) rop3_uses_T(pgs->log_op)
when CombineWitColor is true.
Note that extra calls to cmd_put_drawing_color before an image are low cost
and do nothing if the current device color is already the same.
base/gxclimag.c
2020-02-18 09:48:07 -0800
Michael Vrhel <michael.vrhel@artifex.com>
4f55464d5c1640075a67a8b50557a48766783e08
Bug 702128 : clist pdf14 overprint state
This change ensures that gxdso_overprint_active
gets the proper state information.
When the clist writer is active with the pdf14 device, the writer maintains
the current overprint state (as the writer has no access to the pdf14 member variables)
and must know what to put in the clist.
When the clist writer is not present (i.e. page mode), the pdf14 device
maintains the information.
base/gdevp14.c
2020-02-18 11:46:45 +0000
Robin Watts <Robin.Watts@artifex.com>
f1887408860910c19c980f05fd0f8fc93b5f06a1
Bug 702068 continued: Fix smasked images with masks.
Release testing has shown up another case that needs help.
gs/bin -sDEVICE=ppmraw -o out.ppm -r300 -dMaxBitmap=1G
tests_private/pdf/sumatra/1901_-_tiling_inconsistencies.pdf
This shows horizontal white lines in the "Next" "Up" "Previous"
images at the top of the page.
Investigation shows this is due to the images having Masks as well
as SMasks.
The Mask image is run to a 1 bit memory device, which means that
the gxdso to check if we are in an SMask doesn't work. We work
around this by introducing a new flag to gs_pixel_image_common
that we can set to indicate that we are within an smask. We set
this when we set the masked image up (using the gxdso), and check
it when we come to do the gridfitting.
base/gsiparam.h
base/gxclrast.c
base/gximage.c
base/gximage3.c
base/gxipixel.c
2020-02-17 19:31:50 +0000
Robin Watts <Robin.Watts@artifex.com>
51a0be1a6ac3bae2dc1b8bcdd91f58f76b9132c9
Sync deep colour blending with recent changes to 8 bit blending.
Release testing reveals problems with deep color blending and
overprint. This is because changes were made to the 8bit
branches of gxblend.c that weren't fully reflected in the
16bit branches.
Reapply those changes here.
While we're at it, address some other minor code cleanups,
including keeping the ordering of parameters the same between 8
and 16 bit to avoid confusion in future.
The command that showed the inital problem was:
bin/gswin32c.exe -o out.psd -sDEVICE=psdcmyk16 tests_private/comparefiles/Bug695916.pdf
where the image of the Earth did not appear.
base/gxblend.c
2020-02-17 13:27:10 +0000
Robin Watts <Robin.Watts@artifex.com>
b7faa941d09db8856378e45d4f5c81b5f93e5f90
Bug 702130: Fix JPEG memory failure problems.
The SEGV reported by Memento squeezing (which oddly is at 113600
for me, rather than Julian's higher number) is caused by jpeglib
calling 'mem_term' on something that failed to 'mem_init'.
The fix is to use gs_memory_chunk_unwrap rather than target/release,
and to check whether mem == cmem to see whether that actually did
unwrap.
This runs us into a further problem, where we are freeing the
custom memory descriptor using a gc memory pointer, where it was
allocated using a non gc one.
Rather than just changing the free to use the non gc one, we take
the opportunity to ensure that ALL the blocks are in non gc memory.
JPEGlib will take poorly to its memory being gc'd away, and none
of it needs to subject to gc.
Credit goes largely to Chris for this fix.
base/sjpegc.c
2020-02-14 18:44:53 +0000
Robin Watts <Robin.Watts@artifex.com>
619c0231952c20cc14f0eaf603e0cb01aa937eff
Bug 702124 (continued): Avoid FP errors leading to empty pattern cells.
The limited accuracy of floats can cause pattern cells to appear to
be empty when they are not.
Avoid adding the (often large) tx and ty components in until after we
have calculated the width/heights.
base/gsptype1.c
2020-02-14 18:43:00 +0000
Robin Watts <Robin.Watts@artifex.com>
8edb1b1e7bb84ff4598819fe078eb0ed2c4948d5
Bug 702124: Avoid VMerror when a pattern cell height is 0.
We detect buffer_height == 0 and take it to mean that we can't
get a large enough buffer for even a single scanline. Actually
it can mean that the pattern cell was empty, which gives a
spurious error.
base/gxmclip.c
2020-02-14 17:08:12 +0000
Julian Smith <jules@op59.net>
6beaf42d25f3969b6dc3d8e1b1795017708000c5
Fix segv after memento squeeze in psdf_DCT_filter().
Fixes:
MEMENTO_FAILAT=117152 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
devices/vector/gdevpsdu.c
2020-02-13 14:54:42 +0000
Julian Smith <jules@op59.net>
8d052b3de78b8034daed23e668758c76a8d8c478
Fixed double free after alloc failure in gs_lib_ctx_set_icc_directory*() (found by memento).
After we've freed p_ctx->profiledir we need to set it to NULL otherwise if we
return an error it will be freed a second time when we close down.
Fixes:
MEMENTO_FAILAT=101810 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
base/gslibctx.c
2020-02-12 11:12:37 +0000
Julian Smith <jules@op59.net>
dbde03ca37da96a94f4b7a6f0ba22a47a7bc2cb1
Fixed leak on error in gs_fapi_ufst_init() (found by memento).
Fixes:
MEMENTO_FAILAT=22 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
base/fapiufst.c
2020-02-13 19:48:01 +0000
Robin Watts <Robin.Watts@artifex.com>
08695f8ccebb0d25eb2a5933ecee92281eefc1be
Bug 702121: PCL performance degradation
Henry chased the cause down to commit b399f84, an attempt to
fix Bug 700624. Looking at that code now, it has a silly typo
in it, that was causing it not be triggered in cases when it
should have been. Fixed here.
base/gxpcmap.c
2020-02-13 11:11:40 -0800
Robin Watts <Robin.Watts@artifex.com>
e2cdef26db058e84c2cf4dff5f638e669f961b52
Alternative fix for leaks after error in gs_main_init_with_args01()
When memory squeezing gpdl, Julian found leaks in the gpdl
startup of the postscript interpreter when allocations failed
in gs_main_init_with_args01().
Here, we fix the problem by making the psitop.c layer within gpdl
call the appropriate shutdown code when we catch the error. This
moves gpdl to being consistent with other users of the gs_main
layer.
Memento memory squeezing around the point of failure (event 2035)
now shows this to be OK.
MEMENTO_SQUEEZEAT=2034 ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
gpdl/psitop.c
2020-02-13 18:47:37 +0000
Robin Watts <Robin.Watts@artifex.com>
bbecd13cc34f3dcdcedd726e7de12c988da9794a
Revert "Fix leaks after error in gs_main_init_with_args01() (found by memento)."
This reverts commit f35924926cb35f08be5a12ded4a00eb2f42aed3e.
When memory squeezing gpdl, Julian found leaks in the gpdl
startup of the postscript interpreter when allocations failed
in gs_main_init_with_args01().
The initial fix attempted was to make gs_main_init_with_args01()
closedown the interpreter on such errors. This worked for the
tested cases, but hid problems with non-memory related errors
(such as not being able to open a file specified on the command
line) when called by gs (rather than gpdl).
The change attempted resulted in gs_main_finit() being called
twice as gs (and other users of the gs_main APIs) expect to have
to call gs_main_finit() to shut down after gs_main_init_with_args01()
returns an error code.
The real problem is that gpdl is not doing this in the same way as
other callers.
The gs_main layer has existed for donkeys years, so it's probably
best that we just take it as fixed and don't require callers to
start changing stuff now.
Accordingly, I am reverting the attempted fix here, and will
try a different fix for it that only affects gpdl shortly.
psi/imainarg.c
2020-02-11 16:48:24 -0800
Ray Johnston <ray.johnston@artifex.com>
68be233f36feb045e442a18c4f4e4d2ced52b197
Change to improve memory and speed (Bug 702099)
As described in the bug, the patch to disable high-level images in
pattern-clists when Interpolate is true is no longer needed (hasn't
been since 2015), and it causes the memory and performance problems
with this type of file.
base/gxclimag.c
2020-02-12 15:10:54 -0800
Michael Vrhel <michael.vrhel@artifex.com>
2dea734a6184668511758fe1929a1d3166df85b6
Bug 702114 non-isolated group in knockout group
Make sure to use the parents backdrop as our backdrop when we
push a non-isolated group that resides in a knockout group.
Note though that this apparently is not the case if we are
constructing a soft mask.
base/gdevp14.c
2020-02-12 10:54:47 -0800
Michael Vrhel <michael.vrhel@artifex.com>
9af467b71198710bc42509e00b730a716b8e4828
Bug 702113 Softmask with transfer function
In a couple spots we look at the value of the background value
of the softmask to decide if we really need the softmask in
areas outside the group bounding box. These checks were not
considering the impact of the transfer function.
base/gdevp14.c
2020-02-12 11:37:33 +0000
Chris Liddell <chris.liddell@artifex.com>
b6d36e3205a8b065014b3965cb3c8269408309ca
Dates etc for 9.51 RC1
Plus prelim changelog
Makefile.in
base/gscdefs.h
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Internal.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
psi/winint.mak
Version 9.52 (2020-03-19)
Highlights in this release include:
-
The 9.52 release replaces the 9.51 release, after a problem was reported with 9.51 which warranted the quick turnaround. Thus, like 9.51, 9.52 is primarily a maintenance release, consolidating the changes we introduced in 9.50.
-
We have continued our work on code hygiene for this release, with a focus on the static analysis tool Coverity (from Synopsys, Inc) and we have now adopted a policy of maintaining zero Coverity issues in the Ghostscript/GhostPDL source base.
-
IMPORTANT: In consultation with a representative of (OpenPrinting) it is our intention to deprecate and, in the not distant future, remove the OpenPrinting Vector/Raster Printer Drivers (that is, the
opvp
andoprp
devices).If you rely on either of these devices, please get in touch with us, so we can discuss your use case, and revise our plans accordingly.
-
IMPORTANT: We have forked LittleCMS2 into LittleCMS2mt (the "mt" indicating "multi-thread"). LCMS2 is not thread safe, and cannot be made thread safe without breaking the ABI. Our fork will be thread safe, and include performance enhancements (these changes have all be been offered and rejected upstream). We will maintain compatibility between Ghostscript and LCMS2 for a time, but not in perpetuity. If there is sufficient interest, our fork will be available as its own package separately from Ghostscript (and MuPDF).
-
The usual round of bug fixes, compatibility changes, and incremental improvements.
For a list of open issues, or to report problems, please visit bugs.ghostscript.com.
Incompatible changes
Included below are incompatible changes from recent releases (the specific release in question listed in parentheses). We include these, for now, as we are aware that not everyone upgrades with every release.
-
(9.52) As of 9.52, the Windows binaries released by the Ghostscript development team are built with Microsoft Visual Studio 2019. As a result Microsoft Windows XP and earlier are no longer supported by these binaries. This does not imply we are, or will start relying upon features only available in VS2019, so the
nmake
Makefiles will continue to allow older Visual Studio versions (back to VS2005) to build Ghostscript. -
(9.52)
-dALLOWPSTRANSPARENCY
: The transparency compositor (and related features), whilst we are improving it, remains sensitive to being driven correctly, and incorrect use can have unexpected/undefined results. Hence, as part of improving security we limited access to these operators, originally using the-dSAFER
feature. As we made "SAFER" the default mode, that became unacceptable, hence the new option-dALLOWPSTRANSPARENCY
which enables access to the operators. -
(9.50) There are a couple of subtle incompatibilities between the old and new SAFER implementations. Firstly, as mentioned in the 9.50 release notes, SAFER now leaves standard Postcript functionality unchanged (except for the file access limitations). Secondly, the interaction with
save
/restore
operations, see SAFER.Important Note for Windows Users:
The file/path pattern matching is case sensitive, even on Windows. This is a change in behaviour compared to the old code which, on Windows, was case insensitive. This is in recognition of changes in Windows behaviour, in that it now supports (although does not enforce) case sensitivity. -
(9.27) The process of "tidying" the Postscript name space should have removed only non-standard and undocumented operators. Nevertheless, it is possible that any integrations or utilities that rely on those non-standard and undocumented operators may stop working, or may change behaviour.
If you encounter such a case, please contact us (either the #ghostscript IRC channel, or the gs-devel mailing list would be best), and we'll work with you to either find an alternative solution or return the previous functionality, if there is genuinely no other option.
One case we know this has occurred is GSView 5 (and earlier). GSView 5 support for PDF files relied upon internal use only features which are no longer available. GSView 5 will still work as previously for Postscript files. For PDF files, users are encouraged to look at MuPDF.
Changelog
2020-03-14 15:07:37 +0000
Chris Liddell <chris.liddell@artifex.com>
eec073529fb8dc0c3bb6d612b61bf483d135c9cf
Bug 702217: Reinstate dynamic libs LDFLAGS for MacOS
With the significant revamp of the platform detection functions in configure
the LDFLAGS for building the gs shared library on MacOS went astray. This
puts them back in.
configure.ac
2020-03-16 09:06:16 +0000
Ken Sharp <ken.sharp@artifex.com>
a9cd9959372b9f14b493b87df57664ea831c5d80
Repair device subclassing after fill+stroke commit
Bug 702221 "Ghostscript 9.51 - SIGFPE when -dFirstPage or -dLastPage is set"
The fill+stroke commit had an error with the default method for handling
fill_stroke_path which passed the subclassing device as a parameter to
the child, instead of passing the child device. This caused seg faults,
floating point exceptions, hangs, and possibly other problems.
In addition the object filtering device had been modified to pass the
fill+stroke method to the default handler, instead of checking to see
if vector operations should be dropped.
This commit fixes both problems.
base/gdevoflt.c
base/gdevsclass.c
2020-03-14 10:56:43 +0000
Chris Liddell <chris.liddell@artifex.com>
f712440a2f251ae06277ec4a5ffe8ce7599aa4d8
Add ARCH_MAX_SIZE_T to configure's arch.h prototype
arch/arch_autoconf.h.in
2020-03-14 10:53:15 +0000
Chris Liddell <chris.liddell@artifex.com>
214d16924543fb3116a031463052e8b0eff3f1ae
Don't fail on missing freetype for auxtools run
When cross compiling, we shouldn't fail the recursive call to configure if
there's no freetype - since it's not required for auxtools.
configure.ac
2020-03-02 17:10:43 +0000
Robin Watts <Robin.Watts@artifex.com>
15f5f8bad503e9d3e63db9c3ca395deffd6b1e20
Fix 16bit blending problem.
Seen with:
gs -sDEVICE=psdcmyk16 -o out%d.psd -r72 -dMaxBitmap=2000M
tests_private/pdf/forms/v1.5/proxy_vol_1_number_1_1.pdf
on page 3.
base/gxblend.c
2020-03-02 11:04:32 +0000
Robin Watts <Robin.Watts@artifex.com>
f6e3e9238bb5cf7fe44c3c845be286a3314ed905
Fix 64bit non-console windows build.
The creation of the text window was truncating the pointer to
long (32bit) size. No idea how we've been getting away with this
in the past. I can only assume this has been exposed by
differences in the runtime lib with vs2019 as compared to
earlier versions.
psi/dwtext.c
2020-03-02 09:02:51 +0000
Chris Liddell <chris.liddell@artifex.com>
ffe0e5cf33feee7672e5f4281f0c0b0ff66bddda
Add mention of deprecating/removing opvp/oprp devices
doc/History9.htm
doc/News.htm
2020-02-26 15:22:04 +0000
Robin Watts <Robin.Watts@artifex.com>
dbaddcf6e251229a1506f2df33844365df39de44
Fix signed issue in 16bit alpha blending fill_rectangle routines.
As seen by the central spot in the pink region of page 1 of:
gs -sDEVICE=psdcmyk16 -o out%d.psd -dMaxBitmap=2000M
tests_private/pdf/pdf_1.7_ATS_EXXPA1DC_PDFACT.pdf
base/gxblend.c
2020-02-26 15:09:35 +0000
Ken Sharp <ken.sharp@artifex.com>
4ad8020c3cb63345dd76119e8978c3353940a68e
pdfwrite - Fix indeterminism with QL shading tests
When creating a new colour space to put in a PDF file we perform various
tests to see if its a space we have already written, to prevent writing
duplicate spaces (we perform similar tests for most resources).
In some cases, when we write the resource to a file, we create an MD5
hash and compare those to see if the resources are the same. In the
case of colour spaces, however, they are retained in memory and so we
use a different method. We 'serialise' the colour space. This is not the
same as writing it to the PDF file, and its a graphics library thing not
a pdfwrite function. Basically this writes out the content of the
various C structures. The stream we use is an in-memory stream.
Unfortunately, for Separation colour spaces, there was a fault in the
function which writes the colour space name, and it was writing out
the bytes forming the address of the name instead of the actual string.
This could, very rarely, mean that we would mis-identify a new colour
space as being the same as an old colour space, and so would reuse the
old space instead of creating a new one.
I've checked the DeviceN code and it does not suffer the same problem.
base/gscsepr.c
2020-02-26 13:03:56 +0000
Robin Watts <Robin.Watts@artifex.com>
3cb8b3a403450d617b2b96ec0349bb99ce0d8379
Fix the overflow case in 16 bit saturation blending.
As seen with the second apple of the bottom row of page 1
of:
gs -sDEVICE=psdcmyk16 -r72 -o out%d.psd -dMaxBitmap=2000M
../tests_private/pdf/PDF_1.7_ATS/AIX4G1C3.pdf
base/gxblend.c
2020-02-25 17:10:51 +0000
Julian Smith <jules@op59.net>
5d4305e916d3f75492d03dfd79ab1aaedf9545e3
Fix for bug 702150: make pl_main_run_file_utf8() check for error from s_process_read_buf().
Avoids infinite loop in:
./membin/gpcl6 -sDEVICE=ppmraw -o /dev/null .
pcl/pl/plmain.c
2020-02-25 18:24:55 +0000
Julian Smith <jules@op59.net>
2c6efee0f594ad29394bf8a303f21d85dcb1d70a
minor improvements to toolbin/squeeze2text.py.
toolbin/squeeze2text.py
2020-02-26 08:25:13 +0000
Robin Watts <Robin.Watts@artifex.com>
ef5dfe7e3b3858bdfb20c168b4818c4d65fb932f
CID 354310: Remove pointless unsigned comparison with 0.
base/gxblend.c
2020-02-26 08:11:49 +0000
Chris Liddell <chris.liddell@artifex.com>
29335f43967a0f089d6f2f37883a22f1516f7bde
CID 354291: Add error handling for inability to allocate
Coverity complained about setting dash.pattern = NULL and "Passing "&dash"
to "gstate_copy_dash", which dereferences null "dash.pattern" which is either
wrong, or *very* misleading. We assume that it means that gx_set_dash() *may*
access that pointer.
In truth, this can never happen in these circumstances.
Nevertheless, in gx_set_dash() is we have a NULL mem (allocator) pointer and the
dash pattern pointer is NULL at the point we have to copy into it, then throw
an error.
base/gsline.c
2020-02-25 19:59:03 -0800
Ray Johnston <ray.johnston@artifex.com>
1d0889b9fcf3a5d5012fad021b4c53828879016e
Fix bug 702139 - clist clipping bug.
When characters are filled as paths, the fill_adjust may be set to 0.
Clip paths are supposed to match fill paths, i.e. the 'any part of pixel'
rule, so we need fill_adjust of 0.5 (not 0). The most foolproof way to fix
this is to set it in the reader when processing 'begin_clip' and restore
it when handling the end_clip.
There are many progressions with this change, but it also exposes some
cases where the change in clipping allows other elements to be seen that
were previously hidden. Those few instances are minor and mostly seem to
occur when page mode differs from clist mode. Examination of some of those
cases shows that the clip path with clist mode now matches page mode and
other elements (e.g. images) differ in extent between page and clist mode.
base/gxclrast.c
2020-02-25 19:39:50 +0000
Robin Watts <Robin.Watts@artifex.com>
86f81e9b799b66207c699768616a6e3ba3c311c3
Fix gx_default_copy_alpha_hl_color for 16 bit operation.
The code to write the composite data back to buffers to be sent
to copy_alpha was getting the first byte of each 16 bit pair
wrong in the 16bit data case.
Also, when we 'restart' after skipping a zero byte in the 16bit
case we need to skip 2 bytes per pixel, not one.
This can be seen when running:
gs -r72 -o out%d.psd -sDEVICE=psdcmyk16 -dMaxBitmap=2000M
../tests_private/comparefiles/js.pdf
base/gdevdbit.c
2020-02-25 18:19:07 +0000
Robin Watts <Robin.Watts@artifex.com>
635303ca7d8a36b3dabc9afbd9132f4b9a36dce5
Fix psdcmyk16 blending issue.
Use uint32_t rather than int to avoid signedness issues.
Seen in the psdcmyk16 page mode rendering of
tests_private/comparefiles/Bug692766.pdf
(bad colors in 4th rgb circle intersection test).
base/gxblend.c
2020-02-25 15:57:36 +0000
Robin Watts <Robin.Watts@artifex.com>
a00c75369e082798d82202a2b64d8e4b484d0c11
Fix coverity issues 354292 and 354293.
Don't bother testing an unsigned value for clipping against 0.
base/gxblend.c
2020-02-25 08:58:32 +0000
Chris Liddell <chris.liddell@artifex.com>
32f3d6703a7e5c6582c066837783c6697e98b1ca
Replace 0 with NULL for pointer validation/setting.
Also make validation an explicit comparison with NULL i.e.:
"if (mem != NULL)" rather than "if (mem)".
base/gsline.c
2020-02-24 17:30:54 +0000
Julian Smith <jules@op59.net>
6c1002cc251907e702fd5db9dc81365a964816c6
Add support for multiple squeezes in one run.
E.g. MEMENTO_SQUEEZES=115867-1..+3,119928-1..+3 ...
This is equivalent running multiple times with MEMENTO_FAILAT set to 115866,
115867, 11588, 119927, 119928, 119929.
base/memento.c
2020-02-24 10:38:53 +0000
Julian Smith <jules@op59.net>
39557bd53eee75a8b8f762457ce57a5437e79d6c
Fix for MEMENTO_FAILAT=119928: only call gs_grestoreall_for_restore() if vmsave->gsave not NULL.
Also fix error cleanup in gs_gsave_for_save(), otherwise this fix breaks
previous fix for MEMENTO_FAILAT=115802.
[Thanks to chrisl for this and various other recent fixes.]
Fixes:
MEMENTO_FAILAT=119928 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
base/gsstate.c
psi/isave.c
2020-02-24 11:21:53 +0000
Julian Smith <jules@op59.net>
60507d492507817bb5ae14a17a01d19c50d41e0a
toolbin/squeeze2text.py: improve log output.
With -p, if there is gap in 'Memory squeezing @ <N>' output (because of calls
to free()), output next <N>.
Also flush log output to avoid looking like we've hung.
toolbin/squeeze2text.py
2020-02-24 21:00:21 -0800
Michael Vrhel <michael.vrhel@artifex.com>
3a9ea36465e97ce729c5ab26dc8e0d1435b7b246
Fix issue with fts_14_1416.pdf and psdcmyk16
This was missed in the fix. Affected only 16 bit devices.
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=b1ac0686eea6adcf2db8cabf7858796494b4459d
base/gxblend.c
2020-02-24 20:05:49 +0000
Robin Watts <Robin.Watts@artifex.com>
8f3320f9b6214907d24a4a9f77638b199aa95f8e
Fix Ink names leaking.
The cause of the leak was a typo in gx_final_DeviceN.
Once this is fixed, we hit a problem where ink names are set
to be a pointer to a static empty string, which can't be
freed. Change to using NULL to mean empty ink name.
base/gscdevn.c
2020-02-24 12:01:43 -0800
Robin Watts <Robin.Watts@artifex.com>
b28d57e7422d2d4df8c805342ad01dfc6c6e1232
Memento/Valgrind tweak.
Ensure we mark the contents of a block readable before we
look for pointers in it, and don't overrun the end.
base/memento.c
2020-02-24 12:57:28 +0000
Robin Watts <Robin.Watts@artifex.com>
0822ac2a5f1f02315a783504fccf615a55cf494f
Squash some unused variable warnings.
base/claptrap-planar.c
base/gp_unifs.c
base/gxclpath.c
gpdl/tifftop.c
2020-02-24 12:14:23 +0000
Robin Watts <Robin.Watts@artifex.com>
82a2d6356858c0a4ab9ff7fa294c0380d04aa9e3
pdf14_{fill_stroke_path,clist_fill_stroke_path_pattern_setup} cleanups.
Use a nicer method of breaking const (to avoid warnings). Ensure
that we always put everything back as it was when we leave the
functions, even if we have an error.
Remove needless cleanup code to handle functions that can never
return an error to us returning an error.
base/gdevp14.c
2020-02-24 12:35:30 +0000
Robin Watts <Robin.Watts@artifex.com>
b1ff23ccf08707af544de59d6c59971d0c17098c
pdf14_clist_fill_stroke_path_pattern_setup overprint fix.
Only enable CompatibleOverprint for the stroke part of stroke/fill
patterns if we are in a subtractive space.
base/gdevp14.c
2020-02-24 11:24:28 +0000
Robin Watts <Robin.Watts@artifex.com>
389324fd827e1172eb358b616a32af5fcb2633f6
Squash some warnings with gs_swapcolors_quick breaking const.
At various places in the code, we call gs_swapcolors_quick where
we only have a const pgs.
Properly, we should copy the pgs to a non-const pgs, and then use
that, but that would be a performance hit.
In all cases, we change the graphics state, then restore it before
exit, so effectively it is const over the entire call of the
enclosing procedure.
Rather than having lots of small hacky casts removing const, we
push the const breakage into gs_swapcolors_quick itself where we
do it in the "approved" way using a union.
base/gdevp14.c
base/gsstate.c
base/gxfill.c
base/gxgstate.h
devices/vector/gdevpdfd.c
2020-02-24 10:10:25 +0000
Robin Watts <Robin.Watts@artifex.com>
449433ff6689c603a56186dbde5721f6139aa939
Avoid floating point in gxblend.c
Use fixed point in preference.
base/gxblend.c
2020-02-24 08:23:59 +0000
Ken Sharp <ken.sharp@artifex.com>
6badfb362efe0fb4f0c3df106a33ecd5b0265ef7
Implement OPM tracking in pdfwrite
More than somewhat to my surprise, the release testing of 9.51 revealed
that pdfwrite was not tracking the state of overprint mode (OPM). It
could be set by setdistillerparams, and in no other way.
This commit adds tracking the OPM in the graphics state, removes the
old overprint_mode variable from the device, but preserves the ability
to alter the OPM using setdistillerparms.
This also alters the initial state of OPM, the distiller params
reference states that the 'factory default' of OPM is 1, but the PDF
Reference says that the initial state of OPM is 0. We need to start
with the correct setting of OPM so we change it form 1 to 0
in gs_pdfwr.ps.
In passing, cast a const gs_gstate * to a gs_gstate * when used by
gs_swapcolours_quick, in order to avoid a compiler warning.
This causes a small number of progressions in files using OPM (which is
rare, its even rarer to actually alter it during the course of the file)
Resource/Init/gs_pdfwr.ps
devices/vector/gdevpdfb.h
devices/vector/gdevpdfd.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfx.h
2020-02-20 16:24:12 -0800
Michael Vrhel <michael.vrhel@artifex.com>
3dc65600d6d4eb060398f06f148cfe4f07a82439
Bug 702117 Knockout groups containing non-isolated groups
So this ended up being rather complicated. The first issue was that
we were not setting the backdrop properly for non-isolated groups that
reside in knockout groups. When that was fixed, it was revealed that we
were not doing the recompositing operation for non-isolated knockout groups. This meant
that the backdrop was getting applied twice effectively (once in the original
fill and then again when the group was popped). The only file that showed
this issue was the crazy Altona page with the many overlapping groups. Customer
file added to provide a clearer case in the regression tests.
base/gdevp14.c
base/gxblend.c
base/gxblend1.c
2020-02-20 17:09:41 +0000
Julian Smith <jules@op59.net>
416baca7c4bcf0b1794b7b1647250bf09adaee9d
Fix MEMENTO_FAILAT=115867 - segv in i_unregister_root() after failure in i_register_root().
In pl_main_delete_instance(), don't call gs_unregister_root() if
minst->device_root is NULL.
Also in pl_top_create_device(), check return from
gs_register_struct_root(). But this doesn't appear to make any difference to
the handling of the memento error.
Fixes:
MEMENTO_FAILAT=115867 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
pcl/pl/plmain.c
2020-02-20 16:51:56 +0000
Robin Watts <Robin.Watts@artifex.com>
4eb54af16c69ef36371291bd43f853865adea1eb
Fix deep color group compose issue.
In commit bb7d57e84e9fe I reordered parameters to keep 8/16
branches consistent, and missed one case.
base/gxblend.c
2020-02-20 15:27:07 +0000
Robin Watts <Robin.Watts@artifex.com>
a2276988137021618bb3ca440aba50e126160bcd
Remove needless "isolated" parameter from pdf14_mark_rect routines.
The value was carefully plumbed through (only in the 8bit case) in
a recent commit, but was never actually used. Remove it a) because
it's pointless passing a variable we don't use, and b) because it's
another difference between 8 and 16 bit versions.
base/gxblend.c
2020-02-20 15:21:30 +0000
Robin Watts <Robin.Watts@artifex.com>
9ddcae93fe1629e81d36b17b7fec9de787b411cc
Fix typing mistake in 16bit transparency.
When promoting from 8 to 16 bit, shape and src_alpha become
uint16_ts rather than bytes.
base/gxblend.c
2020-02-20 15:06:38 +0000
Robin Watts <Robin.Watts@artifex.com>
7de8fe5a49df0f9154fa707a934e39c012c3cc2a
Fix more overprint problems with deep color transparency.
Again, overprint changes to the 8 bit paths had not been
pulled across to the 16 bit path.
base/gxblend.c
2020-02-19 07:10:40 +0000
Julian Smith <jules@op59.net>
2d3f8c01231d52a5595e2727b31b8044188a5af8
Added toolbin/squeeze2text.py, for processing output from MEMENTO_SQUEEZEAT=...
An alternative to squeeze2html.pl, outputing just summary information.
toolbin/squeeze2text.py
2020-02-20 11:18:11 +0000
Julian Smith <jules@op59.net>
777d79315e0094bef83d241bc0d5683ea6775a55
Fix for MEMENTO_FAILAT=115802: make gs_gsave_for_save() call gs_gsave() so it can restore after error.
Previously, zsave() called gs_gsave_for_save() then gs_gsave(), but if
gs_gsave() failed we ended up with SEGV in finalise code.
To allow zsave() to restore things after gs_gsave() failure, we would need to
add an include of base/gxgstate.h.
Instead we remove the call of gs_gsave() from zsave() and append it to
gs_gsave_for_save(), where things can be easily restored if it fails.
[There are no other callers of gs_gsave_for_save().]
Fixes:
MEMENTO_FAILAT=115802 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
base/gsstate.c
psi/zvmem.c
2020-02-18 09:44:51 +0000
Julian Smith <jules@op59.net>
6db4560f1e31bb92321894e0d008d310aa600097
Avoid leaks if we get alloc failure when closing down (found by memento).
In gs_main_finit(), ignore gs_error_VMerror from interp_reclaim(). Such error
ultimately comes from gs_vmreclaim() calling context_state_load(), but the
missing info doesn't seem to be required for gs_main_finit() to carry on.
Fixes:
MEMENTO_FAILAT=147801 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
psi/imain.c
2020-02-13 17:40:51 +0000
Robin Watts <Robin.Watts@artifex.com>
eb726fb4d2597cfcd4986dd9c105cf1ab71d09e3
Fix image_color_icc_prep to properly align planar buffers.
base/gxicolor.c
2020-02-13 10:50:10 +0000
Robin Watts <Robin.Watts@artifex.com>
e01371e00caa8f5d08ef150a6f594c93ca495be2
Enable CAL for gxicolor halftoning.
Looks like the calling code was unfinished, and the build
changes were not done.
Also, squash some warnings.
base/gxicolor.c
base/gximono.c
base/lib.mak
devices/gdevtsep.c
2020-02-17 15:57:47 +0000
Chris Liddell <chris.liddell@artifex.com>
c4e7cddc4d053f2850e697696e2498180547961a
Ensure the memory entry in a cloned gstate is correct.
In theory, we could end up cloning a graphics state with one allocator, then
assigning the "memory" entry in the cloned state to that of the state we are
cloning.
In practice the two have (so far) been the same, but that is not guaranteed.
base/gsstate.c
2020-02-14 11:08:57 +0000
Chris Liddell <chris.liddell@artifex.com>
239e70cd02491bab1cce9092c07c959427358646
Fix segfault cleaning up after gstate clone failure.
For me this happens with MEMENTO_FAILAT=112447 and for Julian it happens with
MEMENTO_FAILAT=115905.
Basically, the order of events was that we'd allocate a new gstate, copy the
contents of the existing gstate to the new one, then copy the dash pattern
(which could fail) and copy the "client_data" (which could and, in this case,
did fail). When either of those failed, we'd jump to the error handling and
exit with the error.
The problem is that, by jumping to the "fail" label, we skip over all the code
that fixes up the reference counts (and various other things) to account for
the newly created gstate.
This commit reorders things so we allocate the gstate, copy the client data,
copy the dash pattern, *then* assign the contents of the old gstate to the new
one, and carry on. Thus, by the time the gstate contents are copied, the
function cannot fail, and everything is sure to be correctly setup.
In the event that either the dash pattern or the client data fail to allocate,
the new gstate is still filled with NULLs, except for the subset of
"gs_gstate_parts" which are allocated and setup correctly so we can safely
free the graphics state object before returning the error.
Also, use NULL for pointer validation instead of 0.
base/gsstate.c
2020-02-18 17:43:18 -0800
Michael Vrhel <michael.vrhel@artifex.com>
db5b51109ddee39b17b2ff2c2ac12f41a70785ef
Make sure pattern fills use proper alpha settings
Fix for regression of fts_28_2804.pdf pdfwrite output rendering
with fill-stroke commit. This also fixes the rendering of fts_25_2526.pdf
Bug 702033. Required a minor change in the XPS interpreter to make
sure that patterns did not have their opacity double applied.
base/gdevp14.c
xps/xpstile.c
2020-02-19 17:20:09 +0000
Robin Watts <Robin.Watts@artifex.com>
cddd44e1bfcdaba1c289c3d83645613d136e5e3e
Bug 702105: Premature EOF Infinite loop in interpolated imagemask stream.
Fix supplied by Peter Cherepanov. Many thanks.
base/simscale.c
2020-02-19 16:58:06 +0000
Robin Watts <Robin.Watts@artifex.com>
59089ab66b3faaa683bb3aeb0bf856b7aa284f9b
Fix "blue gradients" seen with psdrgb device.
Since the fill/stroke commit went in, some files have been showing
gradients in the wrong colours. For instance this one, spotted in
release testing:
gs -sDEVICE=psdrgb -r72 -dMaxBitmap=2000M -o out%d.psd
../tests_private/comparefiles/Layout.pdf
Bisecting the fill/stroke branch back, it seems the commit that
caused it is the one that stops psdrgb using 'devn' colors.
This causes gradients to drop to using the color_info.comp_bits and
comp_shift information, which the psd devices don't fill in.
The fix here is to make psd_prn_open call the standard function for
setting up these values.
devices/gdevpsd.c
2020-02-13 14:48:05 -0800
Nancy Durgin <nancy.durgin@artifex.com>
25cd0c72b98f9efc6968254d1e3a2f33ec376369
Bug701972 -- fix pdfwrite image downscaling bug
Calculate the bits on the row using the input image width,
not the output image width.
I had to add an extra argument to a few functions to propagate the info
down to where it is needed.
Note obscure case involving calling psdf_setup_image_to_mask_filter()
for a Type 4 image and CompatibilityLevel < 1.3. This change just
adds the extra input_width arg, which doesn't change whatever it was
doing before. If there is a bug lurking here, it seems unlikely
anybody cares?
devices/vector/gdevpdfi.c
devices/vector/gdevpsdf.h
devices/vector/gdevpsdi.c
devices/vector/gdevpsds.c
devices/vector/gdevpsds.h
2020-02-12 09:22:55 -0800
Nancy Durgin <nancy.durgin@artifex.com>
e9523603ac713e365702b81c228edcaaac667dc4
Set the BitsPerComponent for alt stream in pdfwrite
Add this to the image[1] code where it was missing
This fixes bug where compressed images were correct, but if
-dEncodeGrayImages=false was used, then they were truncated.
This is related to trimmed/rescaled image for Bug701972.
See the sample trim-nobug.pdf attached to that bug.
devices/vector/gdevpdfi.c
2020-02-18 19:25:24 +0000
Robin Watts <Robin.Watts@artifex.com>
924f7ea07c7773a3b1510c6206c9a34227e4b39e
Bug 702131: Fix overprint in additive spaces.
We should only enter CompatibleOverprint blend mode if we
are in an subtractive space. This stops pdf14 trying to honour
drawn_comps even in additive spaces.
base/gdevp14.c
2020-02-14 14:02:24 -0800
Ray Johnston <ray.johnston@artifex.com>
d98b553c829fad94cd4338910468d2b1b6ee64f7
Fix bug 702079: SEGV with clist and PCL caused by wrong color in images.
The clist_image_plane_data function was called with the dev_color for a band
being type <pattern> when the image had type <pure>, but the code was not
calling cmd_put_drawing_color to update the bands for the image because uses_color
was false. Add rop3_uses_S(pgs0>log_op) as well as (||) rop3_uses_T(pgs->log_op)
when CombineWitColor is true.
Note that extra calls to cmd_put_drawing_color before an image are low cost
and do nothing if the current device color is already the same.
base/gxclimag.c
2020-02-18 09:48:07 -0800
Michael Vrhel <michael.vrhel@artifex.com>
4f55464d5c1640075a67a8b50557a48766783e08
Bug 702128 : clist pdf14 overprint state
This change ensures that gxdso_overprint_active
gets the proper state information.
When the clist writer is active with the pdf14 device, the writer maintains
the current overprint state (as the writer has no access to the pdf14 member variables)
and must know what to put in the clist.
When the clist writer is not present (i.e. page mode), the pdf14 device
maintains the information.
base/gdevp14.c
2020-02-18 11:46:45 +0000
Robin Watts <Robin.Watts@artifex.com>
f1887408860910c19c980f05fd0f8fc93b5f06a1
Bug 702068 continued: Fix smasked images with masks.
Release testing has shown up another case that needs help.
gs/bin -sDEVICE=ppmraw -o out.ppm -r300 -dMaxBitmap=1G
tests_private/pdf/sumatra/1901_-_tiling_inconsistencies.pdf
This shows horizontal white lines in the "Next" "Up" "Previous"
images at the top of the page.
Investigation shows this is due to the images having Masks as well
as SMasks.
The Mask image is run to a 1 bit memory device, which means that
the gxdso to check if we are in an SMask doesn't work. We work
around this by introducing a new flag to gs_pixel_image_common
that we can set to indicate that we are within an smask. We set
this when we set the masked image up (using the gxdso), and check
it when we come to do the gridfitting.
base/gsiparam.h
base/gxclrast.c
base/gximage.c
base/gximage3.c
base/gxipixel.c
2020-02-17 19:31:50 +0000
Robin Watts <Robin.Watts@artifex.com>
51a0be1a6ac3bae2dc1b8bcdd91f58f76b9132c9
Sync deep colour blending with recent changes to 8 bit blending.
Release testing reveals problems with deep color blending and
overprint. This is because changes were made to the 8bit
branches of gxblend.c that weren't fully reflected in the
16bit branches.
Reapply those changes here.
While we're at it, address some other minor code cleanups,
including keeping the ordering of parameters the same between 8
and 16 bit to avoid confusion in future.
The command that showed the inital problem was:
bin/gswin32c.exe -o out.psd -sDEVICE=psdcmyk16 tests_private/comparefiles/Bug695916.pdf
where the image of the Earth did not appear.
base/gxblend.c
2020-02-17 13:27:10 +0000
Robin Watts <Robin.Watts@artifex.com>
b7faa941d09db8856378e45d4f5c81b5f93e5f90
Bug 702130: Fix JPEG memory failure problems.
The SEGV reported by Memento squeezing (which oddly is at 113600
for me, rather than Julian's higher number) is caused by jpeglib
calling 'mem_term' on something that failed to 'mem_init'.
The fix is to use gs_memory_chunk_unwrap rather than target/release,
and to check whether mem == cmem to see whether that actually did
unwrap.
This runs us into a further problem, where we are freeing the
custom memory descriptor using a gc memory pointer, where it was
allocated using a non gc one.
Rather than just changing the free to use the non gc one, we take
the opportunity to ensure that ALL the blocks are in non gc memory.
JPEGlib will take poorly to its memory being gc'd away, and none
of it needs to subject to gc.
Credit goes largely to Chris for this fix.
base/sjpegc.c
2020-02-14 18:44:53 +0000
Robin Watts <Robin.Watts@artifex.com>
619c0231952c20cc14f0eaf603e0cb01aa937eff
Bug 702124 (continued): Avoid FP errors leading to empty pattern cells.
The limited accuracy of floats can cause pattern cells to appear to
be empty when they are not.
Avoid adding the (often large) tx and ty components in until after we
have calculated the width/heights.
base/gsptype1.c
2020-02-14 18:43:00 +0000
Robin Watts <Robin.Watts@artifex.com>
8edb1b1e7bb84ff4598819fe078eb0ed2c4948d5
Bug 702124: Avoid VMerror when a pattern cell height is 0.
We detect buffer_height == 0 and take it to mean that we can't
get a large enough buffer for even a single scanline. Actually
it can mean that the pattern cell was empty, which gives a
spurious error.
base/gxmclip.c
2020-02-14 17:08:12 +0000
Julian Smith <jules@op59.net>
6beaf42d25f3969b6dc3d8e1b1795017708000c5
Fix segv after memento squeeze in psdf_DCT_filter().
Fixes:
MEMENTO_FAILAT=117152 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
devices/vector/gdevpsdu.c
2020-02-13 14:54:42 +0000
Julian Smith <jules@op59.net>
8d052b3de78b8034daed23e668758c76a8d8c478
Fixed double free after alloc failure in gs_lib_ctx_set_icc_directory*() (found by memento).
After we've freed p_ctx->profiledir we need to set it to NULL otherwise if we
return an error it will be freed a second time when we close down.
Fixes:
MEMENTO_FAILAT=101810 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
base/gslibctx.c
2020-02-12 11:12:37 +0000
Julian Smith <jules@op59.net>
dbde03ca37da96a94f4b7a6f0ba22a47a7bc2cb1
Fixed leak on error in gs_fapi_ufst_init() (found by memento).
Fixes:
MEMENTO_FAILAT=22 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
base/fapiufst.c
2020-02-13 19:48:01 +0000
Robin Watts <Robin.Watts@artifex.com>
08695f8ccebb0d25eb2a5933ecee92281eefc1be
Bug 702121: PCL performance degradation
Henry chased the cause down to commit b399f84, an attempt to
fix Bug 700624. Looking at that code now, it has a silly typo
in it, that was causing it not be triggered in cases when it
should have been. Fixed here.
base/gxpcmap.c
2020-02-13 11:11:40 -0800
Robin Watts <Robin.Watts@artifex.com>
e2cdef26db058e84c2cf4dff5f638e669f961b52
Alternative fix for leaks after error in gs_main_init_with_args01()
When memory squeezing gpdl, Julian found leaks in the gpdl
startup of the postscript interpreter when allocations failed
in gs_main_init_with_args01().
Here, we fix the problem by making the psitop.c layer within gpdl
call the appropriate shutdown code when we catch the error. This
moves gpdl to being consistent with other users of the gs_main
layer.
Memento memory squeezing around the point of failure (event 2035)
now shows this to be OK.
MEMENTO_SQUEEZEAT=2034 ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
gpdl/psitop.c
2020-02-13 18:47:37 +0000
Robin Watts <Robin.Watts@artifex.com>
bbecd13cc34f3dcdcedd726e7de12c988da9794a
Revert "Fix leaks after error in gs_main_init_with_args01() (found by memento)."
This reverts commit f35924926cb35f08be5a12ded4a00eb2f42aed3e.
When memory squeezing gpdl, Julian found leaks in the gpdl
startup of the postscript interpreter when allocations failed
in gs_main_init_with_args01().
The initial fix attempted was to make gs_main_init_with_args01()
closedown the interpreter on such errors. This worked for the
tested cases, but hid problems with non-memory related errors
(such as not being able to open a file specified on the command
line) when called by gs (rather than gpdl).
The change attempted resulted in gs_main_finit() being called
twice as gs (and other users of the gs_main APIs) expect to have
to call gs_main_finit() to shut down after gs_main_init_with_args01()
returns an error code.
The real problem is that gpdl is not doing this in the same way as
other callers.
The gs_main layer has existed for donkeys years, so it's probably
best that we just take it as fixed and don't require callers to
start changing stuff now.
Accordingly, I am reverting the attempted fix here, and will
try a different fix for it that only affects gpdl shortly.
psi/imainarg.c
2020-02-11 16:48:24 -0800
Ray Johnston <ray.johnston@artifex.com>
68be233f36feb045e442a18c4f4e4d2ced52b197
Change to improve memory and speed (Bug 702099)
As described in the bug, the patch to disable high-level images in
pattern-clists when Interpolate is true is no longer needed (hasn't
been since 2015), and it causes the memory and performance problems
with this type of file.
base/gxclimag.c
2020-02-12 15:10:54 -0800
Michael Vrhel <michael.vrhel@artifex.com>
2dea734a6184668511758fe1929a1d3166df85b6
Bug 702114 non-isolated group in knockout group
Make sure to use the parents backdrop as our backdrop when we
push a non-isolated group that resides in a knockout group.
Note though that this apparently is not the case if we are
constructing a soft mask.
base/gdevp14.c
2020-02-12 10:54:47 -0800
Michael Vrhel <michael.vrhel@artifex.com>
9af467b71198710bc42509e00b730a716b8e4828
Bug 702113 Softmask with transfer function
In a couple spots we look at the value of the background value
of the softmask to decide if we really need the softmask in
areas outside the group bounding box. These checks were not
considering the impact of the transfer function.
base/gdevp14.c
2020-02-12 11:37:33 +0000
Chris Liddell <chris.liddell@artifex.com>
9557cdc0b00894bc4c2c1fccb1f19c33fd7eb499
Dates etc for 9.51 RC1
Makefile.in
base/gscdefs.h
doc/DLL.htm
doc/Deprecated.htm
doc/Develop.htm
doc/Devices.htm
doc/Drivers.htm
doc/Fonts.htm
doc/History9.htm
doc/Install.htm
doc/Internal.htm
doc/Language.htm
doc/Lib.htm
doc/Make.htm
doc/News.htm
doc/Ps-style.htm
doc/Ps2epsi.htm
doc/Psfiles.htm
doc/Readme.htm
doc/Release.htm
doc/SavedPages.htm
doc/Source.htm
doc/Unix-lpr.htm
doc/Use.htm
doc/VectorDevices.htm
doc/WhatIsGS.htm
doc/gs-vms.hlp
doc/sample_downscale_device.htm
doc/subclass.htm
doc/thirdparty.htm
man/dvipdf.1
man/gs.1
man/gslp.1
man/gsnd.1
man/pdf2dsc.1
man/pdf2ps.1
man/pf2afm.1
man/pfbtopfa.1
man/printafm.1
man/ps2ascii.1
man/ps2epsi.1
man/ps2pdf.1
man/ps2pdfwr.1
man/ps2ps.1
psi/winint.mak
2020-02-11 11:11:47 -0800
Ray Johnston <ray.johnston@artifex.com>
ad317d8d436f3ae282597631464313666451747f
Fix bug 702060: clip_transform_pixel_region was ignoring the 'transpose' flag.
base/gxclip.c
2020-02-12 00:24:25 +0800
Sebastian Rasmussen <sebras@gmail.com>
1c6bfa12cccb726974aa1c3ad5c4887600f7331d
Update jbig2dec stuff for 0.18 release.
jbig2dec/CHANGES
jbig2dec/jbig2.h
jbig2dec/jbig2dec.1
2020-02-12 00:27:41 +0800
Sebastian Rasmussen <sebras@gmail.com>
70f094ae147afdbbcfcff3351f3ec13db6a84c42
jbig2dec: Sync memento from ghostscript.
jbig2dec/memento.c
2020-02-10 16:19:49 +0000
Julian Smith <jules@op59.net>
f35924926cb35f08be5a12ded4a00eb2f42aed3e
Fix leaks after error in gs_main_init_with_args01() (found by memento).
Fixes various memento failures starting with:
MEMENTO_FAILAT=2034 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
psi/imainarg.c
2020-02-10 16:11:31 +0000
Julian Smith <jules@op59.net>
2704441705cb115b352350252480dbb2505d9767
Memento: show backtrace when we start failing.
base/memento.c
2020-02-10 16:11:06 +0000
Julian Smith <jules@op59.net>
c736329f36c2258011162c97eec59818fb6f147e
Fixed segv after alloc failure in ps_impl_allocate_interp_instance() (found by memento).
Fixes:
MEMENTO_FAILAT=2017 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
gpdl/psitop.c
2020-02-10 16:00:29 +0000
Julian Smith <jules@op59.net>
f1cb9e832424a1185fe081e2238b2ba42f805318
Fixed leak in xps_impl_allocate_interp_instance() (found by memento).
Fixes:
MEMENTO_FAILAT=2011 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
xps/xpstop.c
2020-02-10 15:40:01 +0000
Julian Smith <jules@op59.net>
59dba1a5a0f2d45c18249697b3429c250ae7311a
Fixed segv on error in gs_cspace_new_scrgb() (found by memento).
Fixes:
MEMENTO_FAILAT=2006 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
base/gscspace.c
2020-02-10 15:30:18 +0000
Julian Smith <jules@op59.net>
95378885483aa68969417c84e59be4eb1ad0f05e
Fixed segv on error in gsicc_set_iccsmaskprofile() (found by memento).
Fixes:
MEMENTO_FAILAT=1951 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
base/gsicc_manage.c
2020-02-10 12:21:24 +0000
Julian Smith <jules@op59.net>
691d2e37fc9f06bf6fb0ed009a880f4d40a86f48
Fixed leak on error in xps_impl_allocate_interp_instance() (found by memento).
Fixes:
MEMENTO_FAILAT=1938 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
xps/xpstop.c
2020-02-10 11:40:59 +0000
Julian Smith <jules@op59.net>
450eb91a0af4901b1f9a259cc69d8976113cbadb
Fix error handling in xps_impl_allocate_interp_instance() (detected by memento).
Handle error from gs_font_dir_alloc(), and moved all cleanup to end.
Fixes:
MEMENTO_FAILAT=1937 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
xps/xpstop.c
2020-02-10 11:21:37 +0000
Julian Smith <jules@op59.net>
33130c86c4d46bafe7613e3b4b114481c30d17ad
Fix segv in gsicc_alloc_link() error handling (detected by memento).
Set up placeholder values in *result before trying to set result->lock, so that
gs_free_object() works without segv.
Fixes:
MEMENTO_FAILAT=431 LD_LIBRARY_PATH=../libbacktrace/.libs ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
base/gsicc_cache.c
2020-02-07 19:01:01 +0000
Julian Smith <jules@op59.net>
da2759cd587e2a67134db469cb143643469f09f5
Fix leak on error in gsicc_profile_new() (detected by memento).
Fixes:
MEMENTO_FAILAT=369 ./membin/gpdl -sDEVICE=bit -o /dev/null examples/tiger.eps
base/gsicc_manage.c
2020-02-07 19:38:55 +0000
Robin Watts <Robin.Watts@artifex.com>
0ddc921923d36c19480223f3d92c19aee03df961
Pull in a couple of memento fixes from Sebastian.
base/memento.c
2019-09-29 16:59:29 +0200
Sebastian Rasmussen <sebras@gmail.com>
df70f85ce3f5dd300b5ce75b348e78dff528c2f4
jbig2dec: Invite user to define MEMENTO in CFLAGS.
Previously we invited the user to define MEMENTO in jbig2_priv.h.
The problem with doing that is that the flag is enabled for all .c
modules, except memento.c. This implies that while memento's wrapper
functions are called, the versions being called are the ones that
have memento features disabled.
Setting CFLAGS=-DMEMENTO while configuring/building is the better
option as CFLAGS will affect all .c modules.
jbig2dec/jbig2_priv.h
2019-09-29 16:55:51 +0200
Sebastian Rasmussen <sebras@gmail.com>
20009c9e35eca1d66f0c1d2fadb9956304692156
jbig2dec: Fix compilation issues with memento build.
jbig2dec/memento.c
2019-10-17 12:11:54 +0200
Sebastian Rasmussen <sebras@gmail.com>
5fde8364de28bc44965a57f1dd0190c0966bccb4
jbig2dec: Fix memento interfering with allocator callback names.
Memento changes the names of the callbacks when they are set, but
not when the structure is defined in the command line tool. Work
around this by including memento prior to the structure being
defined so that memento changes the names in both places.
The alternative would be changing the jbig2dec API yet again.
jbig2dec/jbig2dec.c
2020-02-08 03:18:09 +0800
Sebastian Rasmussen <sebras@gmail.com>
22665fbc3ff92c46952b07fcb99b8102e0fabde5
jbig2dec: Sync memento from ghostscript.
jbig2dec/memento.c
jbig2dec/memento.h
2020-01-11 01:51:19 +0100
Sebastian Rasmussen <sebras@gmail.com>
ebe1bfef330f4568c6ef394571cf800604dff277
Bug 702097: Import security fixes for OpenJPEG.
Upstream has merged two security fixes. At the moment there is
no new upstream release, so we merge the two fixes downstream:
* Fix for upstream issue #1228, registered as CVE-2020-6851:
https://github.com/uclouvain/openjpeg/commit/024b8407392cb0b82b04b58ed256094ed5799e04
"opj_j2k_update_image_dimensions(): reject images whose coordinates are beyond INT_MAX (fixes #1228)"
* Fix for upstream issue #1231, registered as CVE-2020-8112:
https://github.com/uclouvain/openjpeg/commit/05f9b91e60debda0e83977e5e63b2e66486f7074
"opj_tcd_init_tile(): avoid integer overflow
That could lead to later assertion failures.
Fixes #1231 / CVE-2020-8112"
openjpeg/src/lib/openjp2/j2k.c
openjpeg/src/lib/openjp2/tcd.c
2020-02-06 11:47:48 +0000
Julian Smith <jules@op59.net>
c6d8dcf8448235895759fb7e3268105c4092a194
clusterpush.pl: exclude all *-bin and *-obj directories.
toolbin/localcluster/clusterpush.pl
2020-02-07 14:27:12 +0000
Julian Smith <jules@op59.net>
e507f7e272cfe94099ed6a395a3fa584d56fd3aa
Fixed memento leak when squeezed in gs_main_init1().
Fixes leaked blocks in:
MEMENTO_FAILAT=202 ./membin/gs -sDEVICE=bit -o /dev/null examples/tiger.eps
Also in context_state_alloc(), ensure pcst->memory is valid even if we return
an error.
psi/icontext.c
psi/imain.c
2020-02-07 12:33:56 +0000
Robin Watts <Robin.Watts@artifex.com>
0e9f7fc153d92cbed9a4f1fcf60778176888625d
Bug 702100: Followup: Fix arch.h for OS-X to include size_t changes.
Our fix for Bug 702100 meant we were using newly defined size_t
limits from arch.h. While these were generated correctly for
things using arch.h, they were missed out of one of the
pregenerated files in the arch directory, namely the OS-X one.
Add those back here.
Thanks to Peter Skarpetis for reporting this.
arch/osx-x86-x86_64-ppc-gcc.h
2020-02-06 15:08:55 +0000
Robin Watts <Robin.Watts@artifex.com>
e193b5dc14a6029b2648a5712c154499d819186f
Bug 702100: Fix memory limit to be based on size_t not long.
I missed this when converting from longs to size_ts. This
resulted on different maximums for linux and windows 64bit
builds, due to the different size of longs on those two
platforms.
Update the debugging printfs to make use of the PRIdSIZE macros
rather than truncating.
base/gsalloc.c
base/gsmalloc.c
base/std.h
2020-02-06 14:39:10 +0000
Robin Watts <Robin.Watts@artifex.com>
3ac7d3c0ed5a339c8e2fe25c43feac92b9813b1b
Sync memento between mupdf and gs.
base/memento.c
2020-02-06 13:02:33 +0000
Robin Watts <Robin.Watts@artifex.com>
d185c5afea23e937edda368491d382650001f5b4
Memento: Remove MEMENTO_SQUEEZE_BUILD from the code.
Rather than relying on building with MEMENTO_SQUEEZE_BUILD,
instead nobble the pthread based threading functions themselves
to check Memento_squeezing in MEMENTO builds.
a) This means less pollution of the code overall as the changes
are restricted to just one module.
b) This will stop me forgetting to build with MEMENTO_SQUEEZE_BUILD
and not understanding the results - EVERY SINGLE TIME.
c) It means a single MEMENTO build can be used both for
memory squeezing (of single-threaded runs) and normal memento
testing (of both single- and multi-threaded runs).
base/gp_psync.c
base/gsicc_cache.c
base/gsicc_lcms2.c
base/gsicc_lcms2mt.c
base/gsicc_manage.c
base/gslibctx.c
base/gsmalloc.c
base/memento.c
base/memento.h
base/sjpx_openjpeg.c
psi/imain.c
2020-02-06 11:06:38 +0000
Julian Smith <jules@op59.net>
f40471ba6312a89cda81c23c1690dfbdbbc2722f
Fix MEMENTO_FAILAT=352 in gsicc_cache_new()
Ensure that result's fields are initialised before we attempt to allocate
result->lock. Otherwise if the latter fails and we attempt to clean up,
icc_linkcache_finalize() will get a SEGV.
base/gsicc_cache.c
2018-10-31 20:22:11 +0100
Sebastian Rasmussen <sebras@gmail.com>
37fae2058eb7216c60801dfdbd5b9c987446866a
Re-apply fix for bug 700088 lost in openjpeg 2.3.1 upgrade.
The original commit message read:
Bug 700088: Report error if all wanted J2K components are not decoded.
Ghostscript used to attempt to use even the undecoded components.
The source code for upstream's opj_decompress tool avoided this by
a workaround along with a comment indicating that this ought to be
done in the library (so all clients, e.g. Ghostscript will benefit
from it). With this commit the library will error out if not all
requested components are successfully decoded. Thus Ghostscript
will no longer crash.
Reported in https://github.com/uclouvain/openjpeg/issues/1158
sent upstream in https://github.com/uclouvain/openjpeg/pull/1164
and finally committed in e66125fe260deee49fdf6e9978d9bd29871dd5bb
openjpeg/src/lib/openjp2/j2k.c
2020-02-05 11:53:57 +0000
Robin Watts <Robin.Watts@artifex.com>
56e3ed1abc84ef0c8a718b458a5734b016e7b8cc
jbig2dec: Simplify jbig2_arith_decode.
Previously we passed in an int * to get errors back, and
used the return code for 0 or 1. Now we use the return code
for 0, 1 or -ve for error.
This saves between 1% and 2% of gs runtime for decoding
tests/pdf/Jbig2_042_06.pdf.
jbig2dec/jbig2_arith.c
jbig2dec/jbig2_arith.h
jbig2dec/jbig2_arith_iaid.c
jbig2dec/jbig2_arith_int.c
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_refinement.c
2020-02-04 11:10:41 +0000
Robin Watts <Robin.Watts@artifex.com>
db24ea3579f2fb6feef7eef98b7163ce6879ef98
Bug 702068 continued: Revised handling of images within smasks.
In an earlier commit, (Jan 27th, f6f8b8de) I updated the gridfitting
logic so that Images within SMask definitions were gridfitted. This
solved the original complaint.
Sadly, this caused problems with other things (thanks to Ken for
spotting them). Files sometimes use an image in an smask, and then
another "matching" image masked by that smask. The upshot of my
new code was that we'd treat them differently. 'Stretching' the
SMasked image, and not stretching the underlying image could cause
moire effects.
The solution, implemented here, is to apply gridfitting to images
both in SMask definitions and usage.
base/gdevp14.c
base/gdevp14.h
base/gxdevsop.h
base/gxipixel.c
2020-02-03 11:06:48 +0000
Robin Watts <Robin.Watts@artifex.com>
93ff4543685f8692db40a8911ad4605124b3433c
jbig2dec: Fix OSS-Fuzz issue 20493
The maximum x gbat works out as 126, where GBW is 32.
This makes right = GBW - gmax huge. Clip the value to
avoid problems.
Thanks for OSS-Fuzz for reporting.
jbig2dec/jbig2_arith.c
2020-02-04 11:33:02 +0000
Ken Sharp <ken.sharp@artifex.com>
a8572b92d6839abc60ecce6fae7a23b8b3a6bbbd
Fix test of uninitialised value in halftone screens
This is a result of bug #702077 and commit :
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=f434497caaf2624caabbbc62f36b745e096e95b5
There's nothing wrong with the commit, but a 64-bit release build on
Linux, using the customer file and 720 dpi, resulted in an infinite
loop. Valgrind suggested this was due to an uninitialised variable.
The problem here was that the code assumed that the first iteration
looking for the best match would succeed. However, because the halftone
has a Frequency of 1 the value of 'W' exceeded the maximum of a short,
which led to use running round the loop without finding a valid halftone.
Because we didn't find a valid halftone we would not set phcp to the
values in 'p' (which is set by gx_compute_cell_values) and so we would
test phcp->C which was uninitialised, and could end up going round the
loop retrying with different values of rt endlessly.
This commit simply short-circuits this by checking to see if we have
at least one valid match (rt is not 1) or that we have set phcp to p
(better is true). If we have done neither of these, then exit
immediately with an error to prevent testing phcp->C.
base/gshtscr.c
2020-02-03 16:29:59 +0000
Julian Smith <jules@op59.net>
b439a0a33f637254a831b3e76525002df3d41774
jbig2dec: Fix OSS-Fuzz issue 20505.
Previous code could overflow if w >= 2^32 - 32, breaking behaviour of 'if'
statements and causing incorrect behaviour (including assert failures).
The fix is due to sebras - change expressions such as (x + 32 > w) to (w - x <
32) to avoid overflow for very large w. (We know at all times that x <= w.)
Thanks for OSS-Fuzz for reporting.
jbig2dec/jbig2_mmr.c
2020-02-03 11:06:48 +0000
Robin Watts <Robin.Watts@artifex.com>
ece7a0b952d5dbca2a04682f38199444cb1ea16f
jbig2dec: Fix OSS-Fuzz issue 20493
The maximum x gbat works out as 126, where GBW is 32.
This makes right = GBW - gmax huge. Clip the value to
avoid problems.
Thanks for OSS-Fuzz for reporting.
jbig2dec/jbig2_generic.c
2020-02-03 10:54:09 +0000
Ken Sharp <ken.sharp@artifex.com>
f434497caaf2624caabbbc62f36b745e096e95b5
PDF interpreter - don't abort stream on halftone errors
Bug #702077 "Rangecheck error @720 dpi in sethalftone with SimpleDot"
The supplied PDF file has a legal but stupid Halftone, it has a type 5
halftone that does not specify a child halftone for each ink, for those
inks that it does specify it uses the same halftone for all of them, and
the child haftone has a /Frequency and /Angle of 1.
Chris suggests this is a Harlequin Rip specific halftone which is
intended not to be used, but to be replaced by something in the rip. Of
course this means that the PDF file is now device-specific because any
conforming PDF consumer which halftones should use the crazy halftone
in the file which will lead to terrible output.
However, poor quality isn't the complaint here, its the fact that we
simply cannot create a halftone tile large enough to produce a 1 lpi
screen at 720 dpi, so we throw an error.
I believe this is a reasonable error, so I'm not going to try and
change it. Instead this commit runs sethalftone in a stopped context
and, if it fails, does not abort the current content stream but instead
emits a warning and carries on.
Resource/Init/pdf_draw.ps
2020-02-03 10:15:30 +0000
Robin Watts <Robin.Watts@artifex.com>
6a32a890b95355165cbaf79ff679c2f774b41d26
Update msvc.mak to cope with new nmake version.
psi/msvc.mak
2020-01-30 19:08:55 -0800
Ray Johnston <ray.johnston@artifex.com>
a3bc57e11d62227a73e9d86d804966740a6a2196
Fix SEGV with -ZB debug in gx_image1_plane_data
Discovered while debugging. If the buffer is used "in place" without
copying, the 'buffer' pointer in the debug loop would be NULL. Instead
use the penum->buffer.
base/gxidata.c
2020-01-29 15:34:58 +0000
Robin Watts <Robin.Watts@artifex.com>
1c5a25063d6041902442334f633840bd8660451e
Further optimisations to jbig2_decode_generic functions.
Carry 'window' of pixel data across scanlines, and read
samples from it.
Write pixel data back in whole bytes rather than single bits.
Sadly, for cases where the adaptive pixels are non-standard we
need to write back after every pixel in case the adaptive
pixels read from it.
Profiling shows the time spent in the hotspot with jbig2_042_08.pdf
drops from 56% to 43% with this optimisation.
Particular thanks to Sebastian for spotting various issues with
this.
jbig2dec/jbig2_generic.c
2020-01-29 15:21:53 +0000
Robin Watts <Robin.Watts@artifex.com>
0e84a5f7ca660af4de1afb5bce79f6262b44ebd1
Solve warnings in jbig2_image.h.
Move some static inlines into the only file they are called
from rather than having them in the header.
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_image.h
2020-01-30 09:39:40 +0000
Ken Sharp <ken.sharp@artifex.com>
e852e56f0413d5ecb70a83fc03d78ad4a0561433
More 'trailing white space' fixes.
base/gxblend.c
2020-01-30 09:12:13 +0000
Ken Sharp <ken.sharp@artifex.com>
97868a9e6c787ea988f43952ae5d4236e142db13
Fix trailing white spaces in a number of places.
Since I use the Git commit hooks to verify no white space problems I
can't merge master into the pdfi branch without first fixing these.
base/gp_unifs.c
base/gscolor2.c
base/gscspace.c
base/gsovrc.c
base/gxblend.c
base/gxccache.c
base/gxclthrd.c
contrib/gdevlx32.c
2020-01-29 15:10:06 +0000
Julian Smith <jules@op59.net>
3b2ae21ca594934728f623667db1a002286193ea
Fix plane_strip_copy_rop() to use correct color depth when processing the plane.
Temporarily change mdev->color_info.depth to mdev->planes[plane].depth
so that things work when we process the plane. E.g. this fixes bug where
mem_gray8_rgb24_strip_copy_rop() was overwriting into the line_ptrs[] array.
Fixes segv in:
./bin/gs -sOutputFile=foo -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -dMaxBitmap=10000 -sDEVICE=psdrgb -r300 -Z: -sDEFAULTPAPERSIZE=letter -dNOPAUSE -dBATCH -K2000000 -dClusterJob -dJOBSERVER ../fts_27_2709.pdf
base/gdevmpla.c
2020-01-27 15:50:44 +0000
Robin Watts <Robin.Watts@artifex.com>
f6f8b8de526266eebd850e43bf1d0037b6f62e4c
Bug 702068: Fix 'cracks' appearing around transparently blended regions.
As part of rendering SMasks, we take the bbox for the region, and round
it up to make the buffer in pdf14. If (as is frequently the case) the
SMask contents are an image, the PS rendering of that image can result
in it rounding DOWN (due to "any part of a pixel" vs "pixel centre
covered"). This can result in 'cracks' around the edge of smasked
groups.
The fix, implemented here, is to extend the logic that "gridfits"
images within pattern accumulator to also cover smasks.
To make this work we add a new gx_dev_spec_op to detect whether we are
in an smask definition.
base/gdevp14.c
base/gdevp14.h
base/gxdevsop.h
base/gxipixel.c
2020-01-29 12:40:14 +0000
Robin Watts <Robin.Watts@artifex.com>
e22376d9226b02ac8cb7951264dae2f3c1bc0b7f
jbig2dec: Fix OSS-Fuzz issue 20358
Avoid a signed/unsigned comparison which was implicitly casting
gmax=-1 to unsigned, and hence making right larger than it should
have been.
Apply similar fixes to equivalent places in the code.
jbig2dec/jbig2_generic.c
2020-01-29 11:00:18 +0000
Robin Watts <Robin.Watts@artifex.com>
dc48809733f2eec9ab96c012f62c9dd3a7c06c90
Tweak stdpre.h's definition of inline.
Ensure it's actually set when possible, in particular for
VS.
base/stdpre.h
2020-01-28 17:54:28 +0000
Robin Watts <Robin.Watts@artifex.com>
2450ea4feb89996e1107bb79d44a049bab5b971e
MSVC makefile tweaks for VS2019.
Spot a new version of nmake, as supplied with the latest version
of the platform tools.
Cope with both Community and Professional versions of VS2019.
psi/msvc.mak
2020-01-29 10:00:39 +0000
Ken Sharp <ken.sharp@artifex.com>
cb456c92a550e1af70a4e268b2f5b02f2df5b8c6
Fix jbig2dec compilation when inline is not defined.
VS 2008 defines __inline but not inline, later versions of Visual Studio
do define inline, but apparently also permit __inline (presumably for
backwards compatibility).
Since we now use inline for performance purposes in jbig2_image.h its
vital that inline is defined. Here we modify the win32 config file to
define inline in terms of __inline for VS 2008 and above, unless inline
is already defined in which case we use it as is. For VS 2005
Ghostscript defines inline as nothing, so we do the same.
Finally, add a last-ditch definition of inline (as nothing) to jbig2.h
to cover any build environment where inline is still undefined, so that
the code will at least compile.
jbig2dec/config_win32.h
jbig2dec/jbig2.h
2020-01-29 05:04:34 +0800
Sebastian Rasmussen <sebras@gmail.com>
440dca503ee663290227334415f0c482e87b4ad7
Bug 702041: Recognize pre-multiplied alpha when decoding with OpenJPEG.
The bug's attached PDF has an annotation where the apperance stream consists of
a JPEG2000 image with a softmask embedded in the image data (SMaskInData is
non-zero). The JPEG2000 bitstream provides all three RGB channels and has both
non-pre-multiplied and pre-multiplied alpha. The last alpha channel defined in
the bitstream happens to be the pre-multiplied alpha. Having more than than a
single alpha channel is not allowed according to PDF 2.0 if SMaskInData is
non-zero. So the JPEG2000 bitstream (and by inference the PDF file) is arguably
broken.
Adobe Acrobat renders the annotation as a mostly transparent image consisting
of a few hand-scribbled lines, but Ghostscript renders the annotation as a
solid black square. So a workaround to match Acrobat is needed even if the PDF
is broken.
OpenJPEG hides that the JPEG2000 bitstream has multiple alpha channels by
discarding all alpha channels except the last one defined, so Ghostscript can
only get at the pre-multipled alpha channel. Previously the OpenJPEG glue layer
therefore didn't recognize any alpha channels at all. The PDF interpreter has
its own JPX cdef header decoder in Resources/Init/pdf_draw.ps and it _did_
recognize that the file contained an alpha channel. This mismatch between the
OpenJPEG glue layer and the PDF interpreter meant that no alpha channel data
was propagated to the transparency compositor. It assumed that the alpha
channel was fully opaque and because the RGB channels are all zero the
annotation was rendered as a solid black square.
Now that pre-multiplied alpha channels are recognized both in the OpenJPEG glue
layer and in the PDF interpreter the pre-multiplied alpha channel data which
contains the hand-scribbling is propagated to the transparency compositor which
therefore can render the annotation similar to Acrobat.
base/sjpx_openjpeg.c
2020-01-28 10:48:34 +0000
Robin Watts <Robin.Watts@artifex.com>
0e529d11fa270f8a40ebc2512cfb19cf8d3b0e50
Remove "STANDARD_SLOW_VERSION" define from openjpeg makefile.
This was added (apparently) to workaround a bug causing SEGVs
in the optimised code. Sadly, this also halves the speed of the
code.
We have updated openjpeg since, so it shouldn't be necessary.
Tests with the cluster seem to bear this out.
base/openjpeg.mak
2020-01-28 17:35:37 +0000
Robin Watts <Robin.Watts@artifex.com>
9156c43b44b64c3928d2ef20f15d56bd44c6f897
gpdl: Update j2k reading code to spot modified header.
The JP2K spec says we should spot "jP ", where previously
we'd only been spotting "jP\1a\1a". No idea where that
latter one came from, but presumably we've been seeing it
in some files. Make the code cope with both.
gpdl/jp2ktop.c
2020-01-27 11:05:38 -0800
Ray Johnston <ray.johnston@artifex.com>
85cf3b3a7befbed4811d9460dc6a4637f929f8ab
Fix bug 702065: Multiple rendering threads run slower.
The image_render_color_DeviceN would remap colors using gx_remap_ICC
which would get the link from the icclink_cache every time. This would
temporarily lock the mutex for the cache which apparently caused delays.
This would only occur in devices that support spot colors, when the page
used transparency due to gx_device_uses_std_cmap_procs returning false in
this case.
The change refactors gx_remap_ICC to produce gx_remap_ICC_with_link that
can be used by image_render_color_DeviceN with an icc_link that is retained
in the image enum. The gs_image_class_4_color function is changed to get the
icc_link for the image_enum before checking the for std cmap procs so that
it will be available during image_render_color_DeviceN.
base/gsicc.c
base/gsicc.h
base/gxicolor.c
2020-01-28 10:47:04 +0000
Robin Watts <Robin.Watts@artifex.com>
fe9e85d882ade3ebd55c4da0baf1f10d4bb8542d
Remove stray defines from CAL makefile.
When I created the CAL makefile, I copied bits of it from elsewhere.
I obviously copied in a few stray defines. Remove those.
base/cal.mak
2020-01-27 13:07:00 -0800
Ray Johnston <ray.johnston@artifex.com>
ad285b8ae3e1871db43d35e87f49e1d099eaf047
Fix devn code that failed to check for allocation returning NULL
Discovered while fixing Coverity CID 353647. pdf14_spot_get_color_comp_index
failed to check, and since that code was copied from code in this file,
it had the same problem.
base/gdevdevn.c
2020-01-27 13:01:28 -0800
Ray Johnston <ray.johnston@artifex.com>
6efb69c6ae71b10b492ca194f92bfae17310c481
Fix Coverity ID 353647: Possible out of bounds access
The testing where separations were added in pdf14_spot_get_color_comp_index
was wrong since it failed to take into account the process colorants.
Also I found that the allocation of sep_name was not checked for NULL which
could lead to dreferencing location 0 if the allocation failed. Note that
there were other instances of this in gdevdevn.c which will be fixed in a
separate commit.
base/gdevp14.c
2020-01-23 11:19:45 -0800
Ray Johnston <ray.johnston@artifex.com>
089bff145f277d66afe4a3d9e19441aeccaed235
Fix bug 702062: Opacity being applied twice.
If an image has an SMask, the alpha was applied twice, during painting of
the transparency group and again when the transparencygroup was popped.
Thanks to Michael Vrhel for the analysis and suggested cure.
If the device has PreserveSMask (e.g., pdfwrite) the SMask will be processed
by the device and we should not push the group, nor change the opacity.
Resource/Init/pdf_draw.ps
2020-01-27 10:12:24 -0800
Robin Watts <Robin.Watts@artifex.com>
17411adec88c3a846c10cb583cb261f50ca878d6
Fix OSS-Fuzz issue 20332: buffer overflow in jbig2_image_compose.
With extreme values of x/y/w/h we can get overflow. Test for this
and exit safely.
Thanks for OSS-Fuzz for reporting.
jbig2dec/jbig2_image.c
2020-01-23 14:45:15 +0000
Robin Watts <Robin.Watts@artifex.com>
430b6a3eacd9648d029887081e99b3a3f0bba3c7
Further optimisation to jbig2_decode_generic_template0_TPGDON.
When the "standard" values for gbat are used, the pixel lookups
simplify nicely. Optimise for this case.
This brings the time spent in this function down to 17% (from 22%)
for JBig2_042_08.pdf.
jbig2dec/jbig2_generic.c
2020-01-23 12:55:27 +0000
Robin Watts <Robin.Watts@artifex.com>
94d8ea178fa7c36ad7b844d6d0912b6e090a35e2
Further optimisations to jbig2_decode_generic_template0_TPGDON.
Add a function to get a 'run' of pixels, and call that.
This takes the time spent in this function from 29% to 22% for
Jbig2_042_08.pdf.
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_image.h
2020-01-23 12:09:08 +0000
Robin Watts <Robin.Watts@artifex.com>
124ef6a255de0a2816cce32c4fba0852eac1beb3
jbig2dec: Optimise jbig2_decode_generic_template0_TPGDON
Decodes of JBig2_042_08.pdf (the worst comparing file to
luratech in terms of time) show significant time in that
function (45%). With this patch that drops to 29%.
jbig2dec/jbig2_generic.c
jbig2dec/jbig2_image.h
2020-01-25 19:05:09 +0000
Julian Smith <jules@op59.net>
a2f9e74ece1690520cb77d7761cf0a5ddaa98474
Coverity 94484: try different spacing in coverity annotation.
base/gsbitcom.c
2020-01-24 18:08:22 +0000
Robin Watts <Robin.Watts@artifex.com>
34518a9aeaece63d97eda9b802824581846e289e
jbig2dec: Fix whitespace issues from jbig2_image.c
Introduced because I edited this in MuPDF and copied it back across.
jbig2dec/jbig2_image.c
2020-01-24 18:00:13 +0000
Robin Watts <Robin.Watts@artifex.com>
c1565a04a938408fe31c862f10ef91f9ab5a14b1
jbig2dec: reintroduce gcc attribute that got dropped by accident.
jbig2dec/jbig2_priv.h
2020-01-24 17:04:27 +0000
Julian Smith <jules@op59.net>
a2e8041383100db54d1ea949d1b2648330f5188a
Coverity 94484: added some asserts derived from bits_compress_scaled()'s preconditions.
These are enough to demonstrate to the reader that Coverity 94484's
negative_shift warning is spurious - in_shift_initial cannot be negative.
base/gsbitcom.c
2020-01-23 17:12:55 +0000
Julian Smith <jules@op59.net>
409baa5cc81b8d184dceb52c06c9a80c5dcd61d6
Coverity 94484: added annotation to avoid negative_shift issue.
base/gsbitcom.c
2020-01-22 12:24:43 +0000
Julian Smith <jules@op59.net>
77b7cce9253863ac48ef6eb9821880250c7e1307
jbig2dec/jbig2_mmr.c: optimised jbig2_find_changing_element().
This was a hotspot after optimsation of jbig2_compose_image.
Rather than step through each bit in turn, we now look 8, 16 and 32-bit at a
time.
jbig2dec/jbig2_mmr.c
2020-01-23 10:39:30 +0000
Robin Watts <Robin.Watts@artifex.com>
079117d95a3f07587624d6fd9ca388b300d0759e
jbig2dec: Insert missing "inline" in templating.
When using static inline templating to optimise a file, it's
generally best to actually use static inline, and not just
static.
jbig2dec/jbig2_image.c
2020-01-23 10:39:04 +0000
Robin Watts <Robin.Watts@artifex.com>
f8e918106400220ffe21aef6ef1d491a42991475
Squash some double -> fixed warnings.
base/gdevp14.c
2020-01-21 18:16:37 +0000
Robin Watts <Robin.Watts@artifex.com>
b1b3c83af56412a06eeade1ea26a4db10de923a5
Optimise jbig2_compose_image.
Work at byte level rather than bit level, and use static inline
templating methods to generate optimised versions for each
different operator.
jbig2dec/jbig2_image.c
jbig2dec/jbig2_priv.h
2020-01-22 09:54:25 -0800
Ray Johnston <ray.johnston@artifex.com>
bd73d0c1d0c42fd1671b56f1277b5e9f25391907
Bug 702052: MaxSpots > 58 caused exception with tiffsep device.
The MaxSpots devn parameter was allowed to be set according the the
capability of the tiffsep device (up to 60), but an array to hold the
equivalent CMYK parameter information was not that large. Get rid of
the MAX_DEVICE_PROCESS_COLORS #define and use the device num_std_colorants
and color_info.max_components to determine the maximum number of spot
colorants possible for this and PageSpotColors and update the Devices.htm
document to reflect the actual limit.
Also to reduce potential mischief, add range check error limits on the
DeviceN params based on the device component support, not the absolute max.
base/gdevdevn.c
base/gdevdevn.h
doc/Devices.htm
2020-01-22 17:53:24 +0000
Robin Watts <Robin.Watts@artifex.com>
8d548e306ae773e228dba331e614dd4cca2c56c7
Bug 702057: Avoid division by zero in old scan converter.
base/gxdtfill.h
2020-01-21 11:19:33 -0800
Michael Vrhel <michael.vrhel@artifex.com>
ba331d45f8e5be7723ff7bca9450f09c28910464
Bug 702053: Overprint precision issue
AR assumes for the purposes of overprint mode that a color
value that is less that 0.5/255 is essentially zero. Also
fix an issue in the Compatible overprint blend mode when
overprint mode is enabled.
base/gscspace.c
base/gxblend.c
2020-01-21 17:41:52 +0000
Chris Liddell <chris.liddell@artifex.com>
d6569b95a29bf86dbdca0bc95e095acaad003525
Fix segfaults in transparent patterns with -Z@
One gc'ed member (buf) of the structure for patterns with transparency was not
being initialised after allocation, meaning a debug build (which adds a
validation step to the garbager) would attempt to follow an uninitialised
pointer.
Adding the relevant initialisation meant almost identical code in two places,
so use the pre-existing function insteading of duplicating the code.
Segfaults spotted in weekly debug-Z@ test.
base/gxpcmap.c
2020-01-20 17:01:38 +0000
Chris Liddell <chris.liddell@artifex.com>
a0df672b0b65110d81f1e143b2e3681d660df8d2
Bug 702054: Fix threaded render segfault with shared ICC profiles
When creating the devices for individual rendering threads, if we cannot share
the ICC profiles, we also cannot share the device icc_struct. In such a case,
have each rendering thread device also create its own icc_struct.
base/gxclthrd.c
2020-01-20 14:23:50 +0000
Julian Smith <jules@op59.net>
df228c8f42962d696861cfc79f7b114ac887d3c4
Coverity 341118: avoid stat()/opendir() race in gp_enumerate_files_next_impl().
base/gp_unifs.c
2020-01-20 12:32:26 +0000
Julian Smith <jules@op59.net>
30f86d215ac5abba5cfe86f0307d642274b850e4
Coverity 350947: check return from gdev_prn_get_bits().
Also changed some fns from void to int so we can propogate any error.
contrib/gdevlx32.c
2020-01-20 12:31:00 +0000
Julian Smith <jules@op59.net>
bf2fcdc76fe0cec69e48f82e10144441b498a6b2
Coverity 94484: assert that shift is >= 0.
Have ran gs on 6,000 test files with some code that aborts if this shift is
-ve, and nothing failed.
base/gsbitcom.c
2020-01-17 12:58:14 +0000
Chris Liddell <chris.liddell@artifex.com>
144077b38b07119a0a5293ff8f3fc9e44f2813e1
Bug 702049: Handle format strings in pipe OutputFiles
When we implemented the new file access controls, we didn't realise that piped
output files could include formatted strings: "|md5sum > %03d.txt", for example.
This just tweaks the gs_add_control_path() logic so it will go through both
the formatted string section *and* the pipe output section (rather than one or
the other).
base/gslibctx.c
2020-01-17 11:32:10 +0000
Chris Liddell <chris.liddell@artifex.com>
bb8c4e0dbc304e404a09e9e6f9551e1e504822bb
Improve handling of current directory permissions
Tweak the file access permissions code to allow file names with a current
directory prefix to match "bare" file names - i.e. "file.ps" == "./file.ps".
This improves compatibility with the "-P" command line option, as well as
better matching user expectations.
base/gpmisc.c
2020-01-15 16:05:45 +0000
Chris Liddell <chris.liddell@artifex.com>
05d44f258a727d86b9d7d9cbe04e43f3e741a636
Bug 702037: Handle empty path from PDF text clip modes
When using one of the clipping Tr modes (4 to 7), if there is no valid
current point (i.e. no glyphs have been drawn, and no other previous operation
has established a current point), Acrobat ignores the operation, whilst gs was
treating that (as in Postscript) as an empty clip.
We now check for a valid current point before calling clip during the ET
handling.
Resource/Init/pdf_ops.ps
2020-01-16 09:33:47 -0800
Ray Johnston <ray.johnston@artifex.com>
dfdf07b07d4fd83fc606d50eaa7132fc9ea7a1ce
Coverity 353342: supposed Null pointer dereferences in gxclpath.c
Strange that it griped about passing pdevc_stroke to cmd_put_drawing_color,
but not earlier where it was passed to gx_default_fill_stroke_path.
Fix (hopefully) by checking for NULL color pointers before ANY use.
base/gxclpath.c
2020-01-15 12:23:21 -0800
Ray Johnston <ray.johnston@artifex.com>
27a3bf0bc16f492538434a9b1bfdbd588e29cedc
Fix coverity CID 353343.
Remove ppcs. When the code was changed to write the pgs->color[0],
the ppcs param was never removed.
base/gxclrast.c
2020-01-15 12:08:22 -0800
Michael Vrhel <michael.vrhel@artifex.com>
39eff9a56b2077d1a9adb48dfefd38e5e94b59c6
Make -dUseFastColor occur even when source color space is ICC based
The exception will be the CIELAB color space, the PS CIE color spaces,
named color, and DeviceN ICC profiles.
base/gsicc_cache.c
base/gsicc_manage.c
base/gsicc_manage.h
doc/Use.htm
2020-01-15 11:33:45 -0800
Michael Vrhel <michael.vrhel@artifex.com>
1b7690cdd644fd690c2480a88da62be6131e79ab
Coverity 353370 dead code removal
base/gdevp14.c
2020-01-15 13:42:33 +0000
Julian Smith <jules@op59.net>
4872417c26e9133e1f39fc5f9a361053aaee87a7
Coverity 350199: mark cf_encode_2d() as not tainting <lbuf> buffer.
After annotating cf_encode_1d(), this coverity issue appears to have changed
to worrying about cf_encode_2d(). Would have expected a new issue to have been
generated.
base/scfe.c
2020-01-15 11:09:53 +0000
Chris Liddell <chris.liddell@artifex.com>
c58f4c538404527cac25b549453f5b805652b445
Fix dependency for custom freetype config header
I'd missed the dependency to make sure the required directories were created
before attempting to copy the custom header into one of those directories.
base/lib.mak
2020-01-14 11:05:22 +0000
Julian Smith <jules@op59.net>
22618fc2fde49c8fc24ed7e88e98f9677e689c85
Coverity 350199: Final attempt to convince coverity that cf_encode_1d() doesn't taint lbuf.
base/scfe.c
2020-01-13 13:42:21 +0000
Chris Liddell <chris.liddell@artifex.com>
d824fb03a6653856dfe6e304bab8fe67a2c8f1f9
Bug 689279: Disable bitmap glyphs in freetype
The font in the XPS file has both outline and bitmap glyphs, and with such fonts
freetype ends up marking them as "bitmap" and "non-scalable" fonts, so when we
attempt to set a size for glyph scaling not equivalent to the included bitmaps,
freetype throws an error.
The file works with (a default build) of mupdf because mupdf disables freetype's
bitmap font support at build time. It is not possible to force freetype to
ignore bitmap glyphs at run time.
This commit adopts a similar approach to mupdf, and disables bitmap glyph
support using a custom options header file.
base/freetype.mak
base/gsftopts.h
base/lib.mak
2020-01-13 09:54:41 -0800
Michael Vrhel <michael.vrhel@artifex.com>
67559bed1c0dceb2a1a59be0349e3465a1361743
Fix error handling issue found by Coverity
base/gdevp14.c
2020-01-13 18:18:57 +0000
Julian Smith <jules@op59.net>
defe1d994b52100f535cb9e6a7e6a4f4255d2b2b
Coverity 350199: another attempt to quieten coverity.
Will clean up annotations once we've found one that works.
base/scfe.c
2020-01-13 16:48:32 +0000
Julian Smith <jules@op59.net>
3704918f3a987e95e7d06fc025de2dce04bab5e8
Coverity 350199: further attempt to quieten coverity using -tainted_data_sink tag.
base/scfe.c
2020-01-12 15:43:51 -0800
Michael Vrhel <michael.vrhel@artifex.com>
4ad96e96f1f929e444fdb0e220d2b05c1dde1bf1
Fix defects reported from fill-stroke3 merge
base/gdevp14.c
base/gscspace.c
base/gsovrc.c
2020-01-11 12:14:48 -0800
Michael Vrhel <michael.vrhel@artifex.com>
05c41c0dedaa512419f15798cbc3da92b6a90bbc
Squashed commit fill-stroke3 branch
This branch had several contributors including Robin Watts,
Ken Sharp and Ray Johnston.
The intent was to add a "fill and stroke" path device method
to ensure we get proper rendering when doing fill/stroke
methods with overprint and transparency. In addition,
adding the method made it possible for pdfwrite to match
the original pdf source file if it also had fill/stroke methods.
The interaction with overprint and transparency led to significant
changes in parts of the code related to those sections. In particular,
overprint was reworked to ensure that the overprint compositor and
the transparency compositor were aware if it was to be using
the overprint drawn_comps for stroke or for fill. The code was
rewritten so that the overprint compositor actions only occurred when
an actual operation occurred (e.g. fill, stroke, image, text) as opposed
to every time that the overprint graphic state values changed.
When there is a fill-stroke operation with transparency, depending upon the
graphic state values, a non-isolated knockout group may be pushed. From this,
an issue with knockout groups within knockout groups was revealed, which was
related to the backdrop selection. The backdrop selection code was simplified.
Resource/Init/pdf_ops.ps
base/gdbflags.h
base/gdevdflt.c
base/gdevepo.c
base/gdevflp.c
base/gdevmem.h
base/gdevmplt.c
base/gdevnfwd.c
base/gdevoflt.c
base/gdevp14.c
base/gdevp14.h
base/gdevsclass.c
base/gdevsclass.h
base/gscdevn.c
base/gscolor.c
base/gscolor2.c
base/gscolor3.c
base/gscpixel.c
base/gscsepr.c
base/gscspace.c
base/gscspace.h
base/gsdcolor.h
base/gsdevice.c
base/gsdparam.c
base/gsdps1.c
base/gsicc.c
base/gsicc_manage.c
base/gsimage.c
base/gsovrc.c
base/gsovrc.h
base/gspaint.c
base/gspaint.h
base/gspath.c
base/gspcolor.c
base/gsptype1.c
base/gsptype2.c
base/gsstate.c
base/gstext.c
base/gstrans.h
base/gxblend.c
base/gxblend1.c
base/gxccache.c
base/gxclimag.c
base/gxclip.c
base/gxclip.h
base/gxclipm.c
base/gxclist.c
base/gxclist.h
base/gxclpath.c
base/gxclpath.h
base/gxclrast.c
base/gxclrect.c
base/gxcmap.c
base/gxdevcli.h
base/gxdevice.h
base/gxdevsop.h
base/gxfill.c
base/gxgstate.h
base/gxpaint.c
base/gxpaint.h
base/gxpath.h
base/gxpath2.c
base/gxpcmap.c
base/gxpcolor.h
base/gxstroke.c
base/lib.mak
devices/gdevpsd.c
devices/vector/gdevpdfb.h
devices/vector/gdevpdfd.c
devices/vector/gdevpdfg.c
devices/vector/gdevpdfg.h
devices/vector/gdevpdfx.h
lcms2mt/ChangeLog
lcms2mt/Projects/VC2010/lcms2mt.rc
lcms2mt/config.guess
psi/int.mak
psi/zcolor.c
psi/zpaint.c
2020-01-10 16:50:08 +0000
Robin Watts <Robin.Watts@artifex.com>
5faf010d8e043d77ff10f3deee466e9fb2dc7b7e
Bug 702032: Fix overflow problem in scan converter.
Very wide regions to be filled (> 0x80000000) can cause problems
with overflow in clipping calculations, causing regions to be
filled 'the wrong way' (i.e. from -ve to x rather than from x to
+ve).
Fix this by tweaking calculations to promote to 64bit 1 step
earlier than before.
base/gxscanc.c
2020-01-10 11:56:54 +0000
Julian Smith <jules@op59.net>
419f528cf8625a7e2989068324e962c498c255ef
Coverity 94984: disabled code that had no affect other than to cause a coverity issue.
contrib/gdevgdi.c
2020-01-09 17:14:57 +0000
Julian Smith <jules@op59.net>
e3c394504318a9a6774d65c386842d3f568126ce
Coverity 94488: improved detection of uninitialised Jbig2HuffmanEntry.
When checking for an incorrect uninitialised entry, test for /either/ of
<flags> and <PREFLEN> being -1.
Previously we tested for /all/ of <flags>, <PREFLEN> and <entry->u.RANGELOW>
being -1, which made coverity think that the following code could be run with
PREFLEN=-1, which then triggers issue about illegal shifts.
[It seems that <entry->u.RANGELOW> can be -1 in normal operation, so have
excluded from the new test.]
jbig2dec/jbig2_huffman.c
2020-01-09 15:09:58 +0000
Julian Smith <jules@op59.net>
a9c19743cf5bc787ebbcbbff58c5cce0c923d0cc
Coverity 94740: added /* Fall through. */ comment.
contrib/lips4/gdevl4r.c
2020-01-09 15:07:21 +0000
Julian Smith <jules@op59.net>
7ee0bc7749eb7c2726bb593637de7653e2b62f10
Coverity 94747: removed 'if' with duplicate code.
contrib/lips4/gdevl4v.c
2020-01-09 14:40:54 +0000
Julian Smith <jules@op59.net>
ccd8370b09531128634b3f5bab76b1de426ab116
Coverity 94809: added /* Fall through. */ comment.
contrib/eplaser/gdevescv.c
2020-01-09 14:26:05 +0000
Julian Smith <jules@op59.net>
f563ab707b6068a653fb917974fb1e6a88c068d8
Coverity 121439: use gx_color_index instead of uint, to avoid overflow when shifting.
contrib/pcl3/eprn/eprnrend.c
2020-01-09 14:21:01 +0000
Julian Smith <jules@op59.net>
3acc9babb87048dda29ab766ca41750fc6f58eaf
Coverity 94905: disabled code that had no affect other than to cause a coverity issue.
contrib/gdevgdi.c
2020-01-09 11:32:11 +0000
Julian Smith <jules@op59.net>
bd6f5232dbaaa372b9fdcdb98134af8096c807be
Coverity 95087: use cast to indicate intermediate integer division is expected.
contrib/japanese/gdevmjc.c
2020-01-09 12:17:49 +0000
Chris Liddell <chris.liddell@artifex.com>
78773b740b3c0095fb4c5df59390f0eea84a6a49
Docs: Fix a link to a long gone file.
Reword the "What if I'm writing documentation?" so it makes some sense.
doc/Readme.htm
2019-12-17 15:50:13 +0000
Chris Liddell <chris.liddell@artifex.com>
1075fd1caba19e642c9713c3a07961c0a3f0f88d
Improve the English in section on Unicode TTFs
doc/Use.htm
2020-01-08 12:13:35 +0000
Julian Smith <jules@op59.net>
af1fe01f44f528fb1322cfcf1b48aa5e1aa76059
Coverity 95007: propogate error from eprn_check_colour_info().
contrib/pcl3/eprn/gdeveprn.c
contrib/pcl3/eprn/gdeveprn.h
contrib/pcl3/src/gdevpcl3.c
2020-01-08 14:25:52 +0000
Julian Smith <jules@op59.net>
e0a0c0ca0e16e8b598a7839011df4c3374ab561d
clusterpush.pl: also exclude luratech* directories.
toolbin/localcluster/clusterpush.pl
2020-01-08 13:08:07 +0000
Julian Smith <jules@op59.net>
aba372d8efa1ffdb11a496474f519b0015b31031
Coverity 94665: removed unnecessary if and refactored expression.
contrib/gdevdj9.c
2020-01-08 13:04:41 +0000
Julian Smith <jules@op59.net>
5e1685812864cfde94a5c0daee0cae3307078aa7
Coverity 94713: added {...} to match indentation.
contrib/lips4/gdevl4v.c
2020-01-08 13:02:35 +0000
Julian Smith <jules@op59.net>
3b727b709f40d6b93e874680ab307aa124de5422
Coverity 94729: oki4w_print_page()'s compress_code is always 2.
Simplified code accordingly, and removed static fn oki_compress() as no longer
referenced.
contrib/gdevop4w.c
2020-01-08 12:41:57 +0000
Julian Smith <jules@op59.net>
4e4edd2161b4b7f3ccb23a90a8ca90dccffd078c
Coverity 94757: avoid 'if (foo) return code; return code;' construct.
This code is slightly odd, and didn't want to make major changes, so have ended
up with odd-looking extended expression whose actual value we ignore.
contrib/gdevbjc_.c
2020-01-08 12:31:50 +0000
Julian Smith <jules@op59.net>
cef68e9a0ca0be10f08e415785f8b8fac37d7828
Coverity 94778: added missing {...}.
contrib/lips4/gdevl4v.c
2020-01-08 12:28:15 +0000
Julian Smith <jules@op59.net>
c517f26773cd3a63f029b1bf6e275b227e3af5e8
Coverity 94811: added break in switch block.
contrib/gdevlx32.c
2020-01-08 12:25:54 +0000
Julian Smith <jules@op59.net>
0c84b20c653444310c979a5df78542e9671a6692
Coverity 94846: don't dereference <data> without checking it isn't NULL.
contrib/pcl3/src/pclgen.c
2020-01-08 12:18:02 +0000
Julian Smith <jules@op59.net>
87c48dabcdb64262fc0d24ed81b38d28e7545cb2
Coverity 95006: improved use preprocessor to hopefully fix this warning.
contrib/opvp/gdevopvp.c
2020-01-08 11:58:50 +0000
Julian Smith <jules@op59.net>
4c1e5ac5d9def3cbe25c52c63a3d5ba11f2603ac
Coverity 121439: avoid overflow when shifting.
contrib/pcl3/eprn/eprnrend.c
2020-01-08 11:58:14 +0000
Julian Smith <jules@op59.net>
f71ebb708947e57eaf7cd33b319ec0676e03ba2e
Coverity 121442: avoid overflow when shifting.
contrib/opvp/gdevopvp.c
2020-01-08 11:41:50 +0000
Julian Smith <jules@op59.net>
4bb071925d68398f8efb493c6b529e897a9bc356
Coverity 350199: fix coverity annotation arg number.
base/scfe.c
2020-01-07 19:43:07 +0000
Robin Watts <Robin.Watts@artifex.com>
d24553cea74bda19ae7e3dd5a60302fdc49d1fb2
Fix indentation problems in examples in API.htm
doc/API.htm
2020-01-06 16:30:17 +0000
Ken Sharp <ken.sharp@artifex.com>
147591b7a8390d0e98418851b60ac67e659cf2f1
PDF interpreter - don't abort on errors in JBIG2 globals
This was due to Julian's work on comparing jbig2dec with Luratech.
The test file 'normal_716.pdf' and the cluster test file
jbig2_null_segments_and_glyphs.pdf throw errors when trying to read
the JBIG2 globals dictionary. Luratech doesn't cache the globals, while
jbig2dec does, and the problem was that jbig2dec was returning an error
at a point where the PDF interpreter wasn't able to ignore it, while
Luratech deferred the error to a later point, at a time when the
interpreter could, and did, ignore it.
This meant that Luratech continued to render any further content on the
page while jbig2dec did not, resulting in diffs.
This commit simply runs the global context extraction in a stopped
context. If it fails we clean up the stack and exit, which (effectively)
defers the error to the same point as the Luratech decoder.
Resource/Init/pdf_base.ps
2020-01-06 12:56:52 +0000
Robin Watts <Robin.Watts@artifex.com>
9a2414c7f88ef07cb9297bdeb3236cdba44c25ad
Bug 702018: Fix CAL build crash in tiffsep1.
The SSE code for CAL currently only copes with a maximum of 4
planes. Ensure the device falls back to non-CAL code in such
cases.
devices/gdevtsep.c
2020-01-06 11:40:37 +0000
Robin Watts <Robin.Watts@artifex.com>
1085ead1dd22e3908c341df160a722e71a9c7cfe
Fix VS2019 project getting many x64 builds wrong.
windows/GhostPDL.sln
2020-01-06 08:22:00 +0000
Chris Liddell <chris.liddell@artifex.com>
c53f9d984015b65bf234d65befa552fe9d18c886
Bug 702019: fix dependencies for cups devs and gdevp14
Any "printer" device depends on the low level 'page' device (page.dev),
unaccountably, the cups devices (cups and pwgraster) did not have that
dependency in the makefiles.
Also, the PDF transparency compositor now (and for some time) has also depended
upon page.dev, so update the makefiles for that, too.
base/lib.mak
devices/devs.mak
2020-01-04 20:04:03 -0800
Ray Johnston <ray.johnston@artifex.com>
d1aa5fdfdbea4c55445ee1bdbe08b822a1bd7a8c
Further refinement for Bug 701880. Make tiffsep better match pbmraw
The previous change attempted to fix the y-phase, but this was not a
180 degree rotation, so it caused the primary angle of the pattern to
shift by 90 degrees. A better correspondence is achieved by inverting
the polarity of the thresholds. This is slightly "darker" than pbmraw
but the angle and phase matches pbmraw closely.
Note that the phase using the CAL module does not match the non-CAL
or pbmraw, but the angle of the pattern does match.
devices/gdevtsep.c
2020-01-03 09:56:29 -0800
Ray Johnston <ray.johnston@artifex.com>
372c862f2050d82248316f54156e5bb33dd7520a
Fix Bug 701845. The devicen device would confuse transparency.
The devicen device defines 32-bit depth, but 0 components and no
standard process colors or names. This confused the pdf14 device into
writing a clist with 1-component (gray), but then because the icc_profile
had 4 components, would try and use 4 component when reading.
Fix by making it 32-bit CMYK, and also fix to write a valid PCX by
converting the 32-bit CMYK to 24-bit RGB on output. PCX cannot handle
32-bit CMYK. Prior to this, 32-bit CMYK would fail showpage with a
rangecheck error.
base/gdevdevn.c
2020-01-03 15:51:00 +0000
Robin Watts <Robin.Watts@artifex.com>
9608d275bd750b189dd52681791f31617a640817
Use CAL halftoning in tiffsep1 post processing.
A quick back to back test with/without cal using:
bin/gswin32c.exe -sDEVICE=tiffsep1 -o out.tif -r600 -dMaxBitmap=80000000
examples/tiger.eps
shows timings of 1.142s vs 1.297s on my machine.
devices/devs.mak
devices/gdevtsep.c
2020-01-03 15:52:41 +0000
Robin Watts <Robin.Watts@artifex.com>
59ed026565b5be1bd055d0fbd1b066b8c07274e0
Squash warnings (dropped from earlier commit).
These warnings were supposed to have been squashed a few
commits ago, but somehow got lost in a rebase. Thus they
were mentioned in the commit message, but didn't make it
in.
Avoid problems with 'errno' being a special thing that
shouldn't be used as a parameter name.
Explicitly cast time_t to long for printing.
base/gsioram.c
base/mkromfs.c
base/pack_ps.c
2020-01-03 10:21:18 +0000
Ken Sharp <ken.sharp@artifex.com>
d7d012bfe6c8f248db8b8474743618c53318ce40
PDF interpreter - increase robustness in face of invalid annotations
Bug #702016 "Invalid annotation causing an error"
The PDF file has an annotation where the creating application has
inserted the appearance stream directly into the annotation dictionary.
This breaks the code which attempts to parse the annotation dictionary
from an indirect reference into a dictionary object.
This commit tries to recover from such egregiously broken situations by
running the 'oforce' in a stopped context. This is complicated firstly
by the fact that we parse the annotation dictionary in two places, once
to check it for the presence of transparency and once to actually draw
it (if we are rendering annotations).
In addition, the code could potentially leave anything on the stack, so
we can't use a mark/cleartomark pair to tidy up. Instead, use a
(hopefully) unique name object, create it on the stack and in the case
of an error, unwind the stack back to the expected name.
Finally, report the error to the user in a more or less meaningnful way.
Resource/Init/pdf_main.ps
2019-12-13 12:40:44 +0000
Robin Watts <Robin.Watts@artifex.com>
92031bd1fb9084088a657b7d83339bf499dcc7d2
Update Visual Studio solution to VS2019.
Our belief is that this should work in all versions of VS from
2010 onwards.
By moving to VS2019, we lose support totally for Windows XP prior
to SP3. If this is a problem, either build using the Makefile, or
pull the old VS2005 solution out of git and use that. If customers
find this to be a problem, we can maintain the old VS2005 solution
alongside the new one with minimal effort.
Default builds lose support for Windows XP SP3/Windows Server 2003,
but the new "ReleaseXP", "DebugXP" and "MementoXP" configurations
will target these platforms (assuming the v141 tools have been
installed too).
These "XP" binaries will be build into {,debug,mem}objxp directories
and will produce binaries with an 'XP' suffix: i.e.
{,debug,mem}bin/{gs,gpcl6,gxps,gpdl}win{32,32}{,c}xp.exe.
psi/msvc.mak
windows/All.vcxproj
windows/GhostPDL.sln
windows/ghostpcl.vcxproj
windows/ghostpcl.vcxproj.filters
windows/ghostpdl.vcxproj
windows/ghostpdl.vcxproj.filters
windows/ghostscript.vcxproj
windows/ghostscript.vcxproj.filters
windows/ghostxps.vcxproj
windows/ghostxps.vcxproj.filters
2019-12-16 18:18:47 +0000
Robin Watts <Robin.Watts@artifex.com>
10d2678613d5a93bedc094a62b1b98972871f464
Tweak windows Makefiles to know about VS2017 and VS2019.
These builds have only been tested with "DEVSTUDIO=" (i.e.
relying on the paths to the compilers etc having been set up
in advance, such as happens when building from within the IDE
using the supplied solution). Logic has been added for
command like nmake builds, but this hasn't been tested.
Update the makefiles to avoid using flags that aren't supported
in later versions.
base/msvccmd.mak
base/msvclib.mak
psi/msvc.mak
2020-01-02 11:01:03 +0000
Robin Watts <Robin.Watts@artifex.com>
00cd7c475b173e5cdce7e1e4ff3f0880e1e70583
Squash warnings
Don't define STRICT multiple times.
Explicitly cast time_t's in printfs.
Avoid warnings due to errno being a #defined thing.
base/windows_.h
2019-12-26 13:14:43 -0800
Ray Johnston <ray.johnston@artifex.com>
bf689ee0bff720f202ebc98f301c765f34e2c1fa
Bug 701880: tiffsep1 threshold_from_order caused dots in full white.
For patterns with > 256 dots, threshold_from_order would put in 0 value
cells which would then always be imaged. Change this device to (finally)
use the gx_ht_construct_threshold used by the fast_ht thresholding code
so that it should match the other devices, such as pbmraw.
Also vertically invert the use of the threshold array to match the dots
of the other devices.
Add missing dependencies for gdevtsep.c in devs.mak
devices/devs.mak
devices/gdevtsep.c
2019-12-19 09:22:32 -0800
Nancy Durgin <nancy.durgin@artifex.com>
97ac0f6ef4010e0a49bf6f8f4515c32a5695df68
PDF interpreter -- take out manually drawn rectfill
We can now just draw the rectangle directly with rectfill.
Whatever issue ken ran into 5 years ago no longer applies.
See also Bug 693731
Resource/Init/pdf_draw.ps
2019-12-18 14:46:26 +0000
Ken Sharp <ken.sharp@artifex.com>
719bf1f2c4104d933767d37e62489535e8ba9a17
pdfwrite - use correct FontFile key
This was found as part of bug #701997, even if we set -dCompatibilityLevel
to 1.1, so that type 1 fonts are not converted to type 2 (1c, CFF) we
would still write out a FontFile3 key, instead of the correct
FontFile key.
Ghostscript doesn't care about this, but Acrobat refuses to parse the
font from the file when it has the wrong FontFile key.
The test we were using was incorrect anyway, we were checking
ResourcesBeforeUsgae and we should have been checking HaveCFF because
if HaveCFF is true we would convert type 1 to CFF, and if it isn't we
wouldn't.
devices/vector/gdevpdtb.c
2019-12-16 09:52:13 +0000
Ken Sharp <ken.sharp@artifex.com>
bb47dd4128481c2e62bbd6b5e354da8299f2f16b
PDF interpreter - use PDFDocEncoding for fonts in text annotations
Bug #701889 ""
We were often not applying PDFDocEncoding to fonts when we used them to
draw text for annotations. This commit re-encodes the selected font
which will give a better result.
We probably should also check for UTF16-BE text and use the FallBack
CIDFont in that case, but we'll wait for an example before trying to
code that.
Resource/Init/pdf_draw.ps
2019-12-14 19:13:27 +0000
Ken Sharp <ken.sharp@artifex.com>
c3b184c41144a2650e5520643bbb1cff42c18acc
PDF interpreter - fix line ending positions on Line annotations
Bug #701889 "Annotation objects missing or incorrectly interpreted when appearance stream missing"
The calculation of the position of the line ending was incorrect, and
we were applying the wrong LE entry to each end of the line.
Resource/Init/pdf_draw.ps
2019-12-14 15:24:57 +0000
Ken Sharp <ken.sharp@artifex.com>
1246085e17ee35928f737f1fbf69d69fe6b7a2ae
PDF interpreter - Add arrows to /CL lines in FreeText annotations
Bug #701889 "Annotation objects missing or incorrectly interpreted when appearance stream missing"
Add arrowheads to the ends of callout lines.
Resource/Init/pdf_draw.ps
2019-12-13 15:13:58 +0000
Ken Sharp <ken.sharp@artifex.com>
acccfd2fe90e25534e7d492ca2378dc32269e48e
PDF interpreter - Fix multi-line FreeText annotation with /Rotate 270
The calculation of the 'width' of the container for the text was
incorrect, as was the starting x co-ordinate. Fixed here.
Resource/Init/pdf_draw.ps
2019-12-13 11:55:15 +0000
Ken Sharp <ken.sharp@artifex.com>
5e5f7b41c080bdbd15fac5afbd09052a83e81a01
PDF interpreter - apply /C to more annotation types
Bug #701889 "Annotation objects missing or incorrectly interpreted when appearance stream missing"
Seems we also need to apply the /C colour to Polygon, Square and Circle
annotations before drawing them.
Resource/Init/pdf_draw.ps
2019-12-13 11:23:28 +0000
Ken Sharp <ken.sharp@artifex.com>
4940c5cb80916017d3ee0c9b53475323cf5ebbd6
PDF interpreter - more annotation improvements
Bug #701889 "Annotation objects missing or incorrectly interpreted when appearance stream missing"
Apply the /RD array (if present) to the annotation /Rect before using
the Rect to draw the border.
We were using the /C array in drawborder to set the colour before
stroking the border, there are two problems with this; firstly the /C
array is not used to specify a border colour, secondly we need to set
the colour for certain objects irrespective of whether they have a
border.
Remove annotsetcolor from drawborder and apply it to Squiggly, Strikeout,
Underline, Highlight, Line and Ink annotations in order to set the
colour before drawing the annotation. The specification says that this
is used for; the border of a Link annotation, the title bar of a
pop-up annotation's pop-up and the background of the annotation's icon
when closed, but in fact Acrobat also uses it to set the colour for all
the annotation types listed above.
There may still be more work needing done here, but this matches all the
test cases I currently have.
Resource/Init/pdf_draw.ps
2019-12-12 17:04:17 +0000
Ken Sharp <ken.sharp@artifex.com>
d95dd7a23f25e73042f3c8e6043c83285387d0a1
PDF interpreter - apply RD array to Circle, Square and FreeText, apply Rotate to FreeText
Bug #701889 "Annotation objects missing or incorrectly interpreted when appearance stream missing"
The /RD array makes certain kinds of annotations be drawn in a smaller
area. Although the spec does not mention it, Acrobat applies the
/Rotate key if found to the text in a FreeText annotation.
Still more to do on the text; we are nto fitting the text correctly
when Rotate is 270, not certain why. Also we are not drawing Borders
when we should, some text is missing and text is in the wrong colour
(due to not applying /DS)
Resource/Init/pdf_draw.ps
2019-12-12 19:47:18 +0000
Robin Watts <Robin.Watts@artifex.com>
f25987c838ea9437b60f8b3b93f90e187013b641
Tweak CAL makefile to include new intrinsics headers in dependencies.
base/cal.mak
2019-12-12 15:44:30 +0000
Robin Watts <Robin.Watts@artifex.com>
321cf6026a05e31140a87cc83a2653b048550df4
Fix arch.h dependency in cal build.
This was causing parallel makes of CAL enabled builds to
fail.
base/cal.mak
2019-11-29 17:48:29 +0000
Robin Watts <Robin.Watts@artifex.com>
b6f6adb5448fda1f33db4c92c030709618e4ee54
Support for YCbCr, LogL, LOGLUV and paletted TIFFs.
YCbCr TIFFs have to use TIFFRGBAImage as for the old JPEG
encapsulation.
gpdl/tifftop.c
2019-11-28 22:32:43 +0000
Robin Watts <Robin.Watts@artifex.com>
ae1cee743e56a7b654d9dbb2ea88ed90d48d298d
Further fixes for GPDL TIFF.
Support JPEG encoded TIFFs (both old and new formats).
Old JPEG format requires the whole image to be decoded to an
RGBAImage in memory at once; looks like that's just a limitation
of libtiff. This is particularly annoying because it looks like
the internals of libtiff are prepared to do scanline extraction
as you'd hope, but aren't exposed to the outside world.
base/msvclib.mak
base/tiff.mak
configure.ac
gpdl/gpdl.mak
gpdl/tifftop.c
psi/msvc.mak
2019-12-12 17:26:02 +0000
Robin Watts <Robin.Watts@artifex.com>
ef66198ade77d5d551b3045cd36bed81c0b04f54
Changes to libtiff for gpdl.
1) Ensure that libtiff doesn't mess with 'boolean' in GS builds
on Windows. Without this, the jpeg structures used by our JPEG
lib build are different in size when called from gs and libtiff,
resulting in runtime errors.
2) Update libtiff so that it can correctly call into the jpeg
library so that memory operations happen from our pools, not
malloc/free. Slightly horrid in that this is more complex with
OJPEG than JPEG files.
tiff/libtiff/tif_jpeg.c
tiff/libtiff/tif_ojpeg.c
tiff/libtiff/tif_open.c
tiff/libtiff/tiffio.h
tiff/libtiff/tiffiop.h
2019-11-28 10:52:49 +0000
Robin Watts <Robin.Watts@artifex.com>
0c248ced8997dfe8f253a07fc6cc5f47837ca12e
Fixes for GPDL TIFF support.
Support tiled TIFFs, planar TIFFs, and TIFFs where the resolution
isn't properly specified.
gpdl/tifftop.c
2019-12-12 14:33:27 +0000
Chris Liddell <chris.liddell@artifex.com>
76bd0d75823a571130f340ab6231e064d1f997f7
Move pdf_info.ps into lib (from toolbin)
And add it to the list of files to install on Unix systems.
Also, tweak the comments in pdf_info.ps to reflect its new home.
base/unixinst.mak
lib/pdf_info.ps
2019-12-12 14:26:30 +0000
Chris Liddell <chris.liddell@artifex.com>
e39d57f23585b6fe71db5433dc205459be7a3c22
Tweak to handle .shellarguments throwing an error
.shellarguments for quite some time has thrown an undefined error if Ghostscript
is not invoked with the '--' option, so handle that.
toolbin/pdf_info.ps
2019-12-12 14:16:41 +0000
Chris Liddell <chris.liddell@artifex.com>
72f6dd34cd0732cb7cdd9246d5063fc0f70ce79b
Add hex string representation of font names
Mainly CIDFonts come up with multibyte characters in their names, hence making
the normal Postscript string pretty meaningless. This adds a hex string
representation which can be used in Fontmap.GS or cidfmap for subsitution.
toolbin/pdf_info.ps
2019-12-12 13:07:46 +0000
Chris Liddell <chris.liddell@artifex.com>
bcb6fb284fcbe776d9ddd44f98d196da7df2c054
Add NDEBUG to the optimised build flags
Without that, asserts get included in an optimised build, which we don't want.
base/unix-gcc.mak
base/unixansi.mak
configure.ac
psi/msvc.mak
2019-12-10 15:37:35 +0000
Chris Liddell <chris.liddell@artifex.com>
044848a1752273471e9deab826045eca82030d62
Reinstate basic regular expression compatibility
In Basic Regular Expressions `+' is an ordinary character, use `*' instead.
This also maintains consistency with the equivalent code a few lines above in
the file.
jbig2dec/autogen.sh
2019-12-09 03:00:42 +0000
Ken Sharp <ken.sharp@artifex.com>
35828fce7ad795c546831520b7a57ef233453b43
txtwrite - don't close the device on media size changes
Bug #701971 "txtwrite incomplete for certain files and differs when stdout versus file is output"
The problem is nothing to do with stdout vs file. The difference is due
to the fact that the input PDF file has multiple pages with different
media sizes. When the media size is changed the default put_params()
method closes and reopens the device. When the txtwrite device is
closed it closes its output file. Re-opening the device opens a new
file, if the filename doesn not have a %d then the sam file is opened
which will of course truncate it.
Writing to stdout obviously doesn't have this behaviour when the output
file is closed.
We don't need to close the txtwrite device when the media size changes
so here we patch the 'is_open' flag to prevent the default method
from closing the device.
devices/vector/gdevtxtw.c
2019-12-06 21:45:09 +0000
Chris Liddell <chris.liddell@artifex.com>
b46142c94bde32f620bda18e3bc5912fbf999446
Bug 701973: Fix gssprintf.c includes for PRI macros
The header inclusion in gssprintf.c meant the definitions of the PRI macros
for string formatting could be inconsistent with other source files.
Adding the appropriate headers in the correct order resolves that issue.
base/gssprintf.c
base/lib.mak
2019-12-06 21:44:13 +0000
Chris Liddell <chris.liddell@artifex.com>
a4c78f01d9a1bd9862b575f33aa48afddd167005
Fix configure based build for post-Sun Solaris releases
base/stdint_.h
configure.ac
2019-12-07 15:02:15 +0000
Ken Sharp <ken.sharp@artifex.com>
3bf992e26006c8af9e137822159eb7c7540462c0
PDF interpreter - Accept /ColorSpace as well as /CS in group attribute dictionary
Again, no bug report, the customer has asked that the file be kept
confidential
The problem is due to a group attribute dictionary for an SMask. The
dictionary is required to contain a /CS (colour space) entry in order
to correctly set the background. In this case, however, the dictionary
contains a /ColorSpace entry.
I've chosen to implement treating the /ColorSpace as a /CS entry, this
is not what Acrobat does, but mimicking Acrobat's behaviour is more or
less impossible for us. We do emit a warning.
Resource/Init/pdf_draw.ps
2019-12-06 18:43:28 +0000
Ken Sharp <ken.sharp@artifex.com>
539fe73419fdf00ffd7747a2cf890e56bc6f0504
PDF interpreter - cope with legal but sub-optimal indirect /Pattern
No bug, the report is from a customer who wants the file to be treated
confidentially.
The files uses a Pattern colour space, which it defines in a highly
peculiar fashion:
stream
....
/CS0 cs /P0 scn
....
endstream
CS0 is defined as:
/CS0 22 0 R
and object 22 is:
22 0 obj
[ 23 0 R ]
endobj
23 0 obj
/Pattern
endobj
The PDF interpreter wasn't prepared to handle the name being an indirect
reference.
Resource/Init/pdf_draw.ps
2019-11-21 09:54:53 -0800
Ray Johnston <ray.johnston@artifex.com>
5dfca9b93a17806e11d54068a6e5b9705f3b6bc6
Fix problem with setup_trans being undone by grestore
Noticed with text from Bug688728.pdf, but the offending method was
also an issue with 'sh' and 'image' operations where the setup_trans
invocation was withing a gsave ... grestore. The BlendMode and other
graphics state parameters would be reset by the grestore.
Also some places could get errors from pathbbox and/or strokepath
due to a non-invertable matrix, so errors from these now just emit
an empty bbox [ 0 0 0 0 ].
Resource/Init/pdf_draw.ps
Resource/Init/pdf_main.ps
Resource/Init/pdf_ops.ps
2019-12-05 12:50:26 +0000
Chris Liddell <chris.liddell@artifex.com>
fbd776580b26bdf27bcf5778dea94b446c786f67
Coverity ID 351435: reduce buffer size passed to strncat()
Fixes an (unlikely) potential buffer overflow
base/gp_unix.c
2019-12-04 12:23:02 +0000
Chris Liddell <chris.liddell@artifex.com>
53ab3ecee8a60d412c2bf1406340bf9cb228e106
Bug 701969: Fix fontconfig path permissions handling
The paths from fontconfig to be added to the permit file reading list was not
having the trailing directory separator added to indicate we want to allow
the directory to be read.
Also, tweak the path/filename splitting (for the permit file read list) when
parsing the cidfmap so it matches the improved version in gs_fonts.ps
Resource/Init/gs_cidfm.ps
base/gp_unix.c
2019-12-02 18:24:09 +0000
Ken Sharp <ken.sharp@artifex.com>
c25d59001421845d0ff74735388d450d62b459d5
PDF interpreter - improve /Polygon annotation appearance creation
Bug #701889 "Annotation objects missing or incorrectly interpreted when appearance missing"
Another case of failing to stroke the border of an annotation if it had
no interior colour. We still don't support the 'Cloudy' Border Effect.
Resource/Init/pdf_draw.ps
2019-12-02 17:59:34 +0000
Ken Sharp <ken.sharp@artifex.com>
11f6202373fc546cc10d08acfb5ca0463df20437
PDF interpreter - generate callout (/CL) lines for FreeText annots
Bug #701889 "Annotation objects missing or incorrectly interpreted when appearance is missing"
FreeText annotations can have a /CL (callout) entry, which defines a
line to be drawn to the point referenced by the text.
This is a first pass at the problem, Acrobat generates arrow heads for
the callout lines, this patch does not.
Resource/Init/pdf_draw.ps
2019-12-02 17:19:00 +0000
Ken Sharp <ken.sharp@artifex.com>
182e228cee6b30c6e2f00d8abd20a6791d44323f
PDF interpreter - improve /Square annotation appearance creation
Bug #701889 "Annotation objects missing or incorrectly interpreted when appearance stream missing"
First of probably several changes. In this case we were failing to
stroke the border of a /Square annotation if it had no interior colour
(we did not render the annotation at all).
In addition, when element 3 of the Border array was 0 we were still
drawing a Border, which we should not do (this didn't show up until we
fixed the problem above).
Resource/Init/pdf_draw.ps
2019-12-01 22:04:21 +0000
Chris Liddell <chris.liddell@artifex.com>
c535c0c879162ccd7c88c5b8cc6c3a0847c0babe
Create devdevs.tr correctly
devdevs.tr is an interim list of output and core library "devs" that gets
created and then used, ultimately, to create the gconfig.h header file
(which has the bulid configuration of the graphics library), and the linker
scripts.
When devdevs.tr required creation, we were always appending to the file (if it
already existed), not overwriting it, meaning the list would grow indefinitely,
and contain duplicates.
This looks like a typo: the first line of devdevs.tr creation used a '-a'
echogs paramater, rather than the '-w' parameter.
I think this should solve the problem.
base/gs.mak
2019-12-01 21:55:48 +0000
Chris Liddell <chris.liddell@artifex.com>
aa4fa650fa837a6f7b22caad33699bbbf9156bc1
Bug 701957: Explicitly disable webp and ztsd for libtiff
configure.ac
2019-11-29 08:42:15 -0800
Ray Johnston <ray.johnston@artifex.com>
c2b492ad627bdcb476fa3cd15a1c31cc3b6b788d
Fix typo (inadvertent paste) in devices/gdevjbig2.c from f63270230 commit
devices/gdevjbig2.c
2019-11-29 14:40:47 +0000
Julian Smith <jules@op59.net>
8636935ac086f56464f0541ed735f1016f2c3895
Coverity 94659: removed cp_num - was allocated but never actually used.
contrib/opvp/gdevopvp.c
2019-11-29 14:35:25 +0000
Julian Smith <jules@op59.net>
a3f284624a68dcb1ecb72dcf307b42d194e78de1
Coverity 94653: fixed incorrect if() that was logically dead code.
contrib/lips4/gdevl4v.c
2019-11-29 14:15:57 +0000
Julian Smith <jules@op59.net>
ff02f8741f71830e7a4795645680a16b9d7ae106
Coverity 94652: return error from opvp_image_plane_data() rather than segv.
contrib/opvp/gdevopvp.c
2019-11-29 12:40:02 +0000
Julian Smith <jules@op59.net>
f977255de00bb71f5c2627b8692912bb3263ee48
Coverity 94645: added '/* Fall through. */ comments to switch statements.
This should convince Coverity that the fall-through's are intentional.
contrib/lips4/gdevl4r.c
2019-11-29 12:38:10 +0000
Julian Smith <jules@op59.net>
f877f5bc792206085f9edf4143983d4156fb3ae5
Coverity 94638: added '/* Fall through. */ comments to switch statements.
This should convince Coverity that the fall-through's are intentional.
contrib/gdevmd2k.c
2019-11-29 12:33:51 +0000
Julian Smith <jules@op59.net>
39286afa21126c193fcd0f3ccc0800f7c0662ed0
Coverity 94616: added '/* Fall through. */ comments to switch statements
This should convince Coverity that the fall-through's are intentional.
contrib/gdevgdi.c
2019-11-29 12:30:57 +0000
Julian Smith <jules@op59.net>
1c899fc1100f21f6e24096375e2daac26b23f33b
Coverity 94608: added '/* Fall through. */ comments to switch statements.
This should convince Coverity that the fall-through's are intentional.
contrib/lips4/gdevl4v.c
2019-11-29 12:10:19 +0000
Julian Smith <jules@op59.net>
adbf399b79b3e6b645e98acd53f42f9fd5ca9174
Coverity 94601: avoid out-of-bounds access of gendata->dev->hoffset[] if newhead < 0.
contrib/gdevlx32.c
2019-11-29 11:41:05 +0000
Julian Smith <jules@op59.net>
1d04fe90a4c3b82e1286a1b341cdb89a96625715
Coverity 94490: check return codes in opvp_fill_mask().
contrib/opvp/gdevopvp.c
2019-11-28 18:26:56 +0000
Julian Smith <jules@op59.net>
fbd78a0467afb2c66a41d55ee9b3aee0a7a01d7b
Coverity 94511: Use full range of frac when source is 8-bit.
Essentially we use frac2byte() and byte2frac(), instead of frac2cv() and
cv2frac(). This ensures we use full range of frac with the transfer fns.
Note that this change is untested. It is based on observation and discussion
between gs develpoers. This code has not been modified since initial import.
contrib/opvp/gdevopvp.c
2019-11-28 17:00:08 +0000
Julian Smith <jules@op59.net>
a537e5bd4252abdbdc3f90dfdce8dc9fb621b38d
Coverity 94505: converted macros into static fns.
This should avoid Coverity worrying about bits 8-15 always being zero in a call
of write_short().
contrib/gdevmd2k.c
2019-11-28 16:34:49 +0000
Julian Smith <jules@op59.net>
35e0c3f70ba2646b4bdfb41663a708a8594eeb68
Coverity 94553: fixed possible copy&paste error in lips4_image_out().
Use Len_rle instead of Len inside RLE block.
contrib/lips4/gdevl4r.c
2019-11-28 16:08:23 +0000
Julian Smith <jules@op59.net>
792c922fc83aed63090fb37ffc823e75ec8f9c5c
Coverity 95077: fixed various scan-build issues with contrib/japanese/gdevmjc.c.
Some of these will correspond to coverity issues also.
contrib/japanese/gdevmjc.c
2019-11-28 15:44:05 +0000
Julian Smith <jules@op59.net>
efff831b1f3a00c69a32b4edd48614d583f9034a
Coverity 95077: removed unused assignment to <H> variable.
contrib/japanese/gdevmjc.c
2019-11-28 12:05:43 +0000
Julian Smith <jules@op59.net>
94190ff3e48c36a8538a3aba252e2b56909f6984
Coverity 95034: avoid warnings about ignoring return from gs_note_error().
contrib/pcl3/src/gdevpcl3.c
2019-11-28 11:32:14 +0000
Julian Smith <jules@op59.net>
c9f669385954f205d395cbacb2b611d659b3ebf9
Coverity 350199: add '-tainted_data_return' annotation.
This makes this annotation match what has worked elsewhere.
base/scfe.c
2019-11-28 14:36:52 +0000
Chris Liddell <chris.liddell@artifex.com>
fd2b1946fe5a4a8c029324c15f9bd606a489f543
Include the source file libtiff webp compression support
If the webp lib is available, it could cause linker failures if we don't
include the source file.
base/tiff.mak
2019-11-28 11:29:03 +0000
Chris Liddell <chris.liddell@artifex.com>
874ef8cf7f0af2efae3d7fb6598013be5d277384
Enable jpeg support in libtiff if possible
base/tiff.mak
configure.ac
psi/msvc.mak
2019-11-27 15:29:04 +0000
Julian Smith <jules@op59.net>
15f3faeffff7d1b2658b824262314091f7af088b
Coverity 95034: move code so that we have one less call to pcl_cm_is_differential().
fixes scan-build issue, e.g.:
scan-build -o ../scan-build-out make sanitize
contrib/pcl3/src/gdevpcl3.c
2019-11-27 15:27:25 +0000
Julian Smith <jules@op59.net>
6e8c15137a70012776c1b163d7480e1a2cc7c61b
Coverity 95034: removed use of guard() macro.
Instead use static fn to convert error codes, with explicit inline code.
contrib/pcl3/src/gdevpcl3.c
2019-11-27 14:29:41 +0000
Julian Smith <jules@op59.net>
7e1c4da27805ab9b545bc8ab5b0747c37b69454c
Coverity 95034: refactor pcl3_print_page() to avoid leaks.
contrib/pcl3/src/gdevpcl3.c
2019-11-27 13:11:29 +0000
Julian Smith <jules@op59.net>
1df794e69d9f29dae215e50cf328ccad40fe29e8
Coverity 95027: fix off-by-one when bounds-checking against LIPS_MEDIACHAR_MAX.
contrib/lips4/gdevl4r.c
2019-11-27 12:52:17 +0000
Julian Smith <jules@op59.net>
e9ccb4139c5f3fb89a5f4d6554e73323dbf73641
Coverity 94957: Call dlclose() to avoid leaks of handles from dlopen().
contrib/opvp/gdevopvp.c
2019-11-27 11:39:28 +0000
Julian Smith <jules@op59.net>
e4dcc70672b447df52b0a3c7976ab6ece280841e
Coverity 350199: mark cf_encode_1d() as not tainting lbuf.
This may work better than the previous annotation.
base/scfe.c
2019-11-26 12:04:54 -0800
Ray Johnston <ray.johnston@artifex.com>
334132f45320ef35b54032c053c100d07e02ec98
Fix problems seen with m8510 device and improve gdev_prn_copy_scan_lines
Previous patch made this device pay attention to return code from the
gdev_prn_copy_scan_lines, which caused the all_devices test to get an error.
Also this device would get an ioerror if the page width was not a multiple
of 8. Fix m8510_output_run to round up when setting out_end, bullet proof
check of count so we don't try and print with a negative count.
Also fix gdev_prn_copy_scan_lines to return count == 0 if the starting
line is past the end of the page, and fill lines past end of page with
zeroes if the count did not fill it (or if there was an error from
gdev_prn_get_bits).
base/gdevprn.c
devices/gdev8510.c
2019-11-26 14:43:58 +0000
Robin Watts <Robin.Watts@artifex.com>
23b4705f975ee0d4288ad47e62ffb8737ced48a8
GPDL PNG support
gpdl/gpdl.mak
gpdl/jp2ktop.c
gpdl/pngtop.c
pcl/pl/plimpl.c
windows/ghostpdl.vcproj
2019-11-26 14:35:05 +0000
Robin Watts <Robin.Watts@artifex.com>
b772aaf901a3cd37baf5c06eb141c689829bf673
Bug 701949: Add 'omitEOD' flag to RLE compressor and use for PXL.
It turns out that some printers (Samsung ML-2250 and Canon
ImageRunner iRC2380i at least) object to the EOD byte appearing
in RLE data in PXL streams.
Ken kindly checked the PXL spec for me, and found that: "The PXL
spec does say a control code of -128 is ignored and not included
in the decompressed data and the byte following a control byte
of 128 (I assume they mean -128 here) is treated as the next
control byte. And PCL only uses RLE data for images, so they do
know how much data they expect."
Thus, the conclusion we reached is that PCL/PXL don't need
(indeed, really does not want) the EOD byte.
The Postscript spec clearly defines the EOD byte though. Rather
than break the streams for postscript, we introduce a flag
'omitEOD' that can be set for the encoder when we want to produce
a stream for use with PCL/PXL.
base/srle.c
base/srlx.h
devices/vector/gdevpx.c
psi/zfilter.c
2019-11-27 13:27:35 +0000
Chris Liddell <chris.liddell@artifex.com>
c9ed069d86f291dc3118ee96f76765432ac478e3
Update thirdparty.htm to reflect updated libs
doc/thirdparty.htm
2019-11-26 14:39:02 +0000
Chris Liddell <chris.liddell@artifex.com>
79ac3f84060fbd5447219264ab0bcf89c7caa2cf
Update Freetype to 2.4.10
Plus makefile updates to support it
Bug 701288: Handle SEAC ligature glyph metrics correctly.
As originally intended, a Type 1 SEAC charstring would be used for an accented
glyph (like an a-caron, or u-umlaut) where the advance with of the SEAC glyph
is the same as that of the 'base' glyph ('a' or 'u').
It this case, it is not uncommon for the SEAC to skip using an (H)SBW op code
and rely on the one from the base glyph.
But out of spec fonts also use SEAC glyphs ligature glyphs (like 'oe' or 'fi'),
and in those cases the overall advance width is greater than that of the 'base'
glyph.
In this case, we have to allow for the SEAC glyph having included an (H)SBW and
if it has, retain those values, rather than those from the base glyph.
Rename file and make file change to match
Avoids file name clash with freetype 2.4.10
Work around a change in the zlib API for 1.2.11
where it's used in the Freetype/zlib interface debugging code.
base/freetype.mak
base/lcupsi.mak
cups/libs/filter/cupsraster.c
freetype/CMakeLists.txt
freetype/ChangeLog
freetype/ChangeLog.20
freetype/ChangeLog.21
freetype/ChangeLog.22
freetype/ChangeLog.23
freetype/ChangeLog.24
freetype/ChangeLog.25
freetype/ChangeLog.26
freetype/ChangeLog.27
freetype/ChangeLog.28
freetype/ChangeLog.29
freetype/Jamfile
freetype/Jamrules
freetype/Makefile
freetype/README
freetype/README.git
freetype/autogen.sh
freetype/builds/amiga/README
freetype/builds/amiga/include/config/ftconfig.h
freetype/builds/amiga/include/config/ftmodule.h
freetype/builds/amiga/makefile
freetype/builds/amiga/makefile.os4
freetype/builds/amiga/smakefile
freetype/builds/amiga/src/base/ftdebug.c
freetype/builds/amiga/src/base/ftsystem.c
freetype/builds/ansi/ansi-def.mk
freetype/builds/ansi/ansi.mk
freetype/builds/beos/beos-def.mk
freetype/builds/beos/beos.mk
freetype/builds/beos/detect.mk
freetype/builds/cmake/iOS.cmake
freetype/builds/cmake/testbuild.sh
freetype/builds/compiler/ansi-cc.mk
freetype/builds/compiler/bcc-dev.mk
freetype/builds/compiler/bcc.mk
freetype/builds/compiler/emx.mk
freetype/builds/compiler/gcc-dev.mk
freetype/builds/compiler/gcc.mk
freetype/builds/compiler/intelc.mk
freetype/builds/compiler/unix-lcc.mk
freetype/builds/compiler/visualage.mk
freetype/builds/compiler/visualc.mk
freetype/builds/compiler/watcom.mk
freetype/builds/compiler/win-lcc.mk
freetype/builds/detect.mk
freetype/builds/dos/detect.mk
freetype/builds/dos/dos-def.mk
freetype/builds/dos/dos-emx.mk
freetype/builds/dos/dos-gcc.mk
freetype/builds/dos/dos-wat.mk
freetype/builds/exports.mk
freetype/builds/freetype.mk
freetype/builds/link_dos.mk
freetype/builds/link_std.mk
freetype/builds/mac/README
freetype/builds/mac/freetype-Info.plist
freetype/builds/mac/ftmac.c
freetype/builds/modules.mk
freetype/builds/os2/detect.mk
freetype/builds/os2/os2-def.mk
freetype/builds/os2/os2-dev.mk
freetype/builds/os2/os2-gcc.mk
freetype/builds/symbian/bld.inf
freetype/builds/symbian/freetype.mmp
freetype/builds/toplevel.mk
freetype/builds/unix/aclocal.m4
freetype/builds/unix/config.guess
freetype/builds/unix/config.sub
freetype/builds/unix/configure
freetype/builds/unix/configure.ac
freetype/builds/unix/configure.raw
freetype/builds/unix/detect.mk
freetype/builds/unix/freetype-config.in
freetype/builds/unix/freetype2.m4
freetype/builds/unix/ft-munmap.m4
freetype/builds/unix/ftconfig.in
freetype/builds/unix/ftsystem.c
freetype/builds/unix/install-sh
freetype/builds/unix/install.mk
freetype/builds/unix/ltmain.sh
freetype/builds/unix/unix-cc.in
freetype/builds/unix/unix-def.in
freetype/builds/unix/unix-dev.mk
freetype/builds/unix/unix-lcc.mk
freetype/builds/unix/unix.mk
freetype/builds/unix/unixddef.mk
freetype/builds/vms/LIBS.OPT_IA64
freetype/builds/vms/_LINK.OPT_IA64
freetype/builds/vms/ftconfig.h
freetype/builds/vms/ftsystem.c
freetype/builds/vms/vmslib.dat
freetype/builds/wince/ftdebug.c
freetype/builds/wince/vc2005-ce/freetype.vcproj
freetype/builds/wince/vc2005-ce/index.html
freetype/builds/wince/vc2008-ce/freetype.vcproj
freetype/builds/wince/vc2008-ce/index.html
freetype/builds/windows/detect.mk
freetype/builds/windows/ftdebug.c
freetype/builds/windows/vc2005/freetype.sln
freetype/builds/windows/vc2005/freetype.vcproj
freetype/builds/windows/vc2005/index.html
freetype/builds/windows/vc2008/freetype.sln
freetype/builds/windows/vc2008/freetype.vcproj
freetype/builds/windows/vc2008/index.html
freetype/builds/windows/vc2010/freetype.vcxproj
freetype/builds/windows/vc2010/freetype.vcxproj.filters
freetype/builds/windows/vc2010/index.html
freetype/builds/windows/visualc/freetype.dsp
freetype/builds/windows/visualc/freetype.sln
freetype/builds/windows/visualc/freetype.vcproj
freetype/builds/windows/visualc/index.html
freetype/builds/windows/visualce/freetype.dsp
freetype/builds/windows/visualce/freetype.vcproj
freetype/builds/windows/visualce/index.html
freetype/builds/windows/w32-bcc.mk
freetype/builds/windows/w32-bccd.mk
freetype/builds/windows/w32-dev.mk
freetype/builds/windows/w32-gcc.mk
freetype/builds/windows/w32-icc.mk
freetype/builds/windows/w32-intl.mk
freetype/builds/windows/w32-lcc.mk
freetype/builds/windows/w32-mingw32.mk
freetype/builds/windows/w32-vcc.mk
freetype/builds/windows/w32-wat.mk
freetype/builds/windows/win32-def.mk
freetype/configure
freetype/devel/ft2build.h
freetype/devel/ftoption.h
freetype/docs/CHANGES
freetype/docs/CUSTOMIZE
freetype/docs/DEBUG
freetype/docs/DOCGUIDE
freetype/docs/INSTALL
freetype/docs/INSTALL.ANY
freetype/docs/INSTALL.CROSS
freetype/docs/INSTALL.GNU
freetype/docs/INSTALL.UNIX
freetype/docs/INSTALL.VMS
freetype/docs/MAKEPP
freetype/docs/TODO
freetype/docs/VERSIONS.TXT
freetype/docs/formats.txt
freetype/docs/freetype-config.1
freetype/docs/raster.txt
freetype/docs/reference/README
freetype/docs/reference/ft2-auto_hinter.html
freetype/docs/reference/ft2-base_interface.html
freetype/docs/reference/ft2-basic_types.html
freetype/docs/reference/ft2-bdf_fonts.html
freetype/docs/reference/ft2-bitmap_handling.html
freetype/docs/reference/ft2-bzip2.html
freetype/docs/reference/ft2-cache_subsystem.html
freetype/docs/reference/ft2-cff_driver.html
freetype/docs/reference/ft2-cid_fonts.html
freetype/docs/reference/ft2-computations.html
freetype/docs/reference/ft2-error_code_values.html
freetype/docs/reference/ft2-error_enumerations.html
freetype/docs/reference/ft2-font_formats.html
freetype/docs/reference/ft2-gasp_table.html
freetype/docs/reference/ft2-glyph_management.html
freetype/docs/reference/ft2-glyph_stroker.html
freetype/docs/reference/ft2-glyph_variants.html
freetype/docs/reference/ft2-gx_validation.html
freetype/docs/reference/ft2-gzip.html
freetype/docs/reference/ft2-header_file_macros.html
freetype/docs/reference/ft2-header_inclusion.html
freetype/docs/reference/ft2-incremental.html
freetype/docs/reference/ft2-index.html
freetype/docs/reference/ft2-lcd_filtering.html
freetype/docs/reference/ft2-list_processing.html
freetype/docs/reference/ft2-lzw.html
freetype/docs/reference/ft2-mac_specific.html
freetype/docs/reference/ft2-module_management.html
freetype/docs/reference/ft2-multiple_masters.html
freetype/docs/reference/ft2-ot_validation.html
freetype/docs/reference/ft2-outline_processing.html
freetype/docs/reference/ft2-parameter_tags.html
freetype/docs/reference/ft2-pcf_driver.html
freetype/docs/reference/ft2-pfr_fonts.html
freetype/docs/reference/ft2-properties.html
freetype/docs/reference/ft2-quick_advance.html
freetype/docs/reference/ft2-raster.html
freetype/docs/reference/ft2-sfnt_names.html
freetype/docs/reference/ft2-sizes_management.html
freetype/docs/reference/ft2-system_interface.html
freetype/docs/reference/ft2-t1_cid_driver.html
freetype/docs/reference/ft2-toc.html
freetype/docs/reference/ft2-truetype_engine.html
freetype/docs/reference/ft2-truetype_tables.html
freetype/docs/reference/ft2-tt_driver.html
freetype/docs/reference/ft2-type1_tables.html
freetype/docs/reference/ft2-user_allocation.html
freetype/docs/reference/ft2-version.html
freetype/docs/reference/ft2-winfnt_fonts.html
freetype/docs/reference/site/404.html
freetype/docs/reference/site/assets/fonts/font-awesome.css
freetype/docs/reference/site/assets/fonts/material-icons.css
freetype/docs/reference/site/assets/fonts/specimen/FontAwesome.ttf
freetype/docs/reference/site/assets/fonts/specimen/FontAwesome.woff
freetype/docs/reference/site/assets/fonts/specimen/FontAwesome.woff2
freetype/docs/reference/site/assets/fonts/specimen/MaterialIcons-Regular.ttf
freetype/docs/reference/site/assets/fonts/specimen/MaterialIcons-Regular.woff
freetype/docs/reference/site/assets/fonts/specimen/MaterialIcons-Regular.woff2
freetype/docs/reference/site/assets/images/favicon.png
freetype/docs/reference/site/assets/images/icons/bitbucket.1b09e088.svg
freetype/docs/reference/site/assets/images/icons/github.f0b8504a.svg
freetype/docs/reference/site/assets/images/icons/gitlab.6dd19c00.svg
freetype/docs/reference/site/assets/javascripts/application.d9aa80ab.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.da.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.de.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.du.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.es.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.fi.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.fr.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.hu.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.it.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.ja.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.jp.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.multi.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.nl.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.no.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.pt.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.ro.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.ru.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.stemmer.support.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.sv.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.th.js
freetype/docs/reference/site/assets/javascripts/lunr/lunr.tr.js
freetype/docs/reference/site/assets/javascripts/lunr/tinyseg.js
freetype/docs/reference/site/assets/javascripts/lunr/wordcut.js
freetype/docs/reference/site/assets/javascripts/modernizr.1f0bcf2b.js
freetype/docs/reference/site/assets/stylesheets/application-palette.224b79ff.css
freetype/docs/reference/site/assets/stylesheets/application.982221ab.css
freetype/docs/reference/site/ft2-auto_hinter.html
freetype/docs/reference/site/ft2-base_interface.html
freetype/docs/reference/site/ft2-basic_types.html
freetype/docs/reference/site/ft2-bdf_fonts.html
freetype/docs/reference/site/ft2-bitmap_handling.html
freetype/docs/reference/site/ft2-bzip2.html
freetype/docs/reference/site/ft2-cache_subsystem.html
freetype/docs/reference/site/ft2-cff_driver.html
freetype/docs/reference/site/ft2-cid_fonts.html
freetype/docs/reference/site/ft2-color_management.html
freetype/docs/reference/site/ft2-computations.html
freetype/docs/reference/site/ft2-error_code_values.html
freetype/docs/reference/site/ft2-error_enumerations.html
freetype/docs/reference/site/ft2-font_formats.html
freetype/docs/reference/site/ft2-gasp_table.html
freetype/docs/reference/site/ft2-glyph_management.html
freetype/docs/reference/site/ft2-glyph_stroker.html
freetype/docs/reference/site/ft2-glyph_variants.html
freetype/docs/reference/site/ft2-gx_validation.html
freetype/docs/reference/site/ft2-gzip.html
freetype/docs/reference/site/ft2-header_file_macros.html
freetype/docs/reference/site/ft2-header_inclusion.html
freetype/docs/reference/site/ft2-incremental.html
freetype/docs/reference/site/ft2-index.html
freetype/docs/reference/site/ft2-layer_management.html
freetype/docs/reference/site/ft2-lcd_rendering.html
freetype/docs/reference/site/ft2-list_processing.html
freetype/docs/reference/site/ft2-lzw.html
freetype/docs/reference/site/ft2-mac_specific.html
freetype/docs/reference/site/ft2-module_management.html
freetype/docs/reference/site/ft2-multiple_masters.html
freetype/docs/reference/site/ft2-ot_validation.html
freetype/docs/reference/site/ft2-outline_processing.html
freetype/docs/reference/site/ft2-parameter_tags.html
freetype/docs/reference/site/ft2-pcf_driver.html
freetype/docs/reference/site/ft2-pfr_fonts.html
freetype/docs/reference/site/ft2-properties.html
freetype/docs/reference/site/ft2-quick_advance.html
freetype/docs/reference/site/ft2-raster.html
freetype/docs/reference/site/ft2-sfnt_names.html
freetype/docs/reference/site/ft2-sizes_management.html
freetype/docs/reference/site/ft2-system_interface.html
freetype/docs/reference/site/ft2-t1_cid_driver.html
freetype/docs/reference/site/ft2-truetype_engine.html
freetype/docs/reference/site/ft2-truetype_tables.html
freetype/docs/reference/site/ft2-tt_driver.html
freetype/docs/reference/site/ft2-type1_tables.html
freetype/docs/reference/site/ft2-user_allocation.html
freetype/docs/reference/site/ft2-version.html
freetype/docs/reference/site/ft2-winfnt_fonts.html
freetype/docs/reference/site/images/favico.ico
freetype/docs/reference/site/index.html
freetype/docs/reference/site/javascripts/extra.js
freetype/docs/reference/site/search/search_index.json
freetype/docs/reference/site/sitemap.xml
freetype/docs/reference/site/sitemap.xml.gz
freetype/docs/reference/site/stylesheets/extra.css
freetype/docs/release
freetype/include/freetype/config/ftconfig.h
freetype/include/freetype/config/ftheader.h
freetype/include/freetype/config/ftmodule.h
freetype/include/freetype/config/ftoption.h
freetype/include/freetype/config/ftstdlib.h
freetype/include/freetype/freetype.h
freetype/include/freetype/ftadvanc.h
freetype/include/freetype/ftbbox.h
freetype/include/freetype/ftbdf.h
freetype/include/freetype/ftbitmap.h
freetype/include/freetype/ftbzip2.h
freetype/include/freetype/ftcache.h
freetype/include/freetype/ftchapters.h
freetype/include/freetype/ftcid.h
freetype/include/freetype/ftcolor.h
freetype/include/freetype/ftdriver.h
freetype/include/freetype/fterrdef.h
freetype/include/freetype/fterrors.h
freetype/include/freetype/ftfntfmt.h
freetype/include/freetype/ftgasp.h
freetype/include/freetype/ftglyph.h
freetype/include/freetype/ftgxval.h
freetype/include/freetype/ftgzip.h
freetype/include/freetype/ftimage.h
freetype/include/freetype/ftincrem.h
freetype/include/freetype/ftlcdfil.h
freetype/include/freetype/ftlist.h
freetype/include/freetype/ftlzw.h
freetype/include/freetype/ftmac.h
freetype/include/freetype/ftmm.h
freetype/include/freetype/ftmodapi.h
freetype/include/freetype/ftmoderr.h
freetype/include/freetype/ftotval.h
freetype/include/freetype/ftoutln.h
freetype/include/freetype/ftparams.h
freetype/include/freetype/ftpfr.h
freetype/include/freetype/ftrender.h
freetype/include/freetype/ftsizes.h
freetype/include/freetype/ftsnames.h
freetype/include/freetype/ftstroke.h
freetype/include/freetype/ftsynth.h
freetype/include/freetype/ftsystem.h
freetype/include/freetype/fttrigon.h
freetype/include/freetype/fttypes.h
freetype/include/freetype/ftwinfnt.h
freetype/include/freetype/internal/autohint.h
freetype/include/freetype/internal/cffotypes.h
freetype/include/freetype/internal/cfftypes.h
freetype/include/freetype/internal/ftcalc.h
freetype/include/freetype/internal/ftdebug.h
freetype/include/freetype/internal/ftdrv.h
freetype/include/freetype/internal/ftgloadr.h
freetype/include/freetype/internal/fthash.h
freetype/include/freetype/internal/ftmemory.h
freetype/include/freetype/internal/ftobjs.h
freetype/include/freetype/internal/ftpic.h
freetype/include/freetype/internal/ftpsprop.h
freetype/include/freetype/internal/ftrfork.h
freetype/include/freetype/internal/ftserv.h
freetype/include/freetype/internal/ftstream.h
freetype/include/freetype/internal/fttrace.h
freetype/include/freetype/internal/ftvalid.h
freetype/include/freetype/internal/internal.h
freetype/include/freetype/internal/psaux.h
freetype/include/freetype/internal/pshints.h
freetype/include/freetype/internal/services/svbdf.h
freetype/include/freetype/internal/services/svcfftl.h
freetype/include/freetype/internal/services/svcid.h
freetype/include/freetype/internal/services/svfntfmt.h
freetype/include/freetype/internal/services/svgldict.h
freetype/include/freetype/internal/services/svgxval.h
freetype/include/freetype/internal/services/svkern.h
freetype/include/freetype/internal/services/svmetric.h
freetype/include/freetype/internal/services/svmm.h
freetype/include/freetype/internal/services/svotval.h
freetype/include/freetype/internal/services/svpfr.h
freetype/include/freetype/internal/services/svpostnm.h
freetype/include/freetype/internal/services/svprop.h
freetype/include/freetype/internal/services/svpscmap.h
freetype/include/freetype/internal/services/svpsinfo.h
freetype/include/freetype/internal/services/svsfnt.h
freetype/include/freetype/internal/services/svttcmap.h
freetype/include/freetype/internal/services/svtteng.h
freetype/include/freetype/internal/services/svttglyf.h
freetype/include/freetype/internal/services/svwinfnt.h
freetype/include/freetype/internal/sfnt.h
freetype/include/freetype/internal/t1types.h
freetype/include/freetype/internal/tttypes.h
freetype/include/freetype/internal/wofftypes.h
freetype/include/freetype/t1tables.h
freetype/include/freetype/ttnameid.h
freetype/include/freetype/tttables.h
freetype/include/freetype/tttags.h
freetype/include/ft2build.h
freetype/modules.cfg
freetype/src/Jamfile
freetype/src/autofit/Jamfile
freetype/src/autofit/afangles.c
freetype/src/autofit/afangles.h
freetype/src/autofit/afblue.c
freetype/src/autofit/afblue.cin
freetype/src/autofit/afblue.dat
freetype/src/autofit/afblue.h
freetype/src/autofit/afblue.hin
freetype/src/autofit/afcjk.c
freetype/src/autofit/afcjk.h
freetype/src/autofit/afcover.h
freetype/src/autofit/afdummy.c
freetype/src/autofit/afdummy.h
freetype/src/autofit/aferrors.h
freetype/src/autofit/afglobal.c
freetype/src/autofit/afglobal.h
freetype/src/autofit/afhints.c
freetype/src/autofit/afhints.h
freetype/src/autofit/afindic.c
freetype/src/autofit/afindic.h
freetype/src/autofit/aflatin.c
freetype/src/autofit/aflatin.h
freetype/src/autofit/aflatin2.c
freetype/src/autofit/aflatin2.h
freetype/src/autofit/afloader.c
freetype/src/autofit/afloader.h
freetype/src/autofit/afmodule.c
freetype/src/autofit/afmodule.h
freetype/src/autofit/afpic.c
freetype/src/autofit/afpic.h
freetype/src/autofit/afranges.c
freetype/src/autofit/afranges.h
freetype/src/autofit/afscript.h
freetype/src/autofit/afshaper.c
freetype/src/autofit/afshaper.h
freetype/src/autofit/afstyles.h
freetype/src/autofit/aftypes.h
freetype/src/autofit/afwarp.c
freetype/src/autofit/afwarp.h
freetype/src/autofit/afwrtsys.h
freetype/src/autofit/autofit.c
freetype/src/autofit/module.mk
freetype/src/autofit/rules.mk
freetype/src/base/Jamfile
freetype/src/base/basepic.c
freetype/src/base/basepic.h
freetype/src/base/ftadvanc.c
freetype/src/base/ftapi.c
freetype/src/base/ftbase.c
freetype/src/base/ftbase.h
freetype/src/base/ftbbox.c
freetype/src/base/ftbdf.c
freetype/src/base/ftbitmap.c
freetype/src/base/ftcalc.c
freetype/src/base/ftcid.c
freetype/src/base/ftcolor.c
freetype/src/base/ftdbgmem.c
freetype/src/base/ftdebug.c
freetype/src/base/fterrors.c
freetype/src/base/ftfntfmt.c
freetype/src/base/ftfstype.c
freetype/src/base/ftgasp.c
freetype/src/base/ftgloadr.c
freetype/src/base/ftglyph.c
freetype/src/base/ftgxval.c
freetype/src/base/fthash.c
freetype/src/base/ftinit.c
freetype/src/base/ftlcdfil.c
freetype/src/base/ftmac.c
freetype/src/base/ftmm.c
freetype/src/base/ftobjs.c
freetype/src/base/ftotval.c
freetype/src/base/ftoutln.c
freetype/src/base/ftpatent.c
freetype/src/base/ftpfr.c
freetype/src/base/ftpic.c
freetype/src/base/ftpsprop.c
freetype/src/base/ftrfork.c
freetype/src/base/ftsnames.c
freetype/src/base/ftstream.c
freetype/src/base/ftstroke.c
freetype/src/base/ftsynth.c
freetype/src/base/ftsystem.c
freetype/src/base/fttrigon.c
freetype/src/base/fttype1.c
freetype/src/base/ftutil.c
freetype/src/base/ftver.rc
freetype/src/base/ftwinfnt.c
freetype/src/base/rules.mk
freetype/src/bdf/Jamfile
freetype/src/bdf/bdf.h
freetype/src/bdf/bdfdrivr.c
freetype/src/bdf/bdfdrivr.h
freetype/src/bdf/bdferror.h
freetype/src/bdf/bdflib.c
freetype/src/bzip2/Jamfile
freetype/src/bzip2/ftbzip2.c
freetype/src/bzip2/rules.mk
freetype/src/cache/Jamfile
freetype/src/cache/ftcache.c
freetype/src/cache/ftcbasic.c
freetype/src/cache/ftccache.c
freetype/src/cache/ftccache.h
freetype/src/cache/ftccback.h
freetype/src/cache/ftccmap.c
freetype/src/cache/ftcerror.h
freetype/src/cache/ftcglyph.c
freetype/src/cache/ftcglyph.h
freetype/src/cache/ftcimage.c
freetype/src/cache/ftcimage.h
freetype/src/cache/ftcmanag.c
freetype/src/cache/ftcmanag.h
freetype/src/cache/ftcmru.c
freetype/src/cache/ftcmru.h
freetype/src/cache/ftcsbits.c
freetype/src/cache/ftcsbits.h
freetype/src/cache/rules.mk
freetype/src/cff/Jamfile
freetype/src/cff/cff.c
freetype/src/cff/cffcmap.c
freetype/src/cff/cffcmap.h
freetype/src/cff/cffdrivr.c
freetype/src/cff/cffdrivr.h
freetype/src/cff/cfferrs.h
freetype/src/cff/cffgload.c
freetype/src/cff/cffgload.h
freetype/src/cff/cffload.c
freetype/src/cff/cffload.h
freetype/src/cff/cffobjs.c
freetype/src/cff/cffobjs.h
freetype/src/cff/cffparse.c
freetype/src/cff/cffparse.h
freetype/src/cff/cffpic.c
freetype/src/cff/cffpic.h
freetype/src/cff/cfftoken.h
freetype/src/cff/module.mk
freetype/src/cff/rules.mk
freetype/src/cid/Jamfile
freetype/src/cid/ciderrs.h
freetype/src/cid/cidgload.c
freetype/src/cid/cidgload.h
freetype/src/cid/cidload.c
freetype/src/cid/cidload.h
freetype/src/cid/cidobjs.c
freetype/src/cid/cidobjs.h
freetype/src/cid/cidparse.c
freetype/src/cid/cidparse.h
freetype/src/cid/cidriver.c
freetype/src/cid/cidriver.h
freetype/src/cid/cidtoken.h
freetype/src/cid/module.mk
freetype/src/cid/rules.mk
freetype/src/cid/type1cid.c
freetype/src/gxvalid/Jamfile
freetype/src/gxvalid/README
freetype/src/gxvalid/gxvalid.c
freetype/src/gxvalid/gxvalid.h
freetype/src/gxvalid/gxvbsln.c
freetype/src/gxvalid/gxvcommn.c
freetype/src/gxvalid/gxvcommn.h
freetype/src/gxvalid/gxverror.h
freetype/src/gxvalid/gxvfeat.c
freetype/src/gxvalid/gxvfeat.h
freetype/src/gxvalid/gxvfgen.c
freetype/src/gxvalid/gxvjust.c
freetype/src/gxvalid/gxvkern.c
freetype/src/gxvalid/gxvlcar.c
freetype/src/gxvalid/gxvmod.c
freetype/src/gxvalid/gxvmod.h
freetype/src/gxvalid/gxvmort.c
freetype/src/gxvalid/gxvmort.h
freetype/src/gxvalid/gxvmort0.c
freetype/src/gxvalid/gxvmort1.c
freetype/src/gxvalid/gxvmort2.c
freetype/src/gxvalid/gxvmort4.c
freetype/src/gxvalid/gxvmort5.c
freetype/src/gxvalid/gxvmorx.c
freetype/src/gxvalid/gxvmorx.h
freetype/src/gxvalid/gxvmorx0.c
freetype/src/gxvalid/gxvmorx1.c
freetype/src/gxvalid/gxvmorx2.c
freetype/src/gxvalid/gxvmorx4.c
freetype/src/gxvalid/gxvmorx5.c
freetype/src/gxvalid/gxvopbd.c
freetype/src/gxvalid/gxvprop.c
freetype/src/gxvalid/gxvtrak.c
freetype/src/gxvalid/module.mk
freetype/src/gxvalid/rules.mk
freetype/src/gzip/Jamfile
freetype/src/gzip/ftgzip.c
freetype/src/gzip/infblock.c
freetype/src/gzip/infcodes.c
freetype/src/gzip/inflate.c
freetype/src/gzip/rules.mk
freetype/src/lzw/Jamfile
freetype/src/lzw/ftlzw.c
freetype/src/lzw/ftzopen.c
freetype/src/lzw/ftzopen.h
freetype/src/lzw/rules.mk
freetype/src/otvalid/Jamfile
freetype/src/otvalid/module.mk
freetype/src/otvalid/otvalid.c
freetype/src/otvalid/otvalid.h
freetype/src/otvalid/otvbase.c
freetype/src/otvalid/otvcommn.c
freetype/src/otvalid/otvcommn.h
freetype/src/otvalid/otverror.h
freetype/src/otvalid/otvgdef.c
freetype/src/otvalid/otvgpos.c
freetype/src/otvalid/otvgpos.h
freetype/src/otvalid/otvgsub.c
freetype/src/otvalid/otvjstf.c
freetype/src/otvalid/otvmath.c
freetype/src/otvalid/otvmod.c
freetype/src/otvalid/otvmod.h
freetype/src/otvalid/rules.mk
freetype/src/pcf/Jamfile
freetype/src/pcf/pcf.h
freetype/src/pcf/pcfdrivr.c
freetype/src/pcf/pcfdrivr.h
freetype/src/pcf/pcferror.h
freetype/src/pcf/pcfread.c
freetype/src/pcf/pcfutil.c
freetype/src/pfr/Jamfile
freetype/src/pfr/module.mk
freetype/src/pfr/pfr.c
freetype/src/pfr/pfrcmap.c
freetype/src/pfr/pfrcmap.h
freetype/src/pfr/pfrdrivr.c
freetype/src/pfr/pfrdrivr.h
freetype/src/pfr/pfrerror.h
freetype/src/pfr/pfrgload.c
freetype/src/pfr/pfrgload.h
freetype/src/pfr/pfrload.c
freetype/src/pfr/pfrload.h
freetype/src/pfr/pfrobjs.c
freetype/src/pfr/pfrobjs.h
freetype/src/pfr/pfrsbit.c
freetype/src/pfr/pfrsbit.h
freetype/src/pfr/pfrtypes.h
freetype/src/pfr/rules.mk
freetype/src/psaux/Jamfile
freetype/src/psaux/afmparse.c
freetype/src/psaux/afmparse.h
freetype/src/psaux/cffdecode.c
freetype/src/psaux/cffdecode.h
freetype/src/psaux/module.mk
freetype/src/psaux/psarrst.c
freetype/src/psaux/psarrst.h
freetype/src/psaux/psaux.c
freetype/src/psaux/psauxerr.h
freetype/src/psaux/psauxmod.c
freetype/src/psaux/psauxmod.h
freetype/src/psaux/psblues.c
freetype/src/psaux/psblues.h
freetype/src/psaux/psconv.c
freetype/src/psaux/psconv.h
freetype/src/psaux/pserror.c
freetype/src/psaux/pserror.h
freetype/src/psaux/psfixed.h
freetype/src/psaux/psfont.c
freetype/src/psaux/psfont.h
freetype/src/psaux/psft.c
freetype/src/psaux/psft.h
freetype/src/psaux/psglue.h
freetype/src/psaux/pshints.c
freetype/src/psaux/pshints.h
freetype/src/psaux/psintrp.c
freetype/src/psaux/psintrp.h
freetype/src/psaux/psobjs.c
freetype/src/psaux/psobjs.h
freetype/src/psaux/psread.c
freetype/src/psaux/psread.h
freetype/src/psaux/psstack.c
freetype/src/psaux/psstack.h
freetype/src/psaux/pstypes.h
freetype/src/psaux/rules.mk
freetype/src/psaux/t1cmap.c
freetype/src/psaux/t1cmap.h
freetype/src/psaux/t1decode.c
freetype/src/psaux/t1decode.h
freetype/src/pshinter/Jamfile
freetype/src/pshinter/module.mk
freetype/src/pshinter/pshalgo.c
freetype/src/pshinter/pshalgo.h
freetype/src/pshinter/pshglob.c
freetype/src/pshinter/pshglob.h
freetype/src/pshinter/pshinter.c
freetype/src/pshinter/pshmod.c
freetype/src/pshinter/pshmod.h
freetype/src/pshinter/pshnterr.h
freetype/src/pshinter/pshpic.c
freetype/src/pshinter/pshpic.h
freetype/src/pshinter/pshrec.c
freetype/src/pshinter/pshrec.h
freetype/src/pshinter/rules.mk
freetype/src/psnames/Jamfile
freetype/src/psnames/module.mk
freetype/src/psnames/psmodule.c
freetype/src/psnames/psmodule.h
freetype/src/psnames/psnamerr.h
freetype/src/psnames/psnames.c
freetype/src/psnames/pspic.c
freetype/src/psnames/pspic.h
freetype/src/psnames/pstables.h
freetype/src/psnames/rules.mk
freetype/src/raster/Jamfile
freetype/src/raster/ftmisc.h
freetype/src/raster/ftraster.c
freetype/src/raster/ftraster.h
freetype/src/raster/ftrend1.c
freetype/src/raster/ftrend1.h
freetype/src/raster/module.mk
freetype/src/raster/raster.c
freetype/src/raster/rasterrs.h
freetype/src/raster/rastpic.c
freetype/src/raster/rastpic.h
freetype/src/raster/rules.mk
freetype/src/sfnt/Jamfile
freetype/src/sfnt/module.mk
freetype/src/sfnt/pngshim.c
freetype/src/sfnt/pngshim.h
freetype/src/sfnt/rules.mk
freetype/src/sfnt/sfdriver.c
freetype/src/sfnt/sfdriver.h
freetype/src/sfnt/sferrors.h
freetype/src/sfnt/sfnt.c
freetype/src/sfnt/sfntpic.c
freetype/src/sfnt/sfntpic.h
freetype/src/sfnt/sfobjs.c
freetype/src/sfnt/sfobjs.h
freetype/src/sfnt/sfwoff.c
freetype/src/sfnt/sfwoff.h
freetype/src/sfnt/ttbdf.c
freetype/src/sfnt/ttbdf.h
freetype/src/sfnt/ttcmap.c
freetype/src/sfnt/ttcmap.h
freetype/src/sfnt/ttcmapc.h
freetype/src/sfnt/ttcolr.c
freetype/src/sfnt/ttcolr.h
freetype/src/sfnt/ttcpal.c
freetype/src/sfnt/ttcpal.h
freetype/src/sfnt/ttkern.c
freetype/src/sfnt/ttkern.h
freetype/src/sfnt/ttload.c
freetype/src/sfnt/ttload.h
freetype/src/sfnt/ttmtx.c
freetype/src/sfnt/ttmtx.h
freetype/src/sfnt/ttpost.c
freetype/src/sfnt/ttpost.h
freetype/src/sfnt/ttsbit.c
freetype/src/sfnt/ttsbit.h
freetype/src/smooth/Jamfile
freetype/src/smooth/ftgrays.c
freetype/src/smooth/ftgrays.h
freetype/src/smooth/ftsmerrs.h
freetype/src/smooth/ftsmooth.c
freetype/src/smooth/ftsmooth.h
freetype/src/smooth/ftspic.c
freetype/src/smooth/ftspic.h
freetype/src/smooth/module.mk
freetype/src/smooth/rules.mk
freetype/src/smooth/smooth.c
freetype/src/tools/afblue.pl
freetype/src/tools/apinames.c
freetype/src/tools/docmaker/content.py
freetype/src/tools/docmaker/docbeauty.py
freetype/src/tools/docmaker/docmaker.py
freetype/src/tools/docmaker/formatter.py
freetype/src/tools/docmaker/sources.py
freetype/src/tools/docmaker/tohtml.py
freetype/src/tools/docmaker/utils.py
freetype/src/tools/ftfuzzer/README
freetype/src/tools/ftfuzzer/ftfuzzer.cc
freetype/src/tools/ftfuzzer/ftmutator.cc
freetype/src/tools/ftfuzzer/rasterfuzzer.cc
freetype/src/tools/ftfuzzer/runinput.cc
freetype/src/tools/glnames.py
freetype/src/tools/update-copyright-year
freetype/src/truetype/Jamfile
freetype/src/truetype/module.mk
freetype/src/truetype/rules.mk
freetype/src/truetype/truetype.c
freetype/src/truetype/ttdriver.c
freetype/src/truetype/ttdriver.h
freetype/src/truetype/tterrors.h
freetype/src/truetype/ttgload.c
freetype/src/truetype/ttgload.h
freetype/src/truetype/ttgxvar.c
freetype/src/truetype/ttgxvar.h
freetype/src/truetype/ttinterp.c
freetype/src/truetype/ttinterp.h
freetype/src/truetype/ttobjs.c
freetype/src/truetype/ttobjs.h
freetype/src/truetype/ttpic.c
freetype/src/truetype/ttpic.h
freetype/src/truetype/ttpload.c
freetype/src/truetype/ttpload.h
freetype/src/truetype/ttsubpix.c
freetype/src/truetype/ttsubpix.h
freetype/src/type1/Jamfile
freetype/src/type1/module.mk
freetype/src/type1/rules.mk
freetype/src/type1/t1afm.c
freetype/src/type1/t1afm.h
freetype/src/type1/t1driver.c
freetype/src/type1/t1driver.h
freetype/src/type1/t1errors.h
freetype/src/type1/t1gload.c
freetype/src/type1/t1gload.h
freetype/src/type1/t1load.c
freetype/src/type1/t1load.h
freetype/src/type1/t1objs.c
freetype/src/type1/t1objs.h
freetype/src/type1/t1parse.c
freetype/src/type1/t1parse.h
freetype/src/type1/t1tokens.h
freetype/src/type1/type1.c
freetype/src/type42/Jam