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

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: new strategy 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
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 059679a8cda1f3d7284c6278e73b074697a2b9b7..fcc1f870f5b35d8213aaee4cf64ea7f918411ac1 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();
}

Powered by Google App Engine
This is Rietveld 408576698