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

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: CollectionSize 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
« no previous file with comments | « core/fpdfapi/fpdf_page/pageint.h ('k') | core/fxcrt/include/fx_basic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 221d04fd707cd38608241a534a2a319c30199052..f2704b7d60e2d15b43641557e550116e2fa79621 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -736,10 +736,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);
« no previous file with comments | « core/fpdfapi/fpdf_page/pageint.h ('k') | core/fxcrt/include/fx_basic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698