summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2023-02-20 18:29:08 +0000
committerRobin Watts <Robin.Watts@artifex.com>2023-02-22 14:39:37 +0000
commitc1d0170b2fad8386a9e41da27e6c7f422ed4fd3c (patch)
treeb8b83e1938c1b53c3193beb2655ba92bcdf3d5e0 /base
parent70cd48834618ac7accb2e40799a68d3024454de8 (diff)
downloadghostpdl-c1d0170b2fad8386a9e41da27e6c7f422ed4fd3c.tar.gz
Bug 706351: Fix display device with planar separations.
Using the display device with separations in chunky mode, we insist on 8 components all the time. In planar mode, the calculations go wrong, and we get crashes. Update it here so that we don't crash. Planar separations will use a maximum of 64 components. In the case of a PDF file where the number of components in use are known up front, we will run with the correct number of components. In the case of a PS file where the number of components is unknown until rendering has completed, we run with the maximum number of components, and the display device user can just take the required number at the end.
Diffstat (limited to 'base')
-rw-r--r--base/gdevdevn.c22
-rw-r--r--base/gdevdevn.h8
2 files changed, 22 insertions, 8 deletions
diff --git a/base/gdevdevn.c b/base/gdevdevn.c
index 89f26307e..0ef7ce62d 100644
--- a/base/gdevdevn.c
+++ b/base/gdevdevn.c
@@ -813,13 +813,10 @@ static bool devn_params_equal(const gs_devn_params *p1, const gs_devn_params *p2
return true;
}
-/*
- * Utility routine for handling DeviceN related parameters in a
- * standard raster printer type device.
- */
int
-devn_printer_put_params(gx_device * pdev, gs_param_list * plist,
- gs_devn_params * pdevn_params, equivalent_cmyk_color_params * pequiv_colors)
+devn_generic_put_params(gx_device *pdev, gs_param_list *plist,
+ gs_devn_params *pdevn_params, equivalent_cmyk_color_params *pequiv_colors,
+ int is_printer)
{
int code;
/* Save current data in case we have a problem */
@@ -834,7 +831,7 @@ devn_printer_put_params(gx_device * pdev, gs_param_list * plist,
code = devn_put_params(pdev, plist, pdevn_params, pequiv_colors);
/* Check for default printer parameters */
- if (code >= 0)
+ if (is_printer && code >= 0)
code = gdev_prn_put_params(pdev, plist);
/* If we have an error then restore original data. */
@@ -879,6 +876,17 @@ devn_printer_put_params(gx_device * pdev, gs_param_list * plist,
}
/*
+ * Utility routine for handling DeviceN related parameters in a
+ * standard raster printer type device.
+ */
+int
+devn_printer_put_params(gx_device *pdev, gs_param_list *plist,
+ gs_devn_params *pdevn_params, equivalent_cmyk_color_params *pequiv_colors)
+{
+ return devn_generic_put_params(pdev, plist, pdevn_params, pequiv_colors, 1);
+}
+
+/*
* Free a set of separation names
*/
void
diff --git a/base/gdevdevn.h b/base/gdevdevn.h
index 89d7b8825..04d01b6a8 100644
--- a/base/gdevdevn.h
+++ b/base/gdevdevn.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -180,6 +180,12 @@ int devn_printer_put_params(gx_device * pdev, gs_param_list * plist,
gs_devn_params * pdevn_params,
equivalent_cmyk_color_params * pequiv_colors);
+int
+devn_generic_put_params(gx_device *pdev, gs_param_list *plist,
+ gs_devn_params *pdevn_params, equivalent_cmyk_color_params *pequiv_colors,
+ int is_printer);
+
+
/*
* Utility routine for handling DeviceN related parameters. This routine
* may modify the color_info, devn_params, and the * equiv_colors fields.