summaryrefslogtreecommitdiff
path: root/contrib
Commit message (Collapse)AuthorAgeFilesLines
* Update postal address in file headersChris Liddell2023-04-041-3/+3
|
* Epson ESC device - add fuzzy matching for media sizesKen Sharp2023-02-171-2/+4
| | | | | | | | | | | | | | 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.
* Fix compiler warnings in contrib devicesChris Liddell2023-01-044-12/+17
| | | | Function protoype mismatch warnings.
* Coverity 375625: Avoid using uninit variable paper_command.Robin Watts2022-02-171-0/+1
| | | | | Pick a default paper size so Coverity can see that we never reach the use of paper_command without having set it.
* Coverity 375426: Avoid using 'paper' without initing it.Robin Watts2022-02-171-4/+6
|
* Coverity 375555/375657: Avoid resource leak on error.Robin Watts2022-02-171-2/+3
| | | | Will probably never happen, but the fix is simple.
* Move contrib from gs_sprintf to gs_snprintf.Robin Watts2022-02-1613-127/+127
|
* Coverity 374391: opvp device NULL dereferenceMichael Vrhel2021-12-051-4/+5
|
* Removal of globals in opvp deviceMichael Vrhel2021-12-026-791/+2070
| | | | | | | | | | | | | | | | | | | | | | Thanks to Robin for suggesting the structure form to get the globals at a common offset for the raster and vector forms of the device. That coupled with pushing the device through all the methods and doing initialization was the biggest effort. Thanks also to Chris for his help in providing understanding as to what this device was actually doing. This commit includes a test harness for the opvp device, which uses the device client API to write out the commands it receives to a text file for comparison. To build the driver use ./build_opv_harness.sh To use the driver use a command line like -sDEVICE=opvp -sDriver=libopv.so -o output.txt -f ./examples/tiger.eps The command lines are always dumped to the same file which is opvp_command_dump.txt. Note that the harness itself has to rely upon globals due to our inability to change the client API.
* Runtime safety of non threadsafe devices and rework globals.Robin Watts2021-11-053-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some devices within Ghostscript (currently the x11 devices, uniprint and opvp/oprp) use non const static variables, so cannot be run in multiple instances at a time. We now maintain a core "count" of how many non-threadsafe devices are being used at any time. This value can be atomically adjusted by calls to gs_lib_ctx_nts_adjust. Non threadsafe devices now call gx_init_non_threadsafe_device either as or as part of their initialise_device proc. This function attempts to increment the non-threadsafe count and fails to init if there is already a non-threadsafe device running. On success, the device finalize method is modified so that it will decrement the count at the end. The known non-threadsafe devices are updated to call this. In order to have somewhere safe to store this count, we introduce a gs_globals structure, shared between instances. Setting this up without race conditions requires some new gp_ functions that can make use of platform specific threading primitives. We have these implemented for both windows and pthread based platforms. On other platforms, we drop back to the old unsafe mechanism for counting instances. While we do this work, we take the opportunity to push the gs_memory_t pointer used for non-threadsafe debug printing into thread local storage. This enables us to remove the remaining GS_THREADSAFE guarded compilation from the source code. What is left is broadly down to allowing debugging collection for statistics, and these are now controlled by specific COLLECT_STATS_XXX defines. It is assumed that anyone wanting to collect such stats is smart enough to not try to do so while using Ghostscript in a multi-instance environment.
* Tweak eprn and pcl3 devices to remove non const statics.Robin Watts2021-10-278-49/+84
| | | | This should make the devices threadsafe.
* Fix bug 704242. Potential memory leak in pcl3opts.cRay Johnston2021-08-241-0/+1
| | | | Thanks to the bug submitter for noticing it and this patch.
* Bug 703957: Update various contrib devices to use decode/encode_color.Robin Watts2021-07-123-34/+54
| | | | | | | | | | | | | | | | | This patch, from Alex Cherepanov, updates the following devices to use decode_color and encode_color rather than relying on the default implementations that lean on the older, obsoleted color mapping functions: cdj670 cdj850 cdj880 cdj890 cdj1600 chp2200 cdnj500 cdj970 lxm3200
* Move more devices towards encode/decode_color.Robin Watts2021-07-013-7/+8
|
* Add gx_blank_get_bits_rectangle.Robin Watts2021-07-011-0/+13
| | | | | | | | | | | | | | | | | | | | | | | High level devices do not generally keep a rendered bitmap version of the page. As such they cannot honour get_bits_rectangle requests. This causes certain rendering operations to fail; notably those that involve ROPs that involve 'D'. This can cause runs to error out prematurely. For instance, a 72dpi page mode PCL run of j9_acrobat.pcl to the lips4v device dies with an error. Accordingly, we add a gx_blank_get_bits_rectangle routine that returns 'empty' rectangles, and we make lips4v use that. This gives imperfect renderings (in the same way that pdfwriting files that use ROPs gives imperfect renderings), but we do at least get a rendering out at the end. In testing this, I found a suspect spot in lips4v where valgrind spots us operating on uninitialised data. Patch around that to init it to 0 to quell valgrind.
* Split initialize device proc into two.Robin Watts2021-04-2629-387/+204
| | | | | | | | | | | | | | | | | 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 devices away from begin_image to begin_typed_image.Robin Watts2021-04-233-82/+114
|
* Further rationalisation of device init.Robin Watts2021-04-2030-313/+262
| | | | | | | | | | 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.
* Move devices away from static init of procs.Robin Watts2021-04-2026-468/+725
|
* Rename finish_copydevice to initialize, and remove second param.Robin Watts2021-04-203-3/+3
| | | | | | | | | | | 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.
* Solve indeterminism in pr1000_4 device.Robin Watts2021-04-151-2/+16
| | | | | | | | | | | | | | | | | | | 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.
* Remove support for old version of GS from contrib devices.Robin Watts2021-04-135-316/+7
| | | | | We cannot the test old versions, so this will merely bitrot and make maintenance harder.
* Tweak escv devices so they build under Windows.Robin Watts2021-04-081-0/+8
| | | | This enables more contrib devices to be debugged/run under windows.
* Fix gdevescv.c operation with Memento.Robin Watts2021-04-081-9/+1
| | | | | | | | | | gdevescv.c used strdup, which wasn't previously caught by Memento. Accordingly it was careful to release the memory using 'unvectored_free' (i.e. free before Memento got involved). Now that Memento has been updated to catch strdup this is not required (and indeed causes problems). Accordingly, simplify the code.
* Update copyright to 2021Chris Liddell2021-03-151-1/+1
|
* Bug 703294: Fix Ghostscript build for AndroidPeter Cherepanov2021-02-152-1/+1
| | | | | | | Header files shifted around so that the redefinition of printf happens after cdefs. Also removes redundant CONTDEVH definition from contrib/contrib.mak
* Bug 701804: Fix for device that causes buffer overflowsMichael Vrhel2020-11-111-34/+45
| | | | | | | | 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.
* Strip trailing whitespace from makefiles.Robin Watts2020-09-091-4/+4
|
* Strip trailing whitespace from .c and .h files.Robin Watts2020-09-092-2/+2
|
* Remove the dmprt deviceChris Liddell2020-07-077-4514/+1
| | | | | | | | | 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.
* lgtm.com issue: Add some missing "repeat include" guards.Robin Watts2020-05-082-0/+10
|
* lgtm.com fixes for ghostscript.Robin Watts2020-05-061-3/+3
| | | | | | | 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.
* Bug 702364: Fix missing echogs dependenciesChris Liddell2020-04-271-142/+147
|
* Update copyright to 2020Chris Liddell2020-04-101-1/+1
|
* Fix trailing white spaces in a number of places.Ken Sharp2020-01-301-2/+2
| | | | | 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.
* Coverity 350947: check return from gdev_prn_get_bits().Julian Smith2020-01-201-11/+34
| | | | Also changed some fns from void to int so we can propogate any error.
* Coverity 94984: disabled code that had no affect other than to cause a ↵Julian Smith2020-01-101-0/+6
| | | | coverity issue.
* Coverity 94740: added /* Fall through. */ comment.Julian Smith2020-01-091-0/+1
|
* Coverity 94747: removed 'if' with duplicate code.Julian Smith2020-01-091-12/+4
|
* Coverity 94809: added /* Fall through. */ comment.Julian Smith2020-01-091-0/+1
|
* Coverity 121439: use gx_color_index instead of uint, to avoid overflow when ↵Julian Smith2020-01-091-1/+1
| | | | shifting.
* Coverity 94905: disabled code that had no affect other than to cause a ↵Julian Smith2020-01-091-0/+6
| | | | coverity issue.
* Coverity 95087: use cast to indicate intermediate integer division is expected.Julian Smith2020-01-091-1/+1
|
* Coverity 95007: propogate error from eprn_check_colour_info().Julian Smith2020-01-083-6/+13
|
* Coverity 94665: removed unnecessary if and refactored expression.Julian Smith2020-01-081-6/+6
|
* Coverity 94713: added {...} to match indentation.Julian Smith2020-01-081-1/+2
|
* Coverity 94729: oki4w_print_page()'s compress_code is always 2.Julian Smith2020-01-081-83/+3
| | | | | Simplified code accordingly, and removed static fn oki_compress() as no longer referenced.
* Coverity 94757: avoid 'if (foo) return code; return code;' construct.Julian Smith2020-01-081-4/+5
| | | | | 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.
* Coverity 94778: added missing {...}.Julian Smith2020-01-081-1/+2
|
* Coverity 94811: added break in switch block.Julian Smith2020-01-081-0/+1
|