]> git.sesse.net Git - vlc/blobdiff - modules/meta_engine/folder.c
Don't print a message a malloc failed.
[vlc] / modules / meta_engine / folder.c
index 2c1eed348a5733c591a3f874df3acced40373fa7..e6493e0e2e8d5545a72a26397196d8cba7843f78 100644 (file)
@@ -29,7 +29,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_interface.h>
 #include <vlc_meta.h>
@@ -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++;