From 59ce240d509a3079dab64f891a5363b11d4de3c7 Mon Sep 17 00:00:00 2001 From: weili Date: Tue, 17 May 2016 10:16:40 -0700 Subject: Fix DrMemory bot error by properly initializing the variable The variable needs to be initialized before using. Review-Url: https://codereview.chromium.org/1984323002 --- core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp | 2 ++ core/fpdfapi/fpdf_edit/include/cpdf_creator.h | 1 + 2 files changed, 3 insertions(+) diff --git a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp index 372506d6cc..658b9782e5 100644 --- a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp +++ b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp @@ -881,7 +881,9 @@ CPDF_Creator::CPDF_Creator(CPDF_Document* pDoc) 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_bLocalCryptoHandler(FALSE), m_pMetadata(nullptr), m_ObjectStreamSize(200), m_dwLastObjNum(m_pDocument->GetLastObjNum()), diff --git a/core/fpdfapi/fpdf_edit/include/cpdf_creator.h b/core/fpdfapi/fpdf_edit/include/cpdf_creator.h index c932dc0804..8782c54f86 100644 --- a/core/fpdfapi/fpdf_edit/include/cpdf_creator.h +++ b/core/fpdfapi/fpdf_edit/include/cpdf_creator.h @@ -80,6 +80,7 @@ class CPDF_Creator { uint32_t m_dwEncryptObjNum; FX_BOOL m_bEncryptCloned; CPDF_CryptoHandler* m_pCryptoHandler; + // Whether this owns the crypto handler |m_pCryptoHandler|. FX_BOOL m_bLocalCryptoHandler; CPDF_Object* m_pMetadata; std::unique_ptr m_pXRefStream; -- cgit v1.2.3