Package init

This commit is contained in:
overweight 2019-09-30 10:54:36 -04:00
commit 26944f8d5c
4 changed files with 407 additions and 0 deletions

View File

@ -0,0 +1,172 @@
From 768f70ca405cd3159d990e962d54456773bb8cf8 Mon Sep 17 00:00:00 2001
From: Marti Maria <info@littlecms.com>
Date: Wed, 15 Aug 2018 20:07:56 +0200
Subject: [PATCH 17/18] Upgrade Visual studio 2017 15.8
- Upgrade to 15.8
- Add check on CGATS memory allocation (thanks to Quang Nguyen for
pointing out this)
---
Projects/VC2017/jpegicc/jpegicc.vcxproj | 1 +
Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj | 2 +-
Projects/VC2017/lcms2_static/lcms2_static.vcxproj | 2 +-
Projects/VC2017/linkicc/linkicc.vcxproj | 2 +-
Projects/VC2017/psicc/psicc.vcxproj | 2 +-
Projects/VC2017/testbed/testbed.vcxproj | 2 +-
Projects/VC2017/tiffdiff/tiffdiff.vcxproj | 2 +-
Projects/VC2017/tifficc/tifficc.vcxproj | 2 +-
Projects/VC2017/transicc/transicc.vcxproj | 1 +
src/cmscgats.c | 14 ++++++++++----
10 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/Projects/VC2017/jpegicc/jpegicc.vcxproj b/Projects/VC2017/jpegicc/jpegicc.vcxproj
index ab26a53..39cfd00 100644
--- a/Projects/VC2017/jpegicc/jpegicc.vcxproj
+++ b/Projects/VC2017/jpegicc/jpegicc.vcxproj
@@ -22,6 +22,7 @@
<ProjectGuid>{62812507-F926-4968-96A9-17678460AD90}</ProjectGuid>
<RootNamespace>jpegicc</RootNamespace>
<Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
diff --git a/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj b/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
index 4c8aa3f..d1bf3eb 100644
--- a/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
+++ b/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
@@ -22,7 +22,7 @@
<ProjectGuid>{8C51BE48-ADB8-4089-A9EC-F6BF993A0548}</ProjectGuid>
<RootNamespace>lcms2_DLL</RootNamespace>
<Keyword>Win32Proj</Keyword>
- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
diff --git a/Projects/VC2017/lcms2_static/lcms2_static.vcxproj b/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
index 2a9988a..9fc05ce 100644
--- a/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
+++ b/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
@@ -22,7 +22,7 @@
<ProjectGuid>{71DEDE59-3F1E-486B-A899-4283000F76B5}</ProjectGuid>
<RootNamespace>lcms2_static</RootNamespace>
<Keyword>Win32Proj</Keyword>
- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
diff --git a/Projects/VC2017/linkicc/linkicc.vcxproj b/Projects/VC2017/linkicc/linkicc.vcxproj
index 30c2b4e..51586dd 100644
--- a/Projects/VC2017/linkicc/linkicc.vcxproj
+++ b/Projects/VC2017/linkicc/linkicc.vcxproj
@@ -22,7 +22,7 @@
<ProjectGuid>{FBFBE1DC-DB84-4BA1-9552-B4780F457849}</ProjectGuid>
<RootNamespace>linkicc</RootNamespace>
<Keyword>Win32Proj</Keyword>
- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
diff --git a/Projects/VC2017/psicc/psicc.vcxproj b/Projects/VC2017/psicc/psicc.vcxproj
index 9dcf89a..8f26e12 100644
--- a/Projects/VC2017/psicc/psicc.vcxproj
+++ b/Projects/VC2017/psicc/psicc.vcxproj
@@ -22,7 +22,7 @@
<ProjectGuid>{EF6A8851-65FE-46F5-B9EF-14F0B671F693}</ProjectGuid>
<RootNamespace>psicc</RootNamespace>
<Keyword>Win32Proj</Keyword>
- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
diff --git a/Projects/VC2017/testbed/testbed.vcxproj b/Projects/VC2017/testbed/testbed.vcxproj
index 0af3762..3f6aea3 100644
--- a/Projects/VC2017/testbed/testbed.vcxproj
+++ b/Projects/VC2017/testbed/testbed.vcxproj
@@ -22,7 +22,7 @@
<ProjectGuid>{928A3A2B-46EF-4279-959C-513B3652FF0E}</ProjectGuid>
<RootNamespace>testbed</RootNamespace>
<Keyword>Win32Proj</Keyword>
- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
diff --git a/Projects/VC2017/tiffdiff/tiffdiff.vcxproj b/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
index 7edfe28..3a6d837 100644
--- a/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
+++ b/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
@@ -22,7 +22,7 @@
<ProjectGuid>{75B91835-CCD7-48BE-A606-A9C997D5DBEE}</ProjectGuid>
<RootNamespace>tiffdiff</RootNamespace>
<Keyword>Win32Proj</Keyword>
- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
diff --git a/Projects/VC2017/tifficc/tifficc.vcxproj b/Projects/VC2017/tifficc/tifficc.vcxproj
index cd9f04c..5ef954f 100644
--- a/Projects/VC2017/tifficc/tifficc.vcxproj
+++ b/Projects/VC2017/tifficc/tifficc.vcxproj
@@ -22,7 +22,7 @@
<ProjectGuid>{2256DE16-ED92-4A6F-9C54-F65BB61E64A2}</ProjectGuid>
<RootNamespace>tifficc</RootNamespace>
<Keyword>Win32Proj</Keyword>
- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
diff --git a/Projects/VC2017/transicc/transicc.vcxproj b/Projects/VC2017/transicc/transicc.vcxproj
index d9b77c6..b3173d8 100644
--- a/Projects/VC2017/transicc/transicc.vcxproj
+++ b/Projects/VC2017/transicc/transicc.vcxproj
@@ -22,6 +22,7 @@
<ProjectGuid>{9EE22D66-C849-474C-9ED5-C3E141DAB160}</ProjectGuid>
<RootNamespace>transicc</RootNamespace>
<Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
diff --git a/src/cmscgats.c b/src/cmscgats.c
index 1a87613..8c3e96d 100644
--- a/src/cmscgats.c
+++ b/src/cmscgats.c
@@ -1,7 +1,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2017 Marti Maria Saguer
+// Copyright (c) 1998-2018 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"),
@@ -1506,10 +1506,16 @@ void AllocateDataSet(cmsIT8* it8)
t-> nSamples = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_FIELDS"));
t-> nPatches = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_SETS"));
- t-> Data = (char**)AllocChunk (it8, ((cmsUInt32Number) t->nSamples + 1) * ((cmsUInt32Number) t->nPatches + 1) *sizeof (char*));
- if (t->Data == NULL) {
+ if (t -> nSamples < 0 || t->nSamples > 0x7ffe || t->nPatches < 0 || t->nPatches > 0x7ffe)
+ {
+ SynError(it8, "AllocateDataSet: too much data");
+ }
+ else {
+ t->Data = (char**)AllocChunk(it8, ((cmsUInt32Number)t->nSamples + 1) * ((cmsUInt32Number)t->nPatches + 1) * sizeof(char*));
+ if (t->Data == NULL) {
- SynError(it8, "AllocateDataSet: Unable to allocate data array");
+ SynError(it8, "AllocateDataSet: Unable to allocate data array");
+ }
}
}
--
2.17.1

