summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorPaul Gardiner <paulg.artifex@glidos.net>2013-08-28 10:33:03 +0100
committerPaul Gardiner <paulg.artifex@glidos.net>2013-08-28 10:33:03 +0100
commit9eb83b85cc1d1bde2bb4ad7e106b69415520ef8a (patch)
tree06ccd99c45bde419687d75483e716666e83f188f /source
parentdca49ac644409e9bed09812e03977e649519f5d7 (diff)
downloadmupdf-9eb83b85cc1d1bde2bb4ad7e106b69415520ef8a.tar.xz
Fix bad interaction between incremental update and object streams
The symptoms were that, created annoations were in some cases not saved. Some updated objects withing the document were not being moved into the incremental-save xref section. That in turn was due to nodes within the hierarchy of those objects not having their parent_num field set. The objects falling foul of this problem were those held in object streams. When any one object from a stream is cached, the whole stream is read and all other objects from that stream are also cached, but only the initial one has its parent_num set. This patch ensures that all objects from a stream are accounted for. In fact, for the initially-requested object, we now set parent_num twice, but that is harmless and the code to avoid doing so wouls be an unnecessary complication.
Diffstat (limited to 'source')
-rw-r--r--source/pdf/pdf-xref.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
index a8aace68..b1b9abe8 100644
--- a/source/pdf/pdf-xref.c
+++ b/source/pdf/pdf-xref.c
@@ -1317,6 +1317,8 @@ pdf_load_obj_stm(pdf_document *doc, int num, int gen, pdf_lexbuf *buf)
entry = pdf_get_xref_entry(doc, numbuf[i]);
+ pdf_set_obj_parent(obj, numbuf[i]);
+
if (entry->type == 'o' && entry->ofs == num)
{
/* If we already have an entry for this object,