Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions THIRD_PARTY_README
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,7 @@ THE SOFTWARE.

-------------------------------------------------------------------------------

%% This notice is provided with respect to Little CMS 2.14, which may be
%% This notice is provided with respect to Little CMS 2.15, which may be
included with JRE 8, JDK 8, and OpenJDK 8.

--- begin of LICENSE ---
Expand All @@ -1737,7 +1737,7 @@ LittleCMS core is released under MIT License
---------------------------------

Little CMS
Copyright (c) 1998-2022 Marti Maria Saguer
Copyright (c) 1998-2023 Marti Maria Saguer

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand All @@ -1759,7 +1759,6 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---------------------------------

The below license applies to the following files:
liblcms/cmssm.c

Expand All @@ -1771,9 +1770,9 @@ SoftSurfer makes no warranty for this code, and cannot be held
liable for any real or imagined damage resulting from its use.
Users of this code must verify correctness for their application.


AUTHORS File Information:


Main Author
------------
Marti Maria
Expand Down Expand Up @@ -1814,11 +1813,15 @@ Mark Allen
Noel Carboni
Sergei Trofimovic
Philipp Knechtges
Amyspark
Lovell Fuller
Eli Schwartz

Special Thanks
--------------
Artifex software
AlienSkin software
libVIPS
Jan Morovic
Jos Vernon (WebSupergoo)
Harald Schneider (Maxon)
Expand All @@ -1827,7 +1830,6 @@ Dimitrios Anastassakis
Lemke Software
Tim Zaman


--- end of LICENSE ---

-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion jdk/src/share/native/sun/java2d/cmm/lcms/cmsalpha.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down
4 changes: 2 additions & 2 deletions jdk/src/share/native/sun/java2d/cmm/lcms/cmscam02.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down Expand Up @@ -353,7 +353,7 @@ CAM02COLOR HPEtoCAT02(CAM02COLOR clr)
M[5] = ((-0.7036 * 0.201908) + (1.6975 * 0.000008) + 0.0061);
M[6] = (( 0.0030 * 1.910197) + (0.0136 * 0.370950));
M[7] = (( 0.0030 * -1.112124) + (0.0136 * 0.629054));
M[8] = (( 0.0030 * 0.201908) + (0.0136 * 0.000008) + 0.9834);;
M[8] = (( 0.0030 * 0.201908) + (0.0136 * 0.000008) + 0.9834);