View File

@ -0,0 +1,147 @@
From 9632a058a0c617a6461a1c32bc437fef87b3de9c Mon Sep 17 00:00:00 2001
From: Marti Maria <info@littlecms.com>
Date: Sun, 12 May 2019 20:24:37 +0200
Subject: [PATCH] fix array bounds on writing matrices
fixed a out-of-bounds error on certain conditions
---
src/cmstypes.c | 84 ++++++++++++++++++++++++--------------------------
1 file changed, 40 insertions(+), 44 deletions(-)
diff --git a/src/cmstypes.c b/src/cmstypes.c
index 521bef0..74c7aed 100644
--- a/src/cmstypes.c
+++ b/src/cmstypes.c
@@ -1853,7 +1853,7 @@ void *Type_LUT8_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cms
static
cmsBool Type_LUT8_Write(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, void* Ptr, cmsUInt32Number nItems)
{
- cmsUInt32Number j, nTabSize;
+ cmsUInt32Number j, nTabSize, i, n;
cmsUInt8Number val;
cmsPipeline* NewLUT = (cmsPipeline*) Ptr;
cmsStage* mpe;
@@ -1902,22 +1902,19 @@ cmsBool Type_LUT8_Write(struct _cms_typehandler_struct* self, cmsIOHANDLER* io,
if (!_cmsWriteUInt8Number(io, (cmsUInt8Number) clutPoints)) return FALSE;
if (!_cmsWriteUInt8Number(io, 0)) return FALSE; // Padding
+ n = NewLUT->InputChannels * NewLUT->OutputChannels;
if (MatMPE != NULL) {
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[0])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[1])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[2])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[3])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[4])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[5])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[6])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[7])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[8])) return FALSE;
-
+ for (i = 0; i < n; i++)
+ {
+ if (!_cmsWrite15Fixed16Number(io, MatMPE->Double[i])) return FALSE;
+ }
}
else {
+ if (n != 9) return FALSE;
+
if (!_cmsWrite15Fixed16Number(io, 1)) return FALSE;
if (!_cmsWrite15Fixed16Number(io, 0)) return FALSE;
if (!_cmsWrite15Fixed16Number(io, 0)) return FALSE;
@@ -2143,7 +2140,7 @@ void *Type_LUT16_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cm
static
cmsBool Type_LUT16_Write(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, void* Ptr, cmsUInt32Number nItems)
{
- cmsUInt32Number nTabSize;
+ cmsUInt32Number nTabSize, n;
cmsPipeline* NewLUT = (cmsPipeline*) Ptr;
cmsStage* mpe;
_cmsStageToneCurvesData* PreMPE = NULL, *PostMPE = NULL;
@@ -2194,21 +2191,20 @@ cmsBool Type_LUT16_Write(struct _cms_typehandler_struct* self, cmsIOHANDLER* io
if (!_cmsWriteUInt8Number(io, (cmsUInt8Number) clutPoints)) return FALSE;
if (!_cmsWriteUInt8Number(io, 0)) return FALSE; // Padding
+ n = NewLUT->InputChannels * NewLUT->OutputChannels;
if (MatMPE != NULL) {
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[0])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[1])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[2])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[3])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[4])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[5])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[6])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[7])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, MatMPE -> Double[8])) return FALSE;
+ for (i = 0; i < n; i++)
+ {
+ if (!_cmsWrite15Fixed16Number(io, MatMPE->Double[i])) return FALSE;
+ }
+
}
else {
+ if (n != 9) return FALSE;
+
if (!_cmsWrite15Fixed16Number(io, 1)) return FALSE;
if (!_cmsWrite15Fixed16Number(io, 0)) return FALSE;
if (!_cmsWrite15Fixed16Number(io, 0)) return FALSE;
@@ -2550,31 +2546,31 @@ void* Type_LUTA2B_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, c
static
cmsBool WriteMatrix(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsStage* mpe)
{
- _cmsStageMatrixData* m = (_cmsStageMatrixData*) mpe -> Data;
-
- // Write the Matrix
- if (!_cmsWrite15Fixed16Number(io, m -> Double[0])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, m -> Double[1])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, m -> Double[2])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, m -> Double[3])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, m -> Double[4])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, m -> Double[5])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, m -> Double[6])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, m -> Double[7])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, m -> Double[8])) return FALSE;
-
- if (m ->Offset != NULL) {
+ cmsUInt32Number i, n;
- if (!_cmsWrite15Fixed16Number(io, m -> Offset[0])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, m -> Offset[1])) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, m -> Offset[2])) return FALSE;
- }
- else {
- if (!_cmsWrite15Fixed16Number(io, 0)) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, 0)) return FALSE;
- if (!_cmsWrite15Fixed16Number(io, 0)) return FALSE;
+ _cmsStageMatrixData* m = (_cmsStageMatrixData*) mpe -> Data;
- }
+ n = mpe->InputChannels * mpe->OutputChannels;
+
+ // Write the Matrix
+ for (i = 0; i < n; i++)
+ {
+ if (!_cmsWrite15Fixed16Number(io, m->Double[i])) return FALSE;
+ }
+
+ if (m->Offset != NULL) {
+
+ for (i = 0; i < mpe->OutputChannels; i++)
+ {
+ if (!_cmsWrite15Fixed16Number(io, m->Offset[i])) return FALSE;
+ }
+ }
+ else {
+ for (i = 0; i < mpe->OutputChannels; i++)
+ {
+ if (!_cmsWrite15Fixed16Number(io, 0)) return FALSE;
+ }
+ }
return TRUE;

