summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fxge/dib/fx_dib_main.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/fxge/dib/fx_dib_main.cpp b/core/fxge/dib/fx_dib_main.cpp
index 8a97d342b5..32b7c0be52 100644
--- a/core/fxge/dib/fx_dib_main.cpp
+++ b/core/fxge/dib/fx_dib_main.cpp
@@ -1400,14 +1400,15 @@ CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::FlipImage(bool bXFlip,
CFX_DIBExtractor::CFX_DIBExtractor(const CFX_RetainPtr<CFX_DIBSource>& pSrc) {
if (pSrc->GetBuffer()) {
+ CFX_RetainPtr<CFX_DIBSource> pOldSrc(pSrc);
m_pBitmap = pdfium::MakeRetain<CFX_DIBitmap>();
- if (!m_pBitmap->Create(pSrc->GetWidth(), pSrc->GetHeight(),
- pSrc->GetFormat(), pSrc->GetBuffer())) {
+ if (!m_pBitmap->Create(pOldSrc->GetWidth(), pOldSrc->GetHeight(),
+ pOldSrc->GetFormat(), pOldSrc->GetBuffer())) {
m_pBitmap.Reset();
return;
}
- m_pBitmap->SetPalette(pSrc->GetPalette());
- m_pBitmap->SetAlphaMask(pSrc->m_pAlphaMask);
+ m_pBitmap->SetPalette(pOldSrc->GetPalette());
+ m_pBitmap->SetAlphaMask(pOldSrc->m_pAlphaMask);
} else {
m_pBitmap = pSrc->Clone();
}