Skip to content

Commit ee13589

Browse files
author
Ekaterina Vergizova
committed
Backport e28b210d5020fc7cc3a52c58f0a8ce14e16dd5fb
1 parent 9a4bc2d commit ee13589

29 files changed

+101
-64
lines changed

THIRD_PARTY_README

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,7 +1725,7 @@ THE SOFTWARE.
17251725

17261726
-------------------------------------------------------------------------------
17271727

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

17311731
--- begin of LICENSE ---
@@ -1737,7 +1737,7 @@ LittleCMS core is released under MIT License
17371737
---------------------------------
17381738

17391739
Little CMS
1740-
Copyright (c) 1998-2022 Marti Maria Saguer
1740+
Copyright (c) 1998-2023 Marti Maria Saguer
17411741

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

17611761
---------------------------------
1762-
17631762
The below license applies to the following files:
17641763
liblcms/cmssm.c
17651764

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

1774-
17751773
AUTHORS File Information:
17761774

1775+
17771776
Main Author
17781777
------------
17791778
Marti Maria
@@ -1814,11 +1813,15 @@ Mark Allen
18141813
Noel Carboni
18151814
Sergei Trofimovic
18161815
Philipp Knechtges
1816+
Amyspark
1817+
Lovell Fuller
1818+
Eli Schwartz
18171819

18181820
Special Thanks
18191821
--------------
18201822
Artifex software
18211823
AlienSkin software
1824+
libVIPS
18221825
Jan Morovic
18231826
Jos Vernon (WebSupergoo)
18241827
Harald Schneider (Maxon)
@@ -1827,7 +1830,6 @@ Dimitrios Anastassakis
18271830
Lemke Software
18281831
Tim Zaman
18291832

1830-
18311833
--- end of LICENSE ---
18321834

18331835
-------------------------------------------------------------------------------

jdk/src/share/native/sun/java2d/cmm/lcms/cmsalpha.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//---------------------------------------------------------------------------------
3131
//
3232
// Little Color Management System
33-
// Copyright (c) 1998-2022 Marti Maria Saguer
33+
// Copyright (c) 1998-2023 Marti Maria Saguer
3434
//
3535
// Permission is hereby granted, free of charge, to any person obtaining
3636
// a copy of this software and associated documentation files (the "Software"),

jdk/src/share/native/sun/java2d/cmm/lcms/cmscam02.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//---------------------------------------------------------------------------------
3131
//
3232
// Little Color Management System
33-
// Copyright (c) 1998-2022 Marti Maria Saguer
33+
// Copyright (c) 1998-2023 Marti Maria Saguer
3434
//
3535
// Permission is hereby granted, free of charge, to any person obtaining
3636
// a copy of this software and associated documentation files (the "Software"),
@@ -353,7 +353,7 @@ CAM02COLOR HPEtoCAT02(CAM02COLOR clr)
353353
M[5] = ((-0.7036 * 0.201908) + (1.6975 * 0.000008) + 0.0061);
354354
M[6] = (( 0.0030 * 1.910197) + (0.0136 * 0.370950));
355355
M[7] = (( 0.0030 * -1.112124) + (0.0136 * 0.629054));
356-
M[8] = (( 0.0030 * 0.201908) + (0.0136 * 0.000008) + 0.9834);;
356+
M[8] = (( 0.0030 * 0.201908) + (0.0136 * 0.000008) + 0.9834);
357357

358358
clr.RGBc[0] = (clr.RGBp[0] * M[0]) + (clr.RGBp[1] * M[1]) + (clr.RGBp[2] * M[2]);
359359
clr.RGBc[1] = (clr.RGBp[0] * M[3]) + (clr.RGBp[1] * M[4]) + (clr.RGBp[2] * M[5]);

