From ee6088e63bfdee81153ef1eeec9b90e42c87064f Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Fri, 22 Aug 2014 10:30:10 -0700 Subject: 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 --- core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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")); -- cgit v1.2.3