Page MenuHomeSolus

D7700.id.diff
No OneTemporary

D7700.id.diff

diff --git a/Makefile b/Makefile
new file mode 100644
--- /dev/null
+++ b/Makefile
@@ -0,0 +1 @@
+include ../Makefile.common
diff --git a/abi_symbols b/abi_symbols
new file mode 100644
--- /dev/null
+++ b/abi_symbols
@@ -0,0 +1,106 @@
+libaudiofile.so.1:AUpvfree
+libaudiofile.so.1:AUpvgetmaxitems
+libaudiofile.so.1:AUpvgetparam
+libaudiofile.so.1:AUpvgetval
+libaudiofile.so.1:AUpvgetvaltype
+libaudiofile.so.1:AUpvnew
+libaudiofile.so.1:AUpvsetparam
+libaudiofile.so.1:AUpvsetval
+libaudiofile.so.1:AUpvsetvaltype
+libaudiofile.so.1:afCloseFile
+libaudiofile.so.1:afFreeFileSetup
+libaudiofile.so.1:afGetAESChannelData
+libaudiofile.so.1:afGetByteOrder
+libaudiofile.so.1:afGetChannels
+libaudiofile.so.1:afGetCompression
+libaudiofile.so.1:afGetDataOffset
+libaudiofile.so.1:afGetFileFormat
+libaudiofile.so.1:afGetFrameCount
+libaudiofile.so.1:afGetFrameSize
+libaudiofile.so.1:afGetInstIDs
+libaudiofile.so.1:afGetInstParamLong
+libaudiofile.so.1:afGetInstParams
+libaudiofile.so.1:afGetLoopCount
+libaudiofile.so.1:afGetLoopEnd
+libaudiofile.so.1:afGetLoopEndFrame
+libaudiofile.so.1:afGetLoopIDs
+libaudiofile.so.1:afGetLoopMode
+libaudiofile.so.1:afGetLoopStart
+libaudiofile.so.1:afGetLoopStartFrame
+libaudiofile.so.1:afGetLoopTrack
+libaudiofile.so.1:afGetMarkComment
+libaudiofile.so.1:afGetMarkIDs
+libaudiofile.so.1:afGetMarkName
+libaudiofile.so.1:afGetMarkPosition
+libaudiofile.so.1:afGetMiscIDs
+libaudiofile.so.1:afGetMiscSize
+libaudiofile.so.1:afGetMiscType
+libaudiofile.so.1:afGetPCMMapping
+libaudiofile.so.1:afGetRate
+libaudiofile.so.1:afGetSampleFormat
+libaudiofile.so.1:afGetTrackBytes
+libaudiofile.so.1:afGetTrackIDs
+libaudiofile.so.1:afGetVirtualByteOrder
+libaudiofile.so.1:afGetVirtualChannels
+libaudiofile.so.1:afGetVirtualFrameSize
+libaudiofile.so.1:afGetVirtualPCMMapping
+libaudiofile.so.1:afGetVirtualSampleFormat
+libaudiofile.so.1:afIdentifyFD
+libaudiofile.so.1:afIdentifyNamedFD
+libaudiofile.so.1:afInitAESChannelData
+libaudiofile.so.1:afInitAESChannelDataTo
+libaudiofile.so.1:afInitByteOrder
+libaudiofile.so.1:afInitChannels
+libaudiofile.so.1:afInitCompression
+libaudiofile.so.1:afInitDataOffset
+libaudiofile.so.1:afInitFileFormat
+libaudiofile.so.1:afInitFrameCount
+libaudiofile.so.1:afInitInstIDs
+libaudiofile.so.1:afInitLoopIDs
+libaudiofile.so.1:afInitMarkComment
+libaudiofile.so.1:afInitMarkIDs
+libaudiofile.so.1:afInitMarkName
+libaudiofile.so.1:afInitMiscIDs
+libaudiofile.so.1:afInitMiscSize
+libaudiofile.so.1:afInitMiscType
+libaudiofile.so.1:afInitPCMMapping
+libaudiofile.so.1:afInitRate
+libaudiofile.so.1:afInitSampleFormat
+libaudiofile.so.1:afInitTrackIDs
+libaudiofile.so.1:afNewFileSetup
+libaudiofile.so.1:afOpenFD
+libaudiofile.so.1:afOpenFile
+libaudiofile.so.1:afOpenNamedFD
+libaudiofile.so.1:afOpenVirtualFile
+libaudiofile.so.1:afQuery
+libaudiofile.so.1:afQueryDouble
+libaudiofile.so.1:afQueryLong
+libaudiofile.so.1:afQueryPointer
+libaudiofile.so.1:afReadFrames
+libaudiofile.so.1:afReadMisc
+libaudiofile.so.1:afSeekFrame
+libaudiofile.so.1:afSeekMisc
+libaudiofile.so.1:afSetAESChannelData
+libaudiofile.so.1:afSetChannelMatrix
+libaudiofile.so.1:afSetErrorHandler
+libaudiofile.so.1:afSetInstParamLong
+libaudiofile.so.1:afSetInstParams
+libaudiofile.so.1:afSetLoopCount
+libaudiofile.so.1:afSetLoopEnd
+libaudiofile.so.1:afSetLoopEndFrame
+libaudiofile.so.1:afSetLoopMode
+libaudiofile.so.1:afSetLoopStart
+libaudiofile.so.1:afSetLoopStartFrame
+libaudiofile.so.1:afSetLoopTrack
+libaudiofile.so.1:afSetMarkPosition
+libaudiofile.so.1:afSetTrackPCMMapping
+libaudiofile.so.1:afSetVirtualByteOrder
+libaudiofile.so.1:afSetVirtualChannels
+libaudiofile.so.1:afSetVirtualPCMMapping
+libaudiofile.so.1:afSetVirtualSampleFormat
+libaudiofile.so.1:afSyncFile
+libaudiofile.so.1:afTellFrame
+libaudiofile.so.1:afWriteFrames
+libaudiofile.so.1:afWriteMisc
+libaudiofile.so.1:af_virtual_file_destroy
+libaudiofile.so.1:af_virtual_file_new
diff --git a/abi_used_libs b/abi_used_libs
new file mode 100644
--- /dev/null
+++ b/abi_used_libs
@@ -0,0 +1,4 @@
+libFLAC.so.8
+libc.so.6
+libm.so.6
+libstdc++.so.6
diff --git a/files/01_gcc6.patch b/files/01_gcc6.patch
new file mode 100644
--- /dev/null
+++ b/files/01_gcc6.patch
@@ -0,0 +1,102 @@
+Description: Fix FTBFS with GCC 6
+Author: Michael Schwendt <mschwendt@fedoraproject.org>
+Origin: vendor, https://github.com/mpruett/audiofile/pull/27
+Bug-Debian: https://bugs.debian.org/812055
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+
+--- a/libaudiofile/modules/SimpleModule.h
++++ b/libaudiofile/modules/SimpleModule.h
+@@ -123,7 +123,7 @@ struct signConverter
+ typedef typename IntTypes<Format>::UnsignedType UnsignedType;
+
+ static const int kScaleBits = (Format + 1) * CHAR_BIT - 1;
+- static const int kMinSignedValue = -1 << kScaleBits;
++ static const int kMinSignedValue = 0-(1U<<kScaleBits);
+
+ struct signedToUnsigned : public std::unary_function<SignedType, UnsignedType>
+ {
+--- a/test/FloatToInt.cpp
++++ b/test/FloatToInt.cpp
+@@ -115,7 +115,7 @@ TEST_F(FloatToIntTest, Int16)
+ EXPECT_EQ(readData[i], expectedData[i]);
+ }
+
+-static const int32_t kMinInt24 = -1<<23;
++static const int32_t kMinInt24 = 0-(1U<<23);
+ static const int32_t kMaxInt24 = (1<<23) - 1;
+
+ TEST_F(FloatToIntTest, Int24)
+--- a/test/IntToFloat.cpp
++++ b/test/IntToFloat.cpp
+@@ -117,7 +117,7 @@ TEST_F(IntToFloatTest, Int16)
+ EXPECT_EQ(readData[i], expectedData[i]);
+ }
+
+-static const int32_t kMinInt24 = -1<<23;
++static const int32_t kMinInt24 = 0-(1U<<23);
+ static const int32_t kMaxInt24 = (1<<23) - 1;
+
+ TEST_F(IntToFloatTest, Int24)
+--- a/test/NeXT.cpp
++++ b/test/NeXT.cpp
+@@ -37,13 +37,13 @@
+
+ #include "TestUtilities.h"
+
+-const char kDataUnspecifiedLength[] =
++const signed char kDataUnspecifiedLength[] =
+ {
+ '.', 's', 'n', 'd',
+ 0, 0, 0, 24, // offset of 24 bytes
+- 0xff, 0xff, 0xff, 0xff, // unspecified length
++ -1, -1, -1, -1, // unspecified length
+ 0, 0, 0, 3, // 16-bit linear
+- 0, 0, 172, 68, // 44100 Hz
++ 0, 0, -84, 68, // 44100 Hz (0xAC44)
+ 0, 0, 0, 1, // 1 channel
+ 0, 1,
+ 0, 1,
+@@ -57,13 +57,13 @@ const char kDataUnspecifiedLength[] =
+ 0, 55
+ };
+
+-const char kDataTruncated[] =
++const signed char kDataTruncated[] =
+ {
+ '.', 's', 'n', 'd',
+ 0, 0, 0, 24, // offset of 24 bytes
+ 0, 0, 0, 20, // length of 20 bytes
+ 0, 0, 0, 3, // 16-bit linear
+- 0, 0, 172, 68, // 44100 Hz
++ 0, 0, -84, 68, // 44100 Hz (0xAC44)
+ 0, 0, 0, 1, // 1 channel
+ 0, 1,
+ 0, 1,
+@@ -152,13 +152,13 @@ TEST(NeXT, Truncated)
+ ASSERT_EQ(::unlink(testFileName.c_str()), 0);
+ }
+
+-const char kDataZeroChannels[] =
++const signed char kDataZeroChannels[] =
+ {
+ '.', 's', 'n', 'd',
+ 0, 0, 0, 24, // offset of 24 bytes
+ 0, 0, 0, 2, // 2 bytes
+ 0, 0, 0, 3, // 16-bit linear
+- 0, 0, 172, 68, // 44100 Hz
++ 0, 0, -84, 68, // 44100 Hz (0xAC44)
+ 0, 0, 0, 0, // 0 channels
+ 0, 1
+ };
+--- a/test/Sign.cpp
++++ b/test/Sign.cpp
+@@ -116,7 +116,7 @@ TEST_F(SignConversionTest, Int16)
+ EXPECT_EQ(readData[i], expectedData[i]);
+ }
+
+-static const int32_t kMinInt24 = -1<<23;
++static const int32_t kMinInt24 = 0-(1U<<23);
+ static const int32_t kMaxInt24 = (1<<23) - 1;
+ static const uint32_t kMaxUInt24 = (1<<24) - 1;
+
diff --git a/files/02_hurd.patch b/files/02_hurd.patch
new file mode 100644
--- /dev/null
+++ b/files/02_hurd.patch
@@ -0,0 +1,381 @@
+Description: Remove usage of PATH_MAX in tests to fix FTBFS on Hurd.
+ jcowgill: Removed Changelog changes
+Author: Pino Toscano <toscano.pino@tiscali.it>
+Origin: backport, https://github.com/mpruett/audiofile/commit/34c261034f1193a783196618f0052112e00fbcfe
+Bug: https://github.com/mpruett/audiofile/pull/17
+Bug-Debian: https://bugs.debian.org/762595
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+
+--- a/test/TestUtilities.cpp
++++ b/test/TestUtilities.cpp
+@@ -21,8 +21,8 @@
+ #include "TestUtilities.h"
+
+ #include <limits.h>
+-#include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <unistd.h>
+
+ bool createTemporaryFile(const std::string &prefix, std::string *path)
+@@ -35,12 +35,12 @@ bool createTemporaryFile(const std::stri
+ return true;
+ }
+
+-bool createTemporaryFile(const char *prefix, char *path)
++bool createTemporaryFile(const char *prefix, char **path)
+ {
+- snprintf(path, PATH_MAX, "/tmp/%s-XXXXXX", prefix);
+- int fd = ::mkstemp(path);
+- if (fd < 0)
+- return false;
+- ::close(fd);
+- return true;
++ *path = NULL;
++ std::string pathString;
++ bool result = createTemporaryFile(prefix, &pathString);
++ if (result)
++ *path = ::strdup(pathString.c_str());
++ return result;
+ }
+--- a/test/TestUtilities.h
++++ b/test/TestUtilities.h
+@@ -53,7 +53,7 @@ extern "C" {
+
+ #include <stdbool.h>
+
+-bool createTemporaryFile(const char *prefix, char *path);
++bool createTemporaryFile(const char *prefix, char **path);
+
+ #ifdef __cplusplus
+ }
+--- a/test/floatto24.c
++++ b/test/floatto24.c
+@@ -86,8 +86,8 @@ int main (int argc, char **argv)
+ afInitChannels(setup, AF_DEFAULT_TRACK, 1);
+ afInitSampleFormat(setup, AF_DEFAULT_TRACK, AF_SAMPFMT_FLOAT, 32);
+
+- char testFileName[PATH_MAX];
+- if (!createTemporaryFile("floatto24", testFileName))
++ char *testFileName;
++ if (!createTemporaryFile("floatto24", &testFileName))
+ {
+ fprintf(stderr, "Could not create temporary file.\n");
+ exit(EXIT_FAILURE);
+@@ -182,6 +182,7 @@ int main (int argc, char **argv)
+ }
+
+ unlink(testFileName);
++ free(testFileName);
+
+ exit(EXIT_SUCCESS);
+ }
+--- a/test/sixteen-to-eight.c
++++ b/test/sixteen-to-eight.c
+@@ -57,8 +57,8 @@ int main (int argc, char **argv)
+ afInitSampleFormat(setup, AF_DEFAULT_TRACK, AF_SAMPFMT_UNSIGNED, 8);
+ afInitChannels(setup, AF_DEFAULT_TRACK, 1);
+
+- char testFileName[PATH_MAX];
+- if (!createTemporaryFile("sixteen-to-eight", testFileName))
++ char *testFileName;
++ if (!createTemporaryFile("sixteen-to-eight", &testFileName))
+ {
+ fprintf(stderr, "Could not create temporary file.\n");
+ exit(EXIT_FAILURE);
+@@ -113,6 +113,7 @@ int main (int argc, char **argv)
+
+ afCloseFile(file);
+ unlink(testFileName);
++ free(testFileName);
+
+ exit(EXIT_SUCCESS);
+ }
+--- a/test/testchannelmatrix.c
++++ b/test/testchannelmatrix.c
+@@ -39,7 +39,7 @@
+
+ #include "TestUtilities.h"
+
+-static char sTestFileName[PATH_MAX];
++static char *sTestFileName;
+
+ const short samples[] = {300, -300, 515, -515, 2315, -2315, 9154, -9154};
+ #define SAMPLE_COUNT (sizeof (samples) / sizeof (short))
+@@ -47,7 +47,11 @@ const short samples[] = {300, -300, 515,
+
+ void cleanup (void)
+ {
+- unlink(sTestFileName);
++ if (sTestFileName)
++ {
++ unlink(sTestFileName);
++ free(sTestFileName);
++ }
+ }
+
+ void ensure (int condition, const char *message)
+@@ -76,7 +80,7 @@ int main (void)
+ afInitFileFormat(setup, AF_FILE_AIFFC);
+
+ /* Write stereo data to test file. */
+- ensure(createTemporaryFile("testchannelmatrix", sTestFileName),
++ ensure(createTemporaryFile("testchannelmatrix", &sTestFileName),
+ "could not create temporary file");
+ file = afOpenFile(sTestFileName, "w", setup);
+ ensure(file != AF_NULL_FILEHANDLE, "could not open file for writing");
+--- a/test/testdouble.c
++++ b/test/testdouble.c
+@@ -38,7 +38,7 @@
+
+ #include "TestUtilities.h"
+
+-static char sTestFileName[PATH_MAX];
++static char *sTestFileName;
+
+ const double samples[] =
+ {1.0, 0.6, -0.3, 0.95, 0.2, -0.6, 0.9, 0.4, -0.22, 0.125, 0.1, -0.4};
+@@ -48,7 +48,11 @@ void testdouble (int fileFormat);
+
+ void cleanup (void)
+ {
+- unlink(sTestFileName);
++ if (sTestFileName)
++ {
++ unlink(sTestFileName);
++ free(sTestFileName);
++ }
+ }
+
+ void ensure (int condition, const char *message)
+@@ -96,7 +100,7 @@ void testdouble (int fileFormat)
+ afInitSampleFormat(setup, AF_DEFAULT_TRACK, AF_SAMPFMT_DOUBLE, 64);
+ afInitChannels(setup, AF_DEFAULT_TRACK, 2);
+
+- ensure(createTemporaryFile("testdouble", sTestFileName),
++ ensure(createTemporaryFile("testdouble", &sTestFileName),
+ "could not create temporary file");
+ file = afOpenFile(sTestFileName, "w", setup);
+ ensure(file != AF_NULL_FILEHANDLE, "could not open file for writing");
+--- a/test/testfloat.c
++++ b/test/testfloat.c
+@@ -38,7 +38,7 @@
+
+ #include "TestUtilities.h"
+
+-static char sTestFileName[PATH_MAX];
++static char *sTestFileName;
+
+ const float samples[] =
+ {1.0, 0.6, -0.3, 0.95, 0.2, -0.6, 0.9, 0.4, -0.22, 0.125, 0.1, -0.4};
+@@ -48,7 +48,11 @@ void testfloat (int fileFormat);
+
+ void cleanup (void)
+ {
+- unlink(sTestFileName);
++ if (sTestFileName)
++ {
++ unlink(sTestFileName);
++ free(sTestFileName);
++ }
+ }
+
+ void ensure (int condition, const char *message)
+@@ -96,7 +100,7 @@ void testfloat (int fileFormat)
+ afInitSampleFormat(setup, AF_DEFAULT_TRACK, AF_SAMPFMT_FLOAT, 32);
+ afInitChannels(setup, AF_DEFAULT_TRACK, 2);
+
+- ensure(createTemporaryFile("testfloat", sTestFileName),
++ ensure(createTemporaryFile("testfloat", &sTestFileName),
+ "could not create temporary file");
+ file = afOpenFile(sTestFileName, "w", setup);
+ ensure(file != AF_NULL_FILEHANDLE, "could not open file for writing");
+--- a/test/testmarkers.c
++++ b/test/testmarkers.c
+@@ -32,15 +32,19 @@
+
+ #include "TestUtilities.h"
+
+-static char sTestFileName[PATH_MAX];
++static char *sTestFileName;
+
+ #define FRAME_COUNT 200
+
+ void cleanup (void)
+ {
++ if (sTestFileName)
++ {
+ #ifndef DEBUG
+- unlink(sTestFileName);
++ unlink(sTestFileName);
+ #endif
++ free(sTestFileName);
++ }
+ }
+
+ void ensure (int condition, const char *message)
+@@ -127,7 +131,7 @@ int testmarkers (int fileformat)
+
+ int main (void)
+ {
+- ensure(createTemporaryFile("testmarkers", sTestFileName),
++ ensure(createTemporaryFile("testmarkers", &sTestFileName),
+ "could not create temporary file");
+
+ testmarkers(AF_FILE_AIFF);
+--- a/test/twentyfour.c
++++ b/test/twentyfour.c
+@@ -71,8 +71,8 @@ int main (int argc, char **argv)
+ afInitSampleFormat(setup, AF_DEFAULT_TRACK, AF_SAMPFMT_TWOSCOMP, 24);
+ afInitChannels(setup, AF_DEFAULT_TRACK, 1);
+
+- char testFileName[PATH_MAX];
+- if (!createTemporaryFile("twentyfour", testFileName))
++ char *testFileName;
++ if (!createTemporaryFile("twentyfour", &testFileName))
+ {
+ fprintf(stderr, "could not create temporary file\n");
+ exit(EXIT_FAILURE);
+@@ -239,6 +239,7 @@ int main (int argc, char **argv)
+ exit(EXIT_FAILURE);
+ }
+ unlink(testFileName);
++ free(testFileName);
+
+ exit(EXIT_SUCCESS);
+ }
+--- a/test/twentyfour2.c
++++ b/test/twentyfour2.c
+@@ -45,15 +45,19 @@
+
+ #include "TestUtilities.h"
+
+-static char sTestFileName[PATH_MAX];
++static char *sTestFileName;
+
+ #define FRAME_COUNT 10000
+
+ void cleanup (void)
+ {
++ if (sTestFileName)
++ {
+ #ifndef DEBUG
+- unlink(sTestFileName);
++ unlink(sTestFileName);
+ #endif
++ free(sTestFileName);
++ }
+ }
+
+ void ensure (int condition, const char *message)
+@@ -78,7 +82,7 @@ int main (void)
+ afInitChannels(setup, AF_DEFAULT_TRACK, 1);
+ afInitSampleFormat(setup, AF_DEFAULT_TRACK, AF_SAMPFMT_TWOSCOMP, 24);
+
+- ensure(createTemporaryFile("twentyfour2", sTestFileName),
++ ensure(createTemporaryFile("twentyfour2", &sTestFileName),
+ "could not create temporary file");
+ file = afOpenFile(sTestFileName, "w", setup);
+ ensure(file != NULL, "could not open test file for writing");
+--- a/test/writealaw.c
++++ b/test/writealaw.c
+@@ -53,7 +53,7 @@
+
+ #include "TestUtilities.h"
+
+-static char sTestFileName[PATH_MAX];
++static char *sTestFileName;
+
+ #define FRAME_COUNT 16
+ #define SAMPLE_COUNT FRAME_COUNT
+@@ -62,9 +62,13 @@ void testalaw (int fileFormat);
+
+ void cleanup (void)
+ {
++ if (sTestFileName)
++ {
+ #ifndef DEBUG
+- unlink(sTestFileName);
++ unlink(sTestFileName);
+ #endif
++ free(sTestFileName);
++ }
+ }
+
+ void ensure (int condition, const char *message)
+@@ -113,7 +117,7 @@ void testalaw (int fileFormat)
+ afInitFileFormat(setup, fileFormat);
+ afInitChannels(setup, AF_DEFAULT_TRACK, 1);
+
+- ensure(createTemporaryFile("writealaw", sTestFileName),
++ ensure(createTemporaryFile("writealaw", &sTestFileName),
+ "could not create temporary file");
+ file = afOpenFile(sTestFileName, "w", setup);
+ afFreeFileSetup(setup);
+--- a/test/writeraw.c
++++ b/test/writeraw.c
+@@ -44,13 +44,17 @@
+
+ #include "TestUtilities.h"
+
+-static char sTestFileName[PATH_MAX];
++static char *sTestFileName;
+
+ void cleanup (void)
+ {
++ if (sTestFileName)
++ {
+ #ifndef DEBUG
+- unlink(sTestFileName);
++ unlink(sTestFileName);
+ #endif
++ free(sTestFileName);
++ }
+ }
+
+ void ensure (int condition, const char *message)
+@@ -84,7 +88,7 @@ int main (int argc, char **argv)
+ afInitChannels(setup, AF_DEFAULT_TRACK, 1);
+ afInitSampleFormat(setup, AF_DEFAULT_TRACK, AF_SAMPFMT_TWOSCOMP, 16);
+
+- ensure(createTemporaryFile("writeraw", sTestFileName),
++ ensure(createTemporaryFile("writeraw", &sTestFileName),
+ "could not create temporary file");
+ file = afOpenFile(sTestFileName, "w", setup);
+ ensure(file != AF_NULL_FILEHANDLE, "unable to open file for writing");
+--- a/test/writeulaw.c
++++ b/test/writeulaw.c
+@@ -53,7 +53,7 @@
+
+ #include "TestUtilities.h"
+
+-static char sTestFileName[PATH_MAX];
++static char *sTestFileName;
+
+ #define FRAME_COUNT 16
+ #define SAMPLE_COUNT FRAME_COUNT
+@@ -62,9 +62,13 @@ void testulaw (int fileFormat);
+
+ void cleanup (void)
+ {
++ if (sTestFileName)
++ {
+ #ifndef DEBUG
+- unlink(sTestFileName);
++ unlink(sTestFileName);
+ #endif
++ free(sTestFileName);
++ }
+ }
+
+ void ensure (int condition, const char *message)
+@@ -113,7 +117,7 @@ void testulaw (int fileFormat)
+ afInitFileFormat(setup, fileFormat);
+ afInitChannels(setup, AF_DEFAULT_TRACK, 1);
+
+- ensure(createTemporaryFile("writeulaw", sTestFileName),
++ ensure(createTemporaryFile("writeulaw", &sTestFileName),
+ "could not create temporary file");
+ file = afOpenFile(sTestFileName, "w", setup);
+ afFreeFileSetup(setup);
diff --git a/files/03_clamp-index-values-to-fix-index-overflow-in-IMA.cpp.patch b/files/03_clamp-index-values-to-fix-index-overflow-in-IMA.cpp.patch
new file mode 100644
--- /dev/null
+++ b/files/03_clamp-index-values-to-fix-index-overflow-in-IMA.cpp.patch
@@ -0,0 +1,33 @@
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Mon, 6 Mar 2017 18:02:31 +0100
+Subject: 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)
diff --git a/files/04_Always-check-the-number-of-coefficients.patch b/files/04_Always-check-the-number-of-coefficients.patch
new file mode 100644
--- /dev/null
+++ b/files/04_Always-check-the-number-of-coefficients.patch
@@ -0,0 +1,30 @@
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Mon, 6 Mar 2017 12:51:22 +0100
+Subject: 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 9dd8511..0fc48e8 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;
+
diff --git a/files/05_Check-for-multiplication-overflow-in-MSADPCM-decodeSam.patch b/files/05_Check-for-multiplication-overflow-in-MSADPCM-decodeSam.patch
new file mode 100644
--- /dev/null
+++ b/files/05_Check-for-multiplication-overflow-in-MSADPCM-decodeSam.patch
@@ -0,0 +1,116 @@
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Mon, 6 Mar 2017 13:43:53 +0100
+Subject: 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++;
diff --git a/files/06_Check-for-multiplication-overflow-in-sfconvert.patch b/files/06_Check-for-multiplication-overflow-in-sfconvert.patch
new file mode 100644
--- /dev/null
+++ b/files/06_Check-for-multiplication-overflow-in-sfconvert.patch
@@ -0,0 +1,66 @@
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Mon, 6 Mar 2017 13:54:52 +0100
+Subject: 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;
diff --git a/files/07_Fix-signature-of-multiplyCheckOverflow.-It-returns-a-b.patch b/files/07_Fix-signature-of-multiplyCheckOverflow.-It-returns-a-b.patch
new file mode 100644
--- /dev/null
+++ b/files/07_Fix-signature-of-multiplyCheckOverflow.-It-returns-a-b.patch
@@ -0,0 +1,35 @@
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Fri, 10 Mar 2017 15:40:02 +0100
+Subject: 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);
diff --git a/files/08_Actually-fail-when-error-occurs-in-parseFormat.patch b/files/08_Actually-fail-when-error-occurs-in-parseFormat.patch
new file mode 100644
--- /dev/null
+++ b/files/08_Actually-fail-when-error-occurs-in-parseFormat.patch
@@ -0,0 +1,36 @@
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Mon, 6 Mar 2017 18:59:26 +0100
+Subject: 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 0fc48e8..d04b796 100644
+--- a/libaudiofile/WAVE.cpp
++++ b/libaudiofile/WAVE.cpp
+@@ -332,6 +332,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;
+@@ -339,6 +340,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;
diff --git a/files/09_Check-for-division-by-zero-in-BlockCodec-runPull.patch b/files/09_Check-for-division-by-zero-in-BlockCodec-runPull.patch
new file mode 100644
--- /dev/null
+++ b/files/09_Check-for-division-by-zero-in-BlockCodec-runPull.patch
@@ -0,0 +1,21 @@
+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++)
diff --git a/files/security/01_CVE-2015-7747.patch b/files/security/01_CVE-2015-7747.patch
new file mode 100644
--- /dev/null
+++ b/files/security/01_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);
++}
diff --git a/files/security/02_CVE-2018-13440.patch b/files/security/02_CVE-2018-13440.patch
new file mode 100644
--- /dev/null
+++ b/files/security/02_CVE-2018-13440.patch
@@ -0,0 +1,28 @@
+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] 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);
diff --git a/files/security/03_CVE-2018-17095.patch b/files/security/03_CVE-2018-17095.patch
new file mode 100644
--- /dev/null
+++ b/files/security/03_CVE-2018-17095.patch
@@ -0,0 +1,26 @@
+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] 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);
+ }
+
diff --git a/files/series b/files/series
new file mode 100644
--- /dev/null
+++ b/files/series
@@ -0,0 +1,12 @@
+01_gcc6.patch
+02_hurd.patch
+03_clamp-index-values-to-fix-index-overflow-in-IMA.cpp.patch
+04_Always-check-the-number-of-coefficients.patch
+05_Check-for-multiplication-overflow-in-MSADPCM-decodeSam.patch
+06_Check-for-multiplication-overflow-in-sfconvert.patch
+07_Fix-signature-of-multiplyCheckOverflow.-It-returns-a-b.patch
+08_Actually-fail-when-error-occurs-in-parseFormat.patch
+09_Check-for-division-by-zero-in-BlockCodec-runPull.patch
+security/01_CVE-2015-7747.patch
+security/02_CVE-2018-13440.patch
+security/03_CVE-2018-17095.patch
diff --git a/package.yml b/package.yml
new file mode 100644
--- /dev/null
+++ b/package.yml
@@ -0,0 +1,23 @@
+name : audiofile
+version : 0.3.6
+release : 1
+Homepage : https://audiofile.68k.org/
+source :
+ - https://audiofile.68k.org/audiofile-0.3.6.tar.gz : cdc60df19ab08bfe55344395739bb08f50fc15c92da3962fac334d3bff116965
+license :
+ - GPL-2.1-or-later
+ - LGPL-2.1-or-later
+component : multimedia.library
+summary : Silicon Graphics Audio File Library
+description: |
+ Silicon Graphics Audio File Library
+builddeps :
+ - pkgconfig(alsa)
+ - pkgconfig(flac)
+setup : |
+ %apply_patches
+ %reconfigure --disable-static
+build : |
+ %make
+install : |
+ %make_install
diff --git a/pspec_x86_64.xml b/pspec_x86_64.xml
new file mode 100644
--- /dev/null
+++ b/pspec_x86_64.xml
@@ -0,0 +1,88 @@
+<PISI>
+ <Source>
+ <Name>audiofile</Name>
+ <Packager>
+ <Name>F. von Gellhorn</Name>
+ <Email>flinux@vongellhorn.ch</Email>
+ </Packager>
+ <License>GPL-2.1-or-later</License>
+ <License>LGPL-2.1-or-later</License>
+ <PartOf>multimedia.library</PartOf>
+ <Summary xml:lang="en">Silicon Graphics Audio File Library</Summary>
+ <Description xml:lang="en">Silicon Graphics Audio File Library
+</Description>
+ <Archive type="binary" sha1sum="79eb0752a961b8e0d15c77d298c97498fbc89c5a">https://getsol.us/sources/README.Solus</Archive>
+ </Source>
+ <Package>
+ <Name>audiofile</Name>
+ <Summary xml:lang="en">Silicon Graphics Audio File Library</Summary>
+ <Description xml:lang="en">Silicon Graphics Audio File Library
+</Description>
+ <PartOf>multimedia.library</PartOf>
+ <Files>
+ <Path fileType="executable">/usr/bin/sfconvert</Path>
+ <Path fileType="executable">/usr/bin/sfinfo</Path>
+ <Path fileType="library">/usr/lib64/libaudiofile.so.1</Path>
+ <Path fileType="library">/usr/lib64/libaudiofile.so.1.0.0</Path>
+ <Path fileType="man">/usr/share/man/man1/sfconvert.1</Path>
+ <Path fileType="man">/usr/share/man/man1/sfinfo.1</Path>
+ <Path fileType="man">/usr/share/man/man3/afCloseFile.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afGetDataOffset.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afGetFrameCount.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afGetFrameSize.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afGetTrackBytes.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afInitAESChannelData.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afInitAESChannelDataTo.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afInitByteOrder.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afInitChannels.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afInitCompression.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afInitFileFormat.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afInitRate.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afInitSampleFormat.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afNewFileSetup.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afOpenFile.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afQuery.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afQueryDouble.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afQueryLong.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afQueryPointer.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afReadFrames.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afReadMisc.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afSeekFrame.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afSeekMisc.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afSetErrorHandler.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afSetVirtualByteOrder.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afSetVirtualChannels.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afSetVirtualPCMMapping.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afSetVirtualSampleFormat.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afTellFrame.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afWriteFrames.3</Path>
+ <Path fileType="man">/usr/share/man/man3/afWriteMisc.3</Path>
+ </Files>
+ </Package>
+ <Package>
+ <Name>audiofile-devel</Name>
+ <Summary xml:lang="en">Development files for audiofile</Summary>
+ <Description xml:lang="en">Silicon Graphics Audio File Library
+</Description>
+ <PartOf>programming.devel</PartOf>
+ <RuntimeDependencies>
+ <Dependency release="1">audiofile</Dependency>
+ </RuntimeDependencies>
+ <Files>
+ <Path fileType="header">/usr/include/af_vfs.h</Path>
+ <Path fileType="header">/usr/include/audiofile.h</Path>
+ <Path fileType="header">/usr/include/aupvlist.h</Path>
+ <Path fileType="library">/usr/lib64/libaudiofile.so</Path>
+ <Path fileType="data">/usr/lib64/pkgconfig/audiofile.pc</Path>
+ </Files>
+ </Package>
+ <History>
+ <Update release="1">
+ <Date>2019-11-23</Date>
+ <Version>0.3.6</Version>
+ <Comment>Packaging update</Comment>
+ <Name>F. von Gellhorn</Name>
+ <Email>flinux@vongellhorn.ch</Email>
+ </Update>
+ </History>
+</PISI>
\ No newline at end of file

File Metadata

Mime Type
text/plain
Expires
Jul 12 2023, 8:29 AM (4 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5850318
Default Alt Text
D7700.id.diff (43 KB)

Event Timeline