diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2011-02-18 01:22:22 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2011-02-18 01:22:22 +0300 |
commit | 2638adf0ce49aec818a80db333bbb954946d4a86 (patch) | |
tree | c300a0685443d9a71e7ced864841d26672bdef13 /src/thirdparty/lcms2 | |
parent | 2139ba02545766695b2e4e9067e1cb60aa3bd246 (diff) |
update lcms to the latest git
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@2938 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/thirdparty/lcms2')
-rw-r--r-- | src/thirdparty/lcms2/ChangeLog | 5 | ||||
-rw-r--r-- | src/thirdparty/lcms2/src/cmsio0.c | 11 | ||||
-rw-r--r-- | src/thirdparty/lcms2/src/cmsio1.c | 6 | ||||
-rw-r--r-- | src/thirdparty/lcms2/src/cmslut.c | 9 | ||||
-rw-r--r-- | src/thirdparty/lcms2/src/cmsps2.c | 7 | ||||
-rw-r--r-- | src/thirdparty/lcms2/src/cmssm.c | 4 |
6 files changed, 31 insertions, 11 deletions
diff --git a/src/thirdparty/lcms2/ChangeLog b/src/thirdparty/lcms2/ChangeLog index 87fd963fc..6c02d4e01 100644 --- a/src/thirdparty/lcms2/ChangeLog +++ b/src/thirdparty/lcms2/ChangeLog @@ -28,4 +28,7 @@ Added bound check in floating point interpolation -----------------------
Fixed severa bugs in absolute colorimetric intent
-Removed pthreads need
\ No newline at end of file +Removed pthreads need
+Updated linkicc to 2.1, cleanup
+Fixed some potential issues as NULL dereferencing
+Fixed GBD bug (out of bounds memory overwrite)
diff --git a/src/thirdparty/lcms2/src/cmsio0.c b/src/thirdparty/lcms2/src/cmsio0.c index c109eb8ce..aebb87ee6 100644 --- a/src/thirdparty/lcms2/src/cmsio0.c +++ b/src/thirdparty/lcms2/src/cmsio0.c @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2010 Marti Maria Saguer
+// Copyright (c) 1998-2011 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -1649,11 +1649,18 @@ cmsInt32Number CMSEXPORT cmsReadRawTag(cmsHPROFILE hProfile, cmsTagSignature sig // Obtain type handling for the tag
TypeHandler = Icc ->TagTypeHandlers[i];
TagDescriptor = _cmsGetTagDescriptor(sig);
+ if (TagDescriptor == NULL) {
+ cmsCloseIOhandler(MemIO);
+ return 0;
+ }
// Serialize
TypeHandler ->ContextID = Icc ->ContextID;
TypeHandler ->ICCVersion = Icc ->Version;
- if (!TypeHandler ->WritePtr(TypeHandler, MemIO, Object, TagDescriptor ->ElemCount)) return 0;
+ if (!TypeHandler ->WritePtr(TypeHandler, MemIO, Object, TagDescriptor ->ElemCount)) {
+ cmsCloseIOhandler(MemIO);
+ return 0;
+ }
// Get Size and close
rc = MemIO ->Tell(MemIO);
diff --git a/src/thirdparty/lcms2/src/cmsio1.c b/src/thirdparty/lcms2/src/cmsio1.c index 1cb98e09f..a57ffb080 100644 --- a/src/thirdparty/lcms2/src/cmsio1.c +++ b/src/thirdparty/lcms2/src/cmsio1.c @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2010 Marti Maria Saguer
+// Copyright (c) 1998-2011 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -611,7 +611,6 @@ cmsBool CMSEXPORT cmsIsIntentSupported(cmsHPROFILE hProfile, // Read both, profile sequence description and profile sequence id if present. Then combine both to
// create qa unique structure holding both. Shame on ICC to store things in such complicated way.
-
cmsSEQ* _cmsReadProfileSequence(cmsHPROFILE hProfile)
{
cmsSEQ* ProfileSeq;
@@ -636,12 +635,13 @@ cmsSEQ* _cmsReadProfileSequence(cmsHPROFILE hProfile) NewSeq = cmsDupProfileSequenceDescription(ProfileSeq);
// Ok, proceed to the mixing
+ if (NewSeq != NULL) {
for (i=0; i < ProfileSeq ->n; i++) {
memmove(&NewSeq ->seq[i].ProfileID, &ProfileId ->seq[i].ProfileID, sizeof(cmsProfileID));
NewSeq ->seq[i].Description = cmsMLUdup(ProfileId ->seq[i].Description);
}
-
+ }
return NewSeq;
}
diff --git a/src/thirdparty/lcms2/src/cmslut.c b/src/thirdparty/lcms2/src/cmslut.c index 2dc395041..7cd354650 100644 --- a/src/thirdparty/lcms2/src/cmslut.c +++ b/src/thirdparty/lcms2/src/cmslut.c @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2010 Marti Maria Saguer
+// Copyright (c) 1998-2011 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -732,8 +732,13 @@ cmsBool CMSEXPORT cmsStageSampleCLut16bit(cmsStage* mpe, cmsSAMPLER16 Sampler, v int nInputs, nOutputs;
cmsUInt32Number* nSamples;
cmsUInt16Number In[cmsMAXCHANNELS], Out[MAX_STAGE_CHANNELS];
- _cmsStageCLutData* clut = (_cmsStageCLutData*) mpe->Data;
+ _cmsStageCLutData* clut;
+
+ if (mpe == NULL) return FALSE;
+
+ clut = (_cmsStageCLutData*) mpe->Data;
+ if (clut == NULL) return FALSE;
nSamples = clut->Params ->nSamples;
nInputs = clut->Params ->nInputs;
diff --git a/src/thirdparty/lcms2/src/cmsps2.c b/src/thirdparty/lcms2/src/cmsps2.c index 54457dad6..340632bd2 100644 --- a/src/thirdparty/lcms2/src/cmsps2.c +++ b/src/thirdparty/lcms2/src/cmsps2.c @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2008 Marti Maria Saguer
+// Copyright (c) 1998-2011 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -469,6 +469,7 @@ void Emit1Gamma(cmsIOHANDLER* m, cmsToneCurve* Table) cmsUInt32Number i;
cmsFloat64Number gamma;
+ if (Table == NULL) return; // Error
if (Table ->nEntries <= 0) return; // Empty table
@@ -548,6 +549,8 @@ void EmitNGamma(cmsIOHANDLER* m, int n, cmsToneCurve* g[]) for( i=0; i < n; i++ )
{
+ if (g[i] == NULL) return; // Error
+
if (i > 0 && GammaTableEquals(g[i-1]->Table16, g[i]->Table16, g[i]->nEntries)) {
_cmsIOPrintf(m, "dup ");
@@ -836,6 +839,7 @@ cmsToneCurve* ExtractGray2Y(cmsContext ContextID, cmsHPROFILE hProfile, int Inte cmsHTRANSFORM xform = cmsCreateTransformTHR(ContextID, hProfile, TYPE_GRAY_8, hXYZ, TYPE_XYZ_DBL, Intent, cmsFLAGS_NOOPTIMIZE);
int i;
+ if (Out != NULL) {
for (i=0; i < 256; i++) {
cmsUInt8Number Gray = (cmsUInt8Number) i;
@@ -845,6 +849,7 @@ cmsToneCurve* ExtractGray2Y(cmsContext ContextID, cmsHPROFILE hProfile, int Inte Out ->Table16[i] =_cmsQuickSaturateWord(XYZ.Y * 65535.0);
}
+ }
cmsDeleteTransform(xform);
cmsCloseProfile(hXYZ);
diff --git a/src/thirdparty/lcms2/src/cmssm.c b/src/thirdparty/lcms2/src/cmssm.c index 8781d3fc5..4c05a167e 100644 --- a/src/thirdparty/lcms2/src/cmssm.c +++ b/src/thirdparty/lcms2/src/cmssm.c @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2010 Marti Maria Saguer
+// Copyright (c) 1998-2011 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -476,7 +476,7 @@ cmsBool InterpolateMissingSector(cmsGDB* gbd, int alpha, int theta) cmsVEC3 Centre;
cmsLine ray;
int nCloseSectors;
- cmsGDBPoint* Close[NSTEPS];
+ cmsGDBPoint* Close[NSTEPS + 1];
cmsSpherical closel, templ;
cmsLine edge;
int k, m;
|