summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2021-05-10 10:16:08 +0100
committerChris Liddell <chris.liddell@artifex.com>2021-05-11 11:39:16 +0100
commitf814f4f72815a2d495ffb514693d1b9e49f44c87 (patch)
tree360201da32f8b303749e7bc56b265d58e5d21936
parente67f5fbbfdd2604d53b8f54690c49ee8b092e1ea (diff)
downloadghostpdl-f814f4f72815a2d495ffb514693d1b9e49f44c87.tar.gz
Handle missing registry/ordering for decoding (Type 0 fonts)
CMaps and Type 0 fonts with missing registry and ordering strings were handled implicitly when searching a decoding before, but it's clearer to make it explicit.
-rw-r--r--pdf/pdf_font0.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/pdf/pdf_font0.c b/pdf/pdf_font0.c
index b8901170c..fda9c6c1c 100644
--- a/pdf/pdf_font0.c
+++ b/pdf/pdf_font0.c
@@ -38,10 +38,9 @@
extern pdfi_cid_decoding_t *pdfi_cid_decoding_list[];
-static int pdfi_font0_find_ordering_to_unicode(const char *reg, const int reglen, const char *ord, const int ordlen, pdfi_cid_decoding_t **decoding)
+static void pdfi_font0_find_ordering_to_unicode(const char *reg, const int reglen, const char *ord, const int ordlen, pdfi_cid_decoding_t **decoding)
{
int i;
- int code = gs_error_undefined;
*decoding = NULL;
/* This only makes sense for Adobe orderings */
if (reglen == 5 && !memcmp(reg, "Adobe", 5)) {
@@ -49,12 +48,10 @@ static int pdfi_font0_find_ordering_to_unicode(const char *reg, const int reglen
if (strlen(pdfi_cid_decoding_list[i]->s_order) == ordlen &&
!memcmp(pdfi_cid_decoding_list[i]->s_order, ord, ordlen)) {
*decoding = pdfi_cid_decoding_list[i];
- code = 0;
break;
}
}
}
- return code;
}
typedef enum
@@ -405,7 +402,10 @@ int pdfi_read_type0_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream
o = (char *)pcmap->csi_ord.data;
olen = pcmap->csi_ord.size;
}
- (void)pdfi_font0_find_ordering_to_unicode(r, rlen, o, olen, &dec);
+ if (rlen > 0 && olen > 0)
+ pdfi_font0_find_ordering_to_unicode(r, rlen, o, olen, &dec);
+ else
+ dec = NULL;
}
}
if (code < 0)