BIN
lcms2-2.9.tar.gz Normal file

Binary file not shown.

88
lcms2.spec Normal file
View File

@ -0,0 +1,88 @@
Name: lcms2
Version: 2.9
Release: 6
Summary: Color Management Engine
License: MIT
URL: https://www.littlecms.com/
Source0: https://www.littlecms.com/lcms2-%{version}.tar.gz
#patches come from lcms2 official
Patch17: 0017-Upgrade-Visual-studio-2017-15.8.patch
Patch6000: fix-arry-bounds-on-writing-matrices.patch
BuildRequires: gcc libjpeg-devel libtiff-devel zlib-devel
%description
LittleCMS intends to be an OPEN SOURSE small-footprint color management
engine,with special focus on accuracy and performence.It uses the
International Color Consortium standard (ICC), which is the modern
standard when regarding to color management. The ICC specification
is widely used and is referred to in many International and other
de-facto standards.
%package utils
Summary: Utility applications for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description utils
The %{name}-utils package contains utility applications for %{name}.
%package devel
Summary: Development files for LittleCMS
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: littlecms-devel = %{version}-%{release}
%description devel
Development files for LittleCMS.
%package_help
%prep
%autosetup -n %{name}-%{version} -p1
%build
%configure --program-suffix=2
%disable_rpath
%make_build
%install
%make_install
cp -alf doc/LittleCMS2.?\ API.pdf API.pdf
cp -alf doc/LittleCMS2.?\ Plugin\ API.pdf Plugin_API.pdf
cp -alf doc/LittleCMS2.?\ tutorial.pdf tutorial.pdf
%delete_la
%check
%make_build check -k ||:
%ldconfig_scriptlets
%files
%defattr(-,root,root)
%doc AUTHORS API.pdf Plugin_API.pdf tutorial.pdf
%license COPYING
%{_libdir}/liblcms2.so.2*
%files utils
%{_bindir}/*
%files devel
%defattr(-,root,root)
%{_includedir}/lcms2*.h
%{_libdir}/*.a
%{_libdir}/liblcms2.so
%{_libdir}/pkgconfig/*.pc
%files help
%defattr(-,root,root)
%{_mandir}/*
%changelog
* Wed Sep 11 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.9-6
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:Recovery utils package for lcms2
* Tue Aug 27 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.9-5
- Package init