diff options
-rw-r--r-- | base/gdevp14.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/base/gdevp14.c b/base/gdevp14.c index 2384b6228..f129b16d6 100644 --- a/base/gdevp14.c +++ b/base/gdevp14.c | |||
@@ -1311,7 +1311,7 @@ pdf14_find_backdrop_buf(pdf14_ctx *ctx, bool *is_backdrop) | |||
1311 | /* If the new buffer is isolated there is no backdrop */ | 1311 | /* If the new buffer is isolated there is no backdrop */ |
1312 | if (buf->isolated) return NULL; | 1312 | if (buf->isolated) return NULL; |
1313 | 1313 | ||
1314 | /* If the previous buffer is a knockout group | 1314 | /* If the previous buffer is a knockout group |
1315 | then we need to use its backdrop as the backdrop. If | 1315 | then we need to use its backdrop as the backdrop. If |
1316 | it was isolated then that back drop was NULL */ | 1316 | it was isolated then that back drop was NULL */ |
1317 | if (buf->saved != NULL && buf->saved->knockout) { | 1317 | if (buf->saved != NULL && buf->saved->knockout) { |
@@ -2970,7 +2970,7 @@ update_lop_for_pdf14(gs_gstate *pgs, const gx_drawing_color *pdcolor) | |||
2970 | } | 2970 | } |
2971 | 2971 | ||
2972 | static int | 2972 | static int |
2973 | push_shfill_group(pdf14_clist_device *pdev, | 2973 | push_shfill_group(pdf14_clist_device *pdev, |
2974 | gs_gstate *pgs, | 2974 | gs_gstate *pgs, |
2975 | gs_fixed_rect *box) | 2975 | gs_fixed_rect *box) |
2976 | { | 2976 | { |
@@ -6278,7 +6278,7 @@ do_mark_fill_rectangle_ko_simple(gx_device *dev, int x, int y, int w, int h, | |||
6278 | /* composite with backdrop only. */ | 6278 | /* composite with backdrop only. */ |
6279 | if (has_backdrop) | 6279 | if (has_backdrop) |
6280 | bline = buf->backdrop + (x - buf->rect.p.x) + (y - buf->rect.p.y) * rowstride; | 6280 | bline = buf->backdrop + (x - buf->rect.p.x) + (y - buf->rect.p.y) * rowstride; |
6281 | else | 6281 | else |
6282 | bline = NULL; | 6282 | bline = NULL; |
6283 | 6283 | ||
6284 | line = buf->data + (x - buf->rect.p.x) + (y - buf->rect.p.y) * rowstride; | 6284 | line = buf->data + (x - buf->rect.p.x) + (y - buf->rect.p.y) * rowstride; |
@@ -9569,9 +9569,9 @@ pdf14_clist_fill_stroke_path(gx_device *dev, const gs_gstate *pgs, gx_path *ppat | |||
9569 | code = pdf14_clist_update_params(pdev, pgs, false, NULL); | 9569 | code = pdf14_clist_update_params(pdev, pgs, false, NULL); |
9570 | if (code < 0) | 9570 | if (code < 0) |
9571 | return code; | 9571 | return code; |
9572 | /* If we are doing a shading fill or stroke, the clist can't | 9572 | /* If we are doing a shading fill or stroke, the clist can't |
9573 | deal with this and end up in the pdf_fill_stroke operation. | 9573 | deal with this and end up in the pdf_fill_stroke operation. |
9574 | We will need to break up the fill stroke now and do | 9574 | We will need to break up the fill stroke now and do |
9575 | the appropriate group pushes and set up. */ | 9575 | the appropriate group pushes and set up. */ |
9576 | 9576 | ||
9577 | if ((pdevc_fill != NULL && gx_dc_is_pattern2_color(pdevc_fill)) || | 9577 | if ((pdevc_fill != NULL && gx_dc_is_pattern2_color(pdevc_fill)) || |
@@ -10230,7 +10230,7 @@ pdf14_spot_get_color_comp_index(gx_device *dev, const char *pname, | |||
10230 | We need the real target procs */ | 10230 | We need the real target procs */ |
10231 | if (target_get_color_comp_index == pdf14_cmykspot_get_color_comp_index) | 10231 | if (target_get_color_comp_index == pdf14_cmykspot_get_color_comp_index) |
10232 | target_get_color_comp_index = | 10232 | target_get_color_comp_index = |
10233 | ((pdf14_clist_device *)pdev)->saved_target_get_color_comp_index; | 10233 | ((pdf14_clist_device *)pdev)->saved_target_get_color_comp_index; |
10234 | /* | 10234 | /* |
10235 | * If this is not a separation name then simply forward it to the target | 10235 | * If this is not a separation name then simply forward it to the target |
10236 | * device. | 10236 | * device. |
@@ -10251,6 +10251,9 @@ pdf14_spot_get_color_comp_index(gx_device *dev, const char *pname, | |||
10251 | return comp_index - offset; | 10251 | return comp_index - offset; |
10252 | /* | 10252 | /* |
10253 | * If we do not know this color, check if the output (target) device does. | 10253 | * If we do not know this color, check if the output (target) device does. |
10254 | * Note that if the target device has ENABLE_AUTO_SPOT_COLORS this will add | ||
10255 | * the colorant so we will only get < 0 returned when we hit the max. for | ||
10256 | * the target device. | ||
10254 | */ | 10257 | */ |
10255 | comp_index = (*target_get_color_comp_index)(tdev, pname, name_size, component_type); | 10258 | comp_index = (*target_get_color_comp_index)(tdev, pname, name_size, component_type); |
10256 | /* | 10259 | /* |
@@ -10262,14 +10265,20 @@ pdf14_spot_get_color_comp_index(gx_device *dev, const char *pname, | |||
10262 | 10265 | ||
10263 | /* | 10266 | /* |
10264 | * This is a new colorant. Add it to our list of colorants. | 10267 | * This is a new colorant. Add it to our list of colorants. |
10268 | * The limit accounts for the number of process colors (at least 4). | ||
10265 | */ | 10269 | */ |
10266 | if (pseparations->num_separations < GX_DEVICE_COLOR_MAX_COMPONENTS - 1) { | 10270 | if ((pseparations->num_separations + 1) < |
10271 | (GX_DEVICE_COLOR_MAX_COMPONENTS - max(num_process_colors, 4))) { | ||
10267 | int sep_num = pseparations->num_separations++; | 10272 | int sep_num = pseparations->num_separations++; |
10268 | int color_component_number; | 10273 | int color_component_number; |
10269 | byte * sep_name; | 10274 | byte * sep_name; |
10270 | 10275 | ||
10271 | sep_name = gs_alloc_bytes(dev->memory->stable_memory, | 10276 | sep_name = gs_alloc_bytes(dev->memory->stable_memory, |
10272 | name_size, "pdf14_spot_get_color_comp_index"); | 10277 | name_size, "pdf14_spot_get_color_comp_index"); |
10278 | if (sep_name == NULL) { | ||
10279 | pseparations->num_separations--; /* we didn't add it */ | ||
10280 | return -1; | ||
10281 | } | ||
10273 | memcpy(sep_name, pname, name_size); | 10282 | memcpy(sep_name, pname, name_size); |
10274 | pseparations->names[sep_num].size = name_size; | 10283 | pseparations->names[sep_num].size = name_size; |
10275 | pseparations->names[sep_num].data = sep_name; | 10284 | pseparations->names[sep_num].data = sep_name; |