From 0da4afca76a86cb917c0e5b6e3d1feb63f5cf1f3 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 1 Sep 2025 12:39:08 +0200 Subject: [PATCH] audiommixer: only clear mix_ops when initialized It's possible that the mix_ops was not initialized and then the free pointer is NULL, so check this instead of segfaulting. --- spa/plugins/audiomixer/audiomixer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spa/plugins/audiomixer/audiomixer.c b/spa/plugins/audiomixer/audiomixer.c index bab300713..77d8e1453 100644 --- a/spa/plugins/audiomixer/audiomixer.c +++ b/spa/plugins/audiomixer/audiomixer.c @@ -921,7 +921,8 @@ static int impl_clear(struct spa_handle *handle) for (i = 0; i < MAX_PORTS; i++) free(this->in_ports[i]); - mix_ops_free(&this->ops); + if (this->ops.free) + mix_ops_free(&this->ops); return 0; }