[vlc-devel] commit: Fix unprotected access of input item (skins2). (Laurent Aimar )

git version control git at videolan.org
Mon Jan 5 21:26:47 CET 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Jan  4 18:32:17 2009 +0100| [9a31d3ab9e1793eb41228d0bae830293dff86c94] | committer: Laurent Aimar 

Fix unprotected access of input item (skins2).

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

 modules/gui/skins2/commands/cmd_update_item.cpp |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/gui/skins2/commands/cmd_update_item.cpp b/modules/gui/skins2/commands/cmd_update_item.cpp
index ae9878b..8bc860c 100644
--- a/modules/gui/skins2/commands/cmd_update_item.cpp
+++ b/modules/gui/skins2/commands/cmd_update_item.cpp
@@ -46,9 +46,10 @@ void CmdUpdateItem::execute()
 	// Get playlist item information
 	input_item_t *pItem = input_GetItem( p_input );
 
-	// XXX: we should not need to access p_input->psz_source directly, a
-	// getter should be provided by VLC core
-	string name = pItem->psz_name;
+    char *pszName = input_item_GetName( pItem );
+    char *pszUri = input_item_GetURI( pItem );
+
+	string name = pszName;
 	// XXX: This should be done in VLC core, not here...
 	// Remove path information if any
 	OSFactory *pFactory = OSFactory::instance( getIntf() );
@@ -58,7 +59,10 @@ void CmdUpdateItem::execute()
 		name = name.substr( pos + 1, name.size() - pos + 1 );
 	}
 	UString srcName( getIntf(), name.c_str() );
-	UString srcURI( getIntf(), pItem->psz_uri );
+	UString srcURI( getIntf(), pszUri );
+
+    free( pszName );
+    free( pszUri );
 
    // Create commands to update the stream variables
 	CmdSetText *pCmd1 = new CmdSetText( getIntf(), m_rStreamName, srcName );




More information about the vlc-devel mailing list