mirror of https://code.videolan.org/videolan/vlc
vlc_arrays: fix vlc_dictionary_has_key
broken untested function went under the radar and is testing index from hash instead of key. 50% false positive due to hash % size pos. fixes random behaviour in ttml #18250 and probably playlist fetcher, dbus control
This commit is contained in:
parent
6657a82c63
commit
4cee7fe323
|
@ -432,7 +432,13 @@ vlc_dictionary_has_key( const vlc_dictionary_t * p_dict, const char * psz_key )
|
|||
return 0;
|
||||
|
||||
int i_pos = DictHash( psz_key, p_dict->i_size );
|
||||
return p_dict->p_entries[i_pos] != NULL;
|
||||
const vlc_dictionary_entry_t * p_entry = p_dict->p_entries[i_pos];
|
||||
for( ; p_entry != NULL; p_entry = p_entry->p_next )
|
||||
{
|
||||
if( !strcmp( psz_key, p_entry->psz_key ) )
|
||||
break;
|
||||
}
|
||||
return p_entry != NULL;
|
||||
}
|
||||
|
||||
static inline void *
|
||||
|
|
Loading…
Reference in New Issue