svn commit: r451383 - in branches/2017Q4/devel/sdl20: . files
Jan Beich
jbeich at FreeBSD.org
Fri Oct 6 13:12:42 UTC 2017
Author: jbeich
Date: Fri Oct 6 13:12:41 2017
New Revision: 451383
URL: https://svnweb.freebsd.org/changeset/ports/451383
Log:
MFH: r451381
devel/sdl20: crashfix for some consumers after r450461
$ pkg install pioneer
$ pioneer
[...]
ShipType::Init()
Lua::Init()
Server agent disabled
Thread 1 received signal SIGSEGV, Segmentation fault.
0x0000000800cd5d20 in SDL_ConvertSurface_REAL (surface=0x80b374fc0,
format=0xb4c7e8 <Graphics::pixelFormatRGBA>, flags=0)
at /usr/ports/devel/sdl20/work/SDL2-2.0.6/src/video/SDL_surface.c:936
936 copy_flags = surface->map->info.flags;
(gdb) p surface->map
$1 = (struct SDL_BlitMap *) 0x0
(gdb) bt
#0 0x0000000800cd5d20 in SDL_ConvertSurface_REAL (surface=0x80b374fc0,
format=0xb4c7e8 <Graphics::pixelFormatRGBA>, flags=0)
at /usr/ports/devel/sdl20/work/SDL2-2.0.6/src/video/SDL_surface.c:936
#1 0x0000000800c099d2 in SDL_ConvertSurface (a=0x80b374fc0,
b=0xb4c7e8 <Graphics::pixelFormatRGBA>, c=0)
at /usr/ports/devel/sdl20/work/SDL2-2.0.6/src/dynapi/SDL_dynapi_procs.h:492
#2 0x000000000081cfbb in Graphics::TextureBuilder::PrepareSurface (this=0x7fffffffac50)
at TextureBuilder.cpp:117
#3 0x00000000003a0699 in Graphics::TextureBuilder::GetDescriptor (this=0x7fffffffac50)
at ./graphics/TextureBuilder.h:48
[...]
PR: 222822
Obtained from: upstream
Submitted by: lightside at gmx.com
Approved by: ports-secteam blanket
Added:
branches/2017Q4/devel/sdl20/files/patch-src_video_SDL__surface.c
- copied unchanged from r451381, head/devel/sdl20/files/patch-src_video_SDL__surface.c
Modified:
branches/2017Q4/devel/sdl20/Makefile
Directory Properties:
branches/2017Q4/ (props changed)
Modified: branches/2017Q4/devel/sdl20/Makefile
==============================================================================
--- branches/2017Q4/devel/sdl20/Makefile Fri Oct 6 13:09:01 2017 (r451382)
+++ branches/2017Q4/devel/sdl20/Makefile Fri Oct 6 13:12:41 2017 (r451383)
@@ -2,6 +2,7 @@
PORTNAME= sdl2
PORTVERSION= 2.0.6
+PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= http://www.libsdl.org/release/
DISTNAME= SDL2-${PORTVERSION}
Copied: branches/2017Q4/devel/sdl20/files/patch-src_video_SDL__surface.c (from r451381, head/devel/sdl20/files/patch-src_video_SDL__surface.c)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/2017Q4/devel/sdl20/files/patch-src_video_SDL__surface.c Fri Oct 6 13:12:41 2017 (r451383, copy of r451381, head/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);
+ }
+
More information about the svn-ports-all
mailing list