summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-08-12 14:36:21 -0700
committerBo Xu <bo_xu@foxitsoftware.com>2014-08-12 14:36:21 -0700
commit87708e18c8244feecb8e58e9dc8861118061f8de (patch)
treed0f92fafa7b1a5ee6b1d1b18db5ae28d0617d087 /core
parentfda0d427d730d54a2789faffd9547c9775bff9ce (diff)
downloadpdfium-87708e18c8244feecb8e58e9dc8861118061f8de.tar.xz
For a CPDF_Color object, when set a new pattern to it, disconnect its link with the old pattern
This patch is related to https://pdfium.googlesource.com/pdfium/+/1b9c5c4dc41956b8c5ab17b9a882adf8a2513768 BUG=402260 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/460383004
Diffstat (limited to 'core')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
index 8cd26fee37..6c2701f5f7 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
@@ -1326,6 +1326,7 @@ void CPDF_Color::SetValue(CPDF_Pattern* pPattern, FX_FLOAT* comps, int ncomps)
PatternValue* pvalue = (PatternValue*)m_pBuffer;
if (pvalue->m_pPattern && pvalue->m_pPattern->m_pDocument) {
pDocPageData = pvalue->m_pPattern->m_pDocument->GetPageData();
+ pvalue->m_pPattern->SaveColor(NULL);
pDocPageData->ReleasePattern(pvalue->m_pPattern->m_pPatternObj);
}
pvalue->m_nComps = ncomps;