[vlc-commits] commit: qt4: fix a crash if "view-mode" configuration values are invalid. ( Rémi Duraffort )

git at videolan.org git at videolan.org
Tue Nov 2 08:08:49 CET 2010


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Tue Nov  2 07:58:17 2010 +0100| [ef2ea79839f18fd32172344596473820d6d35cbe] | committer: Rémi Duraffort 

qt4: fix a crash if "view-mode" configuration values are invalid.

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

 .../gui/qt4/components/playlist/standardpanel.cpp  |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index 98c8392..e7c15b2 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -73,6 +73,9 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
     getSettings()->beginGroup("Playlist");
     int i_savedViewMode = getSettings()->value( "view-mode", TREE_VIEW ).toInt();
     getSettings()->endGroup();
+    /* Limit the saved value to a possible one inside [0, VIEW_COUNT[ */
+    if(i_savedViewMode < 0 || i_savedViewMode >= VIEW_COUNT)
+        i_savedViewMode = 0;
 
     showView( i_savedViewMode );
 



More information about the vlc-commits mailing list