[vlc-commits] Qt: standardpanel: fix potential null dereference

Francois Cartegnie git at videolan.org
Mon Aug 26 19:19:57 CEST 2013


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Aug 26 19:18:31 2013 +0200| [4543c9c883fa0661f5a3059583ab04a5e4db44ff] | committer: Francois Cartegnie

Qt: standardpanel: fix potential null dereference

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

 modules/gui/qt4/components/playlist/standardpanel.cpp |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index f528dfa..e03a918 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -786,10 +786,13 @@ void StandardPLPanel::activate( const QModelIndex &index )
         {
             playlist_Lock( THEPL );
             playlist_item_t *p_item = playlist_ItemGetById( THEPL, model->itemId( index, PLAYLIST_ID ) );
-            p_item->i_flags |= PLAYLIST_SUBITEM_STOP_FLAG;
-            lastActivatedPLItemId = p_item->i_id;
+            if ( p_item )
+            {
+                p_item->i_flags |= PLAYLIST_SUBITEM_STOP_FLAG;
+                lastActivatedPLItemId = p_item->i_id;
+            }
             playlist_Unlock( THEPL );
-            if ( index.isValid() )
+            if ( p_item && index.isValid() )
                 model->activateItem( index );
         }
     }



More information about the vlc-commits mailing list