summaryrefslogtreecommitdiff
path: root/third_party/lcms2-2.6/src/cmstypes.c
diff options
context:
space:
mode:
authorkcwu <kcwu@chromium.org>2016-11-07 10:41:52 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-07 10:41:52 -0800
commit413e3518ce390860cb5560720e5fba3ca7c8f764 (patch)
treeab0fba43e66f7b5bb174eb93b959e9c54d20fbb0 /third_party/lcms2-2.6/src/cmstypes.c
parenteb3f68cc7f25a1e28464eb251161b8f08fcd04bc (diff)
downloadpdfium-413e3518ce390860cb5560720e5fba3ca7c8f764.tar.xz
lcms: backport upstream commit c0a98d86
This fixed several issues. BUG=chromium:654265,chromium:657282,chromium:654676,chromium:654313 Review-Url: https://codereview.chromium.org/2482523003
Diffstat (limited to 'third_party/lcms2-2.6/src/cmstypes.c')
-rw-r--r--third_party/lcms2-2.6/src/cmstypes.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/third_party/lcms2-2.6/src/cmstypes.c b/third_party/lcms2-2.6/src/cmstypes.c
index 04dd0c4e00..386439ba2b 100644
--- a/third_party/lcms2-2.6/src/cmstypes.c
+++ b/third_party/lcms2-2.6/src/cmstypes.c
@@ -4297,8 +4297,12 @@ void *Type_MPEclut_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io,
// Copy MAX_INPUT_DIMENSIONS at most. Expand to cmsUInt32Number
nMaxGrids = InputChans > MAX_INPUT_DIMENSIONS ? MAX_INPUT_DIMENSIONS : InputChans;
- for (i=0; i < nMaxGrids; i++) GridPoints[i] = (cmsUInt32Number) Dimensions8[i];
+ for (i = 0; i < nMaxGrids; i++) {
+ if (Dimensions8[i] == 1) goto Error; // Impossible value, 0 for no CLUT and then 2 at least
+ GridPoints[i] = (cmsUInt32Number)Dimensions8[i];
+ }
+
// Allocate the true CLUT
mpe = cmsStageAllocCLutFloatGranular(self ->ContextID, GridPoints, InputChans, OutputChans, NULL);
if (mpe == NULL) goto Error;