From a84bcf597dcb59a655aa75a620b5941f24d4ea2b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 12 May 2014 18:53:47 +0200 Subject: input/cdio: handle cdio_open() failure --- src/input/plugins/CdioParanoiaInputPlugin.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/input/plugins/CdioParanoiaInputPlugin.cxx') 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); -- cgit v1.2.3