summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-08-22 10:30:10 -0700
committerBo Xu <bo_xu@foxitsoftware.com>2014-08-22 10:30:10 -0700
commitee6088e63bfdee81153ef1eeec9b90e42c87064f (patch)
treeced0be7501eb2ca00b4c9314a29500128bbd435c /core/src/fpdfapi/fpdf_page
parent4fb24f37072ebe6bac88ef5c56a7bbcb444c8aec (diff)
downloadpdfium-ee6088e63bfdee81153ef1eeec9b90e42c87064f.tar.xz
Check the number of component in ICCBased colorspace
From PDF reference 8.6.5.5, this could only be 1, 3 or 4. BUG=387968 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/464083003
Diffstat (limited to 'core/src/fpdfapi/fpdf_page')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
index c0a5602819..f1640ad14a 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
@@ -585,7 +585,7 @@ FX_BOOL CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
}
CPDF_Dictionary* pDict = pStream->GetDict();
m_nComponents = pDict ? pDict->GetInteger(FX_BSTRC("N")) : 0;
- if (m_nComponents <= 0 || m_nComponents > (1 << 16)) {
+ if (m_nComponents != 1 && m_nComponents != 3 && m_nComponents != 4) {
return FALSE;
}
CPDF_Array* pRanges = pDict->GetArray(FX_BSTRC("Range"));