Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[musicdb] fix: unchecked access to albumartists/artists causes us to …

…crash when they're empty
  • Loading branch information...
commit 40000acaee2f2961d20884907d954b00304c7a92 1 parent 52c2bf1
@night199uk night199uk authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 xbmc/music/infoscanner/MusicInfoScanner.cpp
View
4 xbmc/music/infoscanner/MusicInfoScanner.cpp
@@ -519,7 +519,7 @@ void CMusicInfoScanner::FileItemsToAlbums(CFileItemList& items, VECALBUMS& album
for (vector<string>::const_iterator it = tag.GetMusicBrainzArtistID().begin(); it != tag.GetMusicBrainzArtistID().end(); ++it)
{
CStdString strJoinPhrase = (it == --tag.GetMusicBrainzArtistID().end() ? "" : g_advancedSettings.m_musicItemSeparator);
- CArtistCredit mbartist(song.artist[0], *it, strJoinPhrase);
+ CArtistCredit mbartist(tag.GetArtist().empty() ? "" : tag.GetArtist()[0], *it, strJoinPhrase);
song.artistCredits.push_back(mbartist);
}
song.artist = tag.GetArtist();
@@ -553,7 +553,7 @@ void CMusicInfoScanner::FileItemsToAlbums(CFileItemList& items, VECALBUMS& album
{
// Picard always stored the display artist string in the first artist slot, no need to split it
CStdString strJoinPhrase = (it == --tag.GetMusicBrainzAlbumArtistID().end() ? "" : g_advancedSettings.m_musicItemSeparator);
- CArtistCredit mbartist(tag.GetAlbumArtist()[0], *it, strJoinPhrase);
+ CArtistCredit mbartist(tag.GetAlbumArtist().empty() ? "" : tag.GetAlbumArtist()[0], *it, strJoinPhrase);
album.artistCredits.push_back(mbartist);
}
album.artist = tag.GetAlbumArtist();
Please sign in to comment.
Something went wrong with that request. Please try again.