Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Unified Diff: core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp

Issue 1987783002: Revert of Remove an unnecessary variable from CPDF_Creator (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_edit/include/cpdf_creator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
diff --git a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
index 7604c6224051bbb48420f99145a7a55d4dd810c6..372506d6cce649e0346ea091576e2e6d6fe4f4d4 100644
--- a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
+++ b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
@@ -881,10 +881,8 @@
m_bSecurityChanged(FALSE),
m_pEncryptDict(m_pParser ? m_pParser->GetEncryptDict() : nullptr),
m_dwEncryptObjNum(0),
- m_bEncryptCloned(FALSE),
m_pCryptoHandler(m_pParser ? m_pParser->GetCryptoHandler() : nullptr),
m_pMetadata(nullptr),
- m_pXRefStream(nullptr),
m_ObjectStreamSize(200),
m_dwLastObjNum(m_pDocument->GetLastObjNum()),
m_Offset(0),
@@ -1961,9 +1959,11 @@
CPDF_SecurityHandler handler;
handler.OnCreate(m_pEncryptDict, m_pIDArray, user_pass.raw_str(),
user_pass.GetLength(), flag);
- delete m_pCryptoHandler;
+ if (m_bLocalCryptoHandler)
+ delete m_pCryptoHandler;
m_pCryptoHandler = new CPDF_CryptoHandler;
m_pCryptoHandler->Init(m_pEncryptDict, &handler);
+ m_bLocalCryptoHandler = TRUE;
m_bSecurityChanged = TRUE;
}
}
@@ -2008,6 +2008,10 @@
m_pCryptoHandler = nullptr;
}
void CPDF_Creator::ResetStandardSecurity() {
+ if (!m_bLocalCryptoHandler)
+ return;
+
delete m_pCryptoHandler;
m_pCryptoHandler = nullptr;
-}
+ m_bLocalCryptoHandler = FALSE;
+}
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_edit/include/cpdf_creator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698