mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
f465f24d73
Simon Hug When RWops seeks with fseek or fseeko it uses the types long or off_t which can be 32 bits on some platforms. stdio_seek does not check if the 64-bit integer for the offset fits into a 32-bit integer. Offsets equal or larger than 2 GiB will have implementation-defined behavior and failure states would be very confusing to debug. The attached patch adds range checking by using the macros from limits.h for long type and some bit shifting for off_t because POSIX couldn't be bothered to specify min and max macros. It also defines HAVE_FSEEKI64 in SDL_config_windows.h so that the Windows function gets picked up automatically with the default config. And there's an additional error message for when ftell fails. |
||
---|---|---|
.. | ||
atomic | ||
audio | ||
core | ||
cpuinfo | ||
dynapi | ||
events | ||
file | ||
filesystem | ||
haptic | ||
joystick | ||
libm | ||
loadso | ||
main | ||
power | ||
render | ||
stdlib | ||
test | ||
thread | ||
timer | ||
video | ||
SDL_assert_c.h | ||
SDL_assert.c | ||
SDL_dataqueue.c | ||
SDL_dataqueue.h | ||
SDL_error_c.h | ||
SDL_error.c | ||
SDL_hints.c | ||
SDL_internal.h | ||
SDL_log.c | ||
SDL.c |