No description
Find a file
Sam Lantinga 17e16c2e64 Fixed bug 3544 - Memory freeing bug in SDL_DestroyRenderer/SDL_DestroyTexture
felix

Here's a snippet of SDL_DestroyRenderer from hg revision 10746:95c57a177719:

    SDL_Texture *texture = NULL;
    SDL_Texture *nexttexture = NULL;
    /* ... */
    for (texture = renderer->textures; texture; texture = nexttexture) {
        nexttexture = texture->next;
        SDL_DestroyTexture(texture);
    }

SDL_DestroyTexture removes the texture from the linked list pointed to by the renderer and ends up calling SDL_DestroyTextureInternal, which contains this:

    if (texture->native) {
        SDL_DestroyTexture(texture->native);
    }

If it happens that texture->native is an alias of nexttexture two stack frames up, SDL_DestroyRenderer will end up trying to destroy an already freed texture. I've had this very situation happen in dosemu2.

Bug introduced in revision 10650:b6ec7005ca15, which has a somewhat ironic description of "Fixed all known static analysis bugs"...
2017-01-06 00:32:06 -08:00
acinclude Fixed bug 3481 - Configure fails to detect dynamic library support on powerpc64le 2016-11-06 20:26:48 -08:00
android-project Fixed bug 3444 - Android-TV: no more handling of back button on remote 2016-10-17 22:09:22 -07:00
build-scripts Run sed in binary mode so we don't have to worry about fixing line endings 2017-01-01 18:47:29 -08:00
cmake cmake: Now generates Wayland protocol source bits like the configure script. 2016-10-11 16:36:40 -04:00
debian Updated copyright for 2017 2017-01-01 18:33:28 -08:00
docs Fixed outdated info in README. 2016-10-30 21:01:33 +01:00
include Added SDL_JoystickGetAxisInitialState() to get a joystick axis' initial value. 2017-01-04 10:28:07 -08:00
src Fixed bug 3544 - Memory freeing bug in SDL_DestroyRenderer/SDL_DestroyTexture 2017-01-06 00:32:06 -08:00
test Added SDL_JoystickGetAxisInitialState() to get a joystick axis' initial value. 2017-01-04 10:28:07 -08:00
VisualC Refactored the audio queueing code to a generic SDL_DataQueue interface. 2016-12-06 02:23:54 -05:00
VisualC-WinRT WinRT: build fixes 2016-12-10 15:23:17 -05:00
visualtest Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Xcode Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Xcode-iOS Fixed bug 3517 - Compiler warnings with gcc -Wstrict-prototypes 2016-12-26 02:12:21 -08:00
.hgignore audio: Initial bits to enable audio capture support. 2016-08-01 00:18:56 -04:00
.hgtags Added tag release-2.0.5 for changeset 007dfe83abf8 2016-10-19 21:22:42 -07:00
Android.mk Android: Replaced spaces with tab in Android.mk file. 2015-05-06 21:11:06 +02:00
autogen.sh Don't use pushd/popd in autogen.sh; Ubuntu's /bin/sh doesn't support it. 2016-12-26 22:58:58 -05:00
BUGS.txt BUGS.txt: Bugzilla supports SSL; changed link to https:// ... 2016-08-01 13:36:43 -04:00
cmake_uninstall.cmake.in Add suport for "make uninstall" to cmake. 2014-06-16 10:58:09 -03:00
CMakeLists.txt cpuinfo: first attempt at SDL_HasNEON() implementation. 2016-11-17 01:15:16 -05:00
configure Avoid conflicts with multiple versions of udev by first trying the library that is linked with the executable, if any, and then picking the one that is in the build environment. 2016-11-29 05:34:20 -08:00
configure.in Avoid conflicts with multiple versions of udev by first trying the library that is linked with the executable, if any, and then picking the one that is in the build environment. 2016-11-29 05:34:20 -08:00
COPYING.txt Updated copyright for 2017 2017-01-01 18:33:28 -08:00
CREDITS.txt Added Julian Winter to the credits for the SDL 2.0 website. 2013-08-12 08:45:37 -07:00
INSTALL.txt Moved documentation to docs, recreated a simple README.txt, fixed build 2014-07-29 08:04:15 -07:00
Makefile.in wayland: Build own version of core protocol 2016-06-23 18:39:05 +08:00
Makefile.minimal Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module. 2013-08-20 19:57:11 -04:00
Makefile.pandora Pandora: Fixed referring to no more existing atomic source file in Makefile. 2016-07-19 21:01:13 +02:00
Makefile.psp PSP: Added missing object for generic TLS to Makefile. 2016-02-13 17:34:14 +01:00
Makefile.wiz Pandora: Updated SDL version in Makefile. 2016-07-19 21:01:30 +02:00
README-SDL.txt Another commit to test revision control. 2016-03-08 20:26:26 -05:00
README.txt Moved documentation to docs, recreated a simple README.txt, fixed build 2014-07-29 08:04:15 -07:00
sdl2-config.cmake.in Applied Ubuntu patch bug_822210_fix_sdl2-config.cmake_whitespace.patch 2016-10-07 15:08:37 -07:00
sdl2-config.in Revert fix for bug 1392 because it breaks linking with mingw32 2013-10-21 10:28:57 -07:00
sdl2.m4 Fixed bug 3429 - Update AM_PATH_SDL2() to also check for SDL2.framework 2016-09-29 16:37:08 -07:00
sdl2.pc.in Revert fix for bug 1392 because it breaks linking with mingw32 2013-10-21 10:28:57 -07:00
SDL2.spec.in Fixed docs path in RPM .spec file. 2015-06-04 19:05:01 -04:00
TODO.txt Added __WINDOWS__ to reflect both 32 and 64-bit windows platforms 2013-10-20 20:41:30 -07:00
VisualC.html Fixed two typos in documentation. 2016-01-12 22:23:53 +01:00
WhatsNew.txt Added note for David Carlier's work on OpenBSD 2016-10-12 18:57:12 -07:00

                         Simple DirectMedia Layer

                                  (SDL)

                                Version 2.0

---
http://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.

More extensive documentation is available in the docs directory, starting
with README.md

Enjoy!
	Sam Lantinga				(slouken@libsdl.org)