[ab] Bug in sdl:draw-pixel-* and sdl:read-pixel-*
Michael Ben-Yosef
septagon at mweb.co.za
Sun Dec 16 14:25:39 CST 2007
Hi,
In the definitions of the above-mentioned lispbuilder-sdl functions, the
macro sdl-base::check-bounds is used incorrectly, with (width surface)
and (height surface) as the upper bounds, instead of (- (width surface)
1) and (- (height surface) 1), respectively. This, of course, leads to
possible memory corruption if one draws a pixel to the edge of the
surface. The attached patch gives the required changes. Note that
sdl:draw-line-* uses check-bounds correctly.
I haven't had any problems with sdl-gfx:draw-pixel-*. (Now I see that
the SDL_gfx library does the range checking itself.) If one uses
lispbuilder-sdl-gfx, should one use the sdl-gfx version of a symbol
whenever it is exported by both the sdl and sdl-gfx packages?
Kind regards,
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 1160 bytes
Desc: not available
Url : http://www.lispniks.com/pipermail/application-builder/attachments/20071216/be2d9ab4/patch.bin
More information about the application-builder
mailing list