Commit 4aae8a68 authored by Cyril Deguet's avatar Cyril Deguet

- playlist.c: avoid a segfault when playlist_ViewFind() returns NULL.

 Anyway I guess it should not happen so there is a bug in the playlist
 code but I have no time to understand it...
parent a2de6063
......@@ -861,7 +861,11 @@ static playlist_item_t * NextItem( playlist_t *p_playlist )
p_view = playlist_ViewFind( p_playlist,p_playlist->request.i_view );
p_playlist->status.p_node = p_playlist->request.p_node;
p_playlist->status.i_view = p_playlist->request.i_view;
if( i_skip > 0 )
if( !p_view )
{
msg_Err( p_playlist, "p_view is NULL and should not! (FIXME)" );
}
else if( i_skip > 0 )
{
for( i = i_skip; i > 0 ; i-- )
{
......@@ -939,18 +943,25 @@ static playlist_item_t * NextItem( playlist_t *p_playlist )
playlist_view_t *p_view =
playlist_ViewFind( p_playlist,
p_playlist->status.i_view );
p_new = playlist_FindNextFromParent( p_playlist,
if( !p_view )
{
msg_Err( p_playlist, "p_view is NULL and should not! (FIXME)" );
}
else
{
p_new = playlist_FindNextFromParent( p_playlist,
p_playlist->status.i_view,
p_view->p_root,
p_playlist->status.p_node,
p_playlist->status.p_item );
if( p_new == NULL && b_loop )
{
p_new = playlist_FindNextFromParent( p_playlist,
if( p_new == NULL && b_loop )
{
p_new = playlist_FindNextFromParent( p_playlist,
p_playlist->status.i_view,
p_view->p_root,
p_playlist->status.p_node,
NULL );
}
}
}
}
......
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