also fix potential use-after-free in HWR_AddPrecipitationSprites

no clue why ogl didnt do it since its effectivle the same code as software
This commit is contained in:
Alug committed 2025-01-22 15:44:25 +01:00
1 parent fa9582cc72
commit 2036dfd83b
1 file changed
+4 -1
+4 -1
View File
@@ -4479,7 +4479,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;
@@ -4511,6 +4511,9 @@ static void HWR_AddPrecipitationSprites(void)
{
for (th = precipblocklinks[(by * bmapwidth) + bx]; th; th = next)
{
// Store this beforehand because HWR_ProjectPrecipitationSprite may free th (see P_PrecipThinker)
next = th->bnext;
HWR_ProjectPrecipitationSprite(th);
}
}