diff options
author | thestig <thestig@chromium.org> | 2016-05-19 14:36:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-19 14:36:00 -0700 |
commit | 80f25a5a8135933a405349ffc798d13273b3d690 (patch) | |
tree | db15a1e0c751f6fc0a648a991d744bc14e7bfadd /core/fpdfapi/fpdf_render | |
parent | c7600f99490f83e544e37feb77d3b9e8428b0f68 (diff) | |
download | pdfium-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')
-rw-r--r-- | core/fpdfapi/fpdf_render/fpdf_render_text.cpp | 5 |
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); |