clr.RGBc[0] = (clr.RGBp[0] * M[0]) + (clr.RGBp[1] * M[1]) + (clr.RGBp[2] * M[2]);
clr.RGBc[1] = (clr.RGBp[0] * M[3]) + (clr.RGBp[1] * M[4]) + (clr.RGBp[2] * M[5]);
Expand Down
10 changes: 6 additions & 4 deletions jdk/src/share/native/sun/java2d/cmm/lcms/cmscgats.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down Expand Up @@ -1968,13 +1968,15 @@ cmsBool CMSEXPORT cmsIT8SaveToMem(cmsHANDLE hIT8, void *MemPtr, cmsUInt32Number*
memset(&sd, 0, sizeof(sd));

sd.stream = NULL;
sd.Base = (cmsUInt8Number*) MemPtr;
sd.Base = (cmsUInt8Number*) MemPtr;
sd.Ptr = sd.Base;

sd.Used = 0;

if (sd.Base)
sd.Max = *BytesNeeded; // Write to memory?
if (sd.Base && (*BytesNeeded > 0)) {

sd.Max = (*BytesNeeded) - 1; // Write to memory?
}
else
sd.Max = 0; // Just counting the needed bytes

Expand Down
10 changes: 5 additions & 5 deletions jdk/src/share/native/sun/java2d/cmm/lcms/cmscnvrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down Expand Up @@ -399,11 +399,11 @@ cmsBool ComputeConversion(cmsUInt32Number i,
cmsCIEXYZ WhitePointIn, WhitePointOut;
cmsMAT3 ChromaticAdaptationMatrixIn, ChromaticAdaptationMatrixOut;

_cmsReadMediaWhitePoint(&WhitePointIn, hProfiles[i-1]);
_cmsReadCHAD(&ChromaticAdaptationMatrixIn, hProfiles[i-1]);
if (!_cmsReadMediaWhitePoint(&WhitePointIn, hProfiles[i - 1])) return FALSE;
if (!_cmsReadCHAD(&ChromaticAdaptationMatrixIn, hProfiles[i - 1])) return FALSE;

_cmsReadMediaWhitePoint(&WhitePointOut, hProfiles[i]);
_cmsReadCHAD(&ChromaticAdaptationMatrixOut, hProfiles[i]);
if (!_cmsReadMediaWhitePoint(&WhitePointOut, hProfiles[i])) return FALSE;
if (!_cmsReadCHAD(&ChromaticAdaptationMatrixOut, hProfiles[i])) return FALSE;

if (!ComputeAbsoluteIntent(AdaptationState,
&WhitePointIn, &ChromaticAdaptationMatrixIn,
Expand Down
2 changes: 1 addition & 1 deletion jdk/src/share/native/sun/java2d/cmm/lcms/cmserr.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down
6 changes: 5 additions & 1 deletion jdk/src/share/native/sun/java2d/cmm/lcms/cmsgamma.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down Expand Up @@ -852,6 +852,10 @@ cmsToneCurve* CMSEXPORT cmsBuildTabulatedToneCurveFloat(cmsContext ContextID, cm
{
cmsCurveSegment Seg[3];

// Do some housekeeping
if (nEntries == 0 || values == NULL)
return NULL;

// A segmented tone curve should have function segments in the first and last positions
// Initialize segmented curve part up to 0 to constant value = samples[0]
Seg[0].x0 = MINUS_INF;
Expand Down
2 changes: 1 addition & 1 deletion jdk/src/share/native/sun/java2d/cmm/lcms/cmshalf.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down
2 changes: 1 addition & 1 deletion jdk/src/share/native/sun/java2d/cmm/lcms/cmsintrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down
8 changes: 4 additions & 4 deletions jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down Expand Up @@ -1949,7 +1949,7 @@ cmsUInt32Number CMSEXPORT cmsReadRawTag(cmsHPROFILE hProfile, cmsTagSignature si
if (data != NULL) {

if (BufferSize < TagSize)
goto Error;
TagSize = BufferSize;

if (!Icc ->IOhandler ->Seek(Icc ->IOhandler, Offset)) goto Error;
if (!Icc ->IOhandler ->Read(Icc ->IOhandler, data, 1, TagSize)) goto Error;
Expand All @@ -1962,7 +1962,7 @@ cmsUInt32Number CMSEXPORT cmsReadRawTag(cmsHPROFILE hProfile, cmsTagSignature si
return Icc ->TagSizes[i];
}

// The data has been already read, or written. But wait!, maybe the user chose to save as
// The data has been already read, or written. But wait!, maybe the user choose to save as
// raw data. In this case, return the raw data directly

if (Icc ->TagSaveAsRaw[i]) {
Expand All @@ -1971,7 +1971,7 @@ cmsUInt32Number CMSEXPORT cmsReadRawTag(cmsHPROFILE hProfile, cmsTagSignature si

TagSize = Icc ->TagSizes[i];
if (BufferSize < TagSize)
goto Error;
TagSize = BufferSize;

memmove(data, Icc ->TagPtrs[i], TagSize);

Expand Down
6 changes: 5 additions & 1 deletion jdk/src/share/native/sun/java2d/cmm/lcms/cmsio1.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down Expand Up @@ -880,6 +880,10 @@ cmsBool CMSEXPORT cmsIsCLUT(cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUI
return FALSE;
}

// Extended intents are not strictly CLUT-based
if (Intent > INTENT_ABSOLUTE_COLORIMETRIC)
return FALSE;

return cmsIsTag(hProfile, TagTable[Intent]);

}
Expand Down
2 changes: 1 addition & 1 deletion jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down
2 changes: 1 addition & 1 deletion jdk/src/share/native/sun/java2d/cmm/lcms/cmsmd5.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down
2 changes: 1 addition & 1 deletion jdk/src/share/native/sun/java2d/cmm/lcms/cmsmtrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down
12 changes: 10 additions & 2 deletions jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down Expand Up @@ -399,6 +399,8 @@ const wchar_t* _cmsMLUgetWide(const cmsMLU* mlu,

if (len != NULL) *len = v ->Len;

if (v->StrW + v->Len > mlu->PoolSize) return NULL;

return(wchar_t*) ((cmsUInt8Number*) mlu ->MemPool + v ->StrW);
}

Expand Down Expand Up @@ -790,7 +792,13 @@ cmsStage* CMSEXPORT _cmsStageAllocNamedColor(cmsNAMEDCOLORLIST* NamedColorList,
cmsNAMEDCOLORLIST* CMSEXPORT cmsGetNamedColorList(cmsHTRANSFORM xform)
{
_cmsTRANSFORM* v = (_cmsTRANSFORM*) xform;
cmsStage* mpe = v ->Lut->Elements;
cmsStage* mpe;

if (v == NULL) return NULL;
if (v->Lut == NULL) return NULL;

mpe = v->Lut->Elements;
if (mpe == NULL) return NULL;

if (mpe ->Type != cmsSigNamedColorElemType) return NULL;
return (cmsNAMEDCOLORLIST*) mpe ->Data;
Expand Down
6 changes: 5 additions & 1 deletion jdk/src/share/native/sun/java2d/cmm/lcms/cmsopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down Expand Up @@ -1724,6 +1724,10 @@ cmsBool OptimizeMatrixShaper(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt3
_cmsStageMatrixData* Data1 = (_cmsStageMatrixData*)cmsStageData(Matrix1);
_cmsStageMatrixData* Data2 = (_cmsStageMatrixData*)cmsStageData(Matrix2);

// Only RGB to RGB
if (Matrix1->InputChannels != 3 || Matrix1->OutputChannels != 3 ||
Matrix2->InputChannels != 3 || Matrix2->OutputChannels != 3) return FALSE;

// Input offset should be zero
if (Data1->Offset != NULL) return FALSE;

Expand Down
10 changes: 5 additions & 5 deletions jdk/src/share/native/sun/java2d/cmm/lcms/cmspack.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down Expand Up @@ -1736,7 +1736,7 @@ cmsUInt8Number* PackChunkyBytes(CMSREGISTER _cmsTRANSFORM* info,
if (Reverse)
v = REVERSE_FLAVOR_16(v);

if (Premul && alpha_factor != 0)
if (Premul)
{
v = (cmsUInt16Number)((cmsUInt32Number)((cmsUInt32Number)v * alpha_factor + 0x8000) >> 16);
}
Expand Down Expand Up @@ -1805,7 +1805,7 @@ cmsUInt8Number* PackChunkyWords(CMSREGISTER _cmsTRANSFORM* info,
if (Reverse)
v = REVERSE_FLAVOR_16(v);

if (Premul && alpha_factor != 0)
if (Premul)
{
v = (cmsUInt16Number)((cmsUInt32Number)((cmsUInt32Number)v * alpha_factor + 0x8000) >> 16);
}
Expand Down Expand Up @@ -1872,7 +1872,7 @@ cmsUInt8Number* PackPlanarBytes(CMSREGISTER _cmsTRANSFORM* info,
if (Reverse)
v = REVERSE_FLAVOR_16(v);

if (Premul && alpha_factor != 0)
if (Premul)
{
v = (cmsUInt16Number)((cmsUInt32Number)((cmsUInt32Number)v * alpha_factor + 0x8000) >> 16);
}
Expand Down Expand Up @@ -1932,7 +1932,7 @@ cmsUInt8Number* PackPlanarWords(CMSREGISTER _cmsTRANSFORM* info,
if (Reverse)
v = REVERSE_FLAVOR_16(v);

if (Premul && alpha_factor != 0)
if (Premul)
{
v = (cmsUInt16Number)((cmsUInt32Number)((cmsUInt32Number)v * alpha_factor + 0x8000) >> 16);
}
Expand Down
2 changes: 1 addition & 1 deletion jdk/src/share/native/sun/java2d/cmm/lcms/cmspcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
// Copyright (c) 1998-2022 Marti Maria Saguer
// Copyright (c) 1998-2023 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"),
Expand Down
Loading