changeset 11934:7776a75bfaf8

8157759: LCMS Transform Sampling Enhancement Reviewed-by: prr, serb, mschoene
author aivanov
date Thu, 07 Jul 2016 10:28:36 +0300
parents 11f1127e9684
children e47a4a3f3e54
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	Wed Jul 06 17:56:09 2016 +0300
+++ b/src/share/native/sun/java2d/cmm/lcms/cmstypes.c	Thu Jul 07 10:28:36 2016 +0300
@@ -4305,7 +4305,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);