]> git.sesse.net Git - vlc/blobdiff - src/playlist/tree.c
Fix playlist crasher and simplify a few things
[vlc] / src / playlist / tree.c
index 120ef099869fdc05c685fcb0a3f6c41a149ffff4..c54014a9c8ee85783924972ced7361d43bf211a1 100644 (file)
@@ -354,6 +354,8 @@ playlist_item_t *playlist_GetNextLeaf( playlist_t *p_playlist,
 {
     playlist_item_t *p_next;
 
+    assert( p_root && p_root->i_children != -1 );
+
 #ifdef PLAYLIST_DEBUG
     if( p_item != NULL )
         msg_Dbg( p_playlist, "finding next of %s within %s",
@@ -363,7 +365,6 @@ playlist_item_t *playlist_GetNextLeaf( playlist_t *p_playlist,
                          p_root->p_input->psz_name );
 #endif
 
-    assert( p_root && p_root->i_children != -1 );
 
     /* Now, walk the tree until we find a suitable next item */
     p_next = p_item;