summaryrefslogtreecommitdiff
path: root/pdf/pdf_colour.c
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2022-01-24 17:21:22 +0000
committerChris Liddell <chris.liddell@artifex.com>2022-01-25 08:49:28 +0000
commitc2e848fe05d9ffa99f61285bb1f33f717844abcb (patch)
tree09f9e302b3bf44c58e75a13689b915ba9ea1cedf /pdf/pdf_colour.c
parent4aa284be10e8ddf4afa4d91ace3bf1f2682988f5 (diff)
downloadghostpdl-c2e848fe05d9ffa99f61285bb1f33f717844abcb.tar.gz
oss-fuzz 44018: More Type 1 pattern cleanup on error.
Initialise pattern instance pointer, for safetly. Don't leave a pointer in place to a pattern instance freed on error. On error, free the pdfi pattern context.
Diffstat (limited to 'pdf/pdf_colour.c')
-rw-r--r--pdf/pdf_colour.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pdf/pdf_colour.c b/pdf/pdf_colour.c
index a07dcf705..9a88b13bc 100644
--- a/pdf/pdf_colour.c
+++ b/pdf/pdf_colour.c
@@ -775,6 +775,7 @@ pdfi_setcolorN(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict, boo
code = gs_note_error(gs_error_syntaxerror);
goto cleanupExit0;
}
+ cc.pattern = NULL; /* For safe cleaning up on an error */
base_space = pcs->base_space;
code = pdfi_pattern_set(ctx, stream_dict, page_dict, (pdf_name *)ctx->stack_top[-1], &cc);
pdfi_pop(ctx, 1);