[vlc-devel] commit: directory: assert() at critical places. (Pierre d'Herbemont )
git version control
git at videolan.org
Tue Jul 22 21:25:44 CEST 2008
vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Tue Jul 22 21:24:23 2008 +0200| [dbce11f1dab1bc211ea43bda59a72d7db2960633]
directory: assert() at critical places.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dbce11f1dab1bc211ea43bda59a72d7db2960633
---
modules/access/directory.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/modules/access/directory.c b/modules/access/directory.c
index 5777b08..4e247ab 100644
--- a/modules/access/directory.c
+++ b/modules/access/directory.c
@@ -30,6 +30,7 @@
# include "config.h"
#endif
+#include <assert.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#warning playlist code must not be used here.
@@ -255,6 +256,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len)
p_current->p_input->i_type = ITEM_TYPE_DIRECTORY;
p_item_in_category = playlist_ItemToNode( p_playlist, p_current,
pl_Unlocked );
+ assert( p_item_in_category );
ReadDir( p_access, p_playlist, psz_name, i_mode,
p_item_in_category,
@@ -493,7 +495,7 @@ static int ReadDir( access_t *p_access, playlist_t *p_playlist,
p_parent_category,
PLAYLIST_NO_REBUILD, NULL );
PL_UNLOCK;
-
+ assert( p_node );
/* If we had the parent in category, the it is now node.
* Else, we still don't have */
i_return = ReadDir( p_access, p_playlist, psz_uri , MODE_EXPAND,
@@ -535,6 +537,7 @@ static int ReadDir( access_t *p_access, playlist_t *p_playlist,
{
if( p_current_input )
input_ItemCopyOptions( p_current_input, p_input );
+ assert( p_parent_category );
int i_ret = playlist_BothAddInput( p_playlist, p_input,
p_parent_category,
PLAYLIST_APPEND|PLAYLIST_PREPARSE|
More information about the vlc-devel
mailing list