vlc/vlc-2.2 | branch: master | Rémi Denis-Courmont <[email protected]> | 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() )

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to