* [gentoo-commits] repo/gentoo:master commit in: media-libs/audiofile/, media-libs/audiofile/files/
@ 2016-10-09 7:47 Pacho Ramos
0 siblings, 0 replies; 6+ messages in thread
From: Pacho Ramos @ 2016-10-09 7:47 UTC (permalink / raw
To: gentoo-commits
commit: 9fd38fc545926124b291549549d6beb3c246cab1
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 9 07:19:35 2016 +0000
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Oct 9 07:46:26 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9fd38fc5
media-libs/audiofile: Drop old
Package-Manager: portage-2.3.1
media-libs/audiofile/Manifest | 1 -
media-libs/audiofile/audiofile-0.3.5.ebuild | 45 -----------
.../files/audiofile-0.3.5-system-gtest.patch | 94 ----------------------
3 files changed, 140 deletions(-)
diff --git a/media-libs/audiofile/Manifest b/media-libs/audiofile/Manifest
index ed6aae6..bd9b21e 100644
--- a/media-libs/audiofile/Manifest
+++ b/media-libs/audiofile/Manifest
@@ -1,2 +1 @@
-DIST audiofile-0.3.5.tar.xz 496648 SHA256 335502324b9bffb2528f34352a2c5abcc2c6108be36600b2e547708564eae19a SHA512 199c5879448efd8aa004f09c7a79bd0f4f24fc5391c18bec4d544383548c809b775a80eeb91cfcdb116756e08781d99e7554f5a7b451292bd681545b7c584548 WHIRLPOOL 898fc50c7e31f3abc4667e5959e25f7bf8f14a9778dd04bb10f98e5dd331beb28cef9a2427141539dc7e830a7f35c7d42145009ba41254e5e821c6287bc5079c
DIST audiofile-0.3.6.tar.xz 530760 SHA256 ea2449ad3f201ec590d811db9da6d02ffc5e87a677d06b92ab15363d8cb59782 SHA512 f3b58210a4ef3ac8e08a368a78e0f4b8345456d084bdebfd20d1631fa75e562aa58d31863a502b6ff18178327aa5b87403566bd34566fa52bdfc8e01de400bcb WHIRLPOOL 4e750d9071e2ebfaef033647655fea7ecd2bad3751b74c4e16bd702099f01d731e57d0473379faac8ff1f66c4e5ffeadbf41551e829294fa09fe201354270221
diff --git a/media-libs/audiofile/audiofile-0.3.5.ebuild b/media-libs/audiofile/audiofile-0.3.5.ebuild
deleted file mode 100644
index fc03d5a..00000000
--- a/media-libs/audiofile/audiofile-0.3.5.ebuild
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit autotools eutils gnome.org
-
-DESCRIPTION="An elegant API for accessing audio files"
-HOMEPAGE="http://www.68k.org/~michael/audiofile/"
-
-LICENSE="GPL-2 LGPL-2"
-SLOT="0/1" # subslot = soname major version
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
-IUSE="static-libs test"
-
-RDEPEND=""
-DEPEND="test? ( dev-cpp/gtest )"
-
-DOCS=( ACKNOWLEDGEMENTS AUTHORS ChangeLog NEWS NOTES README TODO )
-
-src_prepare() {
- # don't build examples wrt #455978
- sed -i '/^SUBDIRS/s: examples::' Makefile.am || die
-
- epatch "${FILESDIR}"/${P}-system-gtest.patch
-
- eautoreconf
-}
-
-src_configure() {
- econf \
- $(use_enable static-libs static) \
- --disable-werror \
- --enable-largefile
-}
-
-src_test() {
- emake -C test check
-}
-
-src_install() {
- default
- prune_libtool_files
-}
diff --git a/media-libs/audiofile/files/audiofile-0.3.5-system-gtest.patch b/media-libs/audiofile/files/audiofile-0.3.5-system-gtest.patch
deleted file mode 100644
index 3093d1e..00000000
--- a/media-libs/audiofile/files/audiofile-0.3.5-system-gtest.patch
+++ /dev/null
@@ -1,94 +0,0 @@
---- audiofile-0.3.5/test/Makefile.am
-+++ audiofile-0.3.5/test/Makefile.am
-@@ -53,70 +53,68 @@
-
- DEPENDENCIES = $(LIBAUDIOFILE)
-
--LIBGTEST = ../gtest/libgtest.la
--
- ADPCM_SOURCES = ADPCM.cpp TestUtilities.cpp TestUtilities.h
--ADPCM_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+ADPCM_LDADD = -lgtest $(LIBAUDIOFILE)
-
- AES_SOURCES = AES.cpp TestUtilities.cpp TestUtilities.h
--AES_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+AES_LDADD = -lgtest $(LIBAUDIOFILE)
-
- ChannelMatrix_SOURCES = ChannelMatrix.cpp TestUtilities.cpp TestUtilities.h
--ChannelMatrix_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+ChannelMatrix_LDADD = -lgtest $(LIBAUDIOFILE)
-
- Error_SOURCES = Error.cpp TestUtilities.cpp TestUtilities.h
--Error_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+Error_LDADD = -lgtest $(LIBAUDIOFILE)
-
- FloatToInt_SOURCES = FloatToInt.cpp TestUtilities.cpp TestUtilities.h
--FloatToInt_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+FloatToInt_LDADD = -lgtest $(LIBAUDIOFILE)
-
- IntToFloat_SOURCES = IntToFloat.cpp TestUtilities.cpp TestUtilities.h
--IntToFloat_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+IntToFloat_LDADD = -lgtest $(LIBAUDIOFILE)
-
- InvalidCompressionFormat_SOURCES = InvalidCompressionFormat.cpp TestUtilities.cpp TestUtilities.h
--InvalidCompressionFormat_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+InvalidCompressionFormat_LDADD = -lgtest $(LIBAUDIOFILE)
-
- InvalidSampleFormat_SOURCES = InvalidSampleFormat.cpp TestUtilities.cpp TestUtilities.h
--InvalidSampleFormat_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+InvalidSampleFormat_LDADD = -lgtest $(LIBAUDIOFILE)
-
- Large_SOURCES = Large.cpp TestUtilities.cpp TestUtilities.h
--Large_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+Large_LDADD = -lgtest $(LIBAUDIOFILE)
-
- Loop_SOURCES = Loop.cpp TestUtilities.cpp TestUtilities.h
--Loop_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+Loop_LDADD = -lgtest $(LIBAUDIOFILE)
-
- Marker_SOURCES = Marker.cpp TestUtilities.cpp TestUtilities.h
--Marker_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+Marker_LDADD = -lgtest $(LIBAUDIOFILE)
-
- Miscellaneous_SOURCES = Miscellaneous.cpp TestUtilities.cpp TestUtilities.h
--Miscellaneous_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+Miscellaneous_LDADD = -lgtest $(LIBAUDIOFILE)
-
- NeXT_SOURCES = NeXT.cpp TestUtilities.cpp TestUtilities.h
--NeXT_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+NeXT_LDADD = -lgtest $(LIBAUDIOFILE)
-
- PCMData_SOURCES = PCMData.cpp TestUtilities.cpp TestUtilities.h
--PCMData_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+PCMData_LDADD = -lgtest $(LIBAUDIOFILE)
-
- PCMMapping_SOURCES = PCMMapping.cpp TestUtilities.cpp TestUtilities.h
--PCMMapping_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+PCMMapping_LDADD = -lgtest $(LIBAUDIOFILE)
-
- Pipe_SOURCES = Pipe.cpp TestUtilities.cpp TestUtilities.h
--Pipe_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+Pipe_LDADD = -lgtest $(LIBAUDIOFILE)
-
- Query_SOURCES = Query.cpp TestUtilities.cpp TestUtilities.h
--Query_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+Query_LDADD = -lgtest $(LIBAUDIOFILE)
-
- SampleFormat_SOURCES = SampleFormat.cpp TestUtilities.cpp TestUtilities.h
--SampleFormat_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+SampleFormat_LDADD = -lgtest $(LIBAUDIOFILE)
-
- Seek_SOURCES = Seek.cpp TestUtilities.cpp TestUtilities.h
--Seek_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+Seek_LDADD = -lgtest $(LIBAUDIOFILE)
-
- Sign_SOURCES = Sign.cpp TestUtilities.cpp TestUtilities.h
--Sign_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+Sign_LDADD = -lgtest $(LIBAUDIOFILE)
-
- VirtualFile_SOURCES = VirtualFile.cpp TestUtilities.cpp TestUtilities.h
--VirtualFile_LDADD = $(LIBGTEST) $(LIBAUDIOFILE)
-+VirtualFile_LDADD = -lgtest $(LIBAUDIOFILE)
-
- floatto24_SOURCES = floatto24.c TestUtilities.cpp TestUtilities.h
-
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/audiofile/, media-libs/audiofile/files/
@ 2017-01-21 18:18 Alexis Ballier
0 siblings, 0 replies; 6+ messages in thread
From: Alexis Ballier @ 2017-01-21 18:18 UTC (permalink / raw
To: gentoo-commits
commit: d95fcc8b14612f4a91ab015436e4ea709ba1a7e4
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 21 17:03:07 2017 +0000
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Sat Jan 21 18:14:45 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d95fcc8b
media-libs/audiofile: Add patch for CVE-2015-7747 (bug #562886)
Package-Manager: Portage-2.3.3, Repoman-2.3.1
media-libs/audiofile/audiofile-0.3.6-r3.ebuild | 51 +++++++
.../files/audiofile-0.3.6-CVE-2015-7747.patch | 156 +++++++++++++++++++++
2 files changed, 207 insertions(+)
diff --git a/media-libs/audiofile/audiofile-0.3.6-r3.ebuild b/media-libs/audiofile/audiofile-0.3.6-r3.ebuild
new file mode 100644
index 00000000..4707a47
--- /dev/null
+++ b/media-libs/audiofile/audiofile-0.3.6-r3.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools gnome.org multilib-minimal
+
+DESCRIPTION="An elegant API for accessing audio files"
+HOMEPAGE="http://www.68k.org/~michael/audiofile/"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0/1" # subslot = soname major version
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc \
+ ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux \
+ ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE="flac static-libs test"
+
+RDEPEND="flac? ( >=media-libs/flac-1.2.1[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ test? ( dev-cpp/gtest[${MULTILIB_USEDEP}] )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.3.6-gcc6-build-fixes.patch
+ "${FILESDIR}"/${PN}-0.3.6-system-gtest.patch
+ "${FILESDIR}"/${PN}-0.3.6-CVE-2015-7747.patch
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --enable-largefile
+ --disable-werror
+ --disable-examples
+ $(use_enable flac)
+ $(use_enable static-libs static)
+ )
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
+}
+
+multilib_src_install_all() {
+ einstalldocs
+
+ # package provides .pc file
+ find "${D}" -name '*.la' -delete || die
+}
diff --git a/media-libs/audiofile/files/audiofile-0.3.6-CVE-2015-7747.patch b/media-libs/audiofile/files/audiofile-0.3.6-CVE-2015-7747.patch
new file mode 100644
index 00000000..3325639
--- /dev/null
+++ b/media-libs/audiofile/files/audiofile-0.3.6-CVE-2015-7747.patch
@@ -0,0 +1,156 @@
+Description: fix buffer overflow when changing both sample format and
+ number of channels
+Origin: https://github.com/mpruett/audiofile/pull/25
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/audiofile/+bug/1502721
+Bug-Debian: https://bugs.debian.org/801102
+
+--- a/libaudiofile/modules/ModuleState.cpp
++++ b/libaudiofile/modules/ModuleState.cpp
+@@ -402,7 +402,7 @@ status ModuleState::arrange(AFfilehandle
+ addModule(new Transform(outfc, in.pcm, out.pcm));
+
+ if (in.channelCount != out.channelCount)
+- addModule(new ApplyChannelMatrix(infc, isReading,
++ addModule(new ApplyChannelMatrix(outfc, isReading,
+ in.channelCount, out.channelCount,
+ in.pcm.minClip, in.pcm.maxClip,
+ track->channelMatrix));
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -26,6 +26,7 @@ TESTS = \
+ VirtualFile \
+ floatto24 \
+ query2 \
++ sixteen-stereo-to-eight-mono \
+ sixteen-to-eight \
+ testchannelmatrix \
+ testdouble \
+@@ -139,6 +140,7 @@ printmarkers_SOURCES = printmarkers.c
+ printmarkers_LDADD = $(LIBAUDIOFILE) -lm
+
+ sixteen_to_eight_SOURCES = sixteen-to-eight.c TestUtilities.cpp TestUtilities.h
++sixteen_stereo_to_eight_mono_SOURCES = sixteen-stereo-to-eight-mono.c TestUtilities.cpp TestUtilities.h
+
+ testchannelmatrix_SOURCES = testchannelmatrix.c TestUtilities.cpp TestUtilities.h
+
+--- /dev/null
++++ b/test/sixteen-stereo-to-eight-mono.c
+@@ -0,0 +1,118 @@
++/*
++ Audio File Library
++
++ Copyright 2000, Silicon Graphics, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with this program; if not, write to the Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++*/
++
++/*
++ sixteen-stereo-to-eight-mono.c
++
++ This program tests the conversion from 2-channel 16-bit integers to
++ 1-channel 8-bit integers.
++*/
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
++#include <stdint.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
++#include <limits.h>
++
++#include <audiofile.h>
++
++#include "TestUtilities.h"
++
++int main (int argc, char **argv)
++{
++ AFfilehandle file;
++ AFfilesetup setup;
++ int16_t frames16[] = {14298, 392, 3923, -683, 958, -1921};
++ int8_t frames8[] = {28, 6, -2};
++ int i, frameCount = 3;
++ int8_t byte;
++ AFframecount result;
++
++ setup = afNewFileSetup();
++
++ afInitFileFormat(setup, AF_FILE_WAVE);
++
++ afInitSampleFormat(setup, AF_DEFAULT_TRACK, AF_SAMPFMT_TWOSCOMP, 16);
++ afInitChannels(setup, AF_DEFAULT_TRACK, 2);
++
++ char *testFileName;
++ if (!createTemporaryFile("sixteen-to-eight", &testFileName))
++ {
++ fprintf(stderr, "Could not create temporary file.\n");
++ exit(EXIT_FAILURE);
++ }
++
++ file = afOpenFile(testFileName, "w", setup);
++ if (file == AF_NULL_FILEHANDLE)
++ {
++ fprintf(stderr, "could not open file for writing\n");
++ exit(EXIT_FAILURE);
++ }
++
++ afFreeFileSetup(setup);
++
++ afWriteFrames(file, AF_DEFAULT_TRACK, frames16, frameCount);
++
++ afCloseFile(file);
++
++ file = afOpenFile(testFileName, "r", AF_NULL_FILESETUP);
++ if (file == AF_NULL_FILEHANDLE)
++ {
++ fprintf(stderr, "could not open file for reading\n");
++ exit(EXIT_FAILURE);
++ }
++
++ afSetVirtualSampleFormat(file, AF_DEFAULT_TRACK, AF_SAMPFMT_TWOSCOMP, 8);
++ afSetVirtualChannels(file, AF_DEFAULT_TRACK, 1);
++
++ for (i=0; i<frameCount; i++)
++ {
++ /* Read one frame. */
++ result = afReadFrames(file, AF_DEFAULT_TRACK, &byte, 1);
++
++ if (result != 1)
++ break;
++
++ /* Compare the byte read with its precalculated value. */
++ if (memcmp(&byte, &frames8[i], 1) != 0)
++ {
++ printf("error\n");
++ printf("expected %d, got %d\n", frames8[i], byte);
++ exit(EXIT_FAILURE);
++ }
++ else
++ {
++#ifdef DEBUG
++ printf("got what was expected: %d\n", byte);
++#endif
++ }
++ }
++
++ afCloseFile(file);
++ unlink(testFileName);
++ free(testFileName);
++
++ exit(EXIT_SUCCESS);
++}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/audiofile/, media-libs/audiofile/files/
@ 2017-06-08 18:09 Sergei Trofimovich
0 siblings, 0 replies; 6+ messages in thread
From: Sergei Trofimovich @ 2017-06-08 18:09 UTC (permalink / raw
To: gentoo-commits
commit: 8b9209b71f8b151cf6dfdd20539dfdcd1bf31b63
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 8 18:05:54 2017 +0000
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu Jun 8 18:08:42 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b9209b7
media-libs/audiofile: fix mingw32 build
Pick upstream patch for s/bzero()/memset()/
Package-Manager: Portage-2.3.6, Repoman-2.3.2
media-libs/audiofile/audiofile-0.3.6-r3.ebuild | 1 +
.../audiofile/files/audiofile-0.3.6-mingw32.patch | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/media-libs/audiofile/audiofile-0.3.6-r3.ebuild b/media-libs/audiofile/audiofile-0.3.6-r3.ebuild
index 036e5f2b043..c61e55f0a42 100644
--- a/media-libs/audiofile/audiofile-0.3.6-r3.ebuild
+++ b/media-libs/audiofile/audiofile-0.3.6-r3.ebuild
@@ -22,6 +22,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-0.3.6-gcc6-build-fixes.patch
"${FILESDIR}"/${PN}-0.3.6-system-gtest.patch
"${FILESDIR}"/${PN}-0.3.6-CVE-2015-7747.patch
+ "${FILESDIR}"/${PN}-0.3.6-mingw32.patch
)
src_prepare() {
diff --git a/media-libs/audiofile/files/audiofile-0.3.6-mingw32.patch b/media-libs/audiofile/files/audiofile-0.3.6-mingw32.patch
new file mode 100644
index 00000000000..8ed7cb0534f
--- /dev/null
+++ b/media-libs/audiofile/files/audiofile-0.3.6-mingw32.patch
@@ -0,0 +1,20 @@
+bzero() is a POSIX-specific fuinction.
+x86_64-w64-mingw32-gcc does not provide one.
+
+https://github.com/mpruett/audiofile/commit/d9363a5d16af4ce55eb35c5aad9ca19bb9c53cbe
+
+commit d9363a5d16af4ce55eb35c5aad9ca19bb9c53cbe
+Author: Daniel Verkamp <daniel@drv.nu>
+Date: Mon Jul 4 21:57:44 2016 -0500
+
+ Replace bzero() with memset().
+
+diff --git a/libaudiofile/CAF.cpp b/libaudiofile/CAF.cpp
+index d2b62ea..5752117 100644
+--- a/libaudiofile/CAF.cpp
++++ b/libaudiofile/CAF.cpp
+@@ -720,3 +720,3 @@ void CAFFile::initALACCompressionParams()
+ m_codecData = new Buffer(codecDataSize);
+- bzero(m_codecData->data(), m_codecData->size());
++ memset(m_codecData->data(), 0, m_codecData->size());
+
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/audiofile/, media-libs/audiofile/files/
@ 2020-07-19 18:28 Sam James
0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2020-07-19 18:28 UTC (permalink / raw
To: gentoo-commits
commit: f2bb2dc35eccffb4adbcc7f4057b6e2ea458d1b8
Author: John Helmert III <jchelmert3 <AT> posteo <DOT> net>
AuthorDate: Sun Jul 19 18:28:17 2020 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 19 18:28:17 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2bb2dc3
media-libs/audiofile: Add security patches
Dropping the system-gtest patch is necessary to make the tests run, as
mentioned here: https://bugs.gentoo.org/680482#c8
The three closed bugs are reported test failures fixed by dropping the
aforementioned patch and a slight repair of src_test. Because we're not
using system gtest anymore, we can drop the test dependency on
dev-cpp/gtest, and by extension the IUSE=test boilerplate.
Bug: https://bugs.gentoo.org/614046
Bug: https://bugs.gentoo.org/687766
Closes: https://bugs.gentoo.org/680482
Closes: https://bugs.gentoo.org/715192
Closes: https://bugs.gentoo.org/720836
Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: John Helmert III <jchelmert3 <AT> posteo.net>
Closes: https://github.com/gentoo/gentoo/pull/16141
Signed-off-by: Sam James <sam <AT> gentoo.org>
media-libs/audiofile/audiofile-0.3.6-r4.ebuild | 55 +++
.../files/audiofile-0.3.6-CVE-2017-68xx.patch | 379 +++++++++++++++++++++
...ofile-0.3.6-CVE-2018-13440-CVE-2018-17095.patch | 82 +++++
3 files changed, 516 insertions(+)
diff --git a/media-libs/audiofile/audiofile-0.3.6-r4.ebuild b/media-libs/audiofile/audiofile-0.3.6-r4.ebuild
new file mode 100644
index 00000000000..402fd444e5b
--- /dev/null
+++ b/media-libs/audiofile/audiofile-0.3.6-r4.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools gnome.org multilib-minimal
+
+DESCRIPTION="An elegant API for accessing audio files"
+HOMEPAGE="http://www.68k.org/~michael/audiofile/"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0/1" # subslot = soname major version
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE="flac"
+
+RDEPEND="flac? ( >=media-libs/flac-1.2.1[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.3.6-gcc6-build-fixes.patch
+ "${FILESDIR}"/${PN}-0.3.6-CVE-2015-7747.patch
+ "${FILESDIR}"/${PN}-0.3.6-mingw32.patch
+ "${FILESDIR}"/${PN}-0.3.6-CVE-2017-68xx.patch
+ "${FILESDIR}"/${PN}-0.3.6-CVE-2018-13440-CVE-2018-17095.patch
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+multilib_src_configure() {
+ # Tests depend on statically compiled binaries to work, so we'll have to
+ # delete them later rather than not compile them at all
+ local myconf=(
+ --enable-largefile
+ --disable-werror
+ --disable-examples
+ $(use_enable flac)
+ )
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
+}
+
+multilib_src_test() {
+ emake check
+}
+
+multilib_src_install_all() {
+ einstalldocs
+
+ # package provides .pc file
+ find "${ED}" -name '*.la' -delete || die
+ find "${ED}" -name '*.a' -delete || die
+}
diff --git a/media-libs/audiofile/files/audiofile-0.3.6-CVE-2017-68xx.patch b/media-libs/audiofile/files/audiofile-0.3.6-CVE-2017-68xx.patch
new file mode 100644
index 00000000000..99473d7e22e
--- /dev/null
+++ b/media-libs/audiofile/files/audiofile-0.3.6-CVE-2017-68xx.patch
@@ -0,0 +1,379 @@
+Debian patchset for CVE-2017-68{29..38} and two other vulnerabilities:
+
+https://salsa.debian.org/multimedia-team/audiofile/commit/242f019#a064ca928f514268d4bae308e2e3990138341b76:
+
+* Address several vulnerabilities (Closes: #857651)
+ - Always check the number of coefficients (CVE-2017-6827 CVE-2017-6828
+ CVE-2017-6832 CVE-2017-6833 CVE-2017-6835 CVE-2017-6837)
+ - clamp index values to fix index overflow in IMA.cpp (CVE-2017-6829)
+ - Check for multiplication overflow in sfconvert (CVE-2017-6830
+ CVE-2017-6834 CVE-2017-6836 CVE-2017-6838)
+ - Actually fail when error occurs in parseFormat (CVE-2017-6831)
+ - Check for multiplication overflow in MSADPCM decodeSample
+ (CVE-2017-6839)
+* Fix signature of multiplyCheckOverflow. It returns a bool, not an int
+* Check for division by zero in BlockCodec::runPull
+
+
+From a2e9eab8ea87c4ffc494d839ebb4ea145eb9f2e6 Mon Sep 17 00:00:00 2001
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Mon, 6 Mar 2017 18:59:26 +0100
+Subject: [PATCH] Actually fail when error occurs in parseFormat
+
+When there's an unsupported number of bits per sample or an invalid
+number of samples per block, don't only print an error message using
+the error handler, but actually stop parsing the file.
+
+This fixes #35 (also reported at
+https://bugzilla.opensuse.org/show_bug.cgi?id=1026983 and
+https://blogs.gentoo.org/ago/2017/02/20/audiofile-heap-based-buffer-overflow-in-imadecodeblockwave-ima-cpp/
+)
+---
+ libaudiofile/WAVE.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libaudiofile/WAVE.cpp b/libaudiofile/WAVE.cpp
+index 0e81cf7..d762249 100644
+--- a/libaudiofile/WAVE.cpp
++++ b/libaudiofile/WAVE.cpp
+@@ -326,6 +326,7 @@ status WAVEFile::parseFormat(const Tag &id, uint32_t size)
+ {
+ _af_error(AF_BAD_NOT_IMPLEMENTED,
+ "IMA ADPCM compression supports only 4 bits per sample");
++ return AF_FAIL;
+ }
+
+ int bytesPerBlock = (samplesPerBlock + 14) / 8 * 4 * channelCount;
+@@ -333,6 +334,7 @@ status WAVEFile::parseFormat(const Tag &id, uint32_t size)
+ {
+ _af_error(AF_BAD_CODEC_CONFIG,
+ "Invalid samples per block for IMA ADPCM compression");
++ return AF_FAIL;
+ }
+
+ track->f.sampleWidth = 16;
+--
+2.11.0
+
+From c48e4c6503f7dabd41f11d4c9c7b7f8960e7f2c0 Mon Sep 17 00:00:00 2001
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Mon, 6 Mar 2017 12:51:22 +0100
+Subject: [PATCH] Always check the number of coefficients
+
+When building the library with NDEBUG, asserts are eliminated
+so it's better to always check that the number of coefficients
+is inside the array range.
+
+This fixes the 00191-audiofile-indexoob issue in #41
+---
+ libaudiofile/WAVE.cpp | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/libaudiofile/WAVE.cpp b/libaudiofile/WAVE.cpp
+index 0e81cf7..61f9541 100644
+--- a/libaudiofile/WAVE.cpp
++++ b/libaudiofile/WAVE.cpp
+@@ -281,6 +281,12 @@ status WAVEFile::parseFormat(const Tag &id, uint32_t size)
+
+ /* numCoefficients should be at least 7. */
+ assert(numCoefficients >= 7 && numCoefficients <= 255);
++ if (numCoefficients < 7 || numCoefficients > 255)
++ {
++ _af_error(AF_BAD_HEADER,
++ "Bad number of coefficients");
++ return AF_FAIL;
++ }
+
+ m_msadpcmNumCoefficients = numCoefficients;
+
+--
+2.11.0
+
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Thu, 9 Mar 2017 10:21:18 +0100
+Subject: Check for division by zero in BlockCodec::runPull
+
+---
+ libaudiofile/modules/BlockCodec.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libaudiofile/modules/BlockCodec.cpp b/libaudiofile/modules/BlockCodec.cpp
+index 4731be1..eb2fb4d 100644
+--- a/libaudiofile/modules/BlockCodec.cpp
++++ b/libaudiofile/modules/BlockCodec.cpp
+@@ -47,7 +47,7 @@ void BlockCodec::runPull()
+
+ // Read the compressed data.
+ ssize_t bytesRead = read(m_inChunk->buffer, m_bytesPerPacket * blockCount);
+- int blocksRead = bytesRead >= 0 ? bytesRead / m_bytesPerPacket : 0;
++ int blocksRead = (bytesRead >= 0 && m_bytesPerPacket > 0) ? bytesRead / m_bytesPerPacket : 0;
+
+ // Decompress into m_outChunk.
+ for (int i=0; i<blocksRead; i++)
+From beacc44eb8cdf6d58717ec1a5103c5141f1b37f9 Mon Sep 17 00:00:00 2001
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Mon, 6 Mar 2017 13:43:53 +0100
+Subject: [PATCH] Check for multiplication overflow in MSADPCM decodeSample
+
+Check for multiplication overflow (using __builtin_mul_overflow
+if available) in MSADPCM.cpp decodeSample and return an empty
+decoded block if an error occurs.
+
+This fixes the 00193-audiofile-signintoverflow-MSADPCM case of #41
+---
+ libaudiofile/modules/BlockCodec.cpp | 5 ++--
+ libaudiofile/modules/MSADPCM.cpp | 47 +++++++++++++++++++++++++++++++++----
+ 2 files changed, 46 insertions(+), 6 deletions(-)
+
+diff --git a/libaudiofile/modules/BlockCodec.cpp b/libaudiofile/modules/BlockCodec.cpp
+index 45925e8..4731be1 100644
+--- a/libaudiofile/modules/BlockCodec.cpp
++++ b/libaudiofile/modules/BlockCodec.cpp
+@@ -52,8 +52,9 @@ void BlockCodec::runPull()
+ // Decompress into m_outChunk.
+ for (int i=0; i<blocksRead; i++)
+ {
+- decodeBlock(static_cast<const uint8_t *>(m_inChunk->buffer) + i * m_bytesPerPacket,
+- static_cast<int16_t *>(m_outChunk->buffer) + i * m_framesPerPacket * m_track->f.channelCount);
++ if (decodeBlock(static_cast<const uint8_t *>(m_inChunk->buffer) + i * m_bytesPerPacket,
++ static_cast<int16_t *>(m_outChunk->buffer) + i * m_framesPerPacket * m_track->f.channelCount)==0)
++ break;
+
+ framesRead += m_framesPerPacket;
+ }
+diff --git a/libaudiofile/modules/MSADPCM.cpp b/libaudiofile/modules/MSADPCM.cpp
+index 8ea3c85..ef9c38c 100644
+--- a/libaudiofile/modules/MSADPCM.cpp
++++ b/libaudiofile/modules/MSADPCM.cpp
+@@ -101,24 +101,60 @@ static const int16_t adaptationTable[] =
+ 768, 614, 512, 409, 307, 230, 230, 230
+ };
+
++int firstBitSet(int x)
++{
++ int position=0;
++ while (x!=0)
++ {
++ x>>=1;
++ ++position;
++ }
++ return position;
++}
++
++#ifndef __has_builtin
++#define __has_builtin(x) 0
++#endif
++
++int multiplyCheckOverflow(int a, int b, int *result)
++{
++#if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow))
++ return __builtin_mul_overflow(a, b, result);
++#else
++ if (firstBitSet(a)+firstBitSet(b)>31) // int is signed, so we can't use 32 bits
++ return true;
++ *result = a * b;
++ return false;
++#endif
++}
++
++
+ // Compute a linear PCM value from the given differential coded value.
+ static int16_t decodeSample(ms_adpcm_state &state,
+- uint8_t code, const int16_t *coefficient)
++ uint8_t code, const int16_t *coefficient, bool *ok=NULL)
+ {
+ int linearSample = (state.sample1 * coefficient[0] +
+ state.sample2 * coefficient[1]) >> 8;
++ int delta;
+
+ linearSample += ((code & 0x08) ? (code - 0x10) : code) * state.delta;
+
+ linearSample = clamp(linearSample, MIN_INT16, MAX_INT16);
+
+- int delta = (state.delta * adaptationTable[code]) >> 8;
++ if (multiplyCheckOverflow(state.delta, adaptationTable[code], &delta))
++ {
++ if (ok) *ok=false;
++ _af_error(AF_BAD_COMPRESSION, "Error decoding sample");
++ return 0;
++ }
++ delta >>= 8;
+ if (delta < 16)
+ delta = 16;
+
+ state.delta = delta;
+ state.sample2 = state.sample1;
+ state.sample1 = linearSample;
++ if (ok) *ok=true;
+
+ return static_cast<int16_t>(linearSample);
+ }
+@@ -212,13 +248,16 @@ int MSADPCM::decodeBlock(const uint8_t *encoded, int16_t *decoded)
+ {
+ uint8_t code;
+ int16_t newSample;
++ bool ok;
+
+ code = *encoded >> 4;
+- newSample = decodeSample(*state[0], code, coefficient[0]);
++ newSample = decodeSample(*state[0], code, coefficient[0], &ok);
++ if (!ok) return 0;
+ *decoded++ = newSample;
+
+ code = *encoded & 0x0f;
+- newSample = decodeSample(*state[1], code, coefficient[1]);
++ newSample = decodeSample(*state[1], code, coefficient[1], &ok);
++ if (!ok) return 0;
+ *decoded++ = newSample;
+
+ encoded++;
+--
+2.11.0
+
+From 7d65f89defb092b63bcbc5d98349fb222ca73b3c Mon Sep 17 00:00:00 2001
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Mon, 6 Mar 2017 13:54:52 +0100
+Subject: [PATCH] Check for multiplication overflow in sfconvert
+
+Checks that a multiplication doesn't overflow when
+calculating the buffer size, and if it overflows,
+reduce the buffer size instead of failing.
+
+This fixes the 00192-audiofile-signintoverflow-sfconvert case
+in #41
+---
+ sfcommands/sfconvert.c | 34 ++++++++++++++++++++++++++++++++--
+ 1 file changed, 32 insertions(+), 2 deletions(-)
+
+diff --git a/sfcommands/sfconvert.c b/sfcommands/sfconvert.c
+index 80a1bc4..970a3e4 100644
+--- a/sfcommands/sfconvert.c
++++ b/sfcommands/sfconvert.c
+@@ -45,6 +45,33 @@ void printusage (void);
+ void usageerror (void);
+ bool copyaudiodata (AFfilehandle infile, AFfilehandle outfile, int trackid);
+
++int firstBitSet(int x)
++{
++ int position=0;
++ while (x!=0)
++ {
++ x>>=1;
++ ++position;
++ }
++ return position;
++}
++
++#ifndef __has_builtin
++#define __has_builtin(x) 0
++#endif
++
++int multiplyCheckOverflow(int a, int b, int *result)
++{
++#if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow))
++ return __builtin_mul_overflow(a, b, result);
++#else
++ if (firstBitSet(a)+firstBitSet(b)>31) // int is signed, so we can't use 32 bits
++ return true;
++ *result = a * b;
++ return false;
++#endif
++}
++
+ int main (int argc, char **argv)
+ {
+ if (argc == 2)
+@@ -323,8 +350,11 @@ bool copyaudiodata (AFfilehandle infile, AFfilehandle outfile, int trackid)
+ {
+ int frameSize = afGetVirtualFrameSize(infile, trackid, 1);
+
+- const int kBufferFrameCount = 65536;
+- void *buffer = malloc(kBufferFrameCount * frameSize);
++ int kBufferFrameCount = 65536;
++ int bufferSize;
++ while (multiplyCheckOverflow(kBufferFrameCount, frameSize, &bufferSize))
++ kBufferFrameCount /= 2;
++ void *buffer = malloc(bufferSize);
+
+ AFframecount totalFrames = afGetFrameCount(infile, AF_DEFAULT_TRACK);
+ AFframecount totalFramesWritten = 0;
+--
+2.11.0
+
+From 25eb00ce913452c2e614548d7df93070bf0d066f Mon Sep 17 00:00:00 2001
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Mon, 6 Mar 2017 18:02:31 +0100
+Subject: [PATCH] clamp index values to fix index overflow in IMA.cpp
+
+This fixes #33
+(also reported at https://bugzilla.opensuse.org/show_bug.cgi?id=1026981
+and https://blogs.gentoo.org/ago/2017/02/20/audiofile-global-buffer-overflow-in-decodesample-ima-cpp/)
+---
+ libaudiofile/modules/IMA.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libaudiofile/modules/IMA.cpp b/libaudiofile/modules/IMA.cpp
+index 7476d44..df4aad6 100644
+--- a/libaudiofile/modules/IMA.cpp
++++ b/libaudiofile/modules/IMA.cpp
+@@ -169,7 +169,7 @@ int IMA::decodeBlockWAVE(const uint8_t *encoded, int16_t *decoded)
+ if (encoded[1] & 0x80)
+ m_adpcmState[c].previousValue -= 0x10000;
+
+- m_adpcmState[c].index = encoded[2];
++ m_adpcmState[c].index = clamp(encoded[2], 0, 88);
+
+ *decoded++ = m_adpcmState[c].previousValue;
+
+@@ -210,7 +210,7 @@ int IMA::decodeBlockQT(const uint8_t *encoded, int16_t *decoded)
+ predictor -= 0x10000;
+
+ state.previousValue = clamp(predictor, MIN_INT16, MAX_INT16);
+- state.index = encoded[1] & 0x7f;
++ state.index = clamp(encoded[1] & 0x7f, 0, 88);
+ encoded += 2;
+
+ for (int n=0; n<m_framesPerPacket; n+=2)
+--
+2.11.0
+
+From ce536d707b8e2a26baca77320398c45238224ca7 Mon Sep 17 00:00:00 2001
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Fri, 10 Mar 2017 15:40:02 +0100
+Subject: [PATCH] Fix signature of multiplyCheckOverflow. It returns a bool,
+ not an int
+
+---
+ libaudiofile/modules/MSADPCM.cpp | 2 +-
+ sfcommands/sfconvert.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libaudiofile/modules/MSADPCM.cpp b/libaudiofile/modules/MSADPCM.cpp
+index ef9c38c..d8c9553 100644
+--- a/libaudiofile/modules/MSADPCM.cpp
++++ b/libaudiofile/modules/MSADPCM.cpp
+@@ -116,7 +116,7 @@ int firstBitSet(int x)
+ #define __has_builtin(x) 0
+ #endif
+
+-int multiplyCheckOverflow(int a, int b, int *result)
++bool multiplyCheckOverflow(int a, int b, int *result)
+ {
+ #if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow))
+ return __builtin_mul_overflow(a, b, result);
+diff --git a/sfcommands/sfconvert.c b/sfcommands/sfconvert.c
+index 970a3e4..367f7a5 100644
+--- a/sfcommands/sfconvert.c
++++ b/sfcommands/sfconvert.c
+@@ -60,7 +60,7 @@ int firstBitSet(int x)
+ #define __has_builtin(x) 0
+ #endif
+
+-int multiplyCheckOverflow(int a, int b, int *result)
++bool multiplyCheckOverflow(int a, int b, int *result)
+ {
+ #if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow))
+ return __builtin_mul_overflow(a, b, result);
+--
+2.11.0
+
diff --git a/media-libs/audiofile/files/audiofile-0.3.6-CVE-2018-13440-CVE-2018-17095.patch b/media-libs/audiofile/files/audiofile-0.3.6-CVE-2018-13440-CVE-2018-17095.patch
new file mode 100644
index 00000000000..0d356fb072a
--- /dev/null
+++ b/media-libs/audiofile/files/audiofile-0.3.6-CVE-2018-13440-CVE-2018-17095.patch
@@ -0,0 +1,82 @@
+Fixes for CVE-2018-13440 and CVE-2018-17095 from here:
+https://github.com/mpruett/audiofile/pull/52
+
+These are the same used in Fedora.
+
+From fde6d79fb8363c4a329a184ef0b107156602b225 Mon Sep 17 00:00:00 2001
+From: Wim Taymans <wtaymans@redhat.com>
+Date: Thu, 27 Sep 2018 10:48:45 +0200
+Subject: [PATCH 1/3] ModuleState: handle compress/decompress init failure
+
+When the unit initcompress or initdecompress function fails,
+m_fileModule is NULL. Return AF_FAIL in that case instead of
+causing NULL pointer dereferences later.
+
+Fixes #49
+---
+ libaudiofile/modules/ModuleState.cpp | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/libaudiofile/modules/ModuleState.cpp b/libaudiofile/modules/ModuleState.cpp
+index 0c29d7a..070fd9b 100644
+--- a/libaudiofile/modules/ModuleState.cpp
++++ b/libaudiofile/modules/ModuleState.cpp
+@@ -75,6 +75,9 @@ status ModuleState::initFileModule(AFfilehandle file, Track *track)
+ m_fileModule = unit->initcompress(track, file->m_fh, file->m_seekok,
+ file->m_fileFormat == AF_FILE_RAWDATA, &chunkFrames);
+
++ if (!m_fileModule)
++ return AF_FAIL;
++
+ if (unit->needsRebuffer)
+ {
+ assert(unit->nativeSampleFormat == AF_SAMPFMT_TWOSCOMP);
+
+From 941774c8c0e79007196d7f1e7afdc97689f869b3 Mon Sep 17 00:00:00 2001
+From: Wim Taymans <wtaymans@redhat.com>
+Date: Thu, 27 Sep 2018 12:09:45 +0200
+Subject: [PATCH 2/3] ALAC: set chunk frameCount to 0 on short read
+
+---
+ libaudiofile/modules/ALAC.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libaudiofile/modules/ALAC.cpp b/libaudiofile/modules/ALAC.cpp
+index 7593c11..478e2af 100644
+--- a/libaudiofile/modules/ALAC.cpp
++++ b/libaudiofile/modules/ALAC.cpp
+@@ -240,6 +240,7 @@ void ALAC::runPull()
+ if (read(m_inChunk->buffer, bytesPerPacket) < bytesPerPacket)
+ {
+ reportReadError(0, m_track->f.framesPerPacket);
++ m_outChunk->frameCount = 0;
+ return;
+ }
+
+
+From 822b732fd31ffcb78f6920001e9b1fbd815fa712 Mon Sep 17 00:00:00 2001
+From: Wim Taymans <wtaymans@redhat.com>
+Date: Thu, 27 Sep 2018 12:11:12 +0200
+Subject: [PATCH 3/3] SimpleModule: set output chunk framecount after pull
+
+After pulling the data, set the output chunk to the amount of
+frames we pulled so that the next module in the chain has the correct
+frame count.
+
+Fixes #50 and #51
+---
+ libaudiofile/modules/SimpleModule.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libaudiofile/modules/SimpleModule.cpp b/libaudiofile/modules/SimpleModule.cpp
+index 2bae1eb..e87932c 100644
+--- a/libaudiofile/modules/SimpleModule.cpp
++++ b/libaudiofile/modules/SimpleModule.cpp
+@@ -26,6 +26,7 @@
+ void SimpleModule::runPull()
+ {
+ pull(m_outChunk->frameCount);
++ m_outChunk->frameCount = m_inChunk->frameCount;
+ run(*m_inChunk, *m_outChunk);
+ }
+
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/audiofile/, media-libs/audiofile/files/
@ 2022-10-10 19:55 Sam James
0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2022-10-10 19:55 UTC (permalink / raw
To: gentoo-commits
commit: 0ed289c4438eb7ac8dd34d590900174d7b019a95
Author: orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Mon Oct 10 18:26:35 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct 10 19:55:20 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ed289c4
media-libs/audiofile: Fix -Werror=strict-prototypes
Reference: https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240
Upstream-PR: https://github.com/mpruett/audiofile/pull/64
Upstream-Commit: https://github.com/mpruett/audiofile/commit/7227a65c9725a89f839d01826ea8427becee30be
Signed-off-by: orbea <orbea <AT> riseup.net>
Closes: https://github.com/gentoo/gentoo/pull/27729
Signed-off-by: Sam James <sam <AT> gentoo.org>
media-libs/audiofile/audiofile-0.3.6-r5.ebuild | 1 +
.../files/audiofile-0.3.6-strict-prototypes.patch | 82 ++++++++++++++++++++++
2 files changed, 83 insertions(+)
diff --git a/media-libs/audiofile/audiofile-0.3.6-r5.ebuild b/media-libs/audiofile/audiofile-0.3.6-r5.ebuild
index 02f89e0f9b41..a759228901b9 100644
--- a/media-libs/audiofile/audiofile-0.3.6-r5.ebuild
+++ b/media-libs/audiofile/audiofile-0.3.6-r5.ebuild
@@ -23,6 +23,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-0.3.6-mingw32.patch
"${FILESDIR}"/${PN}-0.3.6-CVE-2017-68xx.patch
"${FILESDIR}"/${PN}-0.3.6-CVE-2018-13440-CVE-2018-17095.patch
+ "${FILESDIR}"/${PN}-0.3.6-strict-prototypes.patch
)
src_prepare() {
diff --git a/media-libs/audiofile/files/audiofile-0.3.6-strict-prototypes.patch b/media-libs/audiofile/files/audiofile-0.3.6-strict-prototypes.patch
new file mode 100644
index 000000000000..6e78b773c93c
--- /dev/null
+++ b/media-libs/audiofile/files/audiofile-0.3.6-strict-prototypes.patch
@@ -0,0 +1,82 @@
+https://github.com/mpruett/audiofile/pull/64
+
+From 519f6c19d3bcfa048fc468f0094ab4235e7c77b2 Mon Sep 17 00:00:00 2001
+From: orbea <orbea@riseup.net>
+Date: Mon, 10 Oct 2022 11:13:10 -0700
+Subject: [PATCH] Fix -Werror=strict-prototypes
+
+This will be required for upcoming gcc and clang versions.
+
+Reference: https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240
+
+diff --git a/libaudiofile/g711.c b/libaudiofile/g711.c
+index 8fb2323..392766c 100644
+--- a/libaudiofile/g711.c
++++ b/libaudiofile/g711.c
+@@ -74,8 +74,7 @@ static int search(int val, const short *table, int size)
+ * John Wiley & Sons, pps 98-111 and 472-476.
+ */
+ unsigned char
+-_af_linear2alaw(pcm_val)
+- int pcm_val; /* 2's complement (16-bit range) */
++_af_linear2alaw(int pcm_val) /* 2's complement (16-bit range) */
+ {
+ int mask;
+ int seg;
+@@ -110,8 +109,7 @@ _af_linear2alaw(pcm_val)
+ *
+ */
+ int
+-_af_alaw2linear(a_val)
+- unsigned char a_val;
++_af_alaw2linear(unsigned char a_val)
+ {
+ int t;
+ int seg;
+diff --git a/sfcommands/sfinfo.c b/sfcommands/sfinfo.c
+index c8fb913..91221a5 100644
+--- a/sfcommands/sfinfo.c
++++ b/sfcommands/sfinfo.c
+@@ -48,7 +48,7 @@ void errorHandler(long error, const char *message)
+ fprintf(stderr, "sfinfo: %s [error %ld]\n", message, error);
+ }
+
+-void printusage()
++void printusage(void)
+ {
+ printf("usage: sfinfo [options...] soundfiles...\n");
+ printf("options:\n");
+@@ -58,7 +58,7 @@ void printusage()
+ printf(" -v, --version Print version\n");
+ }
+
+-void printversion()
++void printversion(void)
+ {
+ printf("sfinfo: Audio File Library version %s\n", VERSION);
+ }
+https://github.com/mpruett/audiofile/commit/7227a65c9725a89f839d01826ea8427becee30be
+
+From 7227a65c9725a89f839d01826ea8427becee30be Mon Sep 17 00:00:00 2001
+From: Michael Pruett <michael@68k.org>
+Date: Thu, 7 Mar 2013 22:44:56 -0800
+Subject: [PATCH] Fix compiler warning regarding discarding const
+ qualification.
+
+diff --git a/libaudiofile/g711.c b/libaudiofile/g711.c
+index 394543e..8fb2323 100644
+--- a/libaudiofile/g711.c
++++ b/libaudiofile/g711.c
+@@ -43,11 +43,7 @@
+ static const short seg_end[8] = {0xFF, 0x1FF, 0x3FF, 0x7FF,
+ 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF};
+
+-static int
+-search(val, table, size)
+- int val;
+- short *table;
+- int size;
++static int search(int val, const short *table, int size)
+ {
+ int i;
+
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/audiofile/, media-libs/audiofile/files/
@ 2024-05-09 0:36 Sam James
0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2024-05-09 0:36 UTC (permalink / raw
To: gentoo-commits
commit: b8bb7f1065bf5701e62f118b5ef7cf727543d0de
Author: NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Tue Apr 2 08:13:05 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu May 9 00:34:07 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b8bb7f10
media-libs/audiofile: replace deprecated template unary_function
Adds the patch from the bug to the tree.
[sam: Add bug ref to patch.]
Closes: https://bugs.gentoo.org/914349
Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/36054
Signed-off-by: Sam James <sam <AT> gentoo.org>
media-libs/audiofile/audiofile-0.3.6-r6.ebuild | 59 +++++++++++++++++++
.../files/audiofile-0.3.6-clang-deprecation.patch | 68 ++++++++++++++++++++++
2 files changed, 127 insertions(+)
diff --git a/media-libs/audiofile/audiofile-0.3.6-r6.ebuild b/media-libs/audiofile/audiofile-0.3.6-r6.ebuild
new file mode 100644
index 000000000000..63b3eb3bfc60
--- /dev/null
+++ b/media-libs/audiofile/audiofile-0.3.6-r6.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools gnome.org multilib-minimal
+
+DESCRIPTION="An elegant API for accessing audio files"
+HOMEPAGE="https://audiofile.68k.org/"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0/1" # subslot = soname major version
+KEYWORDS="~amd64"
+IUSE="flac"
+
+RDEPEND="flac? ( >=media-libs/flac-1.2.1:=[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.3.6-gcc6-build-fixes.patch
+ "${FILESDIR}"/${PN}-0.3.6-CVE-2015-7747.patch
+ "${FILESDIR}"/${PN}-0.3.6-mingw32.patch
+ "${FILESDIR}"/${PN}-0.3.6-CVE-2017-68xx.patch
+ "${FILESDIR}"/${PN}-0.3.6-CVE-2018-13440-CVE-2018-17095.patch
+ "${FILESDIR}"/${PN}-0.3.6-strict-prototypes.patch
+ "${FILESDIR}"/${PN}-0.3.6-clang-deprecation.patch
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+multilib_src_configure() {
+ # Tests depend on statically compiled binaries to work, so we'll have to
+ # delete them later rather than not compile them at all
+ local myconf=(
+ --enable-largefile
+ # static needed for tests, bug #869677
+ --enable-static
+ --disable-werror
+ --disable-examples
+ $(use_enable flac)
+ )
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
+}
+
+multilib_src_test() {
+ emake check
+}
+
+multilib_src_install_all() {
+ einstalldocs
+
+ # package provides .pc file
+ find "${ED}" -name '*.la' -delete || die
+ find "${ED}" -name '*.a' -delete || die
+}
diff --git a/media-libs/audiofile/files/audiofile-0.3.6-clang-deprecation.patch b/media-libs/audiofile/files/audiofile-0.3.6-clang-deprecation.patch
new file mode 100644
index 000000000000..bccb9c1948e9
--- /dev/null
+++ b/media-libs/audiofile/files/audiofile-0.3.6-clang-deprecation.patch
@@ -0,0 +1,68 @@
+https://bugs.gentoo.org/914349
+--- a/libaudiofile/modules/SimpleModule.h
++++ b/libaudiofile/modules/SimpleModule.h
+@@ -125,13 +125,17 @@ struct signConverter
+ static const int kScaleBits = (Format + 1) * CHAR_BIT - 1;
+ static const int kMinSignedValue = -1 << kScaleBits;
+
+- struct signedToUnsigned : public std::unary_function<SignedType, UnsignedType>
++ struct signedToUnsigned
+ {
++ typedef SignedType argument_type;
++ typedef UnsignedType result_type;
+ UnsignedType operator()(SignedType x) { return x - kMinSignedValue; }
+ };
+
+- struct unsignedToSigned : public std::unary_function<SignedType, UnsignedType>
++ struct unsignedToSigned
+ {
++ typedef SignedType argument_type;
++ typedef UnsignedType result_type;
+ SignedType operator()(UnsignedType x) { return x + kMinSignedValue; }
+ };
+ };
+@@ -323,8 +327,10 @@ private:
+ };
+
+ template <typename Arg, typename Result>
+-struct intToFloat : public std::unary_function<Arg, Result>
++struct intToFloat
+ {
++ typedef Arg argument_type;
++ typedef Result result_type;
+ Result operator()(Arg x) const { return x; }
+ };
+
+@@ -389,14 +395,18 @@ private:
+ };
+
+ template <typename Arg, typename Result, unsigned shift>
+-struct lshift : public std::unary_function<Arg, Result>
++struct lshift
+ {
++ typedef Arg argument_type;
++ typedef Result result_type;
+ Result operator()(const Arg &x) const { return x << shift; }
+ };
+
+ template <typename Arg, typename Result, unsigned shift>
+-struct rshift : public std::unary_function<Arg, Result>
++struct rshift
+ {
++ typedef Arg argument_type;
++ typedef Result result_type;
+ Result operator()(const Arg &x) const { return x >> shift; }
+ };
+
+@@ -491,8 +501,10 @@ private:
+ };
+
+ template <typename Arg, typename Result>
+-struct floatToFloat : public std::unary_function<Arg, Result>
++struct floatToFloat
+ {
++ typedef Arg argument_type;
++ typedef Result result_type;
+ Result operator()(Arg x) const { return x; }
+ };
+
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-05-09 0:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-19 18:28 [gentoo-commits] repo/gentoo:master commit in: media-libs/audiofile/, media-libs/audiofile/files/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2024-05-09 0:36 Sam James
2022-10-10 19:55 Sam James
2017-06-08 18:09 Sergei Trofimovich
2017-01-21 18:18 Alexis Ballier
2016-10-09 7:47 Pacho Ramos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox