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 98f9529147
commit e9f0638a70

View file

@ -347,7 +347,7 @@ static void param_tag_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->info.channels > 0 && impl->rate > 0) {
uint32_t delay = impl->rate * impl->target_delay;
void *data;