For a CPDF_Color object, when set a new pattern to it, disconnect its link with the...
authorBo Xu <bo_xu@foxitsoftware.com>
Tue, 12 Aug 2014 21:36:21 +0000 (14:36 -0700)
committerBo Xu <bo_xu@foxitsoftware.com>
Tue, 12 Aug 2014 21:36:21 +0000 (14:36 -0700)
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

index 8cd26fe..6c2701f 100644 (file)
@@ -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;