summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/page')
-rw-r--r--core/fpdfapi/page/cpdf_colorspace.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/fpdfapi/page/cpdf_colorspace.cpp b/core/fpdfapi/page/cpdf_colorspace.cpp
index 89d5285878..ea61c1896b 100644
--- a/core/fpdfapi/page/cpdf_colorspace.cpp
+++ b/core/fpdfapi/page/cpdf_colorspace.cpp
@@ -1015,6 +1015,12 @@ bool CPDF_IndexedCS::v_Load(CPDF_Document* pDoc,
if (!m_pBaseCS)
return false;
+ // The base color space cannot be a Pattern or Indexed space, according to the
+ // PDF 1.7 spec, page 263.
+ if (m_pBaseCS->GetFamily() == PDFCS_INDEXED ||
+ m_pBaseCS->GetFamily() == PDFCS_PATTERN)
+ return false;
+
m_pCountedBaseCS = pDocPageData->FindColorSpacePtr(m_pBaseCS->GetArray());
m_nBaseComponents = m_pBaseCS->CountComponents();
m_pCompMinMax = FX_Alloc2D(float, m_nBaseComponents, 2);