fix bad calculation of file_size

This commit is contained in:
Vincent Wei
2020-01-13 11:45:52 +08:00
parent e8a3c24c9c
commit 5e4f1db566
+1 -1
View File
@@ -166,7 +166,7 @@ GAL_Surface * GAL_CreateSharedRGBSurface (GAL_VideoDevice *video,
/* rounde file size to multiple of page size */
file_size = buf_off + buf_size;
file_size &= ~(getpagesize () - 1);
file_size = ROUND_TO_MULTIPLE(file_size, getpagesize ());
buf_size = file_size - buf_off;
fd = __mg_create_anonymous_file (file_size, NULL, rw_modes);