diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2019-06-01 11:09:05 +0100 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2019-06-04 09:37:16 +0100 |
commit | d5e123d42718370c144a62ba10a7b715cc88b81a (patch) | |
tree | 1b71c8cd22d9a25edd52fc4ea9489a631f964f12 /base/gxchar.c | |
parent | c9a832653a91ddcdd1220fe9fbbc58839eade4aa (diff) | |
download | ghostpdl-d5e123d42718370c144a62ba10a7b715cc88b81a.tar.gz |
Graphics library - match gsaves with grestores
Auditing as part of the pdfi work, when the graphics library executes
a gs_gsave() it should match it with a gs_grestore(), even in the case
of an error.
In addition, if gs_setcolorspace failed in image_PaintProc() it would
leak the pattern enumerator. Because this is only called from PCL
the memory is not garbage collected.
Diffstat (limited to 'base/gxchar.c')
-rw-r--r-- | base/gxchar.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/base/gxchar.c b/base/gxchar.c index 4acf09cdc..94c3eb867 100644 --- a/base/gxchar.c +++ b/base/gxchar.c @@ -181,8 +181,10 @@ gx_default_text_begin(gx_device * dev, gs_gstate * pgs1, gs_newpath(pgs); gx_translate_to_fixed(pgs, fixed_0, fixed_0); code = gx_path_add_point(pgs->path, fixed_0, fixed_0); - if (code < 0) + if (code < 0) { + gs_grestore(pgs); return code; + } } *ppte = (gs_text_enum_t *)penum; return 0; |