Index: core/fpdfapi/fpdf_parser/cpdf_stream.cpp |
diff --git a/core/fpdfapi/fpdf_parser/cpdf_stream.cpp b/core/fpdfapi/fpdf_parser/cpdf_stream.cpp |
index 4f6d0463977a64d8c4eb9ff5e79b3d7feb40c508..6a0bf05937920b5153cb9ccf5cc12cec67b2b948 100644 |
--- a/core/fpdfapi/fpdf_parser/cpdf_stream.cpp |
+++ b/core/fpdfapi/fpdf_parser/cpdf_stream.cpp |
@@ -19,7 +19,11 @@ CPDF_Stream::CPDF_Stream(uint8_t* pData, uint32_t size, CPDF_Dictionary* pDict) |
m_dwSize(size), |
m_pDataBuf(pData) {} |
-CPDF_Stream::~CPDF_Stream() {} |
+CPDF_Stream::~CPDF_Stream() { |
+ m_ObjNum = kInvalidObjNum; |
+ if (m_pDict && m_pDict->GetObjNum() == kInvalidObjNum) |
+ m_pDict.release(); // lowercase release, release ownership. |
+} |
CPDF_Object::Type CPDF_Stream::GetType() const { |
return STREAM; |