Fix crash in soft renderer

RE_Draw_StretchPicImplementation() would write up to
height+picupscale-1 lines.
That overflows the buffer so make sure it doesn't.
This commit is contained in:
Daniel Gibson 2021-06-04 13:38:14 +02:00
parent 2861874da6
commit dc7ad65bb0
1 changed files with 2 additions and 1 deletions

View File

@ -245,10 +245,11 @@ RE_Draw_StretchPicImplementation (int x, int y, int w, int h, const image_t *pic
if (picupscale > 1)
{
int i;
int pu = min(height-v, picupscale);
pixel_t *dest_orig = dest;
// copy first line to fill whole sector
for (i=1; i < picupscale; i++)
for (i=1; i < pu; i++)
{
// go to next line
dest += vid_buffer_width;