[vlc-commits] skins: fix crash if input-title-format is empty
Rémi Denis-Courmont
git at videolan.org
Wed May 6 22:58:34 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed May 6 23:58:14 2015 +0300| [541b381c676cc96b6e1967610a2077b00950b86d] | committer: Rémi Denis-Courmont
skins: fix crash if input-title-format is empty
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=541b381c676cc96b6e1967610a2077b00950b86d
---
modules/gui/skins2/src/vlcproc.cpp | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/modules/gui/skins2/src/vlcproc.cpp b/modules/gui/skins2/src/vlcproc.cpp
index 7cf4882..4d9f166 100644
--- a/modules/gui/skins2/src/vlcproc.cpp
+++ b/modules/gui/skins2/src/vlcproc.cpp
@@ -740,9 +740,15 @@ void VlcProc::update_current_input()
{
// Update short name (as defined by --input-title-format)
char *psz_fmt = var_InheritString( getIntf(), "input-title-format" );
- char *psz_name = str_format_meta( pInput, psz_fmt );
- SET_TEXT( m_cVarStreamName, UString( getIntf(), psz_name ) );
- free( psz_fmt );
+ char *psz_name = NULL;
+ if( psz_fmt != NULL )
+ {
+ psz_name = str_format_meta( pInput, psz_fmt );
+ free( psz_fmt );
+ }
+
+ SET_TEXT( m_cVarStreamName, UString( getIntf(),
+ psz_name ? psz_name : "" ) );
free( psz_name );
// Update local path (if possible) or full uri
More information about the vlc-commits
mailing list