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

Unified Diff: core/fpdfapi/parser/cpdf_stream.cpp

Issue 2401423005: Land all the fixes from 5609f39c but don't enable assert (Closed)
Patch Set: Created 4 years, 2 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 | « core/fpdfapi/parser/cpdf_parser.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/parser/cpdf_stream.cpp
diff --git a/core/fpdfapi/parser/cpdf_stream.cpp b/core/fpdfapi/parser/cpdf_stream.cpp
index c221edec68624a9b86a6a9c4e3b7ee2eb89e0603..935c80c5c890d36d37a626a5e41a65a9efa7d7c1 100644
--- a/core/fpdfapi/parser/cpdf_stream.cpp
+++ b/core/fpdfapi/parser/cpdf_stream.cpp
@@ -17,7 +17,11 @@ CPDF_Stream::CPDF_Stream() {}
CPDF_Stream::CPDF_Stream(uint8_t* pData, uint32_t size, CPDF_Dictionary* pDict)
: m_pDict(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;
« no previous file with comments | « core/fpdfapi/parser/cpdf_parser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698