commit:     34c7075aeac33688f7d7758c4f723cdfd8055820
Author:     Igor V. Kovalenko <igor.v.kovalenko <AT> gmail <DOT> com>
AuthorDate: Fri Jun 17 23:37:30 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 18 00:18:17 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34c7075a

media-sound/pulseaudio-daemon: Fix crash using pacmd play-file command

Upstream commit a8a2a31408c4acf54530d65922d235d3e590ce05

Fixes pulseaudio crash when playing a file using pacmd play-file command.

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/25949
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...pulseaudio-16.0-fix-pacmd-play-file-crash.patch | 42 ++++++++++++++++++++++
 .../pulseaudio-daemon-16.0-r5.ebuild               |  1 +
 2 files changed, 43 insertions(+)

diff --git 
a/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-pacmd-play-file-crash.patch
 
b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-pacmd-play-file-crash.patch
new file mode 100644
index 000000000000..f9c044dbb2be
--- /dev/null
+++ 
b/media-sound/pulseaudio-daemon/files/pulseaudio-16.0-fix-pacmd-play-file-crash.patch
@@ -0,0 +1,42 @@
+https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/a8a2a31408c4acf54530d65922d235d3e590ce05
+
+From a8a2a31408c4acf54530d65922d235d3e590ce05 Mon Sep 17 00:00:00 2001
+From: Jaechul Lee <jcsing....@samsung.com>
+Date: Thu, 2 Jun 2022 15:07:09 +0900
+Subject: [PATCH] sound-file-stream: Fix crash when playing a file which is not
+ aligned
+
+pulseaudio crash occurred when I play a file using pacmd play-file command.
+The file is not aligned with its frame size and the last rendering size
+is also not aligned. Thus, an assertion was generated at the end of the
+file as the following.
+
+memblockq.c: Assertion 'uchunk->length % bq->base == 0' failed at
+../src/pulsecore/memblockq.c:288, function pa_memblockq_push(). Aborting.
+
+When I play the file using paplay, it works good. So, I changed to
+pa_memblockq_push_align instead of pa_memblockq_push to prevent the
+assertion.
+
+Signed-off-by: Jaechul Lee <jcsing....@samsung.com>
+Part-of: 
<https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/717>
+---
+ src/pulsecore/sound-file-stream.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/pulsecore/sound-file-stream.c 
b/src/pulsecore/sound-file-stream.c
+index 147aa2288..255f4b61a 100644
+--- a/src/pulsecore/sound-file-stream.c
++++ b/src/pulsecore/sound-file-stream.c
+@@ -185,7 +185,7 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t 
length, pa_memchunk *chunk
+ 
+         tchunk.length = (size_t) n * fs;
+ 
+-        pa_memblockq_push(u->memblockq, &tchunk);
++        pa_memblockq_push_align(u->memblockq, &tchunk);
+         pa_memblock_unref(tchunk.memblock);
+     }
+ 
+-- 
+GitLab
+

diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r5.ebuild 
b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r5.ebuild
index 25e717a28ffa..5e19cc3419c7 100644
--- a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r5.ebuild
+++ b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0-r5.ebuild
@@ -167,6 +167,7 @@ PATCHES=(
        "${FILESDIR}"/pulseaudio-16.0-optional-module-console-kit.patch
        "${FILESDIR}"/pulseaudio-16.0-fix-combine-sink-underrun-crash.patch
        "${FILESDIR}"/pulseaudio-16.0-fix-gstreamer-bluetooth-arm-crash.patch
+       "${FILESDIR}"/pulseaudio-16.0-fix-pacmd-play-file-crash.patch
 )
 
 src_prepare() {

Reply via email to