Skip to content

Commit

Permalink
ref_soft: fix crash when y < -height
Browse files Browse the repository at this point in the history
  • Loading branch information
mittorn committed Oct 31, 2023
1 parent 253eb25 commit 5e60c3c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ref/soft/r_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ void R_DrawStretchPicImplementation( int x, int y, int w, int h, int s1, int t1,
//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;
Expand Down

0 comments on commit 5e60c3c

Please sign in to comment.