diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2022-11-22 15:36:15 +0000 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2022-11-22 15:37:45 +0000 |
commit | 81762a230ddb26749536e2c1061e68cd28530c68 (patch) | |
tree | 905145383c0e21c8e5e12deb0c44abb8bb67a829 /gpdl | |
parent | bff645e38e347002e69f8eeb16dfe10fc4d24f00 (diff) | |
download | ghostpdl-81762a230ddb26749536e2c1061e68cd28530c68.tar.gz |
Fix leaking PNG data from gpdl.
Diffstat (limited to 'gpdl')
-rw-r--r-- | gpdl/pngtop.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gpdl/pngtop.c b/gpdl/pngtop.c index 8822ac2ba..db189dd04 100644 --- a/gpdl/pngtop.c +++ b/gpdl/pngtop.c @@ -678,11 +678,20 @@ do_impl_process(png_interp_instance_t *png, stream_cursor_read * pr, bool eof) } default: case ii_state_flush: + if (png->png) + { + png_destroy_read_struct(&png->png, &png->png_info, NULL); + png->png = NULL; + png->png_info = NULL; + } + if (png->penum) { (void)gs_image_cleanup_and_free_enum(png->penum, png->pgs); png->penum = NULL; } + gs_free_object(png->memory, png->buffer, "png_impl_process(buffer)"); + png->buffer = NULL; gs_free_object(png->memory, png->samples, "png_impl_process(samples)"); png->samples = NULL; /* We want to bin any data we get up to, but not including |