diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2022-02-21 11:23:09 +0000 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2022-02-21 11:28:05 +0000 |
commit | 68c5ebd4e4963ee5328d65c1e7a245cb10dac0df (patch) | |
tree | 655280fc4490d9ca99aa2f160d75a830092ce957 | |
parent | c8051ae666672cb7ca39531e28ec85636e1ce6d5 (diff) | |
download | ghostpdl-68c5ebd4e4963ee5328d65c1e7a245cb10dac0df.tar.gz |
Ignore return value from replace_cache_entry() for fonts
Even if we cannot cache the instantiated font object, we can still use it, so
don't treat a failure to cache as a "hard" error.
-rw-r--r-- | pdf/pdf_font0.c | 7 | ||||
-rw-r--r-- | pdf/pdf_font1.c | 6 | ||||
-rw-r--r-- | pdf/pdf_font11.c | 6 | ||||
-rw-r--r-- | pdf/pdf_fontTT.c | 4 |
4 files changed, 6 insertions, 17 deletions
diff --git a/pdf/pdf_font0.c b/pdf/pdf_font0.c index bfb5d6666..a322bfb47 100644 --- a/pdf/pdf_font0.c +++ b/pdf/pdf_font0.c @@ -492,12 +492,7 @@ int pdfi_read_type0_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream /* object_num can be zero if the dictionary was defined inline */ if (pdft0->object_num != 0) { - code = replace_cache_entry(ctx, (pdf_obj *)pdft0); - if (code < 0) { - gs_free_object(ctx->memory, pfont0, "pdfi_read_type0_font(pfont0)"); - code = gs_note_error(gs_error_VMerror); - goto error; - } + (void)replace_cache_entry(ctx, (pdf_obj *)pdft0); } *ppdffont = (pdf_font *)pdft0; diff --git a/pdf/pdf_font1.c b/pdf/pdf_font1.c index 5d3e45b24..87ba858b7 100644 --- a/pdf/pdf_font1.c +++ b/pdf/pdf_font1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2019-2021 Artifex Software, Inc. +/* Copyright (C) 2019-2022 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -735,9 +735,7 @@ pdfi_read_type1_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dic } /* object_num can be zero if the dictionary was defined inline */ if (t1f->object_num != 0) { - code = replace_cache_entry(ctx, (pdf_obj *) t1f); - if (code < 0) - goto error; + (void)replace_cache_entry(ctx, (pdf_obj *) t1f); } *ppdffont = (pdf_font *) t1f; } diff --git a/pdf/pdf_font11.c b/pdf/pdf_font11.c index ab719c174..09712f60c 100644 --- a/pdf/pdf_font11.c +++ b/pdf/pdf_font11.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2020-2021 Artifex Software, Inc. +/* Copyright (C) 2020-2022 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -469,9 +469,7 @@ int pdfi_read_cidtype2_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *str /* object_num can be zero if the dictionary was defined inline */ if (font->object_num != 0) { - code = replace_cache_entry(ctx, (pdf_obj *)font); - if (code < 0) - goto error; + (void)replace_cache_entry(ctx, (pdf_obj *)font); } *ppfont = (pdf_font *)font; diff --git a/pdf/pdf_fontTT.c b/pdf/pdf_fontTT.c index f8e4eed80..aec3ee7b9 100644 --- a/pdf/pdf_fontTT.c +++ b/pdf/pdf_fontTT.c @@ -598,9 +598,7 @@ int pdfi_read_truetype_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *str /* object_num can be zero if the dictionary was defined inline */ if (font->object_num != 0) { - code = replace_cache_entry(ctx, (pdf_obj *)font); - if (code < 0) - goto error; + (void)replace_cache_entry(ctx, (pdf_obj *)font); } *ppdffont = (pdf_font *)font; |