Revision: 2255 http://gtkpod.svn.sourceforge.net/gtkpod/?rev=2255&view=rev Author: teuf Date: 2009-02-09 20:00:08 +0000 (Mon, 09 Feb 2009)
Log Message: ----------- Fix crash when generating the album list Modified Paths: -------------- libgpod/trunk/ChangeLog libgpod/trunk/src/itdb_itunesdb.c Modified: libgpod/trunk/ChangeLog =================================================================== --- libgpod/trunk/ChangeLog 2009-02-01 14:49:15 UTC (rev 2254) +++ libgpod/trunk/ChangeLog 2009-02-09 20:00:08 UTC (rev 2255) @@ -1,3 +1,9 @@ +2009-02-09 Christophe Fergeau <t...@gnome.org> + + * src/itdb_itunesdb.c: fix crash when generating the album list + when a track has a NULL album. Thanks to Peter and Todd for + reporting that bug and pinpointing what was wrong. + 2009-01-31 Todd Zullinger <tmzullinger at users.sourceforge.net> * README.SysInfo: Add info on determining FirewireGUID on Modified: libgpod/trunk/src/itdb_itunesdb.c =================================================================== --- libgpod/trunk/src/itdb_itunesdb.c 2009-02-01 14:49:15 UTC (rev 2254) +++ libgpod/trunk/src/itdb_itunesdb.c 2009-02-09 20:00:08 UTC (rev 2255) @@ -5158,12 +5158,17 @@ Itdb_Track *track1 = (Itdb_Track *)v1; Itdb_Track *track2 = (Itdb_Track *)v2; + g_assert (track1->album != NULL); + g_assert (track2->album != NULL); + if ((track1->albumartist != NULL) && (track2->albumartist != NULL)) { return (g_str_equal (track1->album, track2->album) && g_str_equal (track1->albumartist, track2->albumartist)); - } else { + } else if ((track1->artist != NULL) && (track2->artist != NULL)) { return (g_str_equal (track1->album, track2->album) && g_str_equal (track1->artist, track2->artist)); + } else { + return (g_str_equal (track1->album, track2->album)); } } @@ -5217,7 +5222,7 @@ g_return_if_fail (track); track->id = fexp->next_id++; - if ((track->album == NULL) && (track->artist == NULL)) { + if (track->album == NULL) { /* unknow album name and artist, this entry isn't interesting to * build the list of all albums on the ipod */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ gtkpod-cvs2 mailing list gtkpod-cvs2@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2