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

Unified Diff: core/fpdfapi/fpdf_page/include/cpdf_clippath.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/include/cpdf_clippath.h
diff --git a/core/fpdfapi/fpdf_page/include/cpdf_clippath.h b/core/fpdfapi/fpdf_page/include/cpdf_clippath.h
index 6f239e661f760b6d011cb3ee83866170eebec187..e96e6cfe9db2553675eac250710c30706e38745b 100644
--- a/core/fpdfapi/fpdf_page/include/cpdf_clippath.h
+++ b/core/fpdfapi/fpdf_page/include/cpdf_clippath.h
@@ -17,17 +17,17 @@ class CPDF_TextObject;
class CPDF_ClipPath : public CFX_CountRef<CPDF_ClipPathData> {
public:
- uint32_t GetPathCount() const { return m_pObject->m_PathCount; }
- CPDF_Path GetPath(int i) const { return m_pObject->m_pPathList[i]; }
- int GetClipType(int i) const { return m_pObject->m_pTypeList[i]; }
- uint32_t GetTextCount() const { return m_pObject->m_TextCount; }
- CPDF_TextObject* GetText(int i) const { return m_pObject->m_pTextList[i]; }
+ uint32_t GetPathCount() const { return m_pObject->m_PathList.size(); }
Tom Sepez 2016/05/19 18:32:03 pdfium::CollectionSize<uint32_t>() if we worry abo
Lei Zhang 2016/05/19 20:44:26 Done.
+ CPDF_Path GetPath(size_t i) const { return m_pObject->m_PathList[i]; }
+ uint8_t GetClipType(size_t i) const { return m_pObject->m_TypeList[i]; }
+ uint32_t GetTextCount() const { return m_pObject->m_TextList.size(); }
+ CPDF_TextObject* GetText(size_t i) const {
+ return m_pObject->m_TextList[i].get();
+ }
CFX_FloatRect GetClipBox() const;
- void AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge);
- void DeletePath(int layer_index);
-
- void AppendTexts(CPDF_TextObject** pTexts, int count);
+ void AppendPath(CPDF_Path path, uint8_t type, bool bAutoMerge);
+ void AppendTexts(std::vector<std::unique_ptr<CPDF_TextObject>>* pTexts);
void Transform(const CFX_Matrix& matrix);
};

Powered by Google App Engine
This is Rietveld 408576698