changeset 8996:d14c94c19732

8157759: LCMS Transform Sampling Enhancement Reviewed-by: prr, serb, mschoene
author aivanov
date Thu, 07 Jul 2016 10:28:36 +0300
parents 7a2f15b60904
children c99e24994913
files src/share/native/sun/java2d/cmm/lcms/cmstypes.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/java2d/cmm/lcms/cmstypes.c	Tue Jul 12 11:19:59 2016 +0300
+++ b/src/share/native/sun/java2d/cmm/lcms/cmstypes.c	Thu Jul 07 10:28:36 2016 +0300
@@ -4301,7 +4301,10 @@
 
     // 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);