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

Unified Diff: core/fpdfapi/fpdf_render/fpdf_render_text.cpp

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_render/fpdf_render_text.cpp
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
index 225b6726e2dc9fa14bff06bfec1646a360985d3b..1d67f36ac614cad58be8204b8532dc43ec0373b1 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -735,10 +735,11 @@ void CPDF_RenderStatus::DrawTextPathWithPattern(const CPDF_TextObject* textobj,
FX_BOOL bStroke) {
if (!bStroke) {
CPDF_PathObject path;
- CPDF_TextObject* pCopy = textobj->Clone();
+ std::vector<std::unique_ptr<CPDF_TextObject>> pCopy;
+ pCopy.push_back(std::unique_ptr<CPDF_TextObject>(textobj->Clone()));
path.m_bStroke = FALSE;
path.m_FillType = FXFILL_WINDING;
- path.m_ClipPath.AppendTexts(&pCopy, 1);
+ path.m_ClipPath.AppendTexts(&pCopy);
path.m_ColorState = textobj->m_ColorState;
path.m_Path.New()->AppendRect(textobj->m_Left, textobj->m_Bottom,
textobj->m_Right, textobj->m_Top);
« core/fpdfapi/fpdf_page/include/cpdf_clippath.h ('K') | « core/fpdfapi/fpdf_page/pageint.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698