Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Treeve Jelbert (cbd1376dfc4aeae0016c90ce6bd9818a72f379cc)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Treeve Jelbert <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Treeve Jelbert (cbd1376dfc4aeae0016c90ce6bd9818a72f379cc)
  • Date: Sun, 26 Mar 2017 07:11:46 +0000

GIT changes to master grimoire by Treeve Jelbert <treeve AT sourcemage.org>:

audio-libs/audiofile/DETAILS
| 3
audio-libs/audiofile/HISTORY
| 6
audio-libs/audiofile/PRE_BUILD
| 1

audio-libs/audiofile/patches/04_clamp-index-values-to-fix-index-overflow-in-IMA.cpp.patch
| 33 ++

audio-libs/audiofile/patches/05_Always-check-the-number-of-coefficients.patch
| 30 +

audio-libs/audiofile/patches/06_Check-for-multiplication-overflow-in-MSADPCM-decodeSam.patch
| 116 +++++++

audio-libs/audiofile/patches/07_Check-for-multiplication-overflow-in-sfconvert.patch
| 66 ++++

audio-libs/audiofile/patches/08_Fix-signature-of-multiplyCheckOverflow.-It-returns-a-b.patch
| 35 ++

audio-libs/audiofile/patches/09_Actually-fail-when-error-occurs-in-parseFormat.patch
| 36 ++

audio-libs/audiofile/patches/10_Check-for-division-by-zero-in-BlockCodec-runPull.patch
| 21 +
audio-libs/audiofile/patches/CVE-2015-7747.patch
| 161 ++++++++++
dev/null
|binary
editors/tidy/BUILD
| 7
editors/tidy/CONFIGURE
| 4
editors/tidy/DEPENDS
| 8
editors/tidy/DETAILS
| 40 --
editors/tidy/HISTORY
| 8
editors/tidy/INSTALL
| 20 -
editors/tidy/PRE_BUILD
| 18 -
19 files changed, 532 insertions(+), 81 deletions(-)

New commits:
commit cbd1376dfc4aeae0016c90ce6bd9818a72f379cc
Author: Treeve Jelbert <treeve AT sourcemage.org>
Commit: Treeve Jelbert <treeve AT sourcemage.org>

audiofile - SECURITY FIX

commit 5cd1bf397bc813789fffb1f43e4f13320d0ef70c
Author: Treeve Jelbert <treeve AT sourcemage.org>
Commit: Treeve Jelbert <treeve AT sourcemage.org>

tidy: => 5.4.0

