From a6da4faac5e3f3f3f521760f78bef91721c22778 Mon Sep 17 00:00:00 2001 From: Ricardo Constantino Date: Thu, 20 Oct 2016 19:02:32 +0100 Subject: osc: fix crash after reaching a certain position in limited lists Don't try to display more items than there are in the chapter/playlist. Fixes #3691 --- player/lua/osc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player') diff --git a/player/lua/osc.lua b/player/lua/osc.lua index ff7d9120ed..fec1eb07cb 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -672,7 +672,7 @@ function limited_list(prop, pos) end end - for i=min+1, max do + for i=min+1, math.min(max, count) do local item = proplist[i] item.current = (i-1 == pos) and true or nil table.insert(temp, item) -- cgit v1.2.3