From 2ee57f9b0d8d08c554392e6b832a335593a7555d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 4 Jul 2022 19:19:31 +0200 Subject: [PATCH] output/PipeWire: add nullptr check, fixing crash with PipeWire 0.3.53 Since PipeWire 0.3.53, control names can apparently be nulled, leading to crashes in applications assertion that the string cannot be nullptr. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1558 --- NEWS | 2 ++ src/output/plugins/PipeWireOutputPlugin.cxx | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index acdca2550..deca41469 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ ver 0.23.8 (not yet released) * storage - curl: fix crash if web server does not understand WebDAV +* output + - pipewire: fix crash with PipeWire 0.3.53 ver 0.23.7 (2022/05/09) * database diff --git a/src/output/plugins/PipeWireOutputPlugin.cxx b/src/output/plugins/PipeWireOutputPlugin.cxx index 18821b105..c752820d0 100644 --- a/src/output/plugins/PipeWireOutputPlugin.cxx +++ b/src/output/plugins/PipeWireOutputPlugin.cxx @@ -235,7 +235,8 @@ private: [[maybe_unused]] uint32_t id, const struct pw_stream_control *control) noexcept { auto &o = *(PipeWireOutput *)data; - if (StringIsEqual(control->name, "Channel Volumes")) + if (control->name != nullptr && + StringIsEqual(control->name, "Channel Volumes")) o.ControlInfo(control); }