[vlc-commits] luasd: handle memory error on probing

Pierre Ynard git at videolan.org
Wed Nov 16 15:29:30 CET 2016


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Wed Nov 16 15:29:02 2016 +0100| [7f74ae29092a716ee0c554ca31f468fbba6e5e1e] | committer: Pierre Ynard

luasd: handle memory error on probing

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

 modules/lua/vlc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c
index 40ab957..46c4e9d 100644
--- a/modules/lua/vlc.c
+++ b/modules/lua/vlc.c
@@ -621,10 +621,12 @@ int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
 static int vlc_sd_probe_Open( vlc_object_t *obj )
 {
     vlc_dictionary_t name_d;
-    vlc_dictionary_init( &name_d, 32 );
 
     char **ppsz_dir_list;
-    vlclua_dir_list( "sd", &ppsz_dir_list );
+    if( vlclua_dir_list( "sd", &ppsz_dir_list ) )
+        return VLC_ENOMEM;
+
+    vlc_dictionary_init( &name_d, 32 );
     for( char **ppsz_dir = ppsz_dir_list; *ppsz_dir; ppsz_dir++ )
     {
         char **ppsz_filelist;



More information about the vlc-commits mailing list