- drawpixel() now ensures that the x,y coordinates are actually within the screen. This should fix a number of crashes.

This commit is contained in:
Rob Pearce 2006-03-31 05:03:02 +00:00
parent d503d07710
commit 872e2a5242
1 changed files with 4 additions and 0 deletions

View File

@ -3551,6 +3551,10 @@ void drawobjectSVG(SDL_Surface *dest, mapobject_t *o, int doublebuffer) {
void drawpixel(SDL_Surface *screen, int x, int y, SDL_Color c) {
Uint32 color = SDL_MapRGB(screen->format, c.r, c.g, c.b);
if ((x < 0) || (y < 0) || (x >= screen->w) || (y >= screen->h)) {
return;
}
/*if ( SDL_MUSTLOCK(screen) ) {
if ( SDL_LockSurface(screen) < 0 ) {
return;