[arch-commits] Commit in libmad/repos (5 files)
Dan McGee
dan at archlinux.org
Sun Feb 15 19:58:53 UTC 2009
Date: Sunday, February 15, 2009 @ 14:58:53
Author: dan
Revision: 27035
Merged revisions 356,27034 via svnmerge from
svn+ssh://archlinux.org/srv/svn-packages/libmad/trunk
........
r356 | aaron | 2008-04-18 17:56:27 -0500 (Fri, 18 Apr 2008) | 1 line
Added svn:keywords to all PKGBUILDs
........
r27034 | dan | 2009-02-15 13:58:43 -0600 (Sun, 15 Feb 2009) | 2 lines
upgpkg: libmad 0.15.1b-3
rebuild and update patchset based off debian's
........
Added:
libmad/repos/extra-x86_64/amd64-64bit.diff
(from rev 27034, libmad/trunk/amd64-64bit.diff)
libmad/repos/extra-x86_64/frame_length.diff
(from rev 27034, libmad/trunk/frame_length.diff)
libmad/repos/extra-x86_64/optimize.diff
(from rev 27034, libmad/trunk/optimize.diff)
Modified:
libmad/repos/extra-x86_64/ (properties)
libmad/repos/extra-x86_64/PKGBUILD
-------------------+
PKGBUILD | 24 +++++-
amd64-64bit.diff | 12 +++
frame_length.diff | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++++
optimize.diff | 77 ++++++++++++++++++++
4 files changed, 305 insertions(+), 5 deletions(-)
Property changes on: libmad/repos/extra-x86_64
___________________________________________________________________
Modified: svnmerge-integrated
- /libmad/trunk:1
+ /libmad/trunk:1-27034
Modified: extra-x86_64/PKGBUILD
===================================================================
--- extra-x86_64/PKGBUILD 2009-02-15 19:58:43 UTC (rev 27034)
+++ extra-x86_64/PKGBUILD 2009-02-15 19:58:53 UTC (rev 27035)
@@ -2,7 +2,7 @@
# Maintainer: Travis Willard <travis at archlinux.org>
pkgname=libmad
pkgver=0.15.1b
-pkgrel=2
+pkgrel=3
pkgdesc="A high-quality MPEG audio decoder"
arch=(i686 x86_64)
license=('GPL')
@@ -11,14 +11,28 @@
conflicts=('mad')
options=('!libtool')
source=(http://downloads.sourceforge.net/sourceforge/mad/$pkgname-$pkgver.tar.gz
- libmad.patch)
+ libmad.patch amd64-64bit.diff frame_length.diff optimize.diff)
url="http://www.underbit.com/products/mad/"
-md5sums=('1be543bc30c56fb6bea1d7bf6a64e66c' 'fbcca0267a423bae45389666f4cb04d5')
build() {
- cd $startdir/src/$pkgname-$pkgver
- patch -Np1 -i $startdir/src/libmad.patch || return 1
+ cd $srcdir/$pkgname-$pkgver
+ patch -Np1 -i $srcdir/libmad.patch || return 1
+ patch -Np1 -i $srcdir/amd64-64bit.diff || return 1
+ patch -Np1 -i $srcdir/frame_length.diff || return 1
+ patch -Np1 -i $srcdir/optimize.diff || return 1
+ CFLAGS="$CFLAGS -ftree-vectorize -ftree-vectorizer-verbose=1"
./configure --prefix=/usr
make || return 1
make DESTDIR=$startdir/pkg install
}
+
+md5sums=('1be543bc30c56fb6bea1d7bf6a64e66c'
+ 'fbcca0267a423bae45389666f4cb04d5'
+ '8d8bd64a2842dd59153b3a6642059e23'
+ '3329b032118a68e18908197e65b3198d'
+ '3e52afe2103f367810a18bef9e82eb9f')
+sha256sums=('bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690'
+ '813634b07e72ccc23c5c5dc63f88fb789706477fa0a74f535115b8bd898b2ff4'
+ '0b506dc3c3a83837739f84f7b9db7497fd79b3623b5fb7e291ce44f79d7bf726'
+ '0e21f2c6b19337d0b237dacc04f7b90a56be7f359f4c9a2ee0b202d9af0cfa69'
+ 'f38216942a1e84fd5341394a56dc5e91117d168a660f3c07ebd59af9b907e6f2')
Copied: libmad/repos/extra-x86_64/amd64-64bit.diff (from rev 27034, libmad/trunk/amd64-64bit.diff)
===================================================================
--- extra-x86_64/amd64-64bit.diff (rev 0)
+++ extra-x86_64/amd64-64bit.diff 2009-02-15 19:58:53 UTC (rev 27035)
@@ -0,0 +1,12 @@
+Index: libmad-0.15.1b/configure.ac
+===================================================================
+--- libmad-0.15.1b.orig/configure.ac 2008-03-07 20:33:05.000000000 +0000
++++ libmad-0.15.1b/configure.ac 2008-03-07 20:33:31.000000000 +0000
+@@ -233,6 +233,7 @@
+ then
+ case "$host" in
+ i?86-*) FPM="INTEL" ;;
++ x86_64*) FPM="64BIT" ;;
+ arm*-*) FPM="ARM" ;;
+ mips*-*) FPM="MIPS" ;;
+ sparc*-*) FPM="SPARC" ;;
Copied: libmad/repos/extra-x86_64/frame_length.diff (from rev 27034, libmad/trunk/frame_length.diff)
===================================================================
--- extra-x86_64/frame_length.diff (rev 0)
+++ extra-x86_64/frame_length.diff 2009-02-15 19:58:53 UTC (rev 27035)
@@ -0,0 +1,197 @@
+; You can calculate where the next frame will start depending on things
+; like the bitrate. See mad_header_decode(). It seems that when decoding
+; the frame you can go past that boundary. This attempts to catch those cases,
+; but might not catch all of them.
+; For more info see http://bugs.debian.org/508133
+Index: libmad-0.15.1b/layer12.c
+===================================================================
+--- libmad-0.15.1b.orig/layer12.c 2008-12-23 21:38:07.000000000 +0100
++++ libmad-0.15.1b/layer12.c 2008-12-23 21:38:12.000000000 +0100
+@@ -134,6 +134,12 @@
+ for (sb = 0; sb < bound; ++sb) {
+ for (ch = 0; ch < nch; ++ch) {
+ nb = mad_bit_read(&stream->ptr, 4);
++ if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
++ {
++ stream->error = MAD_ERROR_LOSTSYNC;
++ stream->sync = 0;
++ return -1;
++ }
+
+ if (nb == 15) {
+ stream->error = MAD_ERROR_BADBITALLOC;
+@@ -146,6 +152,12 @@
+
+ for (sb = bound; sb < 32; ++sb) {
+ nb = mad_bit_read(&stream->ptr, 4);
++ if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
++ {
++ stream->error = MAD_ERROR_LOSTSYNC;
++ stream->sync = 0;
++ return -1;
++ }
+
+ if (nb == 15) {
+ stream->error = MAD_ERROR_BADBITALLOC;
+@@ -162,6 +174,12 @@
+ for (ch = 0; ch < nch; ++ch) {
+ if (allocation[ch][sb]) {
+ scalefactor[ch][sb] = mad_bit_read(&stream->ptr, 6);
++ if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
++ {
++ stream->error = MAD_ERROR_LOSTSYNC;
++ stream->sync = 0;
++ return -1;
++ }
+
+ # if defined(OPT_STRICT)
+ /*
+@@ -187,6 +205,12 @@
+ frame->sbsample[ch][s][sb] = nb ?
+ mad_f_mul(I_sample(&stream->ptr, nb),
+ sf_table[scalefactor[ch][sb]]) : 0;
++ if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
++ {
++ stream->error = MAD_ERROR_LOSTSYNC;
++ stream->sync = 0;
++ return -1;
++ }
+ }
+ }
+
+@@ -195,6 +219,12 @@
+ mad_fixed_t sample;
+
+ sample = I_sample(&stream->ptr, nb);
++ if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
++ {
++ stream->error = MAD_ERROR_LOSTSYNC;
++ stream->sync = 0;
++ return -1;
++ }
+
+ for (ch = 0; ch < nch; ++ch) {
+ frame->sbsample[ch][s][sb] =
+@@ -403,7 +433,15 @@
+ nbal = bitalloc_table[offsets[sb]].nbal;
+
+ for (ch = 0; ch < nch; ++ch)
++ {
+ allocation[ch][sb] = mad_bit_read(&stream->ptr, nbal);
++ if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
++ {
++ stream->error = MAD_ERROR_LOSTSYNC;
++ stream->sync = 0;
++ return -1;
++ }
++ }
+ }
+
+ for (sb = bound; sb < sblimit; ++sb) {
+@@ -411,6 +449,13 @@
+
+ allocation[0][sb] =
+ allocation[1][sb] = mad_bit_read(&stream->ptr, nbal);
++
++ if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
++ {
++ stream->error = MAD_ERROR_LOSTSYNC;
++ stream->sync = 0;
++ return -1;
++ }
+ }
+
+ /* decode scalefactor selection info */
+@@ -419,6 +464,12 @@
+ for (ch = 0; ch < nch; ++ch) {
+ if (allocation[ch][sb])
+ scfsi[ch][sb] = mad_bit_read(&stream->ptr, 2);
++ if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
++ {
++ stream->error = MAD_ERROR_LOSTSYNC;
++ stream->sync = 0;
++ return -1;
++ }
+ }
+ }
+
+@@ -442,6 +493,12 @@
+ for (ch = 0; ch < nch; ++ch) {
+ if (allocation[ch][sb]) {
+ scalefactor[ch][sb][0] = mad_bit_read(&stream->ptr, 6);
++ if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
++ {
++ stream->error = MAD_ERROR_LOSTSYNC;
++ stream->sync = 0;
++ return -1;
++ }
+
+ switch (scfsi[ch][sb]) {
+ case 2:
+@@ -452,11 +509,23 @@
+
+ case 0:
+ scalefactor[ch][sb][1] = mad_bit_read(&stream->ptr, 6);
++ if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
++ {
++ stream->error = MAD_ERROR_LOSTSYNC;
++ stream->sync = 0;
++ return -1;
++ }
+ /* fall through */
+
+ case 1:
+ case 3:
+ scalefactor[ch][sb][2] = mad_bit_read(&stream->ptr, 6);
++ if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
++ {
++ stream->error = MAD_ERROR_LOSTSYNC;
++ stream->sync = 0;
++ return -1;
++ }
+ }
+
+ if (scfsi[ch][sb] & 1)
+@@ -488,6 +557,12 @@
+ index = offset_table[bitalloc_table[offsets[sb]].offset][index - 1];
+
+ II_samples(&stream->ptr, &qc_table[index], samples);
++ if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
++ {
++ stream->error = MAD_ERROR_LOSTSYNC;
++ stream->sync = 0;
++ return -1;
++ }
+
+ for (s = 0; s < 3; ++s) {
+ frame->sbsample[ch][3 * gr + s][sb] =
+@@ -506,6 +581,12 @@
+ index = offset_table[bitalloc_table[offsets[sb]].offset][index - 1];
+
+ II_samples(&stream->ptr, &qc_table[index], samples);
++ if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
++ {
++ stream->error = MAD_ERROR_LOSTSYNC;
++ stream->sync = 0;
++ return -1;
++ }
+
+ for (ch = 0; ch < nch; ++ch) {
+ for (s = 0; s < 3; ++s) {
+Index: libmad-0.15.1b/layer3.c
+===================================================================
+--- libmad-0.15.1b.orig/layer3.c 2008-12-23 21:38:07.000000000 +0100
++++ libmad-0.15.1b/layer3.c 2008-12-23 21:38:12.000000000 +0100
+@@ -2608,6 +2608,12 @@
+ next_md_begin = 0;
+
+ md_len = si.main_data_begin + frame_space - next_md_begin;
++ if (md_len + MAD_BUFFER_GUARD > MAD_BUFFER_MDLEN)
++ {
++ stream->error = MAD_ERROR_LOSTSYNC;
++ stream->sync = 0;
++ return -1;
++ }
+
+ frame_used = 0;
+
Copied: libmad/repos/extra-x86_64/optimize.diff (from rev 27034, libmad/trunk/optimize.diff)
===================================================================
--- extra-x86_64/optimize.diff (rev 0)
+++ extra-x86_64/optimize.diff 2009-02-15 19:58:53 UTC (rev 27035)
@@ -0,0 +1,77 @@
+Index: libmad-0.15.1b/configure.ac
+===================================================================
+--- libmad-0.15.1b.orig/configure.ac 2008-03-07 20:31:23.000000000 +0000
++++ libmad-0.15.1b/configure.ac 2008-03-07 20:34:26.000000000 +0000
+@@ -124,71 +124,7 @@
+
+ if test "$GCC" = yes
+ then
+- if test -z "$arch"
+- then
+- case "$host" in
+- i386-*) ;;
+- i?86-*) arch="-march=i486" ;;
+- arm*-empeg-*) arch="-march=armv4 -mtune=strongarm1100" ;;
+- armv4*-*) arch="-march=armv4 -mtune=strongarm" ;;
+- powerpc-*) ;;
+- mips*-agenda-*) arch="-mcpu=vr4100" ;;
+- mips*-luxsonor-*) arch="-mips1 -mcpu=r3000 -Wa,-m4010" ;;
+- esac
+- fi
+-
+- case "$optimize" in
+- -O|"-O "*)
+- optimize="-O"
+- optimize="$optimize -fforce-mem"
+- optimize="$optimize -fforce-addr"
+- : #x optimize="$optimize -finline-functions"
+- : #- optimize="$optimize -fstrength-reduce"
+- optimize="$optimize -fthread-jumps"
+- optimize="$optimize -fcse-follow-jumps"
+- optimize="$optimize -fcse-skip-blocks"
+- : #x optimize="$optimize -frerun-cse-after-loop"
+- : #x optimize="$optimize -frerun-loop-opt"
+- : #x optimize="$optimize -fgcse"
+- optimize="$optimize -fexpensive-optimizations"
+- optimize="$optimize -fregmove"
+- : #* optimize="$optimize -fdelayed-branch"
+- : #x optimize="$optimize -fschedule-insns"
+- optimize="$optimize -fschedule-insns2"
+- : #? optimize="$optimize -ffunction-sections"
+- : #? optimize="$optimize -fcaller-saves"
+- : #> optimize="$optimize -funroll-loops"
+- : #> optimize="$optimize -funroll-all-loops"
+- : #x optimize="$optimize -fmove-all-movables"
+- : #x optimize="$optimize -freduce-all-givs"
+- : #? optimize="$optimize -fstrict-aliasing"
+- : #* optimize="$optimize -fstructure-noalias"
+-
+- case "$host" in
+- arm*-*)
+- optimize="$optimize -fstrength-reduce"
+- ;;
+- mips*-*)
+- optimize="$optimize -fstrength-reduce"
+- optimize="$optimize -finline-functions"
+- ;;
+- i?86-*)
+- optimize="$optimize -fstrength-reduce"
+- ;;
+- powerpc-apple-*)
+- # this triggers an internal compiler error with gcc2
+- : #optimize="$optimize -fstrength-reduce"
+-
+- # this is really only beneficial with gcc3
+- : #optimize="$optimize -finline-functions"
+- ;;
+- *)
+- # this sometimes provokes bugs in gcc 2.95.2
+- : #optimize="$optimize -fstrength-reduce"
+- ;;
+- esac
+- ;;
+- esac
++ optimize="-O2"
+ fi
+
+ case "$host" in
More information about the arch-commits
mailing list