Commit 905bbb9e authored by Rémi Duraffort's avatar Rémi Duraffort

Avoid a segfault when services_discovery_GetServicesNames fail.

parent 3f9cee77
...@@ -428,6 +428,9 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf ) ...@@ -428,6 +428,9 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf )
char **ppsz_longnames; char **ppsz_longnames;
char **ppsz_names = services_discovery_GetServicesNames( p_intf, char **ppsz_names = services_discovery_GetServicesNames( p_intf,
&ppsz_longnames ); &ppsz_longnames );
if( !ppsz_names )
return menu;
char **ppsz_name = ppsz_names, **ppsz_longname = ppsz_longnames; char **ppsz_name = ppsz_names, **ppsz_longname = ppsz_longnames;
for( ; *ppsz_name; ppsz_name++, ppsz_longname++ ) for( ; *ppsz_name; ppsz_name++, ppsz_longname++ )
{ {
......
...@@ -1408,6 +1408,9 @@ wxMenu *Playlist::SDMenu() ...@@ -1408,6 +1408,9 @@ wxMenu *Playlist::SDMenu()
char **ppsz_longnames; char **ppsz_longnames;
char **ppsz_names = services_discovery_GetServicesNames( p_playlist, char **ppsz_names = services_discovery_GetServicesNames( p_playlist,
&ppsz_longnames ); &ppsz_longnames );
if( !ppsz_names )
return p_sd_menu;
char **ppsz_name = ppsz_names, **ppsz_longname = ppsz_longnames; char **ppsz_name = ppsz_names, **ppsz_longname = ppsz_longnames;
int i_number = 0; int i_number = 0;
......
...@@ -50,6 +50,9 @@ int vlclua_sd_get_services_names( lua_State *L ) ...@@ -50,6 +50,9 @@ int vlclua_sd_get_services_names( lua_State *L )
vlc_object_t *p_this = vlclua_get_this( L ); vlc_object_t *p_this = vlclua_get_this( L );
char **ppsz_longnames; char **ppsz_longnames;
char **ppsz_names = services_discovery_GetServicesNames( p_this, &ppsz_longnames ); char **ppsz_names = services_discovery_GetServicesNames( p_this, &ppsz_longnames );
if( !ppsz_names )
return 0;
char **ppsz_longname = ppsz_longnames; char **ppsz_longname = ppsz_longnames;
char **ppsz_name = ppsz_names; char **ppsz_name = ppsz_names;
lua_settop( L, 0 ); lua_settop( L, 0 );
......
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