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
This commit is contained in:
Thomas Weißschuh 2022-08-21 10:32:04 +02:00 committed by sfan5
parent bf5c19e05b
commit 6c1f01d284
1 changed files with 1 additions and 1 deletions

View File

@ -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++)