Re: [Podofo-users] what is the status of AES Decrypt/Encrypt
A PDF parsing, modification and creation library.
Brought to you by:
domseichter
|
From: Andreas B. <and...@do...> - 2014-03-10 16:58:36
|
Index: src/base/PdfParser.cpp
===================================================================
--- src/base/PdfParser.cpp (revision 1583)
+++ src/base/PdfParser.cpp (working copy)
@@ -980,6 +980,13 @@
pObject->SetLoadOnDemand( m_bLoadOnDemand );
try {
pObject->ParseFile( m_pEncrypt );
+ PdfObject* pObjType = pObject->IsDictionary() ? pObject->GetDictionary().GetKey( PdfName::KeyType ) : 0;
+ if( pObjType && pObjType->IsName() && pObjType->GetName() == "XRef" ) {
+ // Never add the XRef to m_vecObjects because if it has a stream it is not encrypted
+ // (So setting m_pEncrypt for it would throw exception if the stream is read later on.)
+ delete pObject;
+ continue;
+ }
nLast = pObject->Reference().ObjectNumber();
/* |