diff options
author | Robin Watts <robin.watts@artifex.com> | 2018-07-03 18:57:02 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2018-07-04 10:56:34 +0100 |
commit | 92668c4346480ff4038ecd9ee7beacb688900392 (patch) | |
tree | 95b4e2abd42f1f6c26930398c50d20b17c845253 | |
parent | 72aaafbd98092634b00be0afc80aaa9100208253 (diff) | |
download | mupdf-92668c4346480ff4038ecd9ee7beacb688900392.tar.xz |
Allow for CIDToGIDMap in font being "/Identity".
Previously we would have tripped over this, thrown an error
and aborted loading the whole page. Any non-stream, non "Identity"
CIDToGIDMaps now produce a warning rather than an error so we don't
stop processing the entire page.
-rw-r--r-- | source/pdf/pdf-font.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/pdf/pdf-font.c b/source/pdf/pdf-font.c index f600fc1b..b29a1a18 100644 --- a/source/pdf/pdf-font.c +++ b/source/pdf/pdf-font.c @@ -1083,7 +1083,7 @@ load_cid_font(fz_context *ctx, pdf_document *doc, pdf_obj *dict, pdf_obj *encodi /* Apply encoding */ cidtogidmap = pdf_dict_get(ctx, dict, PDF_NAME(CIDToGIDMap)); - if (pdf_is_indirect(ctx, cidtogidmap)) + if (pdf_is_stream(ctx, cidtogidmap)) { fz_buffer *buf; size_t z, len; @@ -1100,6 +1100,10 @@ load_cid_font(fz_context *ctx, pdf_document *doc, pdf_obj *dict, pdf_obj *encodi fz_drop_buffer(ctx, buf); } + else if (!pdf_name_eq(ctx, PDF_NAME(Identity), cidtogidmap)) + { + fz_warn(ctx, "ignoring unknown CIDToGIDMap entry"); + } /* if font is external, cidtogidmap should not be identity */ /* so we map from cid to unicode and then map that through the (3 1) */ |