[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:17:54 CET 2010


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

qt4: fix a crash if "view-mode" configuration values are invalid.
(cherry picked from commit ef2ea79839f18fd32172344596473820d6d35cbe)

Signed-off-by: Rémi Duraffort <ivoire at videolan.org>

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

 .../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 45b9938..ce0a23b 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -125,6 +125,9 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
     int i_viewMode = getSettings()->value( "view-mode", TREE_VIEW ).toInt();
 
     getSettings()->endGroup();
+    /* Limit the saved value to a possible one inside [0, VIEW_COUNT[ */
+    if(i_viewMode < 0 || i_viewMode >= VIEW_COUNT)
+        i_viewMode = 0;
 
     showView( i_viewMode );
 



More information about the vlc-commits mailing list