From 1d7dc1baba517bbf862e7d144e121b2ea4ffd33b Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Tue, 2 Sep 2014 12:13:36 -0700 Subject: Add m_pDocument in CPDF_Color and check if page date has been forced clear This will prevent using freed pattern object. This is a better solution than https://pdfium.googlesource.com/pdfium/+/1b9c5c4dc41956b8c5ab17b9a882adf8a2513768 and in essence revert that patch BUG=409373 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/522483003 --- core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp') diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp index c7c1e7a565..bcb8196662 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp @@ -8,19 +8,14 @@ #include "pageint.h" CPDF_Pattern::CPDF_Pattern(const CFX_AffineMatrix* pParentMatrix) : - m_pPatternObj(NULL), m_PatternType(PATTERN_TILING), m_pDocument(NULL), m_pColor(NULL) + m_pPatternObj(NULL), m_PatternType(PATTERN_TILING), m_pDocument(NULL) { if (pParentMatrix) { m_ParentMatrix = *pParentMatrix; } } - CPDF_Pattern::~CPDF_Pattern() { - if (m_pColor) { - m_pColor->SetValue(NULL, NULL, 0); - m_pColor = NULL; - } } CPDF_TilingPattern::CPDF_TilingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, const CFX_AffineMatrix* parentMatrix) : CPDF_Pattern(parentMatrix) -- cgit v1.2.3