Prevent crash when drawing an image out of mounts on a pixel grid
This commit is contained in:
parent
5befe5c25f
commit
b612c076eb
@ -329,8 +329,9 @@ void PIXELMETHODS_CLASS::clearrect(int x, int y, int w, int h)
|
|||||||
void PIXELMETHODS_CLASS::draw_image(pixel *img, int x, int y, int w, int h, int a)
|
void PIXELMETHODS_CLASS::draw_image(pixel *img, int x, int y, int w, int h, int a)
|
||||||
{
|
{
|
||||||
int i, j, r, g, b;
|
int i, j, r, g, b;
|
||||||
if (!img || y >= VIDYRES) return;
|
if (!img) return;
|
||||||
if(y + h > VIDYRES) h = (VIDYRES)-y; //Adjust height to prevent drawing off the bottom
|
if(y + h > VIDYRES) h = ((VIDYRES)-y)-1; //Adjust height to prevent drawing off the bottom
|
||||||
|
if(!h || y < 0) return;
|
||||||
if(a >= 255)
|
if(a >= 255)
|
||||||
for (j=0; j<h; j++)
|
for (j=0; j<h; j++)
|
||||||
for (i=0; i<w; i++)
|
for (i=0; i<w; i++)
|
||||||
|
Loading…
Reference in New Issue
Block a user