summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-08-09 15:46:20 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-09 15:46:20 -0700
commitdc359b03ab6a70ee52a91119ff6704cae92f4809 (patch)
tree131cb9b1846f4be24c9cb7c54b30975c6a858071 /core/fpdfapi/fpdf_page/fpdf_page_doc.cpp
parent39ba18a64283ef3fc3c4aedf537a09835f90862e (diff)
downloadpdfium-dc359b03ab6a70ee52a91119ff6704cae92f4809.tar.xz
Fix a leak with FPDFPageObj_NewImgeObj().
BUG=pdfium:545 Review-Url: https://codereview.chromium.org/2194393002
Diffstat (limited to 'core/fpdfapi/fpdf_page/fpdf_page_doc.cpp')
-rw-r--r--core/fpdfapi/fpdf_page/fpdf_page_doc.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp
index f8d7575318..fa242ffb85 100644
--- a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp
+++ b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp
@@ -406,10 +406,8 @@ CPDF_Image* CPDF_DocPageData::GetImage(CPDF_Object* pImageStream) {
if (it != m_ImageMap.end())
return it->second->AddRef();
- CPDF_Image* pImage = new CPDF_Image(m_pPDFDoc);
- pImage->LoadImageF(pImageStream->AsStream(), false);
-
- CPDF_CountedImage* pCountedImage = new CPDF_CountedImage(pImage);
+ CPDF_CountedImage* pCountedImage = new CPDF_CountedImage(
+ new CPDF_Image(m_pPDFDoc, pImageStream->AsStream(), false));
m_ImageMap[dwImageObjNum] = pCountedImage;
return pCountedImage->AddRef();
}