summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-colorspace.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-colorspace.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-colorspace.c')
-rw-r--r--source/pdf/pdf-colorspace.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/pdf/pdf-colorspace.c b/source/pdf/pdf-colorspace.c
index 8bec2707..081ceaaf 100644
--- a/source/pdf/pdf-colorspace.c
+++ b/source/pdf/pdf-colorspace.c
@@ -100,7 +100,7 @@ load_separation(fz_context *ctx, pdf_document *doc, pdf_obj *array)
{
tint = pdf_load_function(ctx, doc, tintobj, n, base->n);
/* RJW: fz_drop_colorspace(ctx, base);
- * "cannot load tint function (%d %d R)", pdf_to_num(ctx, tintobj), pdf_to_gen(ctx, tintobj) */
+ * "cannot load tint function (%d 0 R)", pdf_to_num(ctx, tintobj) */
sep = fz_malloc_struct(ctx, struct separation);
sep->base = base;
@@ -168,7 +168,7 @@ load_indexed(fz_context *ctx, pdf_document *doc, pdf_obj *array)
fz_try(ctx)
{
- file = pdf_open_stream(ctx, doc, pdf_to_num(ctx, lookupobj), pdf_to_gen(ctx, lookupobj));
+ file = pdf_open_stream(ctx, doc, pdf_to_num(ctx, lookupobj));
i = (int)fz_read(ctx, file, lookup, n);
if (i < n)
memset(lookup+i, 0, n-i);
@@ -303,7 +303,7 @@ pdf_load_colorspace_imp(fz_context *ctx, pdf_document *doc, pdf_obj *obj)
}
}
- fz_throw(ctx, FZ_ERROR_GENERIC, "syntaxerror: could not parse color space (%d %d R)", pdf_to_num(ctx, obj), pdf_to_gen(ctx, obj));
+ fz_throw(ctx, FZ_ERROR_GENERIC, "syntaxerror: could not parse color space (%d 0 R)", pdf_to_num(ctx, obj));
}
fz_colorspace *