[poppler] Branch 'xpdf303merge' - poppler/PDFDoc.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Feb 5 14:10:28 PST 2012


 poppler/PDFDoc.cc |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 548648bf29dc1551443eb1925814342e7aadee46
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Feb 5 23:08:44 2012 +0100

    [xpdf303] Merge PDFDoc encryption related code

diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index 608b3ab..30e133a 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -419,7 +419,10 @@ GBool PDFDoc::checkEncryption(GooString *ownerPassword, GooString *userPassword)
   xref->getTrailerDict()->dictLookup("Encrypt", &encrypt);
   if ((encrypted = encrypt.isDict())) {
     if ((secHdlr = SecurityHandler::make(this, &encrypt))) {
-      if (secHdlr->checkEncryption(ownerPassword, userPassword)) {
+      if (secHdlr->isUnencrypted()) {
+	// no encryption
+	ret = gTrue;
+      } else if (secHdlr->checkEncryption(ownerPassword, userPassword)) {
 	// authorization succeeded
        	xref->setEncryption(secHdlr->getPermissionFlags(),
 			    secHdlr->getOwnerPasswordOk(),


More information about the poppler mailing list