summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_image.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/page/cpdf_image.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_image.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp
index c910319aba..feafde3b36 100644
--- a/core/fpdfapi/page/cpdf_image.cpp
+++ b/core/fpdfapi/page/cpdf_image.cpp
@@ -322,18 +322,18 @@ void CPDF_Image::ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pBitmap) {
pPage->GetRenderCache()->ResetBitmap(m_pStream.Get(), pBitmap);
}
-CFX_DIBSource* CPDF_Image::LoadDIBSource(CFX_DIBSource** ppMask,
- uint32_t* pMatteColor,
- bool bStdCS,
- uint32_t GroupFamily,
- bool bLoadMask) const {
+std::unique_ptr<CFX_DIBSource> CPDF_Image::LoadDIBSource(CFX_DIBSource** ppMask,
+ uint32_t* pMatteColor,
+ bool bStdCS,
+ uint32_t GroupFamily,
+ bool bLoadMask) const {
auto source = pdfium::MakeUnique<CPDF_DIBSource>();
- if (source->Load(m_pDocument, m_pStream.Get(),
- reinterpret_cast<CPDF_DIBSource**>(ppMask), pMatteColor,
- nullptr, nullptr, bStdCS, GroupFamily, bLoadMask)) {
- return source.release();
+ if (!source->Load(m_pDocument, m_pStream.Get(),
+ reinterpret_cast<CPDF_DIBSource**>(ppMask), pMatteColor,
+ nullptr, nullptr, bStdCS, GroupFamily, bLoadMask)) {
+ return nullptr;
}
- return nullptr;
+ return std::move(source);
}
CFX_DIBSource* CPDF_Image::DetachBitmap() {