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

Unified Diff: core/fpdfapi/fpdf_page/fpdf_page_doc.cpp

Issue 2194393002: Fix a leak with FPDFPageObj_NewImgeObj(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nit Created 4 years, 4 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/cpdf_imageobject.cpp ('k') | core/fpdfapi/fpdf_page/fpdf_page_parser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_page/fpdf_page_doc.cpp
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp
index f8d75753186707ab7e0dc17aee5062ac8ed92927..fa242ffb857f0c74801dba1fc6f205845aba7566 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();
}
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_imageobject.cpp ('k') | core/fpdfapi/fpdf_page/fpdf_page_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698