[vlc-commits] Qt: fix null deref in pl debug

Francois Cartegnie git at videolan.org
Wed Sep 6 13:10:26 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Sep  6 12:28:04 2017 +0200| [cb6823f8a186cc2726d842cbc2e574e5d4a778b9] | committer: Francois Cartegnie

Qt: fix null deref in pl debug

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

 modules/gui/qt/dialogs/messages.cpp | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt/dialogs/messages.cpp b/modules/gui/qt/dialogs/messages.cpp
index d6a0ecc992..d79826d7cd 100644
--- a/modules/gui/qt/dialogs/messages.cpp
+++ b/modules/gui/qt/dialogs/messages.cpp
@@ -360,12 +360,15 @@ void MessagesDialog::MsgCallback( void *self, int type, const vlc_log_t *item,
 static QTreeWidgetItem * PLWalk( playlist_item_t *p_node )
 {
     QTreeWidgetItem *current = new QTreeWidgetItem();
-    current->setText( 0, qfu( p_node->p_input->psz_name ) );
-    current->setToolTip( 0, qfu( p_node->p_input->psz_uri ) );
-    current->setText( 1, QString("%1").arg( p_node->i_id ) );
-    current->setText( 2, QString("%1").arg( (uintptr_t)p_node->p_input ) );
-    current->setText( 3, QString("0x%1").arg( p_node->i_flags, 0, 16 ) );
-    current->setText( 4, QString("0x%1").arg(  p_node->p_input->i_type, 0, 16 ) );
+    if(p_node->p_input)
+    {
+        current->setText( 0, qfu( p_node->p_input->psz_name ) );
+        current->setToolTip( 0, qfu( p_node->p_input->psz_uri ) );
+        current->setText( 1, QString("%1").arg( p_node->i_id ) );
+        current->setText( 2, QString("%1").arg( (uintptr_t)p_node->p_input ) );
+        current->setText( 3, QString("0x%1").arg( p_node->i_flags, 0, 16 ) );
+        current->setText( 4, QString("0x%1").arg(  p_node->p_input->i_type, 0, 16 ) );
+    }
     for ( int i = 0; p_node->i_children > 0 && i < p_node->i_children; i++ )
         current->addChild( PLWalk( p_node->pp_children[ i ] ) );
     return current;



More information about the vlc-commits mailing list