From 54e71369e1b2dde50af1ee6f41c5375f7ae32610 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 13 Oct 2008 10:26:58 +0000 Subject: fixed some bugs in cue plugin git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@582 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/cue/decoder_cue.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/plugins/Input/cue/decoder_cue.cpp') 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)) -- cgit v1.2.3-13-gbd6f