summaryrefslogtreecommitdiff
path: root/include/mupdf/pdf/xref.h
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-07-01 17:33:30 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-07-06 15:45:16 +0200
commit5983a7de30e84af04dab3c7835c04dba493391fa (patch)
tree67381a4cb938d86b88c116739bcc54a0bcc9de23 /include/mupdf/pdf/xref.h
parent255776a778b519183d6935ff0cb4b766644fa830 (diff)
downloadmupdf-5983a7de30e84af04dab3c7835c04dba493391fa.tar.xz
Fix garbage collection and page grafting for indirect reference chains.
The mark & sweep pass of garbage collection, and resolving indirect objects when grafting objects was following the full chain of indirect references. In the unusual case where a numbered object is itself only an indirect reference to another object, this intermediate numbered object would be missed both when marking for garbage collection, and when copying objects for grafting. Add a function to resolve only one step for these two uses. The following is an example of a file that would break during garbage collection if we follow full indirect reference chains: %PDF-1.3 1 0 obj <</Type/Catalog /Foo[2 0 R 3 0 R]>> endobj 2 0 obj 4 0 R endobj 3 0 obj 5 0 R endobj 4 0 obj <</Length 1>> stream A endstream endobj 5 0 obj <</Length 1>> stream B endstream endobj
Diffstat (limited to 'include/mupdf/pdf/xref.h')
-rw-r--r--include/mupdf/pdf/xref.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/mupdf/pdf/xref.h b/include/mupdf/pdf/xref.h
index 2c8ab858..b85d7334 100644
--- a/include/mupdf/pdf/xref.h
+++ b/include/mupdf/pdf/xref.h
@@ -77,6 +77,7 @@ pdf_xref_entry *pdf_cache_object(fz_context *ctx, pdf_document *doc, int num);
int pdf_count_objects(fz_context *ctx, pdf_document *doc);
pdf_obj *pdf_resolve_indirect(fz_context *ctx, pdf_obj *ref);
+pdf_obj *pdf_resolve_indirect_chain(fz_context *ctx, pdf_obj *ref);
pdf_obj *pdf_load_object(fz_context *ctx, pdf_document *doc, int num);
fz_buffer *pdf_load_raw_stream(fz_context *ctx, pdf_document *doc, int num);