summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSai Ke WANG <onceking@users.noreply.github.com>2019-12-25 13:01:43 -0500
committerwm4 <wm4@nowhere>2019-12-28 14:34:32 +0100
commit01de2a9bd5c4689b70c7cf237b718135c5c73d7b (patch)
treefa81e351f9fb07f4a9464ff81bac2e0a10e04e1c
parent13b8363c47291d30418acb7e969237f031d457bf (diff)
downloadmpv-01de2a9bd5c4689b70c7cf237b718135c5c73d7b.tar.bz2
mpv-01de2a9bd5c4689b70c7cf237b718135c5c73d7b.tar.xz
lua: fix mp.file_info for large files
`size` field with `unsigned int` was truncated to 4GB Signed-off-by: wm4 <wm4@nowhere>
-rw-r--r--player/lua.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/player/lua.c b/player/lua.c
index aec9908b69..cee4c118ad 100644
--- a/player/lua.c
+++ b/player/lua.c
@@ -1131,7 +1131,7 @@ static int script_file_info(lua_State *L)
"mode", "size",
"atime", "mtime", "ctime", NULL
};
- const unsigned int stat_values[] = {
+ const lua_Number stat_values[] = {
statbuf.st_mode,
statbuf.st_size,
statbuf.st_atime,
@@ -1141,7 +1141,7 @@ static int script_file_info(lua_State *L)
// Add all fields
for (int i = 0; stat_names[i]; i++) {
- lua_pushinteger(L, stat_values[i]);
+ lua_pushnumber(L, stat_values[i]);
lua_setfield(L, -2, stat_names[i]);
}