games-emulation/pcsx2: fix cubeb alsa UB

Couldn't reproduce, but this seems to be UB and may cause all sort of
problems randomly. Hopefully upstream cubeb will look at it eventually
(still not merged).

Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
This commit is contained in:
Ionen Wolkens
2026-04-26 23:31:38 -04:00
parent 6b51f56780
commit 0de0077d50
3 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
A user reported crashes while interacting with menus while a game
is running and using ALSA, and that this fixes it for them.
https://github.com/mozilla/cubeb/pull/829
--- a/3rdparty/cubeb/src/cubeb.c
+++ b/3rdparty/cubeb/src/cubeb.c
@@ -741,4 +741,8 @@
rv = context->ops->enumerate_devices(context, devtype, collection);
+ if (rv != CUBEB_OK) {
+ collection->device = NULL;
+ collection->count = 0;
+ }
if (cubeb_log_get_callback()) {

View File

@@ -90,6 +90,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-1.7.5913-musl-cache.patch
"${FILESDIR}"/${PN}-2.5.317-flags.patch
"${FILESDIR}"/${PN}-2.6.3-climits.patch
"${FILESDIR}"/${PN}-2.6.3-cubeb-alsa.patch
)
CMAKE_QA_COMPAT_SKIP=1 #957976

View File

@@ -92,6 +92,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-1.7.5913-musl-cache.patch
"${FILESDIR}"/${PN}-2.5.317-flags.patch
"${FILESDIR}"/${PN}-2.6.3-climits.patch
"${FILESDIR}"/${PN}-2.6.3-cubeb-alsa.patch
)
CMAKE_QA_COMPAT_SKIP=1 #957976