summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-12-23 16:10:06 +0100
committerwm4 <wm4@nowhere>2019-12-23 16:10:06 +0100
commit091ee9d770e63b90a0705cfda1972fcc25b6909c (patch)
tree50f14058c4d35eee327f9aa8c1951d83e5f460c0 /player
parentd951a7f021cb62371988b14bee61cfa31d26ea6c (diff)
downloadmpv-091ee9d770e63b90a0705cfda1972fcc25b6909c.tar.bz2
mpv-091ee9d770e63b90a0705cfda1972fcc25b6909c.tar.xz
lua: fix guard against division by 0
This was incorrectly converted from the original C code. Change it to what the original code used.
Diffstat (limited to 'player')
-rw-r--r--player/lua/defaults.lua2
1 files changed, 1 insertions, 1 deletions
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