[vlc-devel] [PATCH 2/4] lua: do not exit() if SD descriptor() returns nil

Rafaël Carré funman at videolan.org
Thu Nov 14 20:07:52 CET 2013


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

diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c
index 6f9b505..32bf717 100644
--- a/modules/lua/vlc.c
+++ b/modules/lua/vlc.c
@@ -693,6 +693,10 @@ static int vlc_sd_probe_Open( vlc_object_t *obj )
             }
             else
             {
+                if (lua_type(L, -1) == LUA_TNIL) {
+                    free( psz_filename );
+                    goto error;
+                }
                 lua_getfield( L, -1, "title" );
                 if( !lua_isstring( L, -1 ) ||
                     !( psz_longname = strdup( lua_tostring( L, -1 ) ) ) )
-- 
1.8.3.2




More information about the vlc-devel mailing list