Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion engine/openbor.c
Original file line number Diff line number Diff line change
Expand Up @@ -44341,7 +44341,7 @@ void spawnplayer(int index)
//////////////////checking holes/ walls///////////////////////////////////
for(xc = 0; xc < videomodes.hRes / 4; xc++)
{
if(p.position.x > videomodes.hRes)
if(p.position.x >= videomodes.hRes)
{
p.position.x -= videomodes.hRes;
}
Expand Down
4 changes: 2 additions & 2 deletions engine/openborscript.c
Original file line number Diff line number Diff line change
Expand Up @@ -16156,7 +16156,7 @@ HRESULT openbor_getgfxproperty(ScriptVariant **varlist , ScriptVariant **pretvar
{
case bitmap_magic: //As long as the two structures are identical...
case screen_magic:
if(x < 0 || x >= screen->width || y < 0 || y >= screen->height)
if((unsigned)x >= (unsigned)screen->width || (unsigned)y >= (unsigned)screen->height) // includes checks for <0
{
v = 0;
}
Expand All @@ -16180,7 +16180,7 @@ HRESULT openbor_getgfxproperty(ScriptVariant **varlist , ScriptVariant **pretvar
}
break;
case sprite_magic:
if(x < 0 || x >= sprite->width || y < 0 || y >= sprite->height)
if((unsigned)x >= (unsigned)sprite->width || (unsigned)y >= (unsigned)sprite->height) // includes checks for <0
{
v = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion engine/source/gamelib/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void _putpixel(int x, int y, int colour, s_screen *screen, int alpha)
{
int pixind;
unsigned char *lut;
if((unsigned)x > screen->width || (unsigned)y > screen->height)
if((unsigned)x >= (unsigned)screen->width || (unsigned)y >= (unsigned)screen->height)
{
return;
}
Expand Down
4 changes: 1 addition & 3 deletions engine/source/gamelib/draw16.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void _putpixel16(unsigned x, unsigned y, unsigned short colour, s_screen *screen
int pixind;
unsigned short *data ;
unsigned short(*blendfp)(unsigned short, unsigned short);
if(x > screen->width || y > screen->height)
if(x >= (unsigned)screen->width || y >= (unsigned)screen->height)
{
return;
}
Expand All @@ -283,5 +283,3 @@ void _putpixel16(unsigned x, unsigned y, unsigned short colour, s_screen *screen
blendfp = getblendfunction16(alpha);
__putpixel16(data);
}


4 changes: 1 addition & 3 deletions engine/source/gamelib/draw32.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ void _putpixel32(unsigned x, unsigned y, unsigned colour, s_screen *screen, int
int pixind;
unsigned *data ;
unsigned(*blendfp)(unsigned, unsigned);
if(x > screen->width || y > screen->height)
if(x >= (unsigned)screen->width || y >= (unsigned)screen->height)
{
return;
}
Expand All @@ -287,5 +287,3 @@ void _putpixel32(unsigned x, unsigned y, unsigned colour, s_screen *screen, int
blendfp = getblendfunction32(alpha);
__putpixel32(data);
}


Loading