Commit Graph

11 Commits

Author SHA1 Message Date
Sam Lantinga
e3cc5b2c6b Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga
f465f24d73 Fixed bug 3760 - RWops doesn't check for integer overflow when stdio_fseek only supports 32 bits
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.
2017-09-09 08:36:37 -07:00
Ryan C. Gordon
ae667da638 Fixed a bunch of compiler warnings. 2017-08-29 15:52:49 -04:00
Ryan C. Gordon
c7b4f2b92e rwops: Fixed 64-bit file i/o on QNX. 2017-08-15 16:30:26 -04:00
Sam Lantinga
b425050baf Fixed compiler warnings on Visual Studio 2013 2017-08-12 00:04:46 -07:00
Sam Lantinga
e27dcd1c3b Fixed Android build 2017-08-11 23:54:06 -07:00
Sam Lantinga
a48c9e6df8 Fixed bug 3292 - SDL_rwops and 64-bit file I/O
Juha Niemim?

On AmigaOS 4 platform with Newlib 'C' library, there is a problem with failing fseeko64. This seemed to be caused by using fopen instead of fopen64.
2017-08-11 21:16:33 -07:00
Sam Lantinga
dc40018438 Added an API SDL_LoadFile_RW() to load all the data from an SDL data stream, and a convenience macro SDL_LoadFile() to load all the data from a file. 2017-08-09 11:58:38 -07:00
Sam Lantinga
45b774e3f7 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga
42065e785d Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Philipp Wiesemann
0e45984fa0 Fixed crash if initialization of EGL failed but was tried again later.
The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly
uninitialized data structure if loading the library first failed. A later try to
use EGL then skipped initialization and assumed it was previously successful
because the data structure now already existed. This led to at least one crash
in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was
dereferenced to make a call to eglBindAPI().
2015-06-21 17:33:46 +02:00