From 6c1f01d2841281fd594f8ce874b4113640c07553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sun, 21 Aug 2022 10:32:04 +0200 Subject: ao_pipewire: make sure not to exceed the available buffer The error description in #10545 could indicate that we are overflowing we are corrupting the buffer metadata ourselves through out-of-bound writes. This check is also present in pw-cat so it seems to be expected for b->requested to exceed the actual available buffer space. Potential fix for #10545 --- audio/out/ao_pipewire.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/out/ao_pipewire.c b/audio/out/ao_pipewire.c index 3421856c44..5384588e1e 100644 --- a/audio/out/ao_pipewire.c +++ b/audio/out/ao_pipewire.c @@ -133,7 +133,7 @@ static void on_process(void *userdata) int nframes = bytes_per_channel / ao->sstride; #if PW_CHECK_VERSION(0, 3, 49) if (b->requested != 0) - nframes = b->requested; + nframes = MPMIN(b->requested, nframes); #endif for (int i = 0; i < buf->n_datas; i++) -- cgit v1.2.3