module-loopback: only enable delay with valid rate and channels

Or else we can't calculate the required delay buffer size and we might
even end up with a double free.

Fixes #3748
This commit is contained in:
Wim Taymans 2024-04-16 11:16:00 +02:00
parent 0e45836c36
commit 24478b9128

View file

@ -434,7 +434,7 @@ static void param_format_changed(struct impl *impl, const struct spa_pod *param,
static void recalculate_buffer(struct impl *impl)
{
if (impl->target_delay > 0.0f) {
if (impl->target_delay > 0.0f && impl->channels > 0 && impl->rate > 0) {
uint32_t delay = impl->rate * impl->target_delay;
void *data;