[vlc-commits] input/item: slaves must have a valid priority

Thomas Guillem git at videolan.org
Thu May 19 18:43:31 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu May 19 18:41:06 2016 +0200| [1a18ae33fe85a937527c16d6dc4525f1cf5e7c68] | committer: Thomas Guillem

input/item: slaves must have a valid priority

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1a18ae33fe85a937527c16d6dc4525f1cf5e7c68
---

 lib/media.c      |    3 +--
 src/input/item.c |    3 ++-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/media.c b/lib/media.c
index 5a52cb1..0b20aaa 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -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 )
diff --git a/src/input/item.c b/src/input/item.c
index bce22e9..9478064 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -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 );



More information about the vlc-commits mailing list