Commit 1a18ae33 authored by Thomas Guillem's avatar Thomas Guillem

input/item: slaves must have a valid priority

parent 6728a937
......@@ -1178,8 +1178,7 @@ unsigned int libvlc_media_slaves_get( libvlc_media_t *p_md,
for( int i = 0; i < i_count; ++i )
{
input_item_slave_t *p_item_slave = p_input_item->pp_slaves[i];
if( p_item_slave->i_priority == 0 )
continue;
assert( p_item_slave->i_priority >= SLAVE_PRIORITY_MATCH_NONE );
libvlc_media_slave_t *p_slave = malloc( sizeof(*p_slave) +
strlen( p_item_slave->psz_uri )
......
......@@ -660,7 +660,8 @@ input_item_slave_t *input_item_slave_New(const char *psz_uri, enum slave_type i_
int input_item_AddSlave(input_item_t *p_item, input_item_slave_t *p_slave)
{
if( p_item == NULL || p_slave == NULL )
if( p_item == NULL || p_slave == NULL
|| p_slave->i_priority < SLAVE_PRIORITY_MATCH_NONE )
return VLC_EGENERIC;
vlc_mutex_lock( &p_item->lock );
......
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