forked from len0rd/rockbox
quake: Bail out of out-of-bounds draws
With this Quake should hopefully be able to run at native resolution on smaller screens. Change-Id: Ic30c8356eb2fd030a4cf84c54b63c9b688a9c14a
This commit is contained in:
parent
9bd13865b7
commit
5f4e0b6578
1 changed files with 3 additions and 3 deletions
|
@ -297,7 +297,7 @@ void Draw_Pic (int x, int y, qpic_t *pic)
|
||||||
(y < 0) ||
|
(y < 0) ||
|
||||||
(y + pic->height > vid.height))
|
(y + pic->height > vid.height))
|
||||||
{
|
{
|
||||||
Sys_Error ("Draw_Pic: bad coordinates");
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
source = pic->data;
|
source = pic->data;
|
||||||
|
@ -346,7 +346,7 @@ void Draw_TransPic (int x, int y, qpic_t *pic)
|
||||||
if (x < 0 || (unsigned)(x + pic->width) > vid.width || y < 0 ||
|
if (x < 0 || (unsigned)(x + pic->width) > vid.width || y < 0 ||
|
||||||
(unsigned)(y + pic->height) > vid.height)
|
(unsigned)(y + pic->height) > vid.height)
|
||||||
{
|
{
|
||||||
Sys_Error ("Draw_TransPic: bad coordinates");
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
source = pic->data;
|
source = pic->data;
|
||||||
|
@ -433,7 +433,7 @@ void Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte *translation)
|
||||||
if (x < 0 || (unsigned)(x + pic->width) > vid.width || y < 0 ||
|
if (x < 0 || (unsigned)(x + pic->width) > vid.width || y < 0 ||
|
||||||
(unsigned)(y + pic->height) > vid.height)
|
(unsigned)(y + pic->height) > vid.height)
|
||||||
{
|
{
|
||||||
Sys_Error ("Draw_TransPic: bad coordinates");
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
source = pic->data;
|
source = pic->data;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue