summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-05-19 14:36:00 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-19 14:36:00 -0700
commit80f25a5a8135933a405349ffc798d13273b3d690 (patch)
treedb15a1e0c751f6fc0a648a991d744bc14e7bfadd /core/fpdfapi/fpdf_render/fpdf_render_text.cpp
parentc7600f99490f83e544e37feb77d3b9e8428b0f68 (diff)
downloadpdfium-80f25a5a8135933a405349ffc798d13273b3d690.tar.xz
Fix leak in CPDF_StreamContentParser::AddTextObject().
... by using STL containers in more places. Remove dead / duplicate code as well. BUG=603904 Review-Url: https://codereview.chromium.org/1998583002
Diffstat (limited to 'core/fpdfapi/fpdf_render/fpdf_render_text.cpp')
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_text.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
index 221d04fd70..f2704b7d60 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);