- 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:
parent
d503d07710
commit
872e2a5242
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue