diff options
author | Max Kellermann <max@duempel.org> | 2014-05-12 18:53:47 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-05-12 18:53:47 +0200 |
commit | a84bcf597dcb59a655aa75a620b5941f24d4ea2b (patch) | |
tree | d3c508311c84a2a7ce9dc89f04e4adfda5dff704 /src | |
parent | 4bbd4ba855ba343fb76c8d265e3de609bb872438 (diff) | |
download | mpd-a84bcf597dcb59a655aa75a620b5941f24d4ea2b.tar.gz mpd-a84bcf597dcb59a655aa75a620b5941f24d4ea2b.tar.xz mpd-a84bcf597dcb59a655aa75a620b5941f24d4ea2b.zip |
input/cdio: handle cdio_open() failure
Diffstat (limited to 'src')
-rw-r--r-- | src/input/plugins/CdioParanoiaInputPlugin.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/input/plugins/CdioParanoiaInputPlugin.cxx b/src/input/plugins/CdioParanoiaInputPlugin.cxx index 19fd33913..1d39a1cc3 100644 --- a/src/input/plugins/CdioParanoiaInputPlugin.cxx +++ b/src/input/plugins/CdioParanoiaInputPlugin.cxx @@ -197,6 +197,11 @@ input_cdio_open(const char *uri, /* Found such a CD-ROM with a CD-DA loaded. Use the first drive in the list. */ i->cdio = cdio_open(device.c_str(), DRIVER_UNKNOWN); + if (i->cdio == nullptr) { + error.Set(cdio_domain, "Failed to open CD drive"); + delete i; + return nullptr; + } i->drv = cdio_cddap_identify_cdio(i->cdio, 1, nullptr); |