diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2022-11-29 10:07:22 +0000 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2022-11-29 10:07:22 +0000 |
commit | 01c7ca7efc7c5c3bda61f6de37edd8ae00b40b8b (patch) | |
tree | 4f1c43a8c9f70b4e64778fb38ceae9d328fee262 /devices | |
parent | d7cb21de04ba7dc0acad88a0c1f6d4bac38b6e43 (diff) | |
download | ghostpdl-01c7ca7efc7c5c3bda61f6de37edd8ae00b40b8b.tar.gz |
oss-fuzz 53847: ps2write: cleanup incomplete copied font...
... before returning the error.
Diffstat (limited to 'devices')
-rw-r--r-- | devices/vector/gdevpdtb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/devices/vector/gdevpdtb.c b/devices/vector/gdevpdtb.c index 7f424398d..200f6ec3a 100644 --- a/devices/vector/gdevpdtb.c +++ b/devices/vector/gdevpdtb.c @@ -316,8 +316,10 @@ pdf_base_font_alloc(gx_device_pdf *pdev, pdf_base_font_t **ppbfont, complete = copied; else { code = gs_copy_font((gs_font *)font, &font->FontMatrix, mem, &complete, -1); - if (code < 0) + if (code < 0) { + gs_free_copied_font(copied); goto fail; + } } code = gs_copy_font_complete((gs_font *)font, complete); if (code < 0 && pbfont->do_subset == DO_SUBSET_NO) { |