1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-12 01:49:33 +00:00

lua: fix mp.file_info for large files

`size` field with `unsigned int` was truncated to 4GB

Signed-off-by: wm4 <wm4@nowhere>
This commit is contained in:
Sai Ke WANG 2019-12-25 13:01:43 -05:00 committed by wm4
parent 13b8363c47
commit 01de2a9bd5

View File

@ -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]);
}