summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'base/gxcpath.c')
-rw-r--r--base/gxcpath.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/base/gxcpath.c b/base/gxcpath.c
index 4c3d3478..c9fde9d4 100644
--- a/base/gxcpath.c
+++ b/base/gxcpath.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2019 Artifex Software, Inc.
+/* Copyright (C) 2001-2020 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -172,8 +172,8 @@ gx_cpath_init_contained_shared(gx_clip_path * pcpath,
{
if (shared) {
if (shared->path.segments == &shared->path.local_segments) {
- lprintf1("Attempt to share (local) segments of clip path 0x%lx!\n",
- (ulong) shared);
+ lprintf1("Attempt to share (local) segments of clip path "PRI_INTPTR"!\n",
+ (intptr_t)shared);
return_error(gs_error_Fatal);
}
*pcpath = *shared;
@@ -230,8 +230,8 @@ gx_cpath_init_local_shared_nested(gx_clip_path * pcpath,
if (shared) {
if ((shared->path.segments == &shared->path.local_segments) &&
!safely_nested) {
- lprintf1("Attempt to share (local) segments of clip path 0x%lx!\n",
- (ulong) shared);
+ lprintf1("Attempt to share (local) segments of clip path "PRI_INTPTR"!\n",
+ (intptr_t)shared);
return_error(gs_error_Fatal);
}
pcpath->path = shared->path;
@@ -403,8 +403,10 @@ gx_cpath_path_list_new(gs_memory_t *mem, gx_clip_path *pcpath, int rule,
rc_init_free(pcplist, mem, 1, rc_free_cpath_path_list);
if (pcpath!=NULL && !pcpath->path_valid) {
code = gx_path_init_contained_shared(&pcplist->path, NULL, mem, cname);
- if (code < 0)
+ if (code < 0) {
+ gs_free_object(mem, pcplist, "gx_cpath_path_list_new");
return code;
+ }
code = gx_cpath_to_path(pcpath, &pcplist->path);
} else {
gx_path_init_local(&pcplist->path, mem);
@@ -1120,7 +1122,11 @@ gx_cpath_copy(const gx_clip_path * from, gx_clip_path * pcpath)
pcpath->cached = NULL;
l->single = from->rect_list->list.single;
for (r = from->rect_list->list.head; r != NULL; r = r->next) {
- s = gs_alloc_struct(from->rect_list->rc.memory, gx_clip_rect, &st_clip_rect, "gx_cpath_copy");
+ if (pcpath->rect_list->rc.memory == NULL)
+ s = gs_alloc_struct(from->rect_list->rc.memory, gx_clip_rect, &st_clip_rect, "gx_cpath_copy");
+ else
+ s = gs_alloc_struct(pcpath->rect_list->rc.memory, gx_clip_rect, &st_clip_rect, "gx_cpath_copy");
+
if (s == NULL)
return_error(gs_error_VMerror);
*s = *r;