diff --git a/audio-libs/audiofile/DETAILS b/audio-libs/audiofile/DETAILS
index fa1ecb3..0e5904b 100755
--- a/audio-libs/audiofile/DETAILS
+++ b/audio-libs/audiofile/DETAILS
@@ -1,6 +1,7 @@
SPELL=audiofile
VERSION=0.3.6
-#
SOURCE_HASH=sha512:a8ce05848b03d53014328d0dcdb231c211fbe9003ece0c59b9fbeac5b6e5cb72de8ded08a61ba8e0888ae013355c18e31ea6c7a4f12d76f889b5e157f60cf662
+# SOURCE_HASH=sha512:
+ SECURITY_PATCH=1
SOURCE=$SPELL-$VERSION.tar.gz
SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELL-$VERSION
SOURCE_URL[0]=http://www.68k.org/~michael/$SPELL/$SOURCE
diff --git a/audio-libs/audiofile/HISTORY b/audio-libs/audiofile/HISTORY
index e78354e..33a2ee4 100644
--- a/audio-libs/audiofile/HISTORY
+++ b/audio-libs/audiofile/HISTORY
@@ -1,3 +1,9 @@
+2017-03-26 Treeve Jelbert <treeve AT sourcemage.org>
+ * DETAILS: SECURITY_PATCH=1
+ * patches/*: added, from ubuntu
+
https://launchpad.net/ubuntu/+source/audiofile/0.3.6-2ubuntu0.14.04.2
+ * PRE_BUILD: apply patches
+
2016-05-04 Treeve Jelbert <treeve AT sourcemage.org>
* BUILD: fix for gcc-6.1

diff --git a/audio-libs/audiofile/PRE_BUILD b/audio-libs/audiofile/PRE_BUILD
index 1e450ff..5ddca5f 100755
--- a/audio-libs/audiofile/PRE_BUILD
+++ b/audio-libs/audiofile/PRE_BUILD
@@ -1,3 +1,4 @@
default_pre_build &&
cd $SOURCE_DIRECTORY &&
+apply_patch_dir patches &&
sed -i 's/-Werror//' libaudiofile/Makefile.in
libaudiofile/modules/Makefile.in
diff --git
a/audio-libs/audiofile/patches/04_clamp-index-values-to-fix-index-overflow-in-IMA.cpp.patch

b/audio-libs/audiofile/patches/04_clamp-index-values-to-fix-index-overflow-in-IMA.cpp.patch
new file mode 100644
index 0000000..c1047af
--- /dev/null
+++
b/audio-libs/audiofile/patches/04_clamp-index-values-to-fix-index-overflow-in-IMA.cpp.patch
@@ -0,0 +1,33 @@
+From: Antonio Larrosa <larrosa AT 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/audio-libs/audiofile/patches/05_Always-check-the-number-of-coefficients.patch

b/audio-libs/audiofile/patches/05_Always-check-the-number-of-coefficients.patch
new file mode 100644
index 0000000..f9427cb
--- /dev/null
+++
b/audio-libs/audiofile/patches/05_Always-check-the-number-of-coefficients.patch
@@ -0,0 +1,30 @@
+From: Antonio Larrosa <larrosa AT 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/audio-libs/audiofile/patches/06_Check-for-multiplication-overflow-in-MSADPCM-decodeSam.patch

b/audio-libs/audiofile/patches/06_Check-for-multiplication-overflow-in-MSADPCM-decodeSam.patch
new file mode 100644
index 0000000..2be930b
--- /dev/null
+++
b/audio-libs/audiofile/patches/06_Check-for-multiplication-overflow-in-MSADPCM-decodeSam.patch
@@ -0,0 +1,116 @@
+From: Antonio Larrosa <larrosa AT 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/audio-libs/audiofile/patches/07_Check-for-multiplication-overflow-in-sfconvert.patch

b/audio-libs/audiofile/patches/07_Check-for-multiplication-overflow-in-sfconvert.patch
new file mode 100644
index 0000000..0f17140
--- /dev/null
+++
b/audio-libs/audiofile/patches/07_Check-for-multiplication-overflow-in-sfconvert.patch
@@ -0,0 +1,66 @@
+From: Antonio Larrosa <larrosa AT 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/audio-libs/audiofile/patches/08_Fix-signature-of-multiplyCheckOverflow.-It-returns-a-b.patch

b/audio-libs/audiofile/patches/08_Fix-signature-of-multiplyCheckOverflow.-It-returns-a-b.patch
new file mode 100644
index 0000000..35627d3
--- /dev/null
+++
b/audio-libs/audiofile/patches/08_Fix-signature-of-multiplyCheckOverflow.-It-returns-a-b.patch
@@ -0,0 +1,35 @@
+From: Antonio Larrosa <larrosa AT 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/audio-libs/audiofile/patches/09_Actually-fail-when-error-occurs-in-parseFormat.patch

b/audio-libs/audiofile/patches/09_Actually-fail-when-error-occurs-in-parseFormat.patch
new file mode 100644
index 0000000..50cd3dc
--- /dev/null
+++
b/audio-libs/audiofile/patches/09_Actually-fail-when-error-occurs-in-parseFormat.patch
@@ -0,0 +1,36 @@
+From: Antonio Larrosa <larrosa AT 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/audio-libs/audiofile/patches/10_Check-for-division-by-zero-in-BlockCodec-runPull.patch

b/audio-libs/audiofile/patches/10_Check-for-division-by-zero-in-BlockCodec-runPull.patch
new file mode 100644
index 0000000..e001133
--- /dev/null
+++
b/audio-libs/audiofile/patches/10_Check-for-division-by-zero-in-BlockCodec-runPull.patch
@@ -0,0 +1,21 @@
+From: Antonio Larrosa <larrosa AT 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/audio-libs/audiofile/patches/CVE-2015-7747.patch
b/audio-libs/audiofile/patches/CVE-2015-7747.patch
new file mode 100644
index 0000000..06738ea
--- /dev/null
+++ b/audio-libs/audiofile/patches/CVE-2015-7747.patch
@@ -0,0 +1,161 @@
+Description: fix buffer overflow when changing both sample format and
+ number of channels
+Origin: backport, https://github.com/mpruett/audiofile/pull/25
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/audiofile/+bug/1502721
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=801102
+
+Index: audiofile-0.3.6/libaudiofile/modules/ModuleState.cpp
+===================================================================
+--- audiofile-0.3.6.orig/libaudiofile/modules/ModuleState.cpp 2015-10-20
08:00:58.036128202 -0400
++++ audiofile-0.3.6/libaudiofile/modules/ModuleState.cpp 2015-10-20
08:00:58.036128202 -0400
+@@ -402,7 +402,7 @@
+ 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));
+Index: audiofile-0.3.6/test/Makefile.am
+===================================================================
+--- audiofile-0.3.6.orig/test/Makefile.am 2015-10-20 08:00:58.036128202
-0400
++++ audiofile-0.3.6/test/Makefile.am 2015-10-20 08:00:58.036128202 -0400
+@@ -26,6 +26,7 @@
+ VirtualFile \
+ floatto24 \
+ query2 \
++ sixteen-stereo-to-eight-mono \
+ sixteen-to-eight \
+ testchannelmatrix \
+ testdouble \
+@@ -139,6 +140,7 @@
+ 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
+
+Index: audiofile-0.3.6/test/sixteen-stereo-to-eight-mono.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ audiofile-0.3.6/test/sixteen-stereo-to-eight-mono.c 2015-10-20
08:33:57.512286416 -0400
+@@ -0,0 +1,117 @@
++/*
++ 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[PATH_MAX];
++ 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);
++
++ exit(EXIT_SUCCESS);
++}
diff --git a/editors/tidy/BUILD b/editors/tidy/BUILD
index 5e7b394..e013b8d 100755
--- a/editors/tidy/BUILD
+++ b/editors/tidy/BUILD
@@ -1,6 +1 @@
-sh build/gnuauto/setup.sh &&
-default_build &&
-
-if [[ "${TIDY_MAN_PAGES}" == "y" ]]
-then doxygen -u htmldoc/doxygen.cfg && doxygen htmldoc/doxygen.cfg
-fi
+cmake_build
diff --git a/editors/tidy/CONFIGURE b/editors/tidy/CONFIGURE
index 9c4cb04..b2f02c3 100755
--- a/editors/tidy/CONFIGURE
+++ b/editors/tidy/CONFIGURE
@@ -1,3 +1 @@
-config_query TIDY_MAN_PAGES "Install man pages?" n &&
-config_query TIDY_HTML_DOCS "Install html docs?" n &&
-config_query TIDY_API_DOCS "Install api docs?" n
+source $GRIMOIRE/CMAKE_CONFIGURE
diff --git a/editors/tidy/DEPENDS b/editors/tidy/DEPENDS
index 8b7b4ba..6d7d390 100755
--- a/editors/tidy/DEPENDS
+++ b/editors/tidy/DEPENDS
@@ -1,7 +1 @@
-if [[ "${TIDY_BRANCH}" == "scm" ]]
-then depends CVS
-fi
-
-if [[ "${TIDY_MAN_PAGES}" == "y" ]]
-then depends doxygen
-fi
+source $GRIMOIRE/CMAKE_DEPENDS
diff --git a/editors/tidy/DETAILS b/editors/tidy/DETAILS
index d5b8804..08df4ab 100755
--- a/editors/tidy/DETAILS
+++ b/editors/tidy/DETAILS
@@ -9,37 +9,23 @@ if [[ "${TIDY_BRANCH}" == "scm" ]]; then
SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELL-cvsroot

else
- VERSION=051025
-#
-# Do *not* remove the version from the SOURCE.
-#
- SOURCE=${SPELL}_src_$VERSION.tgz
-SOURCE_DIRECTORY=${BUILD_DIRECTORY}/${SPELL}
- SOURCE_URL[0]=http://tidy.sourceforge.net/src/old/${SOURCE}
- SOURCE_GPG=gurus.gpg:${SOURCE}.sig:WORKS_FOR_ME
+ SPELLX=tidy-html5
+ VERSION=5.4.0
+
SOURCE_HASH=sha512:d92c89f2ef371499f9c3de6f9389783d2449433b4da1f5a29e2eb81b7a7db8dd9f68e220cdde092d446e9bd779bcbc30f84bda79013526540f29d00f438cb402
+ SOURCE=${SPELLX}-${VERSION}.tar.gz
+SOURCE_DIRECTORY=${BUILD_DIRECTORY}/${SPELLX}-${VERSION}
+
SOURCE_URL[0]=https://github.com/htacg/$SPELLX/releases/download/$VERSION/$SOURCE
fi
-
-if [[ "${TIDY_MAN_PAGES}" == "y" ||
- "${TIDY_HTML_DOCS}" == "y" ||
- "${TIDY_API_DOCS}" == "y" ]]
-
-then
- DOC_VERSION=051020
- SOURCE2=${SPELL}_docs_${DOC_VERSION}.tgz
- SOURCE2_URL=http://tidy.sf.net/docs/${SOURCE2}
- SOURCE2_GPG=gurus.gpg:${SOURCE2}.sig:WORKS_FOR_ME
-fi
-
- WEB_SITE=http://tidy.sourceforge.net/
+ WEB_SITE=http://www.html-tidy.org
ENTERED=20021002
LICENSE[0]=W3C
KEYWORDS="html editors"
SHORT="Tidy cleans up bad HTML"
cat << EOF
-Tidy is able to fix up a wide range of problems and to bring to your
attention
-things that you need to work on yourself. Each item found is listed with the
-line number and column so that you can see where the problem lies in your
-markup. Tidy won't generate a cleaned up version when there are problems that
-it can't be sure of how to handle. These are logged as "errors" rather than
-"warnings".
+Tidy is a console application for Mac OS X, Linux, Windows, UNIX, and more.
It corrects and
+cleans up HTML and XML documents by fixing markup errors and upgrading
legacy code to modern
+standards.
+libtidy is a C static and dynamic library that developers can integrate into
their applications
+in order to bring all of Tidy’s power to your favorite tools. libtidy is
used today in desktop
+applications, web servers, and more.
EOF
diff --git a/editors/tidy/HISTORY b/editors/tidy/HISTORY
index 194ba80..f2e563a 100644
--- a/editors/tidy/HISTORY
+++ b/editors/tidy/HISTORY
@@ -1,3 +1,11 @@
+2017-03-25 Treeve Jelbert <treeve AT sourcemage.org>
+ * DETAILS: version 5.4.0
+ multiple changes
+ new website
+ man pages are now included
+ * DEPENDS, CONFIGURE, BUILD, INSTALL: add cmake stuff
+ * PRE_BUILD: deleted
+
2014-07-03 Ismael Luceno <ismael AT sourcemage.org>
* DETAILS: Use get_scm_version

diff --git a/editors/tidy/INSTALL b/editors/tidy/INSTALL
index 4b193b0..157bcdc 100755
--- a/editors/tidy/INSTALL
+++ b/editors/tidy/INSTALL
@@ -1,19 +1 @@
-default_install &&
-
-if [[ "${TIDY_MAN_PAGES}" == "y" ]] ; then
- mkdir -p ${INSTALL_ROOT}/usr/share/man/man3 &&
- cp ${SOURCE_DIRECTORY}/htmldoc/man/man3/* \
- ${INSTALL_ROOT}/usr/share/man/man3/
-fi &&
-
-if [[ "${TIDY_HTML_DOCS}" == "y" ]] ; then
- mkdir -p ${INSTALL_ROOT}/usr/share/doc/tidy/htmldoc/ &&
- cp ${SOURCE_DIRECTORY}/htmldoc/*.{html,css,gif} \
- ${INSTALL_ROOT}/usr/share/doc/tidy/htmldoc/
-fi &&
-
-if [[ "${TIDY_API_DOCS}" == "y" ]] ; then
- mkdir -p ${INSTALL_ROOT}/usr/share/doc/tidy/api &&
- cp ${SOURCE_DIRECTORY}/htmldoc/api/* \
- ${INSTALL_ROOT}/usr/share/doc/tidy/api/
-fi
+cmake_install
diff --git a/editors/tidy/PRE_BUILD b/editors/tidy/PRE_BUILD
deleted file mode 100755
index 3553d49..0000000
--- a/editors/tidy/PRE_BUILD
+++ /dev/null
@@ -1,18 +0,0 @@
-default_pre_build &&
-
-if [[ "${TIDY_MAN_PAGES}" == "y" ||
- "${TIDY_HTML_DOCS}" == "y" ||
- "${TIDY_API_DOCS}" == "y" ]]
-then unpack_file 2
-fi
-
-
-if [[ "$TIDY_BRANCH" == "scm" ]]; then
- cd "$SOURCE_DIRECTORY" &&
- NOCONFIGURE=ON source ./build/gnuauto/setup.sh
-fi &&
-
-if [[ "${TIDY_MAN_PAGES}" == "y" ]] ; then
- sedit "s/GENERATE_MAN *=\ NO/GENERATE_MAN\ =\ YES/g" \
- ${SOURCE_DIRECTORY}/htmldoc/doxygen.cfg
-fi
diff --git a/editors/tidy/tidy_docs_051020.tgz.sig
b/editors/tidy/tidy_docs_051020.tgz.sig
deleted file mode 100644
index 7dd427a..0000000
Binary files a/editors/tidy/tidy_docs_051020.tgz.sig and /dev/null differ
diff --git a/editors/tidy/tidy_src_051025.tgz.sig
b/editors/tidy/tidy_src_051025.tgz.sig
deleted file mode 100644
index 477a884..0000000
Binary files a/editors/tidy/tidy_src_051025.tgz.sig and /dev/null differ




Archive powered by MHonArc 2.6.24.

Top of Page