From 5adf43c6b1c5755f6fd29aa89cade21ab8802b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Stenac?= Date: Sat, 16 Sep 2006 21:00:15 +0000 Subject: [PATCH] Fix crash --- src/playlist/control.c | 2 +- src/playlist/tree.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/playlist/control.c b/src/playlist/control.c index 521a9d26f4..8bb86c6b36 100644 --- a/src/playlist/control.c +++ b/src/playlist/control.c @@ -358,7 +358,7 @@ end: /* Start the real work */ if( p_playlist->request.b_request ) { - PL_DEBUG( "processing request node %s item %s skip %i", + PL_DEBUG( "processing request item %s node %s skip %i", PLI_NAME( p_playlist->request.p_item ), PLI_NAME( p_playlist->request.p_node ), i_skip ); p_new = p_playlist->request.p_item; diff --git a/src/playlist/tree.c b/src/playlist/tree.c index c10c372064..9ff52e251a 100644 --- a/src/playlist/tree.c +++ b/src/playlist/tree.c @@ -663,10 +663,15 @@ playlist_item_t *GetPrevItem( playlist_t *p_playlist, { if( i-1 < 0 ) { - /* Was already the first sibling. Look for uncles */ - PL_DEBUG( "Current item is the first of the node," + /* Was already the first sibling. Look for uncles */ + PL_DEBUG( "current item is the first of its node," "looking for uncle from %s", p_parent->p_input->psz_name ); + if( p_parent == p_root ) + { + PL_DEBUG( "already at root" ); + return NULL; + } return GetPrevUncle( p_playlist, p_item, p_root ); } else -- GitLab