jdk/src/share/native/sun/java2d/cmm/lcms/cmscgats.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//---------------------------------------------------------------------------------
3131
//
3232
// Little Color Management System
33-
// Copyright (c) 1998-2022 Marti Maria Saguer
33+
// Copyright (c) 1998-2023 Marti Maria Saguer
3434
//
3535
// Permission is hereby granted, free of charge, to any person obtaining
3636
// a copy of this software and associated documentation files (the "Software"),
@@ -1968,13 +1968,15 @@ cmsBool CMSEXPORT cmsIT8SaveToMem(cmsHANDLE hIT8, void *MemPtr, cmsUInt32Number*
19681968
memset(&sd, 0, sizeof(sd));
19691969

19701970
sd.stream = NULL;
1971-
sd.Base = (cmsUInt8Number*) MemPtr;
1971+
sd.Base = (cmsUInt8Number*) MemPtr;
19721972
sd.Ptr = sd.Base;
19731973

19741974
sd.Used = 0;
19751975

1976-
if (sd.Base)
1977-
sd.Max = *BytesNeeded; // Write to memory?
1976+
if (sd.Base && (*BytesNeeded > 0)) {
1977+
1978+
sd.Max = (*BytesNeeded) - 1; // Write to memory?
1979+
}
19781980
else
19791981
sd.Max = 0; // Just counting the needed bytes
19801982

jdk/src/share/native/sun/java2d/cmm/lcms/cmscnvrt.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//---------------------------------------------------------------------------------
3131
//
3232
// Little Color Management System
33-
// Copyright (c) 1998-2022 Marti Maria Saguer
33+
// Copyright (c) 1998-2023 Marti Maria Saguer
3434
//
3535
// Permission is hereby granted, free of charge, to any person obtaining
3636
// a copy of this software and associated documentation files (the "Software"),
@@ -399,11 +399,11 @@ cmsBool ComputeConversion(cmsUInt32Number i,
399399
cmsCIEXYZ WhitePointIn, WhitePointOut;
400400
cmsMAT3 ChromaticAdaptationMatrixIn, ChromaticAdaptationMatrixOut;
401401

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

405-
_cmsReadMediaWhitePoint(&WhitePointOut, hProfiles[i]);
406-
_cmsReadCHAD(&ChromaticAdaptationMatrixOut, hProfiles[i]);
405+
if (!_cmsReadMediaWhitePoint(&WhitePointOut, hProfiles[i])) return FALSE;
406+
if (!_cmsReadCHAD(&ChromaticAdaptationMatrixOut, hProfiles[i])) return FALSE;
407407

408408
if (!ComputeAbsoluteIntent(AdaptationState,
409409
&WhitePointIn, &ChromaticAdaptationMatrixIn,

jdk/src/share/native/sun/java2d/cmm/lcms/cmserr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//---------------------------------------------------------------------------------
3131
//
3232
// Little Color Management System
33-
// Copyright (c) 1998-2022 Marti Maria Saguer
33+
// Copyright (c) 1998-2023 Marti Maria Saguer
3434
//
3535
// Permission is hereby granted, free of charge, to any person obtaining
3636
// a copy of this software and associated documentation files (the "Software"),

jdk/src/share/native/sun/java2d/cmm/lcms/cmsgamma.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//---------------------------------------------------------------------------------
3131
//
3232
// Little Color Management System
33-
// Copyright (c) 1998-2022 Marti Maria Saguer
33+
// Copyright (c) 1998-2023 Marti Maria Saguer
3434
//
3535
// Permission is hereby granted, free of charge, to any person obtaining
3636
// a copy of this software and associated documentation files (the "Software"),
@@ -852,6 +852,10 @@ cmsToneCurve* CMSEXPORT cmsBuildTabulatedToneCurveFloat(cmsContext ContextID, cm
852852
{
853853
cmsCurveSegment Seg[3];
854854

855+
// Do some housekeeping
856+
if (nEntries == 0 || values == NULL)
857+
return NULL;
858+
855859
// A segmented tone curve should have function segments in the first and last positions
856860
// Initialize segmented curve part up to 0 to constant value = samples[0]
857861
Seg[0].x0 = MINUS_INF;

jdk/src/share/native/sun/java2d/cmm/lcms/cmshalf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//---------------------------------------------------------------------------------
3131
//
3232
// Little Color Management System
33-
// Copyright (c) 1998-2022 Marti Maria Saguer
33+
// Copyright (c) 1998-2023 Marti Maria Saguer
3434
//
3535
// Permission is hereby granted, free of charge, to any person obtaining
3636
// a copy of this software and associated documentation files (the "Software"),

jdk/src/share/native/sun/java2d/cmm/lcms/cmsintrp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//---------------------------------------------------------------------------------
3131
//
3232
// Little Color Management System
33-
// Copyright (c) 1998-2022 Marti Maria Saguer
33+
// Copyright (c) 1998-2023 Marti Maria Saguer
3434
//
3535
// Permission is hereby granted, free of charge, to any person obtaining
3636
// a copy of this software and associated documentation files (the "Software"),

jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//---------------------------------------------------------------------------------
3131
//
3232
// Little Color Management System
33-
// Copyright (c) 1998-2022 Marti Maria Saguer
33+
// Copyright (c) 1998-2023 Marti Maria Saguer
3434
//
3535
// Permission is hereby granted, free of charge, to any person obtaining
3636
// a copy of this software and associated documentation files (the "Software"),
@@ -1949,7 +1949,7 @@ cmsUInt32Number CMSEXPORT cmsReadRawTag(cmsHPROFILE hProfile, cmsTagSignature si
19491949
if (data != NULL) {
19501950

19511951
if (BufferSize < TagSize)
1952-
goto Error;
1952+
TagSize = BufferSize;
19531953

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

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

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

19721972
TagSize = Icc ->TagSizes[i];
19731973
if (BufferSize < TagSize)
1974-
goto Error;
1974+
TagSize = BufferSize;
19751975

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

0 commit comments

Comments
 (0)