summaryrefslogtreecommitdiff
path: root/source/tools/murun.c
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 /source/tools/murun.c
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 'source/tools/murun.c')
-rw-r--r--source/tools/murun.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/tools/murun.c b/source/tools/murun.c
index df0cbdc2..c3b01cda 100644
--- a/source/tools/murun.c
+++ b/source/tools/murun.c
@@ -2986,7 +2986,7 @@ static void ffi_PDFObject_forEach(js_State *J)
int i, n;
fz_try(ctx)
- obj = pdf_resolve_indirect(ctx, obj);
+ obj = pdf_resolve_indirect_chain(ctx, obj);
fz_catch(ctx)
rethrow(J);