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

Rémi Denis-Courmont git at videolan.org
Wed May 6 23:03:02 CEST 2015


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

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

(cherry picked from commit 8ecc026e2094a59cc96be3b507d6eae10849cc24)

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

 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 8283fdc..16c89fe 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