diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2017-08-30 17:02:01 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-31 19:34:56 +0000 |
commit | ce9ad1bee792856c2d9e940ecffff97145e18d32 (patch) | |
tree | 8410b6a25c2f99f91c2bab98d9d764c11ed159b5 /core/fpdfapi/page/cpdf_patterncs.cpp | |
parent | 670c4fdea0acb9663145b96bec1fbf76279781df (diff) | |
download | pdfium-ce9ad1bee792856c2d9e940ecffff97145e18d32.tar.xz |
Fix colorspace loading for mutually referencing colorspaces.
For example, Indexed colorspace A uses ICC Based colorspace B as its
"base". B declares A as its "Alternate" fallback.
Bug: chromium:759012
Change-Id: I4b78e68b9a77456050ecae4452837495546bf93d
Reviewed-on: https://pdfium-review.googlesource.com/12471
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_patterncs.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_patterncs.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/fpdfapi/page/cpdf_patterncs.cpp b/core/fpdfapi/page/cpdf_patterncs.cpp index 46b975ab67..d1b7bf8e10 100644 --- a/core/fpdfapi/page/cpdf_patterncs.cpp +++ b/core/fpdfapi/page/cpdf_patterncs.cpp @@ -24,13 +24,15 @@ CPDF_PatternCS::~CPDF_PatternCS() { } } -bool CPDF_PatternCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) { +bool CPDF_PatternCS::v_Load(CPDF_Document* pDoc, + CPDF_Array* pArray, + std::set<CPDF_Object*>* pVisited) { CPDF_Object* pBaseCS = pArray->GetDirectObjectAt(1); if (pBaseCS == m_pArray) return false; CPDF_DocPageData* pDocPageData = pDoc->GetPageData(); - m_pBaseCS = pDocPageData->GetColorSpace(pBaseCS, nullptr); + m_pBaseCS = pDocPageData->GetColorSpaceGuarded(pBaseCS, nullptr, pVisited); if (!m_pBaseCS) { m_nComponents = 1; return true; |