1
0
Fork 0
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:
Franklin Wei 2019-08-04 23:11:40 -04:00 committed by Solomon Peachy
parent 9bd13865b7
commit 5f4e0b6578

View file

@ -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;