aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/flac/decoderflacfactory.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2021-02-09 18:58:00 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2021-02-09 18:58:00 +0000
commit8eeee6f4df222cb3ad83d8ae53cf9043dfff67e3 (patch)
treead0f62551fe1a86c1bcc13cf4ae9635c1e9ca4c1 /src/plugins/Input/flac/decoderflacfactory.cpp
parentb255a52aa82a7045c8d5afde7c9225dd053daeaa (diff)
downloadqmmp-8eeee6f4df222cb3ad83d8ae53cf9043dfff67e3.tar.gz
qmmp-8eeee6f4df222cb3ad83d8ae53cf9043dfff67e3.tar.bz2
qmmp-8eeee6f4df222cb3ad83d8ae53cf9043dfff67e3.zip
flac: do not return any metadata for invalid cue tracks
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9713 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/flac/decoderflacfactory.cpp')
-rw-r--r--src/plugins/Input/flac/decoderflacfactory.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plugins/Input/flac/decoderflacfactory.cpp b/src/plugins/Input/flac/decoderflacfactory.cpp
index 8ab8cf0ce..588392b9d 100644
--- a/src/plugins/Input/flac/decoderflacfactory.cpp
+++ b/src/plugins/Input/flac/decoderflacfactory.cpp
@@ -139,7 +139,7 @@ QList<TrackInfo*> DecoderFLACFactory::createPlayList(const QString &path, TrackI
if((parts & TrackInfo::MetaData) && tag && !tag->isEmpty())
{
- if (tag->fieldListMap().contains("CUESHEET") && ap)
+ if(tag->fieldListMap().contains("CUESHEET") && ap)
{
QByteArray data(tag->fieldListMap()["CUESHEET"].toString().toCString(true));
QString diskNumber;
@@ -169,6 +169,16 @@ QList<TrackInfo*> DecoderFLACFactory::createPlayList(const QString &path, TrackI
delete info;
return parser.createPlayList(track);
}
+ else if(track > 0) //cue track is not available
+ {
+ if(flacFile)
+ delete flacFile;
+ if(oggFlacFile)
+ delete oggFlacFile;
+
+ delete info;
+ return QList<TrackInfo *>();
+ }
info->setValue(Qmmp::ALBUM, TStringToQString(tag->album()));
info->setValue(Qmmp::ARTIST, TStringToQString(tag->artist()));