summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c09f952)
raw | patch | inline | side by side (parent: c09f952)
author | Max Kellermann <max@duempel.org> | |
Sat, 3 Oct 2009 16:21:15 +0000 (18:21 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sat, 3 Oct 2009 16:21:15 +0000 (18:21 +0200) |
Fix segmentation faults when the list is empty.
src/screen_artist.c | patch | blob | history |
diff --git a/src/screen_artist.c b/src/screen_artist.c
index 5c0ff30994d3a025ca330b70658a0bb7e3ebcf89..95e4d2236683e4dfcb60cda029e5b3433a643fba 100644 (file)
--- a/src/screen_artist.c
+++ b/src/screen_artist.c
case CMD_PLAY:
switch (mode) {
case LIST_ARTISTS:
+ if (browser.lw->selected >= artist_list->len)
+ return true;
+
selected = g_ptr_array_index(artist_list,
browser.lw->selected);
open_album_list(c, g_strdup(selected));
case CMD_ADD:
switch(mode) {
case LIST_ARTISTS:
+ if (browser.lw->selected >= artist_list->len)
+ return true;
+
for (unsigned i = browser.lw->selected_start;
i <= browser.lw->selected_end; ++i) {
selected = g_ptr_array_index(artist_list, i);