View | Details | Raw Unified | Return to bug 222822
Collapse All | Expand All

(-)Makefile (+1 lines)
Lines 2-7 Link Here
2
2
3
PORTNAME=	sdl2
3
PORTNAME=	sdl2
4
PORTVERSION=	2.0.6
4
PORTVERSION=	2.0.6
5
PORTREVISION=	1
5
CATEGORIES=	devel
6
CATEGORIES=	devel
6
MASTER_SITES=	http://www.libsdl.org/release/
7
MASTER_SITES=	http://www.libsdl.org/release/
7
DISTNAME=	SDL2-${PORTVERSION}
8
DISTNAME=	SDL2-${PORTVERSION}
(-)files/patch-src_video_SDL__surface.c (+31 lines)
Line 0 Link Here
1
# Origin: https://hg.libsdl.org/SDL/rev/a09c3f87a12f
2
# Subject: Fixed bug 3852 - SDL_FreeSurface deallocates surface->map even if
3
# the surface is not yet freed
4
# Origin: https://hg.libsdl.org/SDL/rev/3a23ca106752
5
# Subject: Fixed bug 3855 - Memory leak in SDL_FreeSurface
6
7
--- src/video/SDL_surface.c.orig	2017-09-22 18:51:01 UTC
8
+++ src/video/SDL_surface.c
9
@@ -1198,10 +1198,8 @@ SDL_FreeSurface(SDL_Surface * surface)
10
     if (surface->flags & SDL_DONTFREE) {
11
         return;
12
     }
13
-    if (surface->map != NULL) {
14
-        SDL_FreeBlitMap(surface->map);
15
-        surface->map = NULL;
16
-    }
17
+    SDL_InvalidateMap(surface->map);
18
+
19
     if (--surface->refcount > 0) {
20
         return;
21
     }
22
@@ -1219,6 +1217,9 @@ SDL_FreeSurface(SDL_Surface * surface)
23
     if (!(surface->flags & SDL_PREALLOC)) {
24
         SDL_free(surface->pixels);
25
     }
26
+    if (surface->map) {
27
+        SDL_FreeBlitMap(surface->map);
28
+    }
29
     SDL_free(surface);
30
 }
31
 

Return to bug 222822