[SDL] Patch: SDL_SoftStretch segfault fix

Gerry JJ trick at icculus.org
Thu Oct 4 15:48:38 PDT 2007


Hi.  When SDL_SoftStretch assembly code is enabled, SDL doesn't make
the code it generates executable, which results in a segfault on some
machines when calling that code.  The attached patch (against SDL
1.2.12) fixes this by using mprotect to make the copy_rows buffer
executable.  This also requires the buffer to be page-aligned.

Unfortunately the patch is a bit posix-specific though, as I don't know
the right way to do this in Windows etc (does it have mprotect?), so
the patch probably needs some tweaking before it can be committed.

- Gerry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-stretch-segfault.patch
Type: text/x-patch
Size: 1033 bytes
Desc: not available
Url : http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20071005/5610e834/attachment.bin 


More information about the SDL mailing list