| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bug #706367 "ESC/Page driver does not set page size correctly"
The PLRM indicates (Table 6.2, page 401, PageSize) that page dimensions
are considered to match if they are within a tolerance of 5 units in
each direction. This device (like others) was insisting on a precise
match.
Just add the tolerance.
I have no way to test this, other than looking at the content of the
output from the device, written to file, which appears to be correct.
|
|
|
|
|
| |
Pick a default paper size so Coverity can see that we never reach
the use of paper_command without having set it.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The device initialize function currently performs 2 jobs. Firstly,
it fills out the device_procs. Secondly, it performs any minimal
initialization required by the device (typically none).
At various points in the code we want to be able to copy procs
from one 'prototype' device to another, so we call initialize
for that. This populates the device procs, but does other work
that typically requires a 'derived device' structure rather
than a vanilla gx_device to work in.
Accordingly, we split the job into two; initialize_device_procs
(the first part) and initialize_device (the second part). The
initialize_device_procs function will set up the initialize_device
function pointer along with the rest if required.
|
|
|
|
|
|
|
|
|
|
| |
Move the initialize procedure out of the device procs table,
and into a bare function pointer at the start of the device proc.
Devices just initialise this, and the rest should fall into place.
This means changes to the device instantion macros (and all the uses
thereof), but makes the code nicer overall. In particular, this
removes the vestigial 'static_procs' structure.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
It used to be that finish_copydevice(dev, const old_dev) would be
used to copy stuff from a prototype to a new instance of a device.
Now, no copying is ever done.
Also, it's a confusing name. Rename it to be 'initialize', which
is clearer. Also, it should become even more appropriate in
future, if we have this function be the one that is responsible
for filling out the procs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are 4 devices (pr201, pr1000, pr150, and pr1000_4) that are
all basically the same code. They differ in the number of lines
of data they deal with at once.
The first 3 use 24, 40 and 48 lines respectively - all numbers
that are multiples of 8. The code reads that many lines at once
and then "transposes" the data to send 'columns' of 24/40/48
pixels at once.
The pr1000_4 variant uses 60 lines. This means we read outside
the input buffer into uninitialised data.
I have my doubts that this device actually works properly, but
the change here simply bumps up the buffer sizes to be larger
and initialises it all to 0 so we get consistent SHAs in cluster
testing.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Some of these will correspond to coverity issues also.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The printers herein read 1bpp data from gs, and then compressed
in terms of bytes. For the case where w%8 != 0, we'd have
uninitialised bits. Solve this by masking the last byte of each
line as appropriate.
Also, ensure that we don't 'overread' lines, check the return
code from the get_bits call, and blank any lines of the buffer
required to bring us up to a multiple of the stripe height.
|
| |
|
| |
|
|
|
|
|
|
|
| |
for sentinel.
Fixes:
./sanbin/gs -r928 -sOutputFile=tmp -sDEVICE=bj10v ../bug-701854.ps
|
|
|
|
|
|
|
| |
Various contrib devices cast a gx_color_index (a 32 or 64
bit value typically containing 24 bits of data) down to
a gx_color_value before manipulating it. This is a typo,
copied into several places in the code. Correct it here.
|
|
|
|
|
|
| |
MSVC is much more sensitive to casting types than gcc is, it
seems. Accordingly avoid making doubles when we want floats, and
make all casts down to int (or byte) explicit.
|
| |
|
|
|
|
|
| |
When called with a low resolution, we can end up dividing by zero.
Spot this in the open call and give a rangecheck error.
|
|
|
|
|
|
|
|
| |
Code is obscure, so this fix merely avoids out-of-range access in the simplest
way possible, without understanding what the code is trying to do.
Fixes:
./sanbin/gs -sOutputFile=tmp -sDEVICE=mj6000c ../bug-701799.pdf
|
|
|
|
|
| |
Fixes:
./sanbin/gs -sOutputFile=tmp -sDEVICE=mj700v2c ../bug-701793.pdf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Here we fix a lot of contrib devices that had been broken by the
changes to gp_file. I believe they all should work OK now.
One of the routines was calling lib_fopen in an unsupported way; this
can't easily be fixed, so we just call gp_fopen instead now.
We also "fix" some test code that was calling gp_fopen and then doing
things that we can't easily do with a gp_file *. This code has reverted
to using FILE *'s and fopen - this might cause issues on compilation as
this code is untested, but it's better than compiling to give code that
crashes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(squash of commits from filesec branch)
Most of this commit is donkeywork conversions of calls from
FILE * -> gp_file *, fwrite -> gp_fwrite etc. Pretty much every
device is touched, along with the clist and parsing code.
The more interesting changes are within gp.h (where the actual
new API is defined), gpmisc.c (where the basic implementations
live), and the platform specific levels (gp_mswin.c, gp_unifs.c
etc where the platform specific implementations have been
tweaked/renamed).
File opening path validation
All file opening routines now call a central routine for
path validation.
This then consults new entries in gs_lib_ctx to see if validation
is enabled or not. If so, it validates the paths by seeing if
they match.
Simple C level functions for adding/removing/clearing paths, exposed
through the gsapi level.
Add 2 postscript operators for path control.
<name> <string> .addcontrolpath -
Add the given <string> (path) to the list of paths for
controlset <name>, where <name> can be:
/PermitFileReading
/PermitFileWriting
/PermitFileControl
(Anything else -> rangecheck)
- .activatepathcontrol -
Enable path control. At this point PS cannot make any
more changes, and all file access is checked.
|
|
|
|
| |
Check return values for gdev_prn_open_printer()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
09-59.PS cycles through every available device, attempting to open each one.
For many devices this results in an invalid configuration (mainly a lack of
output file).
These devices, on being shutdown, ignored the lack of output file, and attempted
to write their final bytes out anyway (attempting to write data to a null
FILE * pointer), causing a segfault.
We now check the return value of gdev_prn_open_printer() and only write those
final bytes if gdev_prn_open_printer() completed successfully.
|
|
|
|
|
|
|
|
| |
The "rpdl" printer driver required an exact match of the page size in
points so that the correct command for selecting the page size was
sent to the printer. Otherwise the printer received the command for a
custom size. Tis is fixed now, allowing a 5-point tolerance (Bug
697348).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change how gstate initialisation is done:
Previously we relied on the imager state being a subset of the gstate (thus
assigning an imager state to a graphics state over wrote to the entries
common to both, and didn't overwrite any already set graphics state specific
entries).
Making the imager and graphics states the same means that approach doesn't work,
so this changes it to initialise the entries individually.
Renames gsistate.c->gsgstate.c and gxistate.h->gxgstate.h
Cleanup and fix the gs_state gc stuff.
Uses different check for pre/post clist pdf14 device
Previously, the code used "is_gstate" in the imager/graphics state object
to determine if the code was being called pre or post clist (post clist would
only ever have had an imager_state so is_gstate = false).
With no imager state any more, that test would no longer work (and I am dubious
about whether it was really safe, anyway). Other places check for the presence
of a clist reader device in the pdf14 device structure - so use that here
too.
Adds initial (NULL) value for show_gstate pointer in gs_state.
Removes the now pointless macro for the contents of the graphics state
Changes function names that had "imager" to use "gstate"
Removes the redundant 'is_state' flag
Cleans up gs_(g)state_putdeviceparams():
Previously we had to similar routines: one took a graphics state, and used the
device from the graphics state, the other took an imager state and the device
as an explicit parameter.
With the removal of the imager state, "merge" those two functions
Replaces gs_state with gs_gstate
It makes for less confusion as it really is a g(raphics)state
|
| |
|
|
|
|
|
| |
These devices now run to completion. I can't verify if the output
is correct however.
|
|
|
|
|
| |
Using "n = n;" causes some versions of gcc to whinge. Trying
(void)n; instead.
|
|
|
|
|
|
|
| |
Workaround as many warnings as possible in the contrib devices.
Removing dead code, checking return values etc, fixing type casts
(char to unsigned char etc).
|
|
|
|
|
| |
In cases where the code is there for potential future use,
comment small sections out or use #ifdef UNUSED.
|
| |
|
|
|
|
| |
No cluster differences
|
|
Squashed into one commit (see branch for details of the evolution of the
branch).
This brings gpcl6 and gxps into the Ghostscript build system, and a shared
set of graphics library object files for all the interpreters.
Also, brings the same configuration options to the pcl and xps products as we
have for Ghostscript.
|