From 091ee9d770e63b90a0705cfda1972fcc25b6909c Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 23 Dec 2019 16:10:06 +0100 Subject: [PATCH] lua: fix guard against division by 0 This was incorrectly converted from the original C code. Change it to what the original code used. --- player/lua/defaults.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/player/lua/defaults.lua b/player/lua/defaults.lua index c7ff46660b..f44d004a99 100644 --- a/player/lua/defaults.lua +++ b/player/lua/defaults.lua @@ -645,7 +645,7 @@ function mp.get_osd_size() par = 1 end - local aspect = 1.0 * w / math.max(h) / par + local aspect = 1.0 * w / math.max(h, 1.0) / par return w, h, aspect end