ref_soft: fix crash when y < -height

This commit is contained in:
mittorn 2023-10-31 04:05:13 +03:00 committed by Alibek Omarov
parent c082e46662
commit ae7ed03376
1 changed files with 5 additions and 1 deletions

View File

@ -95,7 +95,11 @@ static void R_DrawStretchPicImplementation( int x, int y, int w, int h, int s1,
//gEngfuncs.Con_Printf ("pixels is %p\n", pic->pixels[0] );
height = h;
if (y < 0)
if( y < -h ) // out of display, out of bounds
return;
if( y < 0 )
{
skip = -y;
height += y;