[vlc-commits] commit: playlist: fix crash when p_playlist->current.i_size == 0 and random is on (Ilkka Ollakka )

git at videolan.org git at videolan.org
Sat Mar 6 16:18:37 CET 2010


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sat Mar  6 17:17:29 2010 +0200| [1aacc6584d540be5ff459124f880ad4046343da4] | committer: Ilkka Ollakka 

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1aacc6584d540be5ff459124f880ad4046343da4
---

 src/playlist/thread.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/playlist/thread.c b/src/playlist/thread.c
index 4cbd2a3..b0d9be2 100644
--- a/src/playlist/thread.c
+++ b/src/playlist/thread.c
@@ -187,7 +187,7 @@ static void ResetCurrentlyPlaying( playlist_t *p_playlist,
     PL_DEBUG("rebuild done - %i items, index %i", p_playlist->current.i_size,
                                                   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 */
         for( unsigned j = p_playlist->current.i_size - 1; j > 0; j-- )



More information about the vlc-commits mailing list