also fix potential use-after-free in HWR_AddPrecipitationSprites

no clue why ogl didnt do it since its effectively the same code as software
This commit is contained in:
Alug committed 2025-01-22 15:46:38 +01:00
1 parent 7213f0dd5d
commit a3e2d3ec71
1 file changed
+4 -1
+4 -1
View File
@@ -4396,7 +4396,7 @@ static void HWR_AddSprites(sector_t *sec)
static void HWR_AddPrecipitationSprites(void)
{
INT32 xl, xh, yl, yh, bx, by;
precipmobj_t *th;
precipmobj_t *th, *next;
fixed_t drawdist;
@@ -4428,6 +4428,9 @@ static void HWR_AddPrecipitationSprites(void)
{
for (th = precipblocklinks[(by * bmapwidth) + bx]; th; th = th->bnext)
{
// Store this beforehand because HWR_ProjectPrecipitationSprite may free th (see P_PrecipThinker)
next = th->bnext;
if (th->precipflags & PCF_INVISIBLE)
continue;