summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-xref.c
diff options
context:
space:
mode:
authorSimon Bünzli <zeniko@gmail.com>2014-07-18 15:44:56 +0200
committerSimon Bünzli <zeniko@gmail.com>2014-07-18 15:44:56 +0200
commit17c748e6b7ec0426344476efd2945eb7b5d6ca02 (patch)
tree979b43b1f944a41d89c7e80cb429980c05f52a13 /source/pdf/pdf-xref.c
parent40212ef5a3752bc7021653be192785d1e0f4e1fc (diff)
downloadmupdf-17c748e6b7ec0426344476efd2945eb7b5d6ca02.tar.xz
properly decrypt strings in encrypted but broken documents
If a PDF document is encrypted but broken, repairing caches all strings in encrypted form. Clearing the xref after repairing ensures that strings are returned to API callers as expected. Cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2610
Diffstat (limited to 'source/pdf/pdf-xref.c')
-rw-r--r--source/pdf/pdf-xref.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
index b3505c36..d298a6c3 100644
--- a/source/pdf/pdf-xref.c
+++ b/source/pdf/pdf-xref.c
@@ -1169,6 +1169,10 @@ pdf_init_document(pdf_document *doc)
pdf_drop_obj(dict);
dict = NULL;
}
+
+ /* ensure that strings are not used in their repaired, non-decrypted form */
+ if (doc->crypt)
+ pdf_clear_xref(doc);
}
}
fz_catch(ctx)