[vlc-commits] dbus: fix vlc_array_remove sign (cid #1401376)

Thomas Guillem git at videolan.org
Thu Feb 23 14:46:13 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Feb 23 14:31:23 2017 +0100| [f4b096149ed692dcd0196930b3b149eb9c2257f0] | committer: Thomas Guillem

dbus: fix vlc_array_remove sign (cid #1401376)

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

 modules/control/dbus/dbus.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/control/dbus/dbus.c b/modules/control/dbus/dbus.c
index 46692c5..2bd74d9 100644
--- a/modules/control/dbus/dbus.c
+++ b/modules/control/dbus/dbus.c
@@ -457,11 +457,11 @@ static void remove_watch( DBusWatch *p_watch, void *p_data )
 {
     intf_thread_t *p_intf = (intf_thread_t*) p_data;
     intf_sys_t    *p_sys  = (intf_sys_t*) p_intf->p_sys;
-    size_t idx;
 
     vlc_mutex_lock( &p_sys->lock );
-    idx = vlc_array_index_of_item( &p_sys->watches, p_watch );
-    vlc_array_remove( &p_sys->watches, idx );
+    ssize_t idx = vlc_array_index_of_item( &p_sys->watches, p_watch );
+    if( idx >= 0 )
+        vlc_array_remove( &p_sys->watches, (size_t) idx );
     vlc_mutex_unlock( &p_sys->lock );
 }
 



More information about the vlc-commits mailing list