summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authornia <nia@pkgsrc.org>2022-04-24 09:39:46 +0000
committernia <nia@pkgsrc.org>2022-04-24 09:39:46 +0000
commitbac4f299102fe61e178cf8d642bca04dd42fc2b3 (patch)
treebf17f33bb7e1a53d92bd20b3fd7896c5885a7ec4 /audio
parent205dbd893b433408c4aee968e83726abe2506760 (diff)
downloadpkgsrc-bac4f299102fe61e178cf8d642bca04dd42fc2b3.tar.gz
PR pkg/56800 hitting v or V during sox's play command causes a segfault
from Onno van der Linden
Diffstat (limited to 'audio')
-rw-r--r--audio/sox/Makefile4
-rw-r--r--audio/sox/distinfo6
-rw-r--r--audio/sox/patches/patch-aa14
-rw-r--r--audio/sox/patches/patch-src_sox.c34
-rw-r--r--audio/sox/patches/patch-src_sunaudio.c31
5 files changed, 66 insertions, 23 deletions
diff --git a/audio/sox/Makefile b/audio/sox/Makefile
index bb56469dc7d..81ee826195e 100644
--- a/audio/sox/Makefile
+++ b/audio/sox/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.69 2022/03/28 10:43:39 tnn Exp $
+# $NetBSD: Makefile,v 1.70 2022/04/24 09:39:46 nia Exp $
DISTNAME= sox-14.4.2
-PKGREVISION= 4
+PKGREVISION= 5
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=sox/}
diff --git a/audio/sox/distinfo b/audio/sox/distinfo
index 7ac9088a876..a79745dc004 100644
--- a/audio/sox/distinfo
+++ b/audio/sox/distinfo
@@ -1,10 +1,10 @@
-$NetBSD: distinfo,v 1.30 2021/10/26 09:59:30 nia Exp $
+$NetBSD: distinfo,v 1.31 2022/04/24 09:39:46 nia Exp $
BLAKE2s (sox-14.4.2.tar.gz) = a995d9682dad17ae557248bc008e16309537b49e3229390478e432882445b6d2
SHA512 (sox-14.4.2.tar.gz) = b5c6203f4f5577503a034fe5b3d6a033ee97fe4d171c533933e2b036118a43a14f97c9668433229708609ccf9ee16abdeca3fc7501aa0aafe06baacbba537eca
Size (sox-14.4.2.tar.gz) = 1134299 bytes
-SHA1 (patch-aa) = e6f3d06450862795648622a017b2c696328872f5
SHA1 (patch-ak) = 28675f56a0e2969d0facd98282667c53eb10c0ed
SHA1 (patch-src_coreaudio.c) = baee5596ec5efdc12f99ea9dab9e9c691a17b08d
SHA1 (patch-src_oss.c) = dca4dcf55d4bfa1da80b789cbddb48a9302e694b
-SHA1 (patch-src_sunaudio.c) = 286ad890a32d69d499f76faa255473889b091d56
+SHA1 (patch-src_sox.c) = 2ac1ec7157a1cd9581d07fea5093f49df2dd7b7f
+SHA1 (patch-src_sunaudio.c) = 9f6a67b09c46cbc8298c226d972c43e86aeaae26
diff --git a/audio/sox/patches/patch-aa b/audio/sox/patches/patch-aa
deleted file mode 100644
index d2c8f804f96..00000000000
--- a/audio/sox/patches/patch-aa
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD: patch-aa,v 1.13 2010/07/23 07:55:12 adam Exp $
-
---- src/sox.c.orig 2010-07-22 15:31:02.000000000 +0000
-+++ src/sox.c
-@@ -1216,7 +1216,9 @@ static void adjust_volume(int delta)
- vol2 = range_limit(vol1 + delta, 0, 100);
- AUDIO_INITINFO(&audio_info);
- audio_info.play.gain = (vol2 * AUDIO_MAX_GAIN + 50) / 100;
-+#if !defined(__NetBSD__)
- audio_info.output_muted = 0;
-+#endif
- lsx_debug("%04x %04x", vol1, vol2);
- if (vol1 != vol2 && ioctl(fd, AUDIO_SETINFO, &audio_info) < 0)
- vol2 = vol1;
diff --git a/audio/sox/patches/patch-src_sox.c b/audio/sox/patches/patch-src_sox.c
new file mode 100644
index 00000000000..80feff3f754
--- /dev/null
+++ b/audio/sox/patches/patch-src_sox.c
@@ -0,0 +1,34 @@
+$NetBSD: patch-src_sox.c,v 1.1 2022/04/24 09:39:46 nia Exp $
+
+PR pkg/56800 hitting v or V during sox's play command causes a
+segfault
+
+https://sourceforge.net/p/sox/code/ci/4b17639fb7591153dbd3e234eea21b1a2a29fcfa/
+from more than 10 years ago changed the sun audio driver for the 14.4 release
+to not use stdio (among others) while adjust_volume() in sox.c still used
+fileno under the assumption that stdio was being used in the audio driver.
+
+output_muted is not defined on NetBSD.
+
+--- src/sox.c.orig 2014-10-06 02:02:30.000000000 +0000
++++ src/sox.c
+@@ -1313,7 +1313,8 @@ static void adjust_volume(int delta)
+ #elif defined(HAVE_AUDIOIO_H)
+ static void adjust_volume(int delta)
+ {
+- int vol1 = 0, vol2 = 0, fd = fileno((FILE*)ofile->ft->fp);
++ int vol1 = 0, vol2 = 0, fd;
++ fd = ofile->ft->fp != NULL ? *((int *)ofile->ft->fp) : -1;
+ if (fd >= 0) {
+ audio_info_t audio_info;
+ if (ioctl(fd, AUDIO_GETINFO, &audio_info) >= 0) {
+@@ -1321,7 +1322,9 @@ static void adjust_volume(int delta)
+ vol2 = range_limit(vol1 + delta, 0, 100);
+ AUDIO_INITINFO(&audio_info);
+ audio_info.play.gain = (vol2 * AUDIO_MAX_GAIN + 50) / 100;
++#if defined(__sun)
+ audio_info.output_muted = 0;
++#endif
+ lsx_debug("%04x %04x", vol1, vol2);
+ if (vol1 != vol2 && ioctl(fd, AUDIO_SETINFO, &audio_info) < 0)
+ vol2 = vol1;
diff --git a/audio/sox/patches/patch-src_sunaudio.c b/audio/sox/patches/patch-src_sunaudio.c
index 143b07c81d3..e4ecbd26cb9 100644
--- a/audio/sox/patches/patch-src_sunaudio.c
+++ b/audio/sox/patches/patch-src_sunaudio.c
@@ -1,9 +1,32 @@
-$NetBSD: patch-src_sunaudio.c,v 1.1 2015/05/25 19:06:24 bsiegert Exp $
+$NetBSD: patch-src_sunaudio.c,v 1.2 2022/04/24 09:39:46 nia Exp $
-Fix segfault when playing (PR pkg/49929).
---- src/sunaudio.c.orig 2015-05-25 19:00:39.000000000 +0000
+- Make the now unused (in the audio driver's case) void *fp member of the
+ sox_format_t structure a pointer to the filedescriptor of the audio
+ device in the driver and reference it in adjust_volume() with an
+ additional check for NULL. (PR pkg/56800)
+
+- Fix segfault when playing (PR pkg/49929).
+
+--- src/sunaudio.c.orig 2014-10-06 01:59:34.000000000 +0000
+++ src/sunaudio.c
-@@ -443,7 +443,7 @@ static size_t sunwrite(
+@@ -336,6 +336,8 @@ static int sunstartwrite(sox_format_t *
+ pPriv->cOutput = sox_globals.bufsiz >> pPriv->sample_shift;
+ pPriv->pOutput = lsx_malloc((size_t)pPriv->cOutput << pPriv->sample_shift);
+
++ ft->fp = &pPriv->device;
++
+ return (SOX_SUCCESS);
+ }
+
+@@ -348,6 +350,7 @@ static int sunstop(sox_format_t* ft)
+ if (pPriv->pOutput) {
+ free(pPriv->pOutput);
+ }
++ ft->fp = NULL;
+ return SOX_SUCCESS;
+ }
+
+@@ -443,7 +446,7 @@ static size_t sunwrite(
size_t cbStride;
int cbWritten;