diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2022-09-06 13:28:40 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2022-09-07 08:54:28 +0100 |
commit | 0db229797418cc9b0b0df0221bd00125b8fd8daf (patch) | |
tree | 0971af35e632ae981edfbf4a4001c36b7b69acb4 | |
parent | 7b283e7408501680d7ab2e63a1b0d05f9b76a2c5 (diff) | |
download | ghostpdl-0db229797418cc9b0b0df0221bd00125b8fd8daf.tar.gz |
oss-fuzz 51005: better handle errors retrieving CFF glyph index
-rw-r--r-- | pdf/pdf_font1C.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pdf/pdf_font1C.c b/pdf/pdf_font1C.c index 407fbdc92..43ebced39 100644 --- a/pdf/pdf_font1C.c +++ b/pdf/pdf_font1C.c @@ -277,8 +277,13 @@ pdfi_cff_enumerate_glyph(gs_font *pfont, int *pindex, else if (pdffont->pdfi_font_type != e_pdf_cidfont_type0 && pdffont->Encoding != NULL) { unsigned int nindex; code = (*ctx->get_glyph_index)(pfont, key->data, key->length, &nindex); - if (code < 0) - *pglyph = GS_NO_GLYPH; + if (code < 0) { + code = (*ctx->get_glyph_index)(pfont, (byte *)".notdef", 7, &nindex); + if (code < 0) + *pglyph = GS_NO_GLYPH; + else + *pglyph = (gs_glyph)nindex; + } else *pglyph = (gs_glyph)nindex; } |