From 66568bcd683dd7b18672cb3aebca4487e9203519 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 26 Apr 2017 15:22:00 -0700 Subject: Assert CPDF_Pattern always has a valid CPDF_Document pointer. Same for CPDF_DocPageData. Change-Id: I8f2f559123dbb2f3623d957e4074d5f9d191797f Reviewed-on: https://pdfium-review.googlesource.com/4501 Reviewed-by: Tom Sepez Commit-Queue: Lei Zhang --- core/fpdfapi/page/cpdf_pattern.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'core/fpdfapi/page/cpdf_pattern.h') diff --git a/core/fpdfapi/page/cpdf_pattern.h b/core/fpdfapi/page/cpdf_pattern.h index d44965ff16..3b948aedb7 100644 --- a/core/fpdfapi/page/cpdf_pattern.h +++ b/core/fpdfapi/page/cpdf_pattern.h @@ -24,18 +24,20 @@ class CPDF_Pattern { virtual CPDF_TilingPattern* AsTilingPattern() = 0; virtual CPDF_ShadingPattern* AsShadingPattern() = 0; + // All the getters that return pointers return non-NULL pointers. CPDF_Document* document() { return m_pDocument; } CPDF_Object* pattern_obj() { return m_pPatternObj; } CFX_Matrix* pattern_to_form() { return &m_Pattern2Form; } const CFX_Matrix& parent_matrix() const { return m_ParentMatrix; } protected: - CPDF_Pattern(PatternType type, - CPDF_Document* pDoc, + CPDF_Pattern(CPDF_Document* pDoc, CPDF_Object* pObj, const CFX_Matrix& parentMatrix); - const PatternType m_PatternType; + void SetPatternToFormMatrix(); + + private: CPDF_Document* const m_pDocument; CPDF_Object* const m_pPatternObj; CFX_Matrix m_Pattern2Form; -- cgit v1.2.3