MOC crashes on playlist loading

Forums:

MOC crashes on playlist loading with Shift+A
if the same track is included twice

example playlist:

#EXTM3U #EXTINF:0,6 Code 64 - Every Moment (Departure) /home/blaze/music/Code 64/2006 Departure/06 Every Moment.ogg #EXTINF:0,6 Code 64 - Every Moment (Departure) /home/blaze/music/Code 64/2006 Departure/06 Every Moment.ogg

version 2.6.0 svn revison 2935 on Debian/Ubuntu

Forgot to mention that server doesn't crash in that case, client only.

Seems to be the problem with plist_remove_common_items() checking for duplicates also removed files which might not have filename value set (see plist_load_m3u() ). I think that the following patch resolves the issue:

Index: playlist.c =================================================================== --- playlist.c (revision 2941) +++ playlist.c (working copy) @@ -846,8 +846,12 @@ assert (b != NULL); for (i = 0; i < a->num; i += 1) { - if (plist_find_fname(b, a->items[i].file) != -1) - plist_delete (a, i); + if (a->items[i].deleted == 0) { + assert (a->items[i].file != NULL); + + if (plist_find_fname(b, a->items[i].file) != -1) + plist_delete (a, i); + } } }

I'm not sure however if checking for duplicates in plist_load_m3u() or add_dir_plist() makes much sense. The is a check later on audio_plist_add() (albeit it results in warning logged).

Fix committed as r2944 (MOC 2.5) and r2945.