summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/fpdfapi/parser/cpdf_parser.cpp1
-rw-r--r--core/fpdfapi/parser/cpdf_parser.h4
2 files changed, 3 insertions, 2 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp
index b6231a7a6a..6957c84071 100644
--- a/core/fpdfapi/parser/cpdf_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_parser.cpp
@@ -101,7 +101,6 @@ CPDF_Parser::CPDF_Parser()
m_bHasParsed(false),
m_bXRefStream(false),
m_FileVersion(0),
- m_pEncryptDict(nullptr),
m_TrailerData(pdfium::MakeUnique<TrailerData>()) {}
CPDF_Parser::~CPDF_Parser() {
diff --git a/core/fpdfapi/parser/cpdf_parser.h b/core/fpdfapi/parser/cpdf_parser.h
index 96bd6f43a9..a58838e5fb 100644
--- a/core/fpdfapi/parser/cpdf_parser.h
+++ b/core/fpdfapi/parser/cpdf_parser.h
@@ -200,11 +200,13 @@ class CPDF_Parser {
bool m_bHasParsed;
bool m_bXRefStream;
int m_FileVersion;
+ // m_TrailerData must be destroyed after m_pSecurityHandler due to the
+ // ownership of the ID array data.
+ std::unique_ptr<TrailerData> m_TrailerData;
UnownedPtr<CPDF_Dictionary> m_pEncryptDict;
FX_FILESIZE m_LastXRefOffset;
std::unique_ptr<CPDF_SecurityHandler> m_pSecurityHandler;
ByteString m_Password;
- std::unique_ptr<TrailerData> m_TrailerData;
std::unique_ptr<CPDF_LinearizedHeader> m_pLinearized;
// A map of object numbers to indirect streams.