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

Unified Diff: core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.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 | « BUILD.gn ('k') | core/fpdfapi/fpdf_page/cpdf_image.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp
diff --git a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp
index a85591ceef332173840852817adba7785f7d17fc..0e4bab1ae1fa62cad31f7f080ac5ae4a4d2dd636 100644
--- a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp
+++ b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp
@@ -99,12 +99,12 @@ void CPDF_PageContentGenerator::ProcessImage(CFX_ByteTextBuf& buf,
uint32_t dwSavedObjNum = pStream->GetObjNum();
CFX_ByteString name = RealizeResource(pStream, "XObject");
if (dwSavedObjNum == 0) {
- pImage->Release();
- pImageObj->m_pImage = m_pDocument->GetPageData()->GetImage(pStream);
+ pImageObj->SetUnownedImage(m_pDocument->GetPageData()->GetImage(pStream));
}
buf << "/" << PDF_NameEncode(name) << " Do Q\n";
}
}
+
void CPDF_PageContentGenerator::ProcessForm(CFX_ByteTextBuf& buf,
const uint8_t* data,
uint32_t size,
« no previous file with comments | « BUILD.gn ('k') | core/fpdfapi/fpdf_page/cpdf_image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698