Bug 389867 - "Array indexing error in ReadCurve (mozilla/modules/lcms/src/cmsio1.c)" [p=ehsan.akhgari@gmail.com (Ehsan Akhgari) r+sr=stuart a1.9=schrep]
authorreed@reedloden.com
Wed, 16 Jan 2008 22:53:33 -0800
changeset 10351 d7a600e2cbc0a6256a44456a9c915c3718b622b8
parent 10350 e75eae5157bf7f737103bfe2b034842da0cb763f
child 10352 375caab1b48f0b92e3b8de683147f20f7b48b6ca
push idunknown
push userunknown
push dateunknown
bugs389867
milestone1.9b3pre
Bug 389867 - "Array indexing error in ReadCurve (mozilla/modules/lcms/src/cmsio1.c)" [p=ehsan.akhgari@gmail.com (Ehsan Akhgari) r+sr=stuart a1.9=schrep]
modules/lcms/src/cmsio1.c
--- a/modules/lcms/src/cmsio1.c
+++ b/modules/lcms/src/cmsio1.c
@@ -919,17 +919,17 @@ LPGAMMATABLE ReadCurve(LPLCMSICCPROFILE 
            icUInt32Number Reserved;
            icUInt16Number   Type;
            int i;
            
            if (Icc -> Read(&Type, sizeof(icUInt16Number), 1, Icc) != 1) return NULL;
            if (Icc -> Read(&Reserved, sizeof(icUInt16Number), 1, Icc) != 1) return NULL;
            
            AdjustEndianess16((LPBYTE) &Type);
-           if (Type > 5) {
+           if (Type > 4) {
 
                 cmsSignalError(LCMS_ERRC_ABORTED, "Unknown parametric curve type '%d' found.", Type);
                 return NULL;
            }
         
           ZeroMemory(Params, 10* sizeof(double));
           n = ParamsByType[Type];
 
@@ -1028,17 +1028,17 @@ LPGAMMATABLE ReadCurveReversed(LPLCMSICC
            icUInt16Number   Type;
            int i;
 
 
            if (Icc -> Read(&Type, sizeof(icUInt16Number), 1, Icc) != 1) return NULL;
            if (Icc -> Read(&Reserved, sizeof(icUInt16Number), 1, Icc) != 1) return NULL;
            
            AdjustEndianess16((LPBYTE) &Type);
-           if (Type > 5) {
+           if (Type > 4) {
 
                 cmsSignalError(LCMS_ERRC_ABORTED, "Unknown parametric curve type '%d' found.", Type);
                 return NULL;
            }
         
           ZeroMemory(Params, 10* sizeof(double));
           n = ParamsByType[Type];