diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2023-01-26 13:19:46 +0000 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2023-02-10 09:32:04 +0000 |
commit | 36add0c0844e69c8ab3befde784ca46874bc619e (patch) | |
tree | 6620f5c2db193f9b86c893830f96f0ffb8493f1c /pdf | |
parent | 1897bc5acff438f5628712139f6ee5f47d9a6e54 (diff) | |
download | ghostpdl-36add0c0844e69c8ab3befde784ca46874bc619e.tar.gz |
pdfi: Fix a ref counting mistake in the page bbox handling
When using anything other than the default MediaBox, we'd leak an array and
its contents.
Diffstat (limited to 'pdf')
-rw-r--r-- | pdf/pdf_page.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pdf/pdf_page.c b/pdf/pdf_page.c index 45b31c086..cfebce6fe 100644 --- a/pdf/pdf_page.c +++ b/pdf/pdf_page.c @@ -246,6 +246,7 @@ static int pdfi_get_media_size(pdf_context *ctx, pdf_dict *page_dict) } if (a == NULL) { a = default_media; + pdfi_countup(a); } if (!ctx->args.nouserunit && !ctx->device_state.PassUserUnit) { @@ -258,6 +259,7 @@ static int pdfi_get_media_size(pdf_context *ctx, pdf_dict *page_dict) d[i] *= userunit; } pdfi_countdown(a); + pdfi_countdown(default_media); normalize_rectangle(d); memcpy(ctx->page.Size, d, 4 * sizeof(double)); |