[vlc-commits] ncurses: fix crash after deleting last item

Rafaël Carré git at videolan.org
Thu Sep 5 12:09:52 CEST 2013


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Wed Sep  4 21:45:57 2013 +0200| [9a0efe5e17d3d3cd7b488620a50bb44502ddc1a5] | committer: Rafaël Carré

ncurses: fix crash after deleting last item

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

 modules/gui/ncurses.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c
index 104bbaf..1ed633b 100644
--- a/modules/gui/ncurses.c
+++ b/modules/gui/ncurses.c
@@ -1341,6 +1341,8 @@ static bool HandlePlaylistKey(intf_thread_t *intf, int key)
             playlist_NodeDelete(p_playlist, item, true , false);
         PL_UNLOCK;
         vlc_mutex_lock(&sys->pl_lock);
+        if (sys->box_idx >= sys->box_lines_total - 1)
+            sys->box_idx = sys->box_lines_total - 2;
         sys->need_update = true;
         vlc_mutex_unlock(&sys->pl_lock);
         return true;



More information about the vlc-commits mailing list