summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/fpdfapi/render/fpdf_render_cache.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/core/fpdfapi/render/fpdf_render_cache.cpp b/core/fpdfapi/render/fpdf_render_cache.cpp
index 9f663525ec..d675ce024e 100644
--- a/core/fpdfapi/render/fpdf_render_cache.cpp
+++ b/core/fpdfapi/render/fpdf_render_cache.cpp
@@ -233,22 +233,16 @@ bool CPDF_ImageCacheEntry::GetCachedBitmap(CFX_DIBSource*& pBitmap,
return false;
}
m_MatteColor = MatteColor;
- if (pSrc->GetPitch() * pSrc->GetHeight() < FPDF_HUGE_IMAGE_SIZE) {
- m_pCachedBitmap = pSrc->Clone();
- delete pSrc;
- } else {
- m_pCachedBitmap = pSrc;
- }
- if (pMaskSrc) {
- m_pCachedMask = pMaskSrc->Clone();
- delete pMaskSrc;
- }
+ m_pCachedBitmap = pSrc;
+ if (pMaskSrc)
+ m_pCachedMask = pMaskSrc;
pBitmap = m_pCachedBitmap;
pMask = m_pCachedMask;
CalcSize();
return false;
}
+
CFX_DIBSource* CPDF_ImageCacheEntry::DetachBitmap() {
CFX_DIBSource* pDIBSource = m_pCurBitmap;
m_pCurBitmap = nullptr;