diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-06-30 15:21:56 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-07-06 13:34:37 +0200 |
commit | 255776a778b519183d6935ff0cb4b766644fa830 (patch) | |
tree | 16c2d411870b31cc25a2941d90ca862c10083667 /source/pdf/pdf-font.c | |
parent | b644ed1360d0e47c03a637bbc568000d57d0cdbf (diff) | |
download | mupdf-255776a778b519183d6935ff0cb4b766644fa830.tar.xz |
pdf: Drop generation number from public interfaces.
The generation number is only needed for decryption, and is assumed
to be zero or irrelevant for all other uses.
Store the original object number and generation in the xref slot, so
that we can decrypt them even when the objects have been renumbered,
without needing to pass the original object number around through
the stream loading APIs.
Diffstat (limited to 'source/pdf/pdf-font.c')
-rw-r--r-- | source/pdf/pdf-font.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/pdf/pdf-font.c b/source/pdf/pdf-font.c index 7e15a287..cc6c68ed 100644 --- a/source/pdf/pdf-font.c +++ b/source/pdf/pdf-font.c @@ -411,7 +411,7 @@ pdf_load_embedded_font(fz_context *ctx, pdf_document *doc, pdf_font_desc *fontde { fz_buffer *buf; - buf = pdf_load_stream(ctx, doc, pdf_to_num(ctx, stmref), pdf_to_gen(ctx, stmref)); + buf = pdf_load_stream(ctx, doc, pdf_to_num(ctx, stmref)); fz_try(ctx) fontdesc->font = fz_new_font_from_buffer(ctx, fontname, buf, 0, 1); fz_always(ctx) @@ -867,9 +867,8 @@ pdf_load_simple_font(fz_context *ctx, pdf_document *doc, pdf_obj *dict) static int hail_mary_make_hash_key(fz_context *ctx, fz_store_hash *hash, void *key_) { - hash->u.i.i0 = 0; - hash->u.i.i1 = 0; - hash->u.i.ptr = NULL; + hash->u.pi.i = 0; + hash->u.pi.ptr = NULL; return 1; } @@ -1021,7 +1020,7 @@ load_cid_font(fz_context *ctx, pdf_document *doc, pdf_obj *dict, pdf_obj *encodi fz_buffer *buf; size_t z; - buf = pdf_load_stream(ctx, doc, pdf_to_num(ctx, cidtogidmap), pdf_to_gen(ctx, cidtogidmap)); + buf = pdf_load_stream(ctx, doc, pdf_to_num(ctx, cidtogidmap)); fontdesc->cid_to_gid_len = (buf->len) / 2; fontdesc->cid_to_gid = fz_malloc_array(ctx, fontdesc->cid_to_gid_len, sizeof(unsigned short)); |