Commit Graph

13 Commits

Author SHA1 Message Date
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
Sam Lantinga
d51dc7378b Fixed bug 3797 - configure check for float.h
Ozkan Sezer

Cmake checks for float.h, but configure does not:  the attached patch
adds float.h to checked headers in configury, and it adds the missing
HAVE_FLOAT_H macro to SDL_config.h.cmake and SDL_config.h.in.

In SDL_config_macosx.h and SDL_config_windows.h, defined HAVE_FLOAT_H
as 1, where I know that it's true.
2017-09-06 01:14:23 -07:00
Sam Lantinga
abf8fc4c01 Fixed check for Mac OS X 10.11+ SDK (thanks Edward Rudd!) 2017-08-29 08:27:23 -07:00
Sam Lantinga
2d655cd814 MAC_OS_X_VERSION_MAX_REQUIRED isn't actually set in recent Xcode versions 2017-08-29 02:32:53 -07:00
Sam Lantinga
1067b528d3 Fixed building with an older Mac OS X SDK 2017-08-28 20:52:05 -07:00
Sam Lantinga
e8b114ecfc Vulkan support on Mac OS X introduces a link time dependency (CAMetalLayer) on 10.11 and newer 2017-08-28 19:32:08 -07:00
Sam Lantinga
ce2b16445e Be clear that disabling Vulkan surface support disables the entire SDL Vulkan integration 2017-08-28 00:11:38 -07:00
Ryan C. Gordon
25e3a1ec90 vulkan: Initial Vulkan support!
This work was done by Jacob Lifshay and Mark Callow; I'm just merging it
into revision control.
2017-08-27 22:15:57 -04:00
Sam Lantinga
94754c3968 Updated config headers to override the base SDL_config.h if both are included 2017-02-20 10:55:33 -08:00
Sam Lantinga
45b774e3f7 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga
3615633571 Renaming of guard header names to quiet -Wreserved-id-macro
Patch contributed by Sylvain
2016-11-20 21:34:54 -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