summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-interpret.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-06-30 15:21:56 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-07-06 13:34:37 +0200
commit255776a778b519183d6935ff0cb4b766644fa830 (patch)
tree16c2d411870b31cc25a2941d90ca862c10083667 /source/pdf/pdf-interpret.c
parentb644ed1360d0e47c03a637bbc568000d57d0cdbf (diff)
downloadmupdf-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-interpret.c')
-rw-r--r--source/pdf/pdf-interpret.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/pdf/pdf-interpret.c b/source/pdf/pdf-interpret.c
index 6ad384f3..af5a0ed5 100644
--- a/source/pdf/pdf-interpret.c
+++ b/source/pdf/pdf-interpret.c
@@ -137,7 +137,6 @@ pdf_is_hidden_ocg(fz_context *ctx, pdf_ocg_descriptor *desc, pdf_obj *rdb, const
/* An Optional Content Group */
int default_value = 0;
int num = pdf_to_num(ctx, ocg);
- int gen = pdf_to_gen(ctx, ocg);
int len = desc->len;
int i;
pdf_obj *es;
@@ -145,7 +144,7 @@ pdf_is_hidden_ocg(fz_context *ctx, pdf_ocg_descriptor *desc, pdf_obj *rdb, const
/* by default an OCG is visible, unless it's explicitly hidden */
for (i = 0; i < len; i++)
{
- if (desc->ocgs[i].num == num && desc->ocgs[i].gen == gen)
+ if (desc->ocgs[i].num == num)
{
default_value = desc->ocgs[i].state == 0;
break;
@@ -438,7 +437,7 @@ pdf_process_extgstate(fz_context *ctx, pdf_processor *proc, pdf_csi *csi, pdf_ob
group = pdf_dict_get(ctx, obj, PDF_NAME_G);
if (!group)
- fz_throw(ctx, FZ_ERROR_GENERIC, "cannot load softmask xobject (%d %d R)", pdf_to_num(ctx, obj), pdf_to_gen(ctx, obj));
+ fz_throw(ctx, FZ_ERROR_GENERIC, "cannot load softmask xobject (%d 0 R)", pdf_to_num(ctx, obj));
xobj = pdf_load_xobject(ctx, csi->doc, group);
fz_try(ctx)