From 7a089faa29f45c86b92f684b80fd15ba662e051d Mon Sep 17 00:00:00 2001 From: David Sansome Date: Fri, 7 Jan 2011 19:16:45 +0000 Subject: [PATCH] Fix a crash that ocurrs when something calls GetCaps over dbus before the playlist is initialised, and when a repeat mode is set. --- src/playlist/playlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/playlist/playlist.cpp b/src/playlist/playlist.cpp index 10015af99..70b12107e 100644 --- a/src/playlist/playlist.cpp +++ b/src/playlist/playlist.cpp @@ -462,7 +462,7 @@ int Playlist::next_row() const { } // Still off the end? Then just give up - if (next_virtual_index >= virtual_items_.count()) + if (next_virtual_index < 0 || next_virtual_index >= virtual_items_.count()) return -1; return virtual_items_[next_virtual_index];