[vlc-commits] ncurses: fix crash after deleting last item
Rafaël Carré
git at videolan.org
Thu Sep 5 15:45:31 CEST 2013
vlc/vlc-2.1 | branch: master | Rafaël Carré <funman at videolan.org> | Wed Sep 4 21:45:57 2013 +0200| [84eca733df738c2b794d42d8188b2f4ab6c232bb] | committer: Jean-Baptiste Kempf
ncurses: fix crash after deleting last item
(cherry picked from commit 9a0efe5e17d3d3cd7b488620a50bb44502ddc1a5)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=84eca733df738c2b794d42d8188b2f4ab6c232bb
---
modules/gui/ncurses.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c
index 847fdfe..09fcf7f 100644
--- a/modules/gui/ncurses.c
+++ b/modules/gui/ncurses.c
@@ -1338,6 +1338,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