input/CdioParanoia: fix crash if no drive was found

cdio_get_devices_with_cap() can return nullptr if no drive was found,
or it can instead return an empty list.  The latter caused MPD to
crash.
This commit is contained in:
Max Kellermann 2022-07-08 12:04:41 +02:00
parent 915c5442d1
commit 8eb3164878
2 changed files with 5 additions and 0 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
* input
- cdio_paranoia: fix crash if no drive was found
* output
- pipewire: fix crash with PipeWire 0.3.53
* mixer

View File

@ -176,6 +176,9 @@ cdio_detect_device()
AtScopeExit(devices) { cdio_free_device_list(devices); };
if (devices[0] == nullptr)
return nullptr;
return AllocatedPath::FromFS(devices[0]);
}