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

Unified Diff: core/fpdfapi/fpdf_page/cpdf_clippathdata.h

Issue 1998583002: Fix leak in CPDF_StreamContentParser::AddTextObject(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: More vectors, fix leak Created 4 years, 7 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
Index: core/fpdfapi/fpdf_page/cpdf_clippathdata.h
diff --git a/core/fpdfapi/fpdf_page/cpdf_clippathdata.h b/core/fpdfapi/fpdf_page/cpdf_clippathdata.h
index 05a247f7535dfc5a04d075467763225840fe67a6..b4098cb24d46c4cfde66776c95d1d3a8626191c3 100644
--- a/core/fpdfapi/fpdf_page/cpdf_clippathdata.h
+++ b/core/fpdfapi/fpdf_page/cpdf_clippathdata.h
@@ -9,6 +9,9 @@
#include <stdint.h>
+#include <memory>
+#include <vector>
+
class CPDF_Path;
class CPDF_TextObject;
@@ -18,13 +21,9 @@ class CPDF_ClipPathData {
CPDF_ClipPathData(const CPDF_ClipPathData&);
~CPDF_ClipPathData();
- void SetCount(int path_count, int text_count);
-
- int m_PathCount;
- CPDF_Path* m_pPathList;
- uint8_t* m_pTypeList;
- int m_TextCount;
- CPDF_TextObject** m_pTextList;
+ std::vector<CPDF_Path> m_PathList;
+ std::vector<uint8_t> m_TypeList;
+ std::vector<std::unique_ptr<CPDF_TextObject>> m_TextList;
};
#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_CLIPPATHDATA_H_

Powered by Google App Engine
This is Rietveld 408576698