summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Constantino <wiiaboo@gmail.com>2017-04-15 17:53:24 +0100
committerRicardo Constantino <wiiaboo@gmail.com>2017-04-19 20:18:15 +0100
commit82bf4567f9da29f476a4706850aebdb69f122db6 (patch)
treeee3447354eaf70f95823adda73b0f9af174f284c
parent676570a6435ef7bcec9c37332155b0c3b0080e0f (diff)
downloadmpv-82bf4567f9da29f476a4706850aebdb69f122db6.tar.bz2
mpv-82bf4567f9da29f476a4706850aebdb69f122db6.tar.xz
osc: fix last potential race condition on key events
-rw-r--r--player/lua/osc.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index c917289584..df38141707 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -2086,7 +2086,8 @@ function process_event(source, what)
end
--reset active element
- if not (elements[n].eventresponder["reset"] == nil) then
+ if not (n > #elements) and elements[n].eventresponder ~= nil and
+ elements[n].eventresponder["reset"] ~= nil then
elements[n].eventresponder["reset"](elements[n])
end