From 365b1d4f3d3f3d521002aeb9c4c91c1df1cf0814 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Wed, 20 Sep 2017 05:53:10 +0300 Subject: osc: fix rare stack overflow when changing visibility mode Under some conditions, hide_osc() was calling render(), which then called hide_osc() again, and so forth, until the stack overflows. Tracking the exact conditions where this happens (and then managing them to prevent it) is an excercise in futility. Remove the osc directly - instead of going through the entire rendering procedure just to end up rendering nothing. Fixes #4900 . --- player/lua/osc.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'player') diff --git a/player/lua/osc.lua b/player/lua/osc.lua index e4faf6c0cc..cc0e0d0461 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -1894,7 +1894,7 @@ function hide_osc() -- no-op and won't render again to remove the osc, so do that manually. state.osc_visible = false timer_stop() - render() -- state.osc_visible == false -> remove the osc from screen + render_wipe() elseif (user_opts.fadeduration > 0) then if not(state.osc_visible == false) then state.anitype = "out" @@ -1973,6 +1973,11 @@ function request_init() state.initREQ = true end +function render_wipe() + msg.debug("render_wipe()") + mp.set_osd_ass(0, 0, "{}") +end + function render() msg.debug("rendering") local current_screen_sizeX, current_screen_sizeY, aspect = mp.get_osd_size() -- cgit v1.2.3