aboutsummaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2017-10-06 13:05:21 +0000
committerJan Beich <jbeich@FreeBSD.org>2017-10-06 13:05:21 +0000
commitc6963c2821485e0e3ed58ce2af032f3412a19817 (patch)
tree1f6cba613a0414a43fedc6f7e7ac3744bf153daf /devel
parent98929fe04222edd8e2022e545cc5ae3a5086883c (diff)
Notes
Diffstat (limited to 'devel')
-rw-r--r--devel/sdl20/Makefile1
-rw-r--r--devel/sdl20/files/patch-src_video_SDL__surface.c31
2 files changed, 32 insertions, 0 deletions
diff --git a/devel/sdl20/Makefile b/devel/sdl20/Makefile
index 5bdfc215ad5f..bd1823776eda 100644
--- a/devel/sdl20/Makefile
+++ b/devel/sdl20/Makefile
@@ -2,6 +2,7 @@
PORTNAME= sdl2
PORTVERSION= 2.0.6
+PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= http://www.libsdl.org/release/
DISTNAME= SDL2-${PORTVERSION}
diff --git a/devel/sdl20/files/patch-src_video_SDL__surface.c b/devel/sdl20/files/patch-src_video_SDL__surface.c
new file mode 100644
index 000000000000..ba55080fa22f
--- /dev/null
+++ b/devel/sdl20/files/patch-src_video_SDL__surface.c
@@ -0,0 +1,31 @@
+SDL_FreeSurface deallocates surface->map even if the surface is not yet freed
+https://bugzilla.libsdl.org/show_bug.cgi?id=3852
+
+Memory leak in SDL_FreeSurface (after bug 3852 fix)
+https://bugzilla.libsdl.org/show_bug.cgi?id=3855
+
+--- src/video/SDL_surface.c.orig 2017-09-22 18:51:01 UTC
++++ src/video/SDL_surface.c
+@@ -1198,10 +1198,8 @@ SDL_FreeSurface(SDL_Surface * surface)
+ if (surface->flags & SDL_DONTFREE) {
+ return;
+ }
+- if (surface->map != NULL) {
+- SDL_FreeBlitMap(surface->map);
+- surface->map = NULL;
+- }
++ SDL_InvalidateMap(surface->map);
++
+ if (--surface->refcount > 0) {
+ return;
+ }
+@@ -1219,6 +1217,9 @@ SDL_FreeSurface(SDL_Surface * surface)
+ if (!(surface->flags & SDL_PREALLOC)) {
+ SDL_free(surface->pixels);
+ }
++ if (surface->map) {
++ SDL_FreeBlitMap(surface->map);
++ }
+ SDL_free(surface);
+ }
+