Commit 1aacc658 authored by Ilkka Ollakka's avatar Ilkka Ollakka

playlist: fix crash when p_playlist->current.i_size == 0 and random is on

parent 7fc73f3f
...@@ -187,7 +187,7 @@ static void ResetCurrentlyPlaying( playlist_t *p_playlist, ...@@ -187,7 +187,7 @@ static void ResetCurrentlyPlaying( playlist_t *p_playlist,
PL_DEBUG("rebuild done - %i items, index %i", p_playlist->current.i_size, PL_DEBUG("rebuild done - %i items, index %i", p_playlist->current.i_size,
p_playlist->i_current_index); p_playlist->i_current_index);
if( var_GetBool( p_playlist, "random" ) ) if( var_GetBool( p_playlist, "random" ) && ( p_playlist->current.i_size > 0 ) )
{ {
/* Shuffle the array */ /* Shuffle the array */
for( unsigned j = p_playlist->current.i_size - 1; j > 0; j-- ) for( unsigned j = p_playlist->current.i_size - 1; j > 0; j-- )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment