diff options
Diffstat (limited to 'src/plugins/Input/cue/decoder_cue.cpp')
| -rw-r--r-- | src/plugins/Input/cue/decoder_cue.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
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)) |
