[vlc-commits] qt4: fix crash if input-title-format is empty

Rémi Denis-Courmont git at videolan.org
Wed May 6 22:58:33 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed May  6 23:57:42 2015 +0300| [8ecc026e2094a59cc96be3b507d6eae10849cc24] | committer: Rémi Denis-Courmont

qt4: fix crash if input-title-format is empty

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

 modules/gui/qt4/input_manager.cpp |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 26baf3f..eb68848 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -512,10 +512,17 @@ void InputManager::UpdateName()
 
     /* Try to get the nowplaying */
     char *format = var_InheritString( p_intf, "input-title-format" );
-    char *formated = str_format_meta( p_input, format );
-    free( format );
-    name = qfu(formated);
-    free( formated );
+    char *formatted = NULL;
+    if (format != NULL)
+    {
+        formatted = str_format_meta( p_input, format );
+        free( format );
+        if( formatted != NULL )
+        {
+            name = qfu(formatted);
+            free( formatted );
+        }
+    }
 
     /* If we have Nothing */
     if( name.simplified().isEmpty() )



More information about the vlc-commits mailing list