Skip to content
This repository
Browse code

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

…crash when they're empty
  • Loading branch information...
commit 40000acaee2f2961d20884907d954b00304c7a92 1 parent 52c2bf1
night199uk authored May 04, 2013
4  xbmc/music/infoscanner/MusicInfoScanner.cpp
@@ -519,7 +519,7 @@ void CMusicInfoScanner::FileItemsToAlbums(CFileItemList& items, VECALBUMS& album
519 519
       for (vector<string>::const_iterator it = tag.GetMusicBrainzArtistID().begin(); it != tag.GetMusicBrainzArtistID().end(); ++it)
520 520
       {
521 521
         CStdString strJoinPhrase = (it == --tag.GetMusicBrainzArtistID().end() ? "" : g_advancedSettings.m_musicItemSeparator);
522  
-        CArtistCredit mbartist(song.artist[0], *it, strJoinPhrase);
  522
+        CArtistCredit mbartist(tag.GetArtist().empty() ? "" : tag.GetArtist()[0], *it, strJoinPhrase);
523 523
         song.artistCredits.push_back(mbartist);
524 524
       }
525 525
       song.artist = tag.GetArtist();
@@ -553,7 +553,7 @@ void CMusicInfoScanner::FileItemsToAlbums(CFileItemList& items, VECALBUMS& album
553 553
         {
554 554
           // Picard always stored the display artist string in the first artist slot, no need to split it
555 555
           CStdString strJoinPhrase = (it == --tag.GetMusicBrainzAlbumArtistID().end() ? "" : g_advancedSettings.m_musicItemSeparator);
556  
-          CArtistCredit mbartist(tag.GetAlbumArtist()[0], *it, strJoinPhrase);
  556
+          CArtistCredit mbartist(tag.GetAlbumArtist().empty() ? "" : tag.GetAlbumArtist()[0], *it, strJoinPhrase);
557 557
           album.artistCredits.push_back(mbartist);
558 558
         }
559 559
         album.artist = tag.GetAlbumArtist();

0 notes on commit 40000ac

Please sign in to comment.
Something went wrong with that request. Please try again.