Commit 6323eda2 authored by dionoea's avatar dionoea

* luaplaylist.c: make sure that the Lua stack is big enough before reading the playlist table.

parent a8a66a68
...@@ -438,6 +438,7 @@ static int Demux( demux_t *p_demux ) ...@@ -438,6 +438,7 @@ static int Demux( demux_t *p_demux )
input_item_t *p_input; input_item_t *p_input;
lua_State *p_state = p_demux->p_sys->p_state; lua_State *p_state = p_demux->p_sys->p_state;
char *psz_filename = p_demux->p_sys->psz_filename; char *psz_filename = p_demux->p_sys->psz_filename;
int t;
INIT_PLAYLIST_STUFF; INIT_PLAYLIST_STUFF;
...@@ -462,9 +463,13 @@ static int Demux( demux_t *p_demux ) ...@@ -462,9 +463,13 @@ static int Demux( demux_t *p_demux )
return VLC_EGENERIC; return VLC_EGENERIC;
} }
if( lua_gettop( p_state ) ) /* Check that the Lua stack is big enough and grow it if needed.
* Should be ok since LUA_MINSTACK is 20 but we never know. */
lua_checkstack( p_state, 7 );
if( ( t = lua_gettop( p_state ) ) )
{ {
int t = lua_gettop( p_state );
if( lua_istable( p_state, t ) ) if( lua_istable( p_state, t ) )
{ {
lua_pushnil( p_state ); lua_pushnil( p_state );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment