upnp: MediaServerList::m_lock protects the access to m_list
authorSteve Lhomme <robux4@videolabs.io>
Wed, 1 Jun 2016 14:38:07 +0000 (16:38 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 1 Jun 2016 15:41:43 +0000 (17:41 +0200)
parseNewServer() is called from various threads of UPNP so we need to protect
our server list

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/services_discovery/upnp.cpp

index e967e2e..7e88c12 100644 (file)
@@ -398,6 +398,8 @@ void MediaServerList::parseNewServer( IXML_Document *doc, const std::string &loc
 
     if ( !p_device_list )
         return;
+
+    vlc_mutex_locker lock( &m_lock );
     for ( unsigned int i = 0; i < ixmlNodeList_length( p_device_list ); i++ )
     {
         IXML_Element* p_device_element = ( IXML_Element* ) ixmlNodeList_item( p_device_list, i );