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

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_array.cpp

Issue 2375343004: Assert that only 0-numbered objects are Released() (Closed)
Patch Set: typo 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 | « no previous file | core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/cpdf_array.cpp
diff --git a/core/fpdfapi/fpdf_parser/cpdf_array.cpp b/core/fpdfapi/fpdf_parser/cpdf_array.cpp
index 26e65bca3463def701abd0130af9eba67f87ca39..a3be55b9f0cb1977e6073245f8c760ccadf6bcd6 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_array.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_array.cpp
@@ -23,7 +23,7 @@ CPDF_Array::~CPDF_Array() {
// in case of cyclic references.
m_ObjNum = kInvalidObjNum;
for (auto& it : m_Objects) {
- if (it)
+ if (it && it->GetObjNum() != kInvalidObjNum)
it->Release();
}
}
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698