vlc | branch: master | Alexandre Janniaux <[email protected]> | Mon Jul 22 
15:30:57 2019 +0200| [679a38a6bf36d23cfe2a0ff83153ff05bb58f367] | committer: 
Jean-Baptiste Kempf

qt: playlist: don't call vlc_playlist_GoTo if playlist is empty

It was failing on the following assertion in vlc_playlist_GoTo:
`index == -1 || (size_t) index < playlist->items.size'

Signed-off-by: Jean-Baptiste Kempf <[email protected]>

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

 modules/gui/qt/components/playlist/playlist_controller.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/components/playlist/playlist_controller.cpp 
b/modules/gui/qt/components/playlist/playlist_controller.cpp
index f32e1b1c40..8b0137138e 100644
--- a/modules/gui/qt/components/playlist/playlist_controller.cpp
+++ b/modules/gui/qt/components/playlist/playlist_controller.cpp
@@ -560,7 +560,8 @@ void PlaylistControllerModel::goTo(uint index, bool 
startPlaying)
 {
     Q_D(PlaylistControllerModel);
     PlaylistLocker lock{ d->m_playlist };
-    if (index > vlc_playlist_Count( d->m_playlist ) -1)
+    size_t count = vlc_playlist_Count( d->m_playlist );
+    if (count == 0 || index > count-1)
         return;
     vlc_playlist_GoTo( d->m_playlist, index );
     if (startPlaying)

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to