Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libsndfile/files/, media-libs/libsndfile/
Date: Sun, 04 Oct 2020 13:55:29
Message-Id: 1601819709.455ff240b6739983b52aa3d63f9f2cb2c0f4c654.soap@gentoo
1 commit: 455ff240b6739983b52aa3d63f9f2cb2c0f4c654
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 4 13:55:09 2020 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 4 13:55:09 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=455ff240
7
8 media-libs/libsndfile: Remove old 1.0.28-r4 and 1.0.29
9
10 Closes: https://bugs.gentoo.org/631674
11 Package-Manager: Portage-3.0.8, Repoman-3.0.1
12 Signed-off-by: David Seifert <soap <AT> gentoo.org>
13
14 media-libs/libsndfile/Manifest | 2 -
15 .../files/libsndfile-1.0.28-CVE-2017-12562.patch | 88 --------------
16 .../files/libsndfile-1.0.28-CVE-2017-14634.patch | 35 ------
17 .../files/libsndfile-1.0.28-CVE-2017-6892.patch | 25 ----
18 .../files/libsndfile-1.0.28-CVE-2017-8362.patch | 50 --------
19 .../files/libsndfile-1.0.28-CVE-2017-8363.patch | 28 -----
20 .../files/libsndfile-1.0.28-CVE-2017-8365.patch | 64 -----------
21 .../files/libsndfile-1.0.28-CVE-2018-13139.patch | 31 -----
22 .../libsndfile-1.0.28-arm-varargs-failure.patch | 32 ------
23 .../files/libsndfile-1.0.29-pointer-aliasing.patch | 128 ---------------------
24 media-libs/libsndfile/libsndfile-1.0.28-r4.ebuild | 71 ------------
25 media-libs/libsndfile/libsndfile-1.0.29.ebuild | 79 -------------
26 12 files changed, 633 deletions(-)
27
28 diff --git a/media-libs/libsndfile/Manifest b/media-libs/libsndfile/Manifest
29 index 75717570710..21eef4133d6 100644
30 --- a/media-libs/libsndfile/Manifest
31 +++ b/media-libs/libsndfile/Manifest
32 @@ -1,4 +1,2 @@
33 -DIST libsndfile-1.0.28.tar.gz 1202833 BLAKE2B 102735766e2c22b5278fde43feaaa664598c08fadb5264d5130e4bf1e354bd4202948db38e2912d7487bd7f8c0b9faf1616c0873eed886a56b1d7f49452bf488 SHA512 890731a6b8173f714155ce05eaf6d991b31632c8ab207fbae860968861a107552df26fcf85602df2e7f65502c7256c1b41735e1122485a3a07ddb580aa83b57f
34 -DIST libsndfile-1.0.29.tar.bz2 831090 BLAKE2B 0bdf20a0abe22f628434e80c61c6b7d31e62c40dd881f462d8e12eb4488f0bcb1c0c7712fbff4902bbbea86e08763a01f7d85b875166c5c9214ab9d8aa10a1c1 SHA512 72cf038b26c66e6e085d97ef1954bd3aa76315527f632649707c76128953bfbb2c9b52527d309720ca1107a9e04e033722995911dad43b4adda46bf4a05354d7
35 DIST libsndfile-1.0.29_pre2_p20191024.tar.gz 720981 BLAKE2B 9f1dcf3d3669b66d8582d50b62ff863facd7125432a84a3e1e3fb0f817554f260f42948b4479371fb0967dcc75bedc6c49afffc6bee3f973a875d72d2e508210 SHA512 e37b385b90cadc97348db03b6c5ae7a8fcee17ded60f54d1508adddb8e2dc604ea44b60a0fe08627e81c0faa83997cdafb0b0ecf8574f901bf5e8a1819a63998
36 DIST libsndfile-1.0.30.tar.bz2 852320 BLAKE2B 00bd558a3d8645f4ad03fba38c31fcea25d30bea4b6f1a785b4b31b0da61bfa6a6f7df1bd7907c95c543cce8ee6766032d2e614eb285f2fc529146cb1d319517 SHA512 c4be4bc57df880da81570889a80256ba4567f2c7d6bdfb38f3803c55f616278160e962544bfac32e53b613b8fdf2a2644d8da9ee778747c32cb681a0fd5aab00
37
38 diff --git a/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-12562.patch b/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-12562.patch
39 deleted file mode 100644
40 index 0ff2b7ef459..00000000000
41 --- a/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-12562.patch
42 +++ /dev/null
43 @@ -1,88 +0,0 @@
44 -From b6a9d7e95888ffa77d8c75ce3f03e6c7165587cd Mon Sep 17 00:00:00 2001
45 -From: =?UTF-8?q?J=C3=B6rn=20Heusipp?= <osmanx@×××××××××××××××××××××××.de>
46 -Date: Wed, 14 Jun 2017 12:25:40 +0200
47 -Subject: [PATCH] src/common.c: Fix heap buffer overflows when writing strings
48 - in binheader
49 -
50 -Fixes the following problems:
51 - 1. Case 's' only enlarges the buffer by 16 bytes instead of size bytes.
52 - 2. psf_binheader_writef() enlarges the header buffer (if needed) prior to the
53 - big switch statement by an amount (16 bytes) which is enough for all cases
54 - where only a single value gets added. Cases 's', 'S', 'p' however
55 - additionally write an arbitrary length block of data and again enlarge the
56 - buffer to the required amount. However, the required space calculation does
57 - not take into account the size of the length field which gets output before
58 - the data.
59 - 3. Buffer size requirement calculation in case 'S' does not account for the
60 - padding byte ("size += (size & 1) ;" happens after the calculation which
61 - uses "size").
62 - 4. Case 'S' can overrun the header buffer by 1 byte when no padding is
63 - involved
64 - ("memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size + 1) ;" while
65 - the buffer is only guaranteed to have "size" space available).
66 - 5. "psf->header.ptr [psf->header.indx] = 0 ;" in case 'S' always writes 1 byte
67 - beyond the space which is guaranteed to be allocated in the header buffer.
68 - 6. Case 's' can overrun the provided source string by 1 byte if padding is
69 - involved ("memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size) ;"
70 - where "size" is "strlen (strptr) + 1" (which includes the 0 terminator,
71 - plus optionally another 1 which is padding and not guaranteed to be
72 - readable via the source string pointer).
73 -
74 -Closes: https://github.com/erikd/libsndfile/issues/292
75 ----
76 - src/common.c | 15 +++++++--------
77 - 1 file changed, 7 insertions(+), 8 deletions(-)
78 -
79 -diff --git a/src/common.c b/src/common.c
80 -index 1a6204ca..6b2a2ee9 100644
81 ---- a/src/common.c
82 -+++ b/src/common.c
83 -@@ -681,16 +681,16 @@ psf_binheader_writef (SF_PRIVATE *psf, const char *format, ...)
84 - /* Write a C string (guaranteed to have a zero terminator). */
85 - strptr = va_arg (argptr, char *) ;
86 - size = strlen (strptr) + 1 ;
87 -- size += (size & 1) ;
88 -
89 -- if (psf->header.indx + (sf_count_t) size >= psf->header.len && psf_bump_header_allocation (psf, 16))
90 -+ if (psf->header.indx + 4 + (sf_count_t) size + (sf_count_t) (size & 1) > psf->header.len && psf_bump_header_allocation (psf, 4 + size + (size & 1)))
91 - return count ;
92 -
93 - if (psf->rwf_endian == SF_ENDIAN_BIG)
94 -- header_put_be_int (psf, size) ;
95 -+ header_put_be_int (psf, size + (size & 1)) ;
96 - else
97 -- header_put_le_int (psf, size) ;
98 -+ header_put_le_int (psf, size + (size & 1)) ;
99 - memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size) ;
100 -+ size += (size & 1) ;
101 - psf->header.indx += size ;
102 - psf->header.ptr [psf->header.indx - 1] = 0 ;
103 - count += 4 + size ;
104 -@@ -703,16 +703,15 @@ psf_binheader_writef (SF_PRIVATE *psf, const char *format, ...)
105 - */
106 - strptr = va_arg (argptr, char *) ;
107 - size = strlen (strptr) ;
108 -- if (psf->header.indx + (sf_count_t) size > psf->header.len && psf_bump_header_allocation (psf, size))
109 -+ if (psf->header.indx + 4 + (sf_count_t) size + (sf_count_t) (size & 1) > psf->header.len && psf_bump_header_allocation (psf, 4 + size + (size & 1)))
110 - return count ;
111 - if (psf->rwf_endian == SF_ENDIAN_BIG)
112 - header_put_be_int (psf, size) ;
113 - else
114 - header_put_le_int (psf, size) ;
115 -- memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size + 1) ;
116 -+ memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size + (size & 1)) ;
117 - size += (size & 1) ;
118 - psf->header.indx += size ;
119 -- psf->header.ptr [psf->header.indx] = 0 ;
120 - count += 4 + size ;
121 - break ;
122 -
123 -@@ -724,7 +723,7 @@ psf_binheader_writef (SF_PRIVATE *psf, const char *format, ...)
124 - size = (size & 1) ? size : size + 1 ;
125 - size = (size > 254) ? 254 : size ;
126 -
127 -- if (psf->header.indx + (sf_count_t) size > psf->header.len && psf_bump_header_allocation (psf, size))
128 -+ if (psf->header.indx + 1 + (sf_count_t) size > psf->header.len && psf_bump_header_allocation (psf, 1 + size))
129 - return count ;
130 -
131 - header_put_byte (psf, size) ;
132
133 diff --git a/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-14634.patch b/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-14634.patch
134 deleted file mode 100644
135 index 9eab370aac4..00000000000
136 --- a/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-14634.patch
137 +++ /dev/null
138 @@ -1,35 +0,0 @@
139 -From 85c877d5072866aadbe8ed0c3e0590fbb5e16788 Mon Sep 17 00:00:00 2001
140 -From: Fabian Greffrath <fabian@×××××××××.com>
141 -Date: Thu, 28 Sep 2017 12:15:04 +0200
142 -Subject: [PATCH] double64_init: Check psf->sf.channels against upper bound
143 -
144 -This prevents division by zero later in the code.
145 -
146 -While the trivial case to catch this (i.e. sf.channels < 1) has already
147 -been covered, a crafted file may report a number of channels that is
148 -so high (i.e. > INT_MAX/sizeof(double)) that it "somehow" gets
149 -miscalculated to zero (if this makes sense) in the determination of the
150 -blockwidth. Since we only support a limited number of channels anyway,
151 -make sure to check here as well.
152 -
153 -CVE-2017-14634
154 -
155 -Closes: https://github.com/erikd/libsndfile/issues/318
156 -Signed-off-by: Erik de Castro Lopo <erikd@×××××××××.com>
157 ----
158 - src/double64.c | 2 +-
159 - 1 file changed, 1 insertion(+), 1 deletion(-)
160 -
161 -diff --git a/src/double64.c b/src/double64.c
162 -index b318ea86..78dfef7f 100644
163 ---- a/src/double64.c
164 -+++ b/src/double64.c
165 -@@ -91,7 +91,7 @@ int
166 - double64_init (SF_PRIVATE *psf)
167 - { static int double64_caps ;
168 -
169 -- if (psf->sf.channels < 1)
170 -+ if (psf->sf.channels < 1 || psf->sf.channels > SF_MAX_CHANNELS)
171 - { psf_log_printf (psf, "double64_init : internal error : channels = %d\n", psf->sf.channels) ;
172 - return SFE_INTERNAL ;
173 - } ;
174
175 diff --git a/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-6892.patch b/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-6892.patch
176 deleted file mode 100644
177 index d5ccf726684..00000000000
178 --- a/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-6892.patch
179 +++ /dev/null
180 @@ -1,25 +0,0 @@
181 -From f833c53cb596e9e1792949f762e0b33661822748 Mon Sep 17 00:00:00 2001
182 -From: Erik de Castro Lopo <erikd@×××××××××.com>
183 -Date: Tue, 23 May 2017 20:15:24 +1000
184 -Subject: [PATCH] src/aiff.c: Fix a buffer read overflow
185 -
186 -Secunia Advisory SA76717.
187 -
188 -Found by: Laurent Delosieres, Secunia Research at Flexera Software
189 ----
190 - src/aiff.c | 2 +-
191 - 1 file changed, 1 insertion(+), 1 deletion(-)
192 -
193 -diff --git a/src/aiff.c b/src/aiff.c
194 -index 5b5f9f53..45864b76 100644
195 ---- a/src/aiff.c
196 -+++ b/src/aiff.c
197 -@@ -1759,7 +1759,7 @@ aiff_read_chanmap (SF_PRIVATE * psf, unsigned dword)
198 - psf_binheader_readf (psf, "j", dword - bytesread) ;
199 -
200 - if (map_info->channel_map != NULL)
201 -- { size_t chanmap_size = psf->sf.channels * sizeof (psf->channel_map [0]) ;
202 -+ { size_t chanmap_size = SF_MIN (psf->sf.channels, layout_tag & 0xffff) * sizeof (psf->channel_map [0]) ;
203 -
204 - free (psf->channel_map) ;
205 -
206
207 diff --git a/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-8362.patch b/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-8362.patch
208 deleted file mode 100644
209 index 54fbfb44c3b..00000000000
210 --- a/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-8362.patch
211 +++ /dev/null
212 @@ -1,50 +0,0 @@
213 -From ef1dbb2df1c0e741486646de40bd638a9c4cd808 Mon Sep 17 00:00:00 2001
214 -From: Erik de Castro Lopo <erikd@×××××××××.com>
215 -Date: Fri, 14 Apr 2017 15:19:16 +1000
216 -Subject: [PATCH] src/flac.c: Fix a buffer read overflow
217 -
218 -A file (generated by a fuzzer) which increased the number of channels
219 -from one frame to the next could cause a read beyond the end of the
220 -buffer provided by libFLAC. Only option is to abort the read.
221 -
222 -Closes: https://github.com/erikd/libsndfile/issues/231
223 ----
224 - src/flac.c | 11 +++++++++--
225 - 1 file changed, 9 insertions(+), 2 deletions(-)
226 -
227 -diff --git a/src/flac.c b/src/flac.c
228 -index 5a4f8c21..e4f9aaa0 100644
229 ---- a/src/flac.c
230 -+++ b/src/flac.c
231 -@@ -169,6 +169,14 @@ flac_buffer_copy (SF_PRIVATE *psf)
232 - const int32_t* const *buffer = pflac->wbuffer ;
233 - unsigned i = 0, j, offset, channels, len ;
234 -
235 -+ if (psf->sf.channels != (int) frame->header.channels)
236 -+ { psf_log_printf (psf, "Error: FLAC frame changed from %d to %d channels\n"
237 -+ "Nothing to do but to error out.\n" ,
238 -+ psf->sf.channels, frame->header.channels) ;
239 -+ psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
240 -+ return 0 ;
241 -+ } ;
242 -+
243 - /*
244 - ** frame->header.blocksize is variable and we're using a constant blocksize
245 - ** of FLAC__MAX_BLOCK_SIZE.
246 -@@ -202,7 +210,6 @@ flac_buffer_copy (SF_PRIVATE *psf)
247 - return 0 ;
248 - } ;
249 -
250 --
251 - len = SF_MIN (pflac->len, frame->header.blocksize) ;
252 -
253 - if (pflac->remain % channels != 0)
254 -@@ -436,7 +443,7 @@ sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC_
255 - { case FLAC__METADATA_TYPE_STREAMINFO :
256 - if (psf->sf.channels > 0 && psf->sf.channels != (int) metadata->data.stream_info.channels)
257 - { psf_log_printf (psf, "Error: FLAC stream changed from %d to %d channels\n"
258 -- "Nothing to be but to error out.\n" ,
259 -+ "Nothing to do but to error out.\n" ,
260 - psf->sf.channels, metadata->data.stream_info.channels) ;
261 - psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
262 - return ;
263
264 diff --git a/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-8363.patch b/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-8363.patch
265 deleted file mode 100644
266 index d0aa400bdd9..00000000000
267 --- a/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-8363.patch
268 +++ /dev/null
269 @@ -1,28 +0,0 @@
270 -From cd7da8dbf6ee4310d21d9e44b385d6797160d9e8 Mon Sep 17 00:00:00 2001
271 -From: Erik de Castro Lopo <erikd@×××××××××.com>
272 -Date: Wed, 12 Apr 2017 20:19:34 +1000
273 -Subject: [PATCH] src/flac.c: Fix another memory leak
274 -
275 -When the FLAC decoder was passed a malformed file, the associated
276 -`FLAC__StreamDecoder` object was not getting released.
277 -
278 -Closes: https://github.com/erikd/libsndfile/issues/233
279 ----
280 - src/flac.c | 4 +++-
281 - 1 file changed, 3 insertions(+), 1 deletion(-)
282 -
283 -diff --git a/src/flac.c b/src/flac.c
284 -index 986a7b8f..5a4f8c21 100644
285 ---- a/src/flac.c
286 -+++ b/src/flac.c
287 -@@ -841,7 +841,9 @@ flac_read_header (SF_PRIVATE *psf)
288 -
289 - psf_log_printf (psf, "End\n") ;
290 -
291 -- if (psf->error == 0)
292 -+ if (psf->error != 0)
293 -+ FLAC__stream_decoder_delete (pflac->fsd) ;
294 -+ else
295 - { FLAC__uint64 position ;
296 -
297 - FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ;
298
299 diff --git a/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-8365.patch b/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-8365.patch
300 deleted file mode 100644
301 index 1dc5b57f1d3..00000000000
302 --- a/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2017-8365.patch
303 +++ /dev/null
304 @@ -1,64 +0,0 @@
305 -From fd0484aba8e51d16af1e3a880f9b8b857b385eb3 Mon Sep 17 00:00:00 2001
306 -From: Erik de Castro Lopo <erikd@×××××××××.com>
307 -Date: Wed, 12 Apr 2017 19:45:30 +1000
308 -Subject: [PATCH] FLAC: Fix a buffer read overrun
309 -
310 -Buffer read overrun occurs when reading a FLAC file that switches
311 -from 2 channels to one channel mid-stream. Only option is to
312 -abort the read.
313 -
314 -Closes: https://github.com/erikd/libsndfile/issues/230
315 ----
316 - src/common.h | 1 +
317 - src/flac.c | 13 +++++++++++++
318 - src/sndfile.c | 1 +
319 - 3 files changed, 15 insertions(+)
320 -
321 -diff --git a/src/common.h b/src/common.h
322 -index 0bd810c3..e2669b6a 100644
323 ---- a/src/common.h
324 -+++ b/src/common.h
325 -@@ -725,6 +725,7 @@ enum
326 - SFE_FLAC_INIT_DECODER,
327 - SFE_FLAC_LOST_SYNC,
328 - SFE_FLAC_BAD_SAMPLE_RATE,
329 -+ SFE_FLAC_CHANNEL_COUNT_CHANGED,
330 - SFE_FLAC_UNKOWN_ERROR,
331 -
332 - SFE_WVE_NOT_WVE,
333 -diff --git a/src/flac.c b/src/flac.c
334 -index 84de0e26..986a7b8f 100644
335 ---- a/src/flac.c
336 -+++ b/src/flac.c
337 -@@ -434,6 +434,19 @@ sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC_
338 -
339 - switch (metadata->type)
340 - { case FLAC__METADATA_TYPE_STREAMINFO :
341 -+ if (psf->sf.channels > 0 && psf->sf.channels != (int) metadata->data.stream_info.channels)
342 -+ { psf_log_printf (psf, "Error: FLAC stream changed from %d to %d channels\n"
343 -+ "Nothing to be but to error out.\n" ,
344 -+ psf->sf.channels, metadata->data.stream_info.channels) ;
345 -+ psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
346 -+ return ;
347 -+ } ;
348 -+
349 -+ if (psf->sf.channels > 0 && psf->sf.samplerate != (int) metadata->data.stream_info.sample_rate)
350 -+ { psf_log_printf (psf, "Warning: FLAC stream changed sample rates from %d to %d.\n"
351 -+ "Carrying on as if nothing happened.",
352 -+ psf->sf.samplerate, metadata->data.stream_info.sample_rate) ;
353 -+ } ;
354 - psf->sf.channels = metadata->data.stream_info.channels ;
355 - psf->sf.samplerate = metadata->data.stream_info.sample_rate ;
356 - psf->sf.frames = metadata->data.stream_info.total_samples ;
357 -diff --git a/src/sndfile.c b/src/sndfile.c
358 -index 41875610..e2a87be8 100644
359 ---- a/src/sndfile.c
360 -+++ b/src/sndfile.c
361 -@@ -245,6 +245,7 @@ ErrorStruct SndfileErrors [] =
362 - { SFE_FLAC_INIT_DECODER , "Error : problem with initialization of the flac decoder." },
363 - { SFE_FLAC_LOST_SYNC , "Error : flac decoder lost sync." },
364 - { SFE_FLAC_BAD_SAMPLE_RATE, "Error : flac does not support this sample rate." },
365 -+ { SFE_FLAC_CHANNEL_COUNT_CHANGED, "Error : flac channel changed mid stream." },
366 - { SFE_FLAC_UNKOWN_ERROR , "Error : unknown error in flac decoder." },
367 -
368 - { SFE_WVE_NOT_WVE , "Error : not a WVE file." },
369
370 diff --git a/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2018-13139.patch b/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2018-13139.patch
371 deleted file mode 100644
372 index f75843267b0..00000000000
373 --- a/media-libs/libsndfile/files/libsndfile-1.0.28-CVE-2018-13139.patch
374 +++ /dev/null
375 @@ -1,31 +0,0 @@
376 -From df18323c622b54221ee7ace74b177cdcccc152d7 Mon Sep 17 00:00:00 2001
377 -From: "Brett T. Warden" <brett.t.warden@×××××.com>
378 -Date: Tue, 28 Aug 2018 12:01:17 -0700
379 -Subject: [PATCH] Check MAX_CHANNELS in sndfile-deinterleave
380 -
381 -Allocated buffer has space for only 16 channels. Verify that input file
382 -meets this limit.
383 -
384 -Fixes #397
385 ----
386 - programs/sndfile-deinterleave.c | 7 +++++++
387 - 1 file changed, 7 insertions(+)
388 -
389 -diff --git a/programs/sndfile-deinterleave.c b/programs/sndfile-deinterleave.c
390 -index 53660310..225b4d54 100644
391 ---- a/programs/sndfile-deinterleave.c
392 -+++ b/programs/sndfile-deinterleave.c
393 -@@ -89,6 +89,13 @@ main (int argc, char **argv)
394 - exit (1) ;
395 - } ;
396 -
397 -+ if (sfinfo.channels > MAX_CHANNELS)
398 -+ { printf ("\nError : Input file '%s' has too many (%d) channels. Limit is %d.\n",
399 -+ argv [1], sfinfo.channels, MAX_CHANNELS) ;
400 -+ exit (1) ;
401 -+ } ;
402 -+
403 -+
404 - state.channels = sfinfo.channels ;
405 - sfinfo.channels = 1 ;
406 -
407
408 diff --git a/media-libs/libsndfile/files/libsndfile-1.0.28-arm-varargs-failure.patch b/media-libs/libsndfile/files/libsndfile-1.0.28-arm-varargs-failure.patch
409 deleted file mode 100644
410 index ed726f82976..00000000000
411 --- a/media-libs/libsndfile/files/libsndfile-1.0.28-arm-varargs-failure.patch
412 +++ /dev/null
413 @@ -1,32 +0,0 @@
414 -From 9d470ee5577d3ccedb1c28c7e0a7295ba17feaf5 Mon Sep 17 00:00:00 2001
415 -From: Erik de Castro Lopo <erikd@×××××××××.com>
416 -Date: Sun, 16 Apr 2017 17:54:17 +1000
417 -Subject: [PATCH] src/rf64.c: Fix varargs related bug
418 -
419 -C's <stargs.h> functionality isn't type checked so that passing an
420 -`sf_count_t` (64 bits) by mistake in place of a `unit32_t` can cause
421 -errors. This would be fine if it was an error on every architecture
422 -and platform, but its not. This particular problem only manifested
423 -on armhf and some other Arm architectures. It was not an issue on
424 -32 bit x86.
425 -
426 -I have now fixed variants of this same bug several times.
427 -
428 -Closes: https://github.com/erikd/libsndfile/issues/229
429 ----
430 - src/rf64.c | 2 +-
431 - 1 file changed, 1 insertion(+), 1 deletion(-)
432 -
433 -diff --git a/src/rf64.c b/src/rf64.c
434 -index b3d637fa..02dd9046 100644
435 ---- a/src/rf64.c
436 -+++ b/src/rf64.c
437 -@@ -742,7 +742,7 @@ rf64_write_header (SF_PRIVATE *psf, int calc_length)
438 -
439 - pad_size = psf->dataoffset - 16 - psf->header.indx ;
440 - if (pad_size >= 0)
441 -- psf_binheader_writef (psf, "m4z", PAD_MARKER, pad_size, make_size_t (pad_size)) ;
442 -+ psf_binheader_writef (psf, "m4z", PAD_MARKER, (unsigned int) pad_size, make_size_t (pad_size)) ;
443 -
444 - if (wpriv->rf64_downgrade && (psf->filelength < RIFF_DOWNGRADE_BYTES))
445 - psf_binheader_writef (psf, "tm8", data_MARKER, psf->datalength) ;
446
447 diff --git a/media-libs/libsndfile/files/libsndfile-1.0.29-pointer-aliasing.patch b/media-libs/libsndfile/files/libsndfile-1.0.29-pointer-aliasing.patch
448 deleted file mode 100644
449 index 644bf333413..00000000000
450 --- a/media-libs/libsndfile/files/libsndfile-1.0.29-pointer-aliasing.patch
451 +++ /dev/null
452 @@ -1,128 +0,0 @@
453 -From e5f9469a824fc660494b52ec3edc0dda2509594c Mon Sep 17 00:00:00 2001
454 -From: Arthur Taylor <art@×××××.ca>
455 -Date: Tue, 8 Sep 2020 09:31:37 -0700
456 -Subject: [PATCH] Opus: Fix integer bug in header parsing. Fixes issue #581.
457 -
458 -Fix errors in parsing an OggOpus header packet where aliased pointers of
459 -different type widths are used with psf_binheader_readf(), resulting in
460 -incorrect data or endian issues. Telling psf_binheader_readf() to read
461 -an integer of fixed width, but then passing a pointer to an integer
462 -of a different width is a bug.
463 ----
464 - src/ogg_opus.c | 38 ++++++++++++++++++++++----------------
465 - 1 file changed, 22 insertions(+), 16 deletions(-)
466 -
467 -diff --git a/src/ogg_opus.c b/src/ogg_opus.c
468 -index de66b061..b40a6fb1 100644
469 ---- a/src/ogg_opus.c
470 -+++ b/src/ogg_opus.c
471 -@@ -183,32 +183,32 @@
472 - #define OGG_OPUS_PREROLL (80 * 48) /* 80 milliseconds */
473 -
474 - typedef struct
475 --{ int version ;
476 -+{ uint8_t version ;
477 -
478 - /* Number of channels, 1...255 */
479 -- int channels ;
480 -+ uint8_t channels ;
481 -
482 - /* Encoder latency, the amount to skip before valid data comes out. */
483 -- int preskip ;
484 -+ uint16_t preskip ;
485 -
486 - /* The sample rate of a the encoded source, as it may have been converted. */
487 -- int input_samplerate ;
488 -+ int32_t input_samplerate ;
489 -
490 - /* 'baked-in' gain to apply, dB S7.8 format. Should be zero when possible. */
491 - int16_t gain ;
492 -
493 - /* Channel mapping type. See OggOpus spec */
494 -- int channel_mapping ;
495 -+ uint8_t channel_mapping ;
496 -
497 - /* The rest is only used if channel_mapping != 0 */
498 - /* How many streams are there? */
499 -- int nb_streams ;
500 -+ uint8_t nb_streams ;
501 -
502 - /* How man of those streams are coupled? (aka stereo) */
503 -- int nb_coupled ;
504 -+ uint8_t nb_coupled ;
505 -
506 - /* Mapping of opus streams to output channels */
507 -- unsigned char stream_map [255] ;
508 -+ uint8_t stream_map [255] ;
509 - } OpusHeader ;
510 -
511 - typedef struct
512 -@@ -637,6 +637,9 @@ ogg_opus_setup_decoder (SF_PRIVATE *psf, int input_samplerate)
513 - static int
514 - ogg_opus_setup_encoder (SF_PRIVATE *psf, OGG_PRIVATE *odata, OPUS_PRIVATE *oopus)
515 - { int error ;
516 -+ int lookahead ;
517 -+ int nb_streams ;
518 -+ int nb_coupled ;
519 -
520 - /* default page latency value (1000ms) */
521 - oopus->u.encode.latency = 1000 * 48 ;
522 -@@ -655,16 +658,16 @@ ogg_opus_setup_encoder (SF_PRIVATE *psf, OGG_PRIVATE *odata, OPUS_PRIVATE *oopus
523 -
524 - if (psf->sf.channels <= 2)
525 - { oopus->header.channel_mapping = 0 ;
526 -- oopus->header.nb_streams = 1 ;
527 -- oopus->header.nb_coupled = psf->sf.channels - 1 ;
528 -+ nb_streams = 1 ;
529 -+ nb_coupled = psf->sf.channels - 1 ;
530 - oopus->header.stream_map [0] = 0 ;
531 - oopus->header.stream_map [1] = 1 ;
532 -
533 - oopus->u.encode.state = opus_multistream_encoder_create (
534 - psf->sf.samplerate,
535 - psf->sf.channels,
536 -- oopus->header.nb_streams,
537 -- oopus->header.nb_coupled,
538 -+ nb_streams,
539 -+ nb_coupled,
540 - oopus->header.stream_map,
541 - OPUS_APPLICATION_AUDIO,
542 - &error) ;
543 -@@ -683,17 +686,20 @@ ogg_opus_setup_encoder (SF_PRIVATE *psf, OGG_PRIVATE *odata, OPUS_PRIVATE *oopus
544 - psf->sf.samplerate,
545 - psf->sf.channels,
546 - oopus->header.channel_mapping,
547 -- &oopus->header.nb_streams,
548 -- &oopus->header.nb_coupled,
549 -+ &nb_streams,
550 -+ &nb_coupled,
551 - oopus->header.stream_map,
552 - OPUS_APPLICATION_AUDIO,
553 - &error) ;
554 -+
555 - }
556 -
557 - if (error != OPUS_OK)
558 - { psf_log_printf (psf, "Opus : Error, opus_multistream_encoder_create returned %s\n", opus_strerror (error)) ;
559 - return SFE_BAD_OPEN_FORMAT ;
560 - } ;
561 -+ oopus->header.nb_streams = nb_streams ;
562 -+ oopus->header.nb_coupled = nb_coupled ;
563 -
564 - opus_multistream_encoder_ctl (oopus->u.encode.state, OPUS_GET_BITRATE (&oopus->u.encode.bitrate)) ;
565 - psf_log_printf (psf, "Encoding at target bitrate of %dbps\n", oopus->u.encode.bitrate) ;
566 -@@ -711,12 +717,12 @@ ogg_opus_setup_encoder (SF_PRIVATE *psf, OGG_PRIVATE *odata, OPUS_PRIVATE *oopus
567 - ** GOTCHA: This returns the preskip at the encoder samplerate, not the
568 - ** granulepos rate of 48000Hz needed for header.preskip.
569 - */
570 -- error = opus_multistream_encoder_ctl (oopus->u.encode.state, OPUS_GET_LOOKAHEAD (&oopus->header.preskip)) ;
571 -+ error = opus_multistream_encoder_ctl (oopus->u.encode.state, OPUS_GET_LOOKAHEAD (&lookahead)) ;
572 - if (error != OPUS_OK)
573 - { psf_log_printf (psf, "Opus : OPUS_GET_LOOKAHEAD returned: %s\n", opus_strerror (error)) ;
574 - return SFE_BAD_OPEN_FORMAT ;
575 - } ;
576 -- oopus->header.preskip *= oopus->sr_factor ;
577 -+ oopus->header.preskip = lookahead * oopus->sr_factor ;
578 -
579 - oopus->len = OGG_OPUS_ENCODE_PACKET_LEN (psf->sf.samplerate) ;
580 - oopus->buffer = malloc (sizeof (float) * psf->sf.channels * oopus->len) ;
581
582 diff --git a/media-libs/libsndfile/libsndfile-1.0.28-r4.ebuild b/media-libs/libsndfile/libsndfile-1.0.28-r4.ebuild
583 deleted file mode 100644
584 index 95ea458a1e5..00000000000
585 --- a/media-libs/libsndfile/libsndfile-1.0.28-r4.ebuild
586 +++ /dev/null
587 @@ -1,71 +0,0 @@
588 -# Copyright 1999-2020 Gentoo Authors
589 -# Distributed under the terms of the GNU General Public License v2
590 -
591 -EAPI=7
592 -
593 -PYTHON_COMPAT=( python3_6 pypy3 )
594 -
595 -inherit python-any-r1 multilib-minimal
596 -
597 -MY_P=${P/_pre/pre}
598 -
599 -DESCRIPTION="C library for reading and writing files containing sampled sound"
600 -HOMEPAGE="http://www.mega-nerd.com/libsndfile"
601 -if [[ ${MY_P} == ${P} ]]; then
602 - SRC_URI="http://www.mega-nerd.com/libsndfile/files/${P}.tar.gz"
603 -else
604 - SRC_URI="http://www.mega-nerd.com/tmp/${MY_P}b.tar.gz"
605 -fi
606 -
607 -LICENSE="LGPL-2.1"
608 -SLOT="0"
609 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
610 -IUSE="alsa minimal sqlite static-libs test"
611 -RESTRICT="!test? ( test )"
612 -
613 -RDEPEND="
614 - !minimal? (
615 - >=media-libs/flac-1.2.1-r5[${MULTILIB_USEDEP}]
616 - >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}]
617 - >=media-libs/libvorbis-1.3.3-r1[${MULTILIB_USEDEP}]
618 - )
619 - alsa? ( media-libs/alsa-lib )
620 - sqlite? ( >=dev-db/sqlite-3.2 )"
621 -DEPEND="${RDEPEND}"
622 -BDEPEND="
623 - virtual/pkgconfig
624 - test? ( ${PYTHON_DEPS} )"
625 -
626 -S=${WORKDIR}/${MY_P}
627 -
628 -PATCHES=(
629 - "${FILESDIR}"/${P}-arm-varargs-failure.patch
630 - "${FILESDIR}"/${P}-CVE-2017-12562.patch
631 - "${FILESDIR}"/${P}-CVE-2018-13139.patch
632 - "${FILESDIR}"/${P}-CVE-2017-6892.patch
633 - "${FILESDIR}"/${P}-CVE-2017-836{3,5,2}.patch
634 - "${FILESDIR}"/${P}-CVE-2017-14634.patch
635 -)
636 -
637 -pkg_setup() {
638 - use test && python-any-r1_pkg_setup
639 -}
640 -
641 -multilib_src_configure() {
642 - ECONF_SOURCE="${S}" econf \
643 - --disable-octave \
644 - --enable-gcc-pipe \
645 - --enable-gcc-opt \
646 - $(use_enable static-libs static) \
647 - $(use_enable !minimal external-libs) \
648 - $(multilib_native_enable full-suite) \
649 - $(multilib_native_use_enable alsa) \
650 - $(multilib_native_use_enable sqlite)
651 -}
652 -
653 -multilib_src_install_all() {
654 - einstalldocs
655 -
656 - # package provides .pc files
657 - find "${D}" -name '*.la' -delete || die
658 -}
659
660 diff --git a/media-libs/libsndfile/libsndfile-1.0.29.ebuild b/media-libs/libsndfile/libsndfile-1.0.29.ebuild
661 deleted file mode 100644
662 index 37cae9590d1..00000000000
663 --- a/media-libs/libsndfile/libsndfile-1.0.29.ebuild
664 +++ /dev/null
665 @@ -1,79 +0,0 @@
666 -# Copyright 1999-2020 Gentoo Authors
667 -# Distributed under the terms of the GNU General Public License v2
668 -
669 -EAPI=7
670 -
671 -PYTHON_COMPAT=( python3_{6,7,8} pypy3 )
672 -
673 -if [[ ${PV} == *9999 ]]; then
674 - inherit autotools git-r3
675 - EGIT_REPO_URI="https://github.com/erikd/libsndfile.git"
676 -else
677 - SRC_URI="https://github.com/erikd/libsndfile/releases/download/v${PV}/${P}.tar.bz2"
678 - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
679 -fi
680 -inherit python-any-r1 multilib-minimal
681 -
682 -DESCRIPTION="C library for reading and writing files containing sampled sound"
683 -HOMEPAGE="http://www.mega-nerd.com/libsndfile"
684 -
685 -LICENSE="LGPL-2.1"
686 -SLOT="0"
687 -IUSE="alsa minimal sqlite static-libs test"
688 -RESTRICT="!test? ( test )"
689 -
690 -RDEPEND="
691 - !minimal? (
692 - >=media-libs/flac-1.2.1-r5:=[${MULTILIB_USEDEP}]
693 - >=media-libs/libogg-1.3.0:=[${MULTILIB_USEDEP}]
694 - >=media-libs/libvorbis-1.3.3-r1:=[${MULTILIB_USEDEP}]
695 - >=media-libs/opus-1.1:=[${MULTILIB_USEDEP}]
696 - )
697 - alsa? ( media-libs/alsa-lib:= )
698 - sqlite? ( >=dev-db/sqlite-3.2 )"
699 -DEPEND="${RDEPEND}"
700 -BDEPEND="
701 - virtual/pkgconfig
702 - test? ( ${PYTHON_DEPS} )"
703 -if [[ ${PV} == *9999 ]]; then
704 - BDEPEND+="
705 - ${PYTHON_DEPS}
706 - sys-devel/autogen
707 - "
708 -fi
709 -
710 -PATCHES=(
711 - # bug 719020: backported, remove on version bump
712 - "${FILESDIR}"/${P}-pointer-aliasing.patch
713 -)
714 -
715 -pkg_setup() {
716 - if use test || [[ ${PV} == *9999 ]]; then
717 - python-any-r1_pkg_setup
718 - fi
719 -}
720 -
721 -src_prepare() {
722 - default
723 -
724 - [[ ${PV} == *9999 ]] && eautoreconf
725 -}
726 -
727 -multilib_src_configure() {
728 - ECONF_SOURCE="${S}" econf \
729 - --disable-octave \
730 - --disable-werror \
731 - $(use_enable static-libs static) \
732 - $(use_enable !minimal external-libs) \
733 - $(multilib_native_enable full-suite) \
734 - $(multilib_native_use_enable alsa) \
735 - $(multilib_native_use_enable sqlite) \
736 - PYTHON="${EPYTHON}"
737 -}
738 -
739 -multilib_src_install_all() {
740 - einstalldocs
741 -
742 - # package provides .pc files
743 - find "${D}" -name '*.la' -delete || die
744 -}