diff options
author | Henry Stiles <henry.stiles@artifex.com> | 2016-08-29 12:46:47 -0600 |
---|---|---|
committer | Henry Stiles <henry.stiles@artifex.com> | 2016-08-29 12:46:47 -0600 |
commit | 6892b89fab66086346d754714806ce0870407970 (patch) | |
tree | b68d4cff5aec0054fb478983c30d8b10545ad454 | |
parent | 2f18c60fd2aa43f59fbf197463aca30ea3a0bc2d (diff) | |
download | ghostpdl-6892b89fab66086346d754714806ce0870407970.tar.gz |
Fix 696929 - SetLineDash error.
Many HP printer and our PXL interpreter limit the dash element array
size to 20 so we shouldn't produce PCLXL that exceeds that limit.
-rw-r--r-- | devices/vector/gdevpx.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/devices/vector/gdevpx.c b/devices/vector/gdevpx.c index 7a75832b9..aad1e76cb 100644 --- a/devices/vector/gdevpx.c +++ b/devices/vector/gdevpx.c @@ -1314,6 +1314,14 @@ pclxl_setmiterlimit(gx_device_vector * vdev, double limit) return 0; } +/* + * The number of elements in the dash pattern array is device + * dependent but a maximum of 20 has been observed on several HP + * printers. + */ + +#define MAX_DASH_ELEMENTS 20 + static int pclxl_setdash(gx_device_vector * vdev, const float *pattern, uint count, double offset) @@ -1326,7 +1334,7 @@ pclxl_setdash(gx_device_vector * vdev, const float *pattern, uint count, }; PX_PUT_LIT(s, nac_); - } else if (count > 255) + } else if (count > MAX_DASH_ELEMENTS) return_error(gs_error_limitcheck); else { uint i; |