[vlc-devel] commit: meta engine: add checks to verify that we indeed have the inputitem and it' s dir when we use it. (Derk-Jan Hartman )

git version control git at videolan.org
Fri Jul 25 03:56:45 CEST 2008


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Fri Jul 25 03:28:15 2008 +0200| [c4afdf592d3f4261bf05aabefab0b1d3bbf0dd28]

meta engine: add checks to verify that we indeed have the inputitem and it's dir when we use it.

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

 modules/meta_engine/folder.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/modules/meta_engine/folder.c b/modules/meta_engine/folder.c
index d2fb5db..e6493e0 100644
--- a/modules/meta_engine/folder.c
+++ b/modules/meta_engine/folder.c
@@ -73,9 +73,14 @@ static int FindMeta( vlc_object_t *p_this )
     int i = 0;
     struct stat a;
     char psz_filename[MAX_PATH];
+    if( !p_item )
+        return VLC_EGENERIC;
+
     char *psz_dir = input_item_GetURI( p_item );
-    char *psz_buf = strrchr( psz_dir, '/' );
+    if( !psz_dir )
+        return VLC_EGENERIC;
 
+    char *psz_buf = strrchr( psz_dir, '/' );
     if( psz_buf )
     {
         psz_buf++;




More information about the vlc-devel mailing list