diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-02-13 13:13:45 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-02-13 13:14:23 +0100 |
commit | 7085ddc1eb1a4abb6bf7e8e2d6e65ae8bbe2ce3c (patch) | |
tree | 9f3481864d4b736ecb456d2dbcef5cb964269566 | |
parent | 7570d162477dc8efe67f4c31e93ed21bf8a3fd80 (diff) | |
download | mupdf-7085ddc1eb1a4abb6bf7e8e2d6e65ae8bbe2ce3c.tar.xz |
Use indirect references when pre-loading image resources.
Don't use directly loaded objects; since the image code assumes
that you always use an indirect reference to the dictionary/stream.
-rw-r--r-- | source/pdf/pdf-resources.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/source/pdf/pdf-resources.c b/source/pdf/pdf-resources.c index c401a16f..3a0ddbce 100644 --- a/source/pdf/pdf-resources.c +++ b/source/pdf/pdf-resources.c @@ -29,20 +29,18 @@ pdf_preload_image_resources(fz_context *ctx, pdf_document *doc) int len, k; pdf_obj *obj = NULL; pdf_obj *type; - pdf_obj *res = NULL; fz_image *image = NULL; unsigned char digest[16]; fz_var(obj); fz_var(image); - fz_var(res); fz_try(ctx) { len = pdf_count_objects(ctx, doc); for (k = 1; k < len; k++) { - obj = pdf_load_object(ctx, doc, k); + obj = pdf_new_indirect(ctx, doc, k, 0); type = pdf_dict_get(ctx, obj, PDF_NAME_Subtype); if (pdf_name_eq(ctx, type, PDF_NAME_Image)) { |