diff options
| -rw-r--r-- | src/plugins/Input/cue/cueparser.cpp | 6 | ||||
| -rw-r--r-- | src/plugins/Input/cue/decoder_cue.cpp | 18 |
2 files changed, 22 insertions, 2 deletions
diff --git a/src/plugins/Input/cue/cueparser.cpp b/src/plugins/Input/cue/cueparser.cpp index cf79db5c2..6fdf5d0f8 100644 --- a/src/plugins/Input/cue/cueparser.cpp +++ b/src/plugins/Input/cue/cueparser.cpp @@ -31,7 +31,11 @@ CUEParser::CUEParser(const QString &fileName) { QString album; QFile file(fileName); - file.open(QIODevice::ReadOnly); + if(!file.open(QIODevice::ReadOnly)) + { + qDebug("CUEParser: Error: %s", qPrintable(file.errorString())); + return; + } while (!file.atEnd()) { diff --git a/src/plugins/Input/cue/decoder_cue.cpp b/src/plugins/Input/cue/decoder_cue.cpp index 31d921596..3ebc0fdca 100644 --- a/src/plugins/Input/cue/decoder_cue.cpp +++ b/src/plugins/Input/cue/decoder_cue.cpp @@ -46,11 +46,27 @@ DecoderCUE::~DecoderCUE() bool DecoderCUE::initialize() { + m_input2 = 0; CUEParser parser(QUrl(path).path()); + if (parser.count() == 0) + { + qWarning("DecoderCUE: Invalid cue file"); + return FALSE; + } int track = path.section("#", -1).toInt(); path = parser.filePath(); + if (!QFile::exists(path)) + { + qWarning("DecoderCUE: File \"%s\" doesn't exist", qPrintable(path)); + return FALSE; + } DecoderFactory *df = Decoder::findByPath(path); - if (df) + if (!df) + { + qWarning("DecoderCUE: unsupported file format"); + return FALSE; + } + if (!df->properties().noInput) { m_input2 = new QFile(path); if (!m_input2->open(QIODevice::ReadOnly)) |
