Gentoo Archives: gentoo-commits

From: Alexis Ballier <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/openexr/files/, media-libs/openexr/
Date: Thu, 28 Sep 2017 12:50:24
Message-Id: 1506602707.dd4ad81b5d8ba426b3d2d75b27f9993119f73e30.aballier@gentoo
1 commit: dd4ad81b5d8ba426b3d2d75b27f9993119f73e30
2 Author: Jonathan Scruggs <j.scruggs <AT> gmail <DOT> com>
3 AuthorDate: Sat Sep 23 13:04:39 2017 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 28 12:45:07 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd4ad81b
7
8 media-libs/openexr: Revision bump to 2.2.0-r2
9
10 * Added patch to fix a typo in the C bindings
11 * Added patch to install the missing header files
12 * Added patch to fix security issues:
13 CVE-2017-9110, CVE-2017-9111, CVE-2017-9112, CVE-2017-9113,
14 CVE-2017-9114, CVE-2017-9115, CVE-2017-9116
15 * Fixed build system patch
16 * Added tabs in the metadata.xml file
17
18 Closes: https://bugs.gentoo.org/616996
19 Closes: https://bugs.gentoo.org/631382
20 Closes: https://bugs.gentoo.org/620324
21
22 ....2.0-CVE-2017-9110-to-9116-security-fixes.patch | 98 ++++++++++++++++++++++
23 .../openexr-2.2.0-Fix-typo-in-C-bindings.patch | 26 ++++++
24 ...penexr-2.2.0-Install-missing-header-files.patch | 60 +++++++++++++
25 .../files/openexr-2.2.0-fix-build-system.patch | 4 +-
26 media-libs/openexr/metadata.xml | 9 +-
27 media-libs/openexr/openexr-2.2.0-r2.ebuild | 64 ++++++++++++++
28 6 files changed, 256 insertions(+), 5 deletions(-)
29
30 diff --git a/media-libs/openexr/files/openexr-2.2.0-CVE-2017-9110-to-9116-security-fixes.patch b/media-libs/openexr/files/openexr-2.2.0-CVE-2017-9110-to-9116-security-fixes.patch
31 new file mode 100644
32 index 00000000000..0a37ee9c2d9
33 --- /dev/null
34 +++ b/media-libs/openexr/files/openexr-2.2.0-CVE-2017-9110-to-9116-security-fixes.patch
35 @@ -0,0 +1,98 @@
36 +From c2b32f21cbe2db7c7ef485d62ffe9bec8eaa5165 Mon Sep 17 00:00:00 2001
37 +From: Shawn Walker-Salas <shawn.walker@××××××.com>
38 +Date: Tue, 30 May 2017 19:07:52 -0700
39 +Subject: [PATCH] CVE-2017-{9110,9111,9112,9113,9114,9115,9116} fixes
40 +
41 +---
42 + OpenEXR/IlmImf/ImfDwaCompressor.cpp | 7 ++++++-
43 + OpenEXR/IlmImf/ImfHuf.cpp | 10 ++++++----
44 + OpenEXR/IlmImf/ImfPizCompressor.cpp | 6 ++++++
45 + 3 files changed, 18 insertions(+), 5 deletions(-)
46 +
47 +diff --git a/IlmImf/ImfDwaCompressor.cpp b/IlmImf/ImfDwaCompressor.cpp
48 +index 1c1bd45..2ef8878 100644
49 +--- a/IlmImf/ImfDwaCompressor.cpp
50 ++++ b/IlmImf/ImfDwaCompressor.cpp
51 +@@ -2377,7 +2377,12 @@ DwaCompressor::uncompress
52 +
53 + const char *dataPtr = inPtr + NUM_SIZES_SINGLE * sizeof(Int64);
54 +
55 +- if (inSize < headerSize + compressedSize)
56 ++ /* Both the sum and individual sizes are checked in case of overflow. */
57 ++ if (inSize < (headerSize + compressedSize) ||
58 ++ inSize < unknownCompressedSize ||
59 ++ inSize < acCompressedSize ||
60 ++ inSize < dcCompressedSize ||
61 ++ inSize < rleCompressedSize)
62 + {
63 + throw Iex::InputExc("Error uncompressing DWA data"
64 + "(truncated file).");
65 +diff --git a/IlmImf/ImfHuf.cpp b/IlmImf/ImfHuf.cpp
66 +index a375d05..97909a5 100644
67 +--- a/IlmImf/ImfHuf.cpp
68 ++++ b/IlmImf/ImfHuf.cpp
69 +@@ -822,7 +822,7 @@ hufEncode // return: output size (in bits)
70 + }
71 +
72 +
73 +-#define getCode(po, rlc, c, lc, in, out, oe) \
74 ++#define getCode(po, rlc, c, lc, in, out, ob, oe)\
75 + { \
76 + if (po == rlc) \
77 + { \
78 +@@ -835,6 +835,8 @@ hufEncode // return: output size (in bits)
79 + \
80 + if (out + cs > oe) \
81 + tooMuchData(); \
82 ++ else if (out - 1 < ob) \
83 ++ notEnoughData(); \
84 + \
85 + unsigned short s = out[-1]; \
86 + \
87 +@@ -895,7 +897,7 @@ hufDecode
88 + //
89 +
90 + lc -= pl.len;
91 +- getCode (pl.lit, rlc, c, lc, in, out, oe);
92 ++ getCode (pl.lit, rlc, c, lc, in, out, outb, oe);
93 + }
94 + else
95 + {
96 +@@ -925,7 +927,7 @@ hufDecode
97 + //
98 +
99 + lc -= l;
100 +- getCode (pl.p[j], rlc, c, lc, in, out, oe);
101 ++ getCode (pl.p[j], rlc, c, lc, in, out, outb, oe);
102 + break;
103 + }
104 + }
105 +@@ -952,7 +954,7 @@ hufDecode
106 + if (pl.len)
107 + {
108 + lc -= pl.len;
109 +- getCode (pl.lit, rlc, c, lc, in, out, oe);
110 ++ getCode (pl.lit, rlc, c, lc, in, out, outb, oe);
111 + }
112 + else
113 + {
114 +diff --git a/IlmImf/ImfPizCompressor.cpp b/IlmImf/ImfPizCompressor.cpp
115 +index 46c6fba..8b3ee38 100644
116 +--- a/IlmImf/ImfPizCompressor.cpp
117 ++++ b/IlmImf/ImfPizCompressor.cpp
118 +@@ -573,6 +573,12 @@ PizCompressor::uncompress (const char *inPtr,
119 + int length;
120 + Xdr::read <CharPtrIO> (inPtr, length);
121 +
122 ++ if (length > inSize)
123 ++ {
124 ++ throw InputExc ("Error in header for PIZ-compressed data "
125 ++ "(invalid array length).");
126 ++ }
127 ++
128 + hufUncompress (inPtr, length, _tmpBuffer, tmpBufferEnd - _tmpBuffer);
129 +
130 + //
131 +--
132 +2.14.1
133 +
134
135 diff --git a/media-libs/openexr/files/openexr-2.2.0-Fix-typo-in-C-bindings.patch b/media-libs/openexr/files/openexr-2.2.0-Fix-typo-in-C-bindings.patch
136 new file mode 100644
137 index 00000000000..966e95e72c3
138 --- /dev/null
139 +++ b/media-libs/openexr/files/openexr-2.2.0-Fix-typo-in-C-bindings.patch
140 @@ -0,0 +1,26 @@
141 +From c229dfe63380f41dfae1e977b10dfc7c49c7efc7 Mon Sep 17 00:00:00 2001
142 +From: Edward Kmett <ekmett@×××××.com>
143 +Date: Wed, 9 Dec 2015 12:15:48 -0500
144 +Subject: [PATCH] Fix typo in C bindings (Close #140)
145 +
146 +IMF_RAMDOM_Y should be IMF_RANDOM_Y
147 +---
148 + OpenEXR/IlmImf/ImfCRgbaFile.h | 2 +-
149 + 1 file changed, 1 insertion(+), 1 deletion(-)
150 +
151 +diff --git a/IlmImf/ImfCRgbaFile.h b/IlmImf/ImfCRgbaFile.h
152 +index 5ac2bf8..db58247 100644
153 +--- a/IlmImf/ImfCRgbaFile.h
154 ++++ b/IlmImf/ImfCRgbaFile.h
155 +@@ -98,7 +98,7 @@ typedef struct ImfRgba ImfRgba;
156 +
157 + #define IMF_INCREASING_Y 0
158 + #define IMF_DECREASING_Y 1
159 +-#define IMF_RAMDOM_Y 2
160 ++#define IMF_RANDOM_Y 2
161 +
162 +
163 + /*
164 +--
165 +2.14.1
166 +
167
168 diff --git a/media-libs/openexr/files/openexr-2.2.0-Install-missing-header-files.patch b/media-libs/openexr/files/openexr-2.2.0-Install-missing-header-files.patch
169 new file mode 100644
170 index 00000000000..1075cd9a30f
171 --- /dev/null
172 +++ b/media-libs/openexr/files/openexr-2.2.0-Install-missing-header-files.patch
173 @@ -0,0 +1,60 @@
174 +From a018f82655402421a995565dd4a5192259cbc207 Mon Sep 17 00:00:00 2001
175 +From: Jonathan Scruggs <j.scruggs@×××××.com>
176 +Date: Sat, 23 Sep 2017 10:36:40 +0100
177 +Subject: [PATCH] OpenEXR: Install missing header files
178 +
179 +Some header files are not installed via Autotools, but are with
180 +CMake which breaks compatibility with certain programs. This patch
181 +enables Autotools to install these header files.
182 +
183 +Signed-off by: Jonathan Scruggs <j.scruggs@×××××.com>
184 +---
185 + OpenEXR/IlmImf/Makefile.am | 3 ++-
186 + OpenEXR/IlmImfUtil/Makefile.am | 17 +++++++++++++++++
187 + 2 files changed, 19 insertions(+), 1 deletion(-)
188 +
189 +diff --git a/IlmImf/Makefile.am b/IlmImf/Makefile.am
190 +index a7c219c..b7b96ac 100644
191 +--- a/IlmImf/Makefile.am
192 ++++ b/IlmImf/Makefile.am
193 +@@ -162,7 +162,8 @@ libIlmImfinclude_HEADERS = ImfForward.h ImfAttribute.h ImfBoxAttribute.h \
194 + ImfMisc.h \
195 + ImfPartHelper.h \
196 + ImfDeepImageState.h \
197 +- ImfDeepImageStateAttribute.h
198 ++ ImfDeepImageStateAttribute.h \
199 ++ ImfFloatVectorAttribute.h
200 +
201 + noinst_HEADERS = ImfCompressor.h \
202 + ImfRleCompressor.h \
203 +diff --git a/IlmImfUtil/Makefile.am b/IlmImfUtil/Makefile.am
204 +index 8005ee1..e1d3674 100644
205 +--- a/IlmImfUtil/Makefile.am
206 ++++ b/IlmImfUtil/Makefile.am
207 +@@ -33,6 +33,23 @@ libIlmImfUtil_la_LIBADD = -L$(top_builddir)/IlmImf $(ILMBASE_LIBS) -lIlmImf
208 +
209 + libIlmImfUtilincludedir = $(includedir)/OpenEXR
210 +
211 ++libIlmImfUtilinclude_HEADERS = ImfFlatImage.h \
212 ++ ImfDeepImage.h \
213 ++ ImfDeepImageChannel.h \
214 ++ ImfImageLevel.h \
215 ++ ImfDeepImageLevel.h \
216 ++ ImfDeepImageIO.h \
217 ++ ImfImageChannelRenaming.h \
218 ++ ImfImageIO.h \
219 ++ ImfFlatImageChannel.h \
220 ++ ImfImage.h \
221 ++ ImfFlatImageLevel.h \
222 ++ ImfImageDataWindow.h \
223 ++ ImfSampleCountChannel.h \
224 ++ ImfFlatImageIO.h \
225 ++ ImfImageChannel.h
226 ++
227 ++
228 + EXTRA_DIST = CMakeLists.txt
229 +
230 + INCLUDES = \
231 +--
232 +2.14.1
233 +
234
235 diff --git a/media-libs/openexr/files/openexr-2.2.0-fix-build-system.patch b/media-libs/openexr/files/openexr-2.2.0-fix-build-system.patch
236 index 446e4e53c87..3ccfb1da7ac 100644
237 --- a/media-libs/openexr/files/openexr-2.2.0-fix-build-system.patch
238 +++ b/media-libs/openexr/files/openexr-2.2.0-fix-build-system.patch
239 @@ -69,8 +69,8 @@
240 -AC_DEFINE_UNQUOTED(OPENEXR_VERSION_MAJOR, ${OPENEXR_VERSION_MAJOR})
241 -AC_DEFINE_UNQUOTED(OPENEXR_VERSION_MINOR, ${OPENEXR_VERSION_MINOR})
242 -AC_DEFINE_UNQUOTED(OPENEXR_VERSION_PATCH, ${OPENEXR_VERSION_PATCH})
243 -+AC_DEFINE_UNQUOTED([OPENEXR_VERSION_STRING], [${VERSION}], [OpenEXR version string])
244 -+AC_DEFINE_UNQUOTED([OPENEXR_PACKAGE_STRING], [${PACKAGE_STRING}], [OpenEXR version string])
245 ++AC_DEFINE_UNQUOTED([OPENEXR_VERSION_STRING], ["${VERSION}"], [OpenEXR version string])
246 ++AC_DEFINE_UNQUOTED([OPENEXR_PACKAGE_STRING], ["${PACKAGE_STRING}"], [OpenEXR version string])
247 +AC_DEFINE_UNQUOTED([OPENEXR_VERSION_MAJOR], [${OPENEXR_VERSION_MAJOR}], [OpenEXR version string])
248 +AC_DEFINE_UNQUOTED([OPENEXR_VERSION_MINOR], [${OPENEXR_VERSION_MINOR}], [OpenEXR version string])
249 +AC_DEFINE_UNQUOTED([OPENEXR_VERSION_PATCH], [${OPENEXR_VERSION_PATCH}], [OpenEXR version string])
250
251 diff --git a/media-libs/openexr/metadata.xml b/media-libs/openexr/metadata.xml
252 index 0427ec20bfd..fc9e500d69e 100644
253 --- a/media-libs/openexr/metadata.xml
254 +++ b/media-libs/openexr/metadata.xml
255 @@ -1,7 +1,10 @@
256 <?xml version="1.0" encoding="UTF-8"?>
257 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
258 <pkgmetadata>
259 -<maintainer type="project">
260 -<email>media-video@g.o</email>
261 -</maintainer>
262 + <maintainer type="project">
263 + <email>media-video@g.o</email>
264 + </maintainer>
265 + <upstream>
266 + <remote-id type="github">openexr/openexr</remote-id>
267 + </upstream>
268 </pkgmetadata>
269
270 diff --git a/media-libs/openexr/openexr-2.2.0-r2.ebuild b/media-libs/openexr/openexr-2.2.0-r2.ebuild
271 new file mode 100644
272 index 00000000000..91e85f36c2b
273 --- /dev/null
274 +++ b/media-libs/openexr/openexr-2.2.0-r2.ebuild
275 @@ -0,0 +1,64 @@
276 +# Copyright 1999-2017 Gentoo Foundation
277 +# Distributed under the terms of the GNU General Public License v2
278 +
279 +EAPI=6
280 +
281 +inherit autotools multilib-minimal
282 +
283 +DESCRIPTION="ILM's OpenEXR high dynamic-range image file format libraries"
284 +HOMEPAGE="http://openexr.com/"
285 +SRC_URI="http://download.savannah.gnu.org/releases/openexr/${P}.tar.gz"
286 +
287 +LICENSE="BSD"
288 +SLOT="0/22" # based on SONAME
289 +KEYWORDS="~amd64 -arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
290 +IUSE="cpu_flags_x86_avx examples static-libs"
291 +
292 +RDEPEND="
293 + sys-libs/zlib[${MULTILIB_USEDEP}]
294 + >=media-libs/ilmbase-${PV}:=[${MULTILIB_USEDEP}]"
295 +DEPEND="${RDEPEND}
296 + virtual/pkgconfig[${MULTILIB_USEDEP}]
297 + >=sys-devel/autoconf-archive-2016.09.16"
298 +
299 +PATCHES=(
300 + "${FILESDIR}/${P}-fix-cpuid-on-abi_x86_32.patch"
301 + "${FILESDIR}/${P}-use-ull-for-64-bit-literals.patch"
302 + "${FILESDIR}/${P}-fix-build-system.patch"
303 + "${FILESDIR}/${P}-fix-config.h-collision.patch"
304 + "${FILESDIR}/${P}-Fix-typo-in-C-bindings.patch"
305 + "${FILESDIR}/${P}-Install-missing-header-files.patch"
306 + "${FILESDIR}/${P}-CVE-2017-9110-to-9116-security-fixes.patch"
307 +)
308 +
309 +src_prepare() {
310 + default
311 + # Fix path for testsuite
312 + sed -i -e "s:/var/tmp/:${T}:" IlmImfTest/tmpDir.h || die
313 +
314 + # delete stray config files causing havoc
315 + rm -f config*/OpenEXRConfig.h* || die
316 +
317 + eautoreconf
318 +}
319 +
320 +multilib_src_configure() {
321 + ECONF_SOURCE="${S}" econf \
322 + --enable-threading \
323 + $(use_enable cpu_flags_x86_avx avx) \
324 + $(use_enable static-libs static) \
325 + $(use_enable examples imfexamples)
326 +}
327 +
328 +multilib_src_install_all() {
329 + einstalldocs
330 +
331 + if use examples; then
332 + docompress -x /usr/share/doc/${PF}/examples
333 + else
334 + rm -rf "${ED%/}"/usr/share/doc/${PF}/examples || die
335 + fi
336 +
337 + # package provides .pc files
338 + find "${D}" -name '*.la' -delete || die
339 +}