comparison src/share/native/sun/java2d/cmm/lcms/cmsopt.c @ 6295:2c71b4f2104b

8007929: Improve CurvesAlloc Reviewed-by: bae, prr Contributed-by: jia-hong.chen@oracle.com
author bae
date Thu, 21 Mar 2013 12:02:04 +0400
parents 6e0721fb94e1
children 7fa6d3ba2cc7
comparison
equal deleted inserted replaced
1:80ffa586073f 2:c14b2fe7b48f
1199 if (c16 ->Curves == NULL) return NULL; 1199 if (c16 ->Curves == NULL) return NULL;
1200 1200
1201 for (i=0; i < nCurves; i++) { 1201 for (i=0; i < nCurves; i++) {
1202 1202
1203 c16->Curves[i] = _cmsCalloc(ContextID, nElements, sizeof(cmsUInt16Number)); 1203 c16->Curves[i] = _cmsCalloc(ContextID, nElements, sizeof(cmsUInt16Number));
1204 if (c16->Curves[i] == NULL) {
1205 for (j=0; j < i; j++) {
1206 _cmsFree(ContextID, c16->Curves[j]);
1207 }
1208 _cmsFree(ContextID, c16->Curves);
1209 _cmsFree(ContextID, c16);
1210
1211 return NULL;
1212 }
1204 1213
1205 if (nElements == 256) { 1214 if (nElements == 256) {
1206 1215
1207 for (j=0; j < nElements; j++) { 1216 for (j=0; j < nElements; j++) {
1208 1217