diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2023-04-05 14:55:30 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2023-04-05 18:00:49 +0100 |
commit | 81eedb262e019faf2819cff89b23bc57fe776c21 (patch) | |
tree | a1cf9256b99d47387e6fc70414787c1fc56cc8ba /gpdl | |
parent | 38af36ec272280bebd503d9b0419e27e5b9a239c (diff) | |
download | ghostpdl-81eedb262e019faf2819cff89b23bc57fe776c21.tar.gz |
gpdl: tiff handler; fix leak.
Seen with the second tiff from bug 706539.
Diffstat (limited to 'gpdl')
-rw-r--r-- | gpdl/tifftop.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gpdl/tifftop.c b/gpdl/tifftop.c index 7bba78490..743a7b99c 100644 --- a/gpdl/tifftop.c +++ b/gpdl/tifftop.c @@ -1067,8 +1067,7 @@ do_impl_process(pl_interp_implementation_t * impl, stream_cursor_read * pr, int false, tiff->pgs); if (code < 0) { - tiff->state = ii_state_flush; - return code; + goto fail_decode; } tremx = tiff->width - tx; @@ -1152,7 +1151,12 @@ do_impl_process(pl_interp_implementation_t * impl, stream_cursor_read * pr, int (void)pl_finish_page(tiff->memory->gs_lib_ctx->top_of_system, tiff->pgs, 1, true); break; -fail_decode: + fail_decode: + if (tiff->penum) + { + (void)gs_image_cleanup_and_free_enum(tiff->penum, tiff->pgs); + tiff->penum = NULL; + } tiff->state = ii_state_flush; break; } |