diff options
author | Marti Maria <info@littlecms.com> | 2010-04-30 17:54:47 +0200 |
---|---|---|
committer | Marti Maria <info@littlecms.com> | 2010-04-30 17:54:47 +0200 |
commit | d72daf9f381d8801e0faba01c68bb7fb081c4f80 (patch) | |
tree | 71adfd5d196dda89d8d24e059500dce2dcc8c2d1 /src/cmsxform.c | |
parent | 640b20b71f529b11f562323b22f3e120b5d5c30f (diff) | |
download | lcms2-d72daf9f381d8801e0faba01c68bb7fb081c4f80.tar.gz |
FC fixes
Diffstat (limited to 'src/cmsxform.c')
-rw-r--r-- | src/cmsxform.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/cmsxform.c b/src/cmsxform.c index f9f3ff4..0ca151c 100644 --- a/src/cmsxform.c +++ b/src/cmsxform.c @@ -427,12 +427,14 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cmsUInt32Number InputFo } static -void GetXFormColorSpaces(int nProfiles, cmsHPROFILE hProfiles[], cmsColorSpaceSignature* Input, cmsColorSpaceSignature* Output) +cmsBool GetXFormColorSpaces(int nProfiles, cmsHPROFILE hProfiles[], cmsColorSpaceSignature* Input, cmsColorSpaceSignature* Output) { cmsColorSpaceSignature ColorSpaceIn, ColorSpaceOut; cmsColorSpaceSignature PostColorSpace; int i; + if (hProfiles[0] == NULL) return FALSE; + *Input = PostColorSpace = cmsGetColorSpace(hProfiles[0]); for (i=0; i < nProfiles; i++) { @@ -442,6 +444,8 @@ void GetXFormColorSpaces(int nProfiles, cmsHPROFILE hProfiles[], cmsColorSpaceSi int lIsInput = (PostColorSpace != cmsSigXYZData) && (PostColorSpace != cmsSigLabData); + if (hProfile == NULL) return FALSE; + if (lIsInput) { ColorSpaceIn = cmsGetColorSpace(hProfile); @@ -457,6 +461,8 @@ void GetXFormColorSpaces(int nProfiles, cmsHPROFILE hProfiles[], cmsColorSpaceSi } *Output = PostColorSpace; + + return TRUE; } // Check colorspace @@ -508,7 +514,10 @@ cmsHTRANSFORM CMSEXPORT cmsCreateExtendedTransform(cmsContext ContextID, dwFlags |= cmsFLAGS_NOCACHE; // Mark entry/exit spaces - GetXFormColorSpaces(nProfiles, hProfiles, &EntryColorSpace, &ExitColorSpace); + if (!GetXFormColorSpaces(nProfiles, hProfiles, &EntryColorSpace, &ExitColorSpace)) { + cmsSignalError(ContextID, cmsERROR_NULL, "NULL input profiles on transform"); + return NULL; + } // Check if proper colorspaces if (!IsProperColorSpace(EntryColorSpace, InputFormat)) { |