From 491b918f5628a502a6bcf89141e5ecfba3c7757d Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Kempf <jb@videolan.org>
Date: Mon, 9 Jan 2012 22:08:24 +0100
Subject: [PATCH] Qt: avoid a crash on displaying the chapters for some mp4

---
 modules/gui/qt4/util/input_slider.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/qt4/util/input_slider.cpp b/modules/gui/qt4/util/input_slider.cpp
index ecbcd25aba32..77494a62af58 100644
--- a/modules/gui/qt4/util/input_slider.cpp
+++ b/modules/gui/qt4/util/input_slider.cpp
@@ -260,7 +260,7 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event )
                     if ( event->x() >= x )
                         i_selected = i + ( ( b_startsnonzero )? 1 : 0 );
                 }
-                if ( i_selected >= 0 )
+                if ( i_selected >= 0 && i_selected < points.size() )
                     chapterLabel = points.at( i_selected ).name;
         }
 
-- 
GitLab