diff --git a/include/lcms2.h b/include/lcms2.h index 12c5f89e..ee61ba71 100644 --- a/include/lcms2.h +++ b/include/lcms2.h @@ -23,7 +23,7 @@ // //--------------------------------------------------------------------------------- // -// Version 2.16 +// Version 2.17alpha0 // #ifndef _lcms2_H @@ -84,7 +84,7 @@ extern "C" { #endif // Version/release -#define LCMS_VERSION 2160 +#define LCMS_VERSION 2170 // I will give the chance of redefining basic types for compilers that are not fully C99 compliant #ifndef CMS_BASIC_TYPES_ALREADY_DEFINED @@ -248,7 +248,7 @@ typedef int cmsBool; # define CMSAPI # endif #else // not Windows -# ifdef HAVE_FUNC_ATTRIBUTE_VISIBILITY +# if defined(HAVE_FUNC_ATTRIBUTE_VISIBILITY) && !defined(CMS_NO_VISIBILITY) # define CMSEXPORT # define CMSAPI __attribute__((visibility("default"))) # else diff --git a/src/cmsxform.c b/src/cmsxform.c index 45445553..99e9bb96 100644 --- a/src/cmsxform.c +++ b/src/cmsxform.c @@ -1131,7 +1131,15 @@ cmsHTRANSFORM CMSEXPORT cmsCreateExtendedTransform(cmsContext ContextID, cmsColorSpaceSignature EntryColorSpace; cmsColorSpaceSignature ExitColorSpace; cmsPipeline* Lut; - cmsUInt32Number LastIntent = Intents[nProfiles-1]; + cmsUInt32Number LastIntent; + + // Safeguard + if (nProfiles <= 0 || nProfiles > 255) { + cmsSignalError(ContextID, cmsERROR_RANGE, "Wrong number of profiles. 1..255 expected, %d found.", nProfiles); + return NULL; + } + + LastIntent = Intents[nProfiles - 1]; // If it is a fake transform if (dwFlags & cmsFLAGS_NULLTRANSFORM)