Commit de3efb74 authored by Rafaël Carré's avatar Rafaël Carré

adds sanity check to module_Exists()

parent 46cd2cb9
...@@ -767,12 +767,13 @@ vlc_bool_t __module_Exists( vlc_object_t *p_this, const char * psz_name ) ...@@ -767,12 +767,13 @@ vlc_bool_t __module_Exists( vlc_object_t *p_this, const char * psz_name )
{ {
vlc_list_t *p_list; vlc_list_t *p_list;
int i; int i;
char *psz_module_name;
p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE );
for( i = 0 ; i < p_list->i_count; i++) for( i = 0 ; i < p_list->i_count; i++)
{ {
if (!strcmp( psz_module_name =
((module_t *) p_list->p_values[i].p_object)->psz_shortname , ((module_t *) p_list->p_values[i].p_object)->psz_shortname;
psz_name ) ) if ( psz_module_name && !strcmp( psz_module_name, psz_name ) )
{ {
/* We can release the list, and return yes */ /* We can release the list, and return yes */
vlc_list_release( p_list ); return VLC_TRUE; vlc_list_release( p_list ); return VLC_TRUE;
......
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