summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2017-06-08 08:55:46 +0200
committerDavid Seifert <soap@gentoo.org>2017-06-08 08:56:39 +0200
commit35457ed57bb3c46248bdf1bb9e58bcee3af48a5d (patch)
tree7ef8c9d1f0561869e3cc39f1b32b88dd8fcdcb72 /media-libs/libsndfile
parentsys-kernel/vanilla-sources: Automated version bump to {4.4.71,4.9.31,4.11.4} ... (diff)
downloadgentoo-35457ed57bb3c46248bdf1bb9e58bcee3af48a5d.tar.gz
gentoo-35457ed57bb3c46248bdf1bb9e58bcee3af48a5d.tar.bz2
gentoo-35457ed57bb3c46248bdf1bb9e58bcee3af48a5d.zip
media-libs/libsndfile: Fix varargs type bug
Bug: https://bugs.gentoo.org/show_bug.cgi?id=618452 Package-Manager: Portage-2.3.6, Repoman-2.3.2
Diffstat (limited to 'media-libs/libsndfile')
-rw-r--r--media-libs/libsndfile/files/libsndfile-1.0.28-arm-varargs-failure.patch32
-rw-r--r--media-libs/libsndfile/libsndfile-1.0.28-r1.ebuild2
2 files changed, 34 insertions, 0 deletions
diff --git a/media-libs/libsndfile/files/libsndfile-1.0.28-arm-varargs-failure.patch b/media-libs/libsndfile/files/libsndfile-1.0.28-arm-varargs-failure.patch
new file mode 100644
index 000000000000..ed726f829769
--- /dev/null
+++ b/media-libs/libsndfile/files/libsndfile-1.0.28-arm-varargs-failure.patch
@@ -0,0 +1,32 @@
+From 9d470ee5577d3ccedb1c28c7e0a7295ba17feaf5 Mon Sep 17 00:00:00 2001
+From: Erik de Castro Lopo <erikd@mega-nerd.com>
+Date: Sun, 16 Apr 2017 17:54:17 +1000
+Subject: [PATCH] src/rf64.c: Fix varargs related bug
+
+C's <stargs.h> functionality isn't type checked so that passing an
+`sf_count_t` (64 bits) by mistake in place of a `unit32_t` can cause
+errors. This would be fine if it was an error on every architecture
+and platform, but its not. This particular problem only manifested
+on armhf and some other Arm architectures. It was not an issue on
+32 bit x86.
+
+I have now fixed variants of this same bug several times.
+
+Closes: https://github.com/erikd/libsndfile/issues/229
+---
+ src/rf64.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/rf64.c b/src/rf64.c
+index b3d637fa..02dd9046 100644
+--- a/src/rf64.c
++++ b/src/rf64.c
+@@ -742,7 +742,7 @@ rf64_write_header (SF_PRIVATE *psf, int calc_length)
+
+ pad_size = psf->dataoffset - 16 - psf->header.indx ;
+ if (pad_size >= 0)
+- psf_binheader_writef (psf, "m4z", PAD_MARKER, pad_size, make_size_t (pad_size)) ;
++ psf_binheader_writef (psf, "m4z", PAD_MARKER, (unsigned int) pad_size, make_size_t (pad_size)) ;
+
+ if (wpriv->rf64_downgrade && (psf->filelength < RIFF_DOWNGRADE_BYTES))
+ psf_binheader_writef (psf, "tm8", data_MARKER, psf->datalength) ;
diff --git a/media-libs/libsndfile/libsndfile-1.0.28-r1.ebuild b/media-libs/libsndfile/libsndfile-1.0.28-r1.ebuild
index d0862f411ff4..cfec91e87a09 100644
--- a/media-libs/libsndfile/libsndfile-1.0.28-r1.ebuild
+++ b/media-libs/libsndfile/libsndfile-1.0.28-r1.ebuild
@@ -36,6 +36,8 @@ DEPEND="${RDEPEND}
S=${WORKDIR}/${MY_P}
+PATCHES=( "${FILESDIR}"/${P}-arm-varargs-failure.patch )
+
pkg_setup() {
use test && python-any-r1_pkg_setup
}