From 87708e18c8244feecb8e58e9dc8861118061f8de Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Tue, 12 Aug 2014 14:36:21 -0700 Subject: 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 --- core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'core/src/fpdfapi/fpdf_page') 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; -- cgit v1.2.3