summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-shade.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-shade.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-shade.c')
-rw-r--r--source/pdf/pdf-shade.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/pdf/pdf-shade.c b/source/pdf/pdf-shade.c
index b8e138c0..7815b3ce 100644
--- a/source/pdf/pdf-shade.c
+++ b/source/pdf/pdf-shade.c
@@ -256,7 +256,7 @@ pdf_load_type4_shade(fz_context *ctx, pdf_document *doc, fz_shade *shade, pdf_ob
if (funcs > 0)
pdf_sample_shade_function(ctx, shade, funcs, func, shade->u.m.c0[0], shade->u.m.c1[0]);
- shade->buffer = pdf_load_compressed_stream(ctx, doc, pdf_to_num(ctx, dict), pdf_to_gen(ctx, dict));
+ shade->buffer = pdf_load_compressed_stream(ctx, doc, pdf_to_num(ctx, dict));
}
static void
@@ -268,7 +268,7 @@ pdf_load_type5_shade(fz_context *ctx, pdf_document *doc, fz_shade *shade, pdf_ob
if (funcs > 0)
pdf_sample_shade_function(ctx, shade, funcs, func, shade->u.m.c0[0], shade->u.m.c1[0]);
- shade->buffer = pdf_load_compressed_stream(ctx, doc, pdf_to_num(ctx, dict), pdf_to_gen(ctx, dict));
+ shade->buffer = pdf_load_compressed_stream(ctx, doc, pdf_to_num(ctx, dict));
}
/* Type 6 & 7 -- Patch mesh shadings */
@@ -282,7 +282,7 @@ pdf_load_type6_shade(fz_context *ctx, pdf_document *doc, fz_shade *shade, pdf_ob
if (funcs > 0)
pdf_sample_shade_function(ctx, shade, funcs, func, shade->u.m.c0[0], shade->u.m.c1[0]);
- shade->buffer = pdf_load_compressed_stream(ctx, doc, pdf_to_num(ctx, dict), pdf_to_gen(ctx, dict));
+ shade->buffer = pdf_load_compressed_stream(ctx, doc, pdf_to_num(ctx, dict));
}
static void
@@ -294,7 +294,7 @@ pdf_load_type7_shade(fz_context *ctx, pdf_document *doc, fz_shade *shade, pdf_ob
if (funcs > 0)
pdf_sample_shade_function(ctx, shade, funcs, func, shade->u.m.c0[0], shade->u.m.c1[0]);
- shade->buffer = pdf_load_compressed_stream(ctx, doc, pdf_to_num(ctx, dict), pdf_to_gen(ctx, dict));
+ shade->buffer = pdf_load_compressed_stream(ctx, doc, pdf_to_num(ctx, dict));
}
/* Load all of the shading dictionary parameters, then switch on the shading type. */
@@ -361,7 +361,7 @@ pdf_load_shading_dict(fz_context *ctx, pdf_document *doc, pdf_obj *dict, const f
func[0] = pdf_load_function(ctx, doc, obj, in, out);
if (!func[0])
- fz_throw(ctx, FZ_ERROR_GENERIC, "cannot load shading function (%d %d R)", pdf_to_num(ctx, obj), pdf_to_gen(ctx, obj));
+ fz_throw(ctx, FZ_ERROR_GENERIC, "cannot load shading function (%d 0 R)", pdf_to_num(ctx, obj));
}
else if (pdf_is_array(ctx, obj))
{
@@ -387,13 +387,13 @@ pdf_load_shading_dict(fz_context *ctx, pdf_document *doc, pdf_obj *dict, const f
{
func[i] = pdf_load_function(ctx, doc, pdf_array_get(ctx, obj, i), in, out);
if (!func[i])
- fz_throw(ctx, FZ_ERROR_GENERIC, "cannot load shading function (%d %d R)", pdf_to_num(ctx, obj), pdf_to_gen(ctx, obj));
+ fz_throw(ctx, FZ_ERROR_GENERIC, "cannot load shading function (%d 0 R)", pdf_to_num(ctx, obj));
}
}
else if (type < 4)
{
/* Functions are compulsory for types 1,2,3 */
- fz_throw(ctx, FZ_ERROR_GENERIC, "cannot load shading function (%d %d R)", pdf_to_num(ctx, obj), pdf_to_gen(ctx, obj));
+ fz_throw(ctx, FZ_ERROR_GENERIC, "cannot load shading function (%d 0 R)", pdf_to_num(ctx, obj));
}
shade->type = type;