Fix use-after-free when mobj is removed while still playing sounds
This commit is contained in:
1 parent
f578781418
commit
3bdc745bd1
2 files changed
+8
-1
No files matched your search
@@ -812,6 +812,8 @@ static void P_LoadSectors(UINT8 *data)
|
||||
ss->tag = SHORT(ms->tag);
|
||||
|
||||
ss->flags |= SF_FLIPSPECIAL_FLOOR;
|
||||
|
||||
ss->soundorg.thinker.function = (actionf_p1)P_MobjThinker;
|
||||
}
|
||||
|
||||
// set the sky flat num
|
||||
|
||||
+6
-1
@@ -772,9 +772,14 @@ void S_UpdateSounds(void)
|
||||
volume = c->volume; // 8 bits internal volume precision
|
||||
sep = NORM_SEP;
|
||||
|
||||
if (P_MobjWasRemoved(c->origin))
|
||||
{
|
||||
// origin was removed, stop the music
|
||||
S_StopChannel(cnum);
|
||||
}
|
||||
// check non-local sounds for distance clipping
|
||||
// or modify their params
|
||||
if (c->origin)
|
||||
else
|
||||
{
|
||||
boolean itsUs = false;
|
||||
|
||||
|
||||
Reference in new issue
Block a user