Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp

Issue 397803002: Error handling for invalid component number in CPDF_ICCBasedCS::v_Load (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
index 408a55301e3902c288a3720d36c88db339111e29..1cd109784d76ef14d209263bf9e8e4dabeee4834 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
@@ -582,7 +582,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 <= 0 || m_nComponents > (1 << 16)) {
return FALSE;
}
CPDF_Array* pRanges = pDict->GetArray(FX_BSTRC("Range"));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698