[vlc-devel] [PATCH 2/2] lua: fix crash after recent playlist changes
Steve Lhomme
robux4 at videolabs.io
Mon May 15 08:45:30 CEST 2017
---
modules/lua/libs/playlist.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/modules/lua/libs/playlist.c b/modules/lua/libs/playlist.c
index d03c63e541..395e0a22d3 100644
--- a/modules/lua/libs/playlist.c
+++ b/modules/lua/libs/playlist.c
@@ -130,8 +130,9 @@ static int vlclua_playlist_gotoitem( lua_State * L )
int i_id = luaL_checkint( L, 1 );
playlist_t *p_playlist = vlclua_get_playlist_internal( L );
PL_LOCK;
- playlist_ViewPlay( p_playlist, NULL,
- playlist_ItemGetById( p_playlist, i_id ) );
+ playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_id );
+ if( p_item != NULL )
+ playlist_ViewPlay( p_playlist, NULL, p_item );
PL_UNLOCK;
return vlclua_push_ret( L, VLC_SUCCESS );
}
--
2.12.1
More information about the vlc-devel
mailing list