Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix a number of minor issues reported by Coverity for mythmusic.

  • Loading branch information...
commit 687f24234af0b0372a4e26b87a7a4b8e631bc388 1 parent 32cd375
Stuart Morgan stuartm authored
5 mythplugins/mythmusic/mythmusic/decoderhandler.cpp
View
@@ -472,7 +472,8 @@ bool DecoderHandler::createPlaylistForSingleFile(const QUrl &url)
bool DecoderHandler::createPlaylistFromFile(const QUrl &url)
{
QFile f(QFileInfo(url.path()).absolutePath() + "/" + QFileInfo(url.path()).fileName());
- f.open(QIODevice::ReadOnly);
+ if (!f.open(QIODevice::ReadOnly))
+ return false;
QTextStream stream(&f);
QString extension = QFileInfo(url.path()).suffix().toLower();
@@ -730,7 +731,7 @@ MusicSGIODevice::~MusicSGIODevice(void)
bool MusicSGIODevice::open(int)
{
- return true;
+ return m_remotefile->isOpen();
}
bool MusicSGIODevice::seek(qint64 pos)
9 mythplugins/mythmusic/mythmusic/editmetadata.cpp
View
@@ -524,15 +524,14 @@ void EditMetadataDialog::checkClicked(bool state)
{
if (!state)
{
- if (m_compArtistEdit)
- m_compArtistEdit->SetText(m_metadata->Artist());
+ m_compArtistEdit->SetText(m_metadata->Artist());
}
else
{
- if (m_compArtistEdit->GetText().isEmpty() || m_compArtistEdit->GetText() == m_artistEdit->GetText())
+ if (m_compArtistEdit->GetText().isEmpty() ||
+ m_compArtistEdit->GetText() == m_artistEdit->GetText())
{
- if (m_compArtistEdit)
- m_compArtistEdit->SetText(tr("Various Artists"));
+ m_compArtistEdit->SetText(tr("Various Artists"));
}
}
}
6 mythplugins/mythmusic/mythmusic/metadata.cpp
View
@@ -1502,7 +1502,11 @@ void AlbumArtImages::dumpToDatabase(void)
query.bindValue(":SONGID", trackID);
query.bindValue(":DIRECTORYID", directoryID);
- query.exec();
+ if (!query.exec())
+ {
+ MythDB::DBError("AlbumArtImages::dumpToDatabase - "
+ "deleting existing albumart", query);
+ }
// now add the albumart to the db
AlbumArtList::iterator it = m_imageList.begin();
5 mythplugins/mythmusic/mythmusic/metaiotaglib.cpp
View
@@ -62,8 +62,11 @@ void MetaIOTagLib::WriteGenericMetadata(Tag *tag, const Metadata *metadata)
*/
void MetaIOTagLib::ReadGenericMetadata(Tag *tag, Metadata *metadata)
{
+ if (!tag || ! metadata)
+ return;
+
// Basic Tags
- if (metadata && tag && !tag->isEmpty())
+ if (!tag->isEmpty())
{
metadata->setTitle(TStringToQString(tag->title()).trimmed());
metadata->setArtist(TStringToQString(tag->artist()).trimmed());
4 mythplugins/mythmusic/mythmusic/musicutils.cpp
View
@@ -57,8 +57,8 @@ uint calcTrackLength(const QString &musicFile)
AVFormatContext *inputFC = NULL;
AVInputFormat *fmt = NULL;
- if (type)
- fmt = av_find_input_format(type);
+// if (type)
+// fmt = av_find_input_format(type);
// Open recording
LOG(VB_GENERAL, LOG_DEBUG, QString("calcTrackLength: Opening '%1'")
2  mythplugins/mythmusic/mythmusic/playlisteditorview.h
View
@@ -54,7 +54,7 @@ class MPUBLIC MusicGenericTree : public MythGenericTree
QPointer<MusicButtonItem> m_buttonItem;
MythUIButtonListItem::CheckState m_check;
bool m_showArrow;
- bool m_active;
+ //bool m_active;
};
Q_DECLARE_METATYPE(MusicGenericTree*)
Please sign in to comment.
Something went wrong with that request. Please try again.