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
This commit is contained in:
Max Kellermann 2022-07-04 19:19:31 +02:00
parent 5a5655b790
commit 2ee57f9b0d
2 changed files with 4 additions and 1 deletions

2
NEWS
View File

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

View File

@ -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);
}