summaryrefslogtreecommitdiff
path: root/core/include/fpdfapi/fpdf_resource.h
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-09-02 12:13:36 -0700
committerBo Xu <bo_xu@foxitsoftware.com>2014-09-02 12:13:36 -0700
commit1d7dc1baba517bbf862e7d144e121b2ea4ffd33b (patch)
tree8b701fcb0b798a193475ac9aa64b6acdb55b81ef /core/include/fpdfapi/fpdf_resource.h
parent49c41ac846ed685439b3b5ea9c9037bf4bba2365 (diff)
downloadpdfium-1d7dc1baba517bbf862e7d144e121b2ea4ffd33b.tar.xz
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
Diffstat (limited to 'core/include/fpdfapi/fpdf_resource.h')
-rw-r--r--core/include/fpdfapi/fpdf_resource.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h
index 4ce4ddc8bb..92c4872537 100644
--- a/core/include/fpdfapi/fpdf_resource.h
+++ b/core/include/fpdfapi/fpdf_resource.h
@@ -680,10 +680,8 @@ class CPDF_Color : public CFX_Object
{
public:
- CPDF_Color()
+ CPDF_Color() :m_pCS(NULL), m_pBuffer(NULL), m_pDocument(NULL)
{
- m_pBuffer = NULL;
- m_pCS = NULL;
}
CPDF_Color(int family);
@@ -720,10 +718,11 @@ public:
CPDF_ColorSpace* m_pCS;
- FX_FLOAT* m_pBuffer;
protected:
void ReleaseBuffer();
void ReleaseColorSpace();
+ FX_FLOAT* m_pBuffer;
+ CPDF_Document* m_pDocument;
};
#define PATTERN_TILING 1
#define PATTERN_SHADING 2
@@ -732,7 +731,6 @@ class CPDF_Pattern : public CFX_Object
public:
virtual ~CPDF_Pattern();
- void SaveColor(CPDF_Color* pColor) {m_pColor = pColor;}
CPDF_Object* m_pPatternObj;
@@ -742,7 +740,6 @@ public:
CFX_AffineMatrix m_ParentMatrix;
CPDF_Document* m_pDocument;
- CPDF_Color* m_pColor;
protected: