summaryrefslogtreecommitdiff
path: root/psi
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2022-11-17 12:18:48 +0000
committerKen Sharp <ken.sharp@artifex.com>2022-11-17 12:18:48 +0000
commit188b861a60b0c19a21f1d4a8e7026149ac6ef731 (patch)
tree77eccb04e16e6621442fda64f31dfb9efe3f574d /psi
parent1042469a5225ff063c465e61dbd3ebb50c770006 (diff)
downloadghostpdl-188b861a60b0c19a21f1d4a8e7026149ac6ef731.tar.gz
PostScript interpreter - Use the correct ref for DeviceN /All ink
File from customer, no bug report. We have special processing for the /All ink in a DeviceN colour space, and that processing was assuming that the ink name was a name object which it then wanted to turn into a string object in order to get the actual string representing the name. The file in question, however, defines the names array (quite legally) as: [(All)] So the ink name is a string, not a name. The code explicitly used name_string_ref to turn the name into a string, which unsurprisingly failed because the object isn't a name. In fact we have already dealt with this earlier in the code, all we need to do is use the correct variable and it all works correctly.
Diffstat (limited to 'psi')
-rw-r--r--psi/zcolor.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/psi/zcolor.c b/psi/zcolor.c
index e1b51db42..b4f7cee97 100644
--- a/psi/zcolor.c
+++ b/psi/zcolor.c
@@ -4181,12 +4181,11 @@ static int setdevicenspace(i_ctx_t * i_ctx_p, ref *devicenspace, int *stage, int
return code;
pcs->params.separation.sep_type = sep_type;
pcs->params.separation.mem = imemory->non_gc_memory;
- name_string_ref(imemory, &sname, &sname);
- pcs->params.separation.sep_name = (char *)gs_alloc_bytes(pcs->params.separation.mem, r_size(&sname) + 1, "Separation name");
+ pcs->params.separation.sep_name = (char *)gs_alloc_bytes(pcs->params.separation.mem, r_size(&tname) + 1, "Separation name");
if (pcs->params.separation.sep_name == NULL)
return_error(gs_error_VMerror);
- memcpy(pcs->params.separation.sep_name, sname.value.bytes, r_size(&sname));
- pcs->params.separation.sep_name[r_size(&sname)] = 0x00;
+ memcpy(pcs->params.separation.sep_name, tname.value.bytes, r_size(&tname));
+ pcs->params.separation.sep_name[r_size(&tname)] = 0x00;
code = array_get(imemory, &namesarray, (long)0, &sname);
if (code < 0)
return code;