- Fixed: Possible NULL deref in P_RailAttack.

SVN r4274 (trunk)
This commit is contained in:
Braden Obrzut 2013-05-20 20:47:55 +00:00
parent 1d4fbc05a5
commit 5007571732
1 changed files with 6 additions and 9 deletions

View File

@ -4071,24 +4071,21 @@ void P_RailAttack (AActor *source, int damage, int offset_xy, fixed_t offset_z,
}
}
if (trace.HitType == TRACE_HitFloor &&
trace.CrossedWater == NULL &&
trace.Sector->heightsec == NULL)
if(thepuff != NULL)
{
if (thepuff != NULL)
if (trace.HitType == TRACE_HitFloor &&
trace.CrossedWater == NULL &&
trace.Sector->heightsec == NULL)
{
thepuff->SetOrigin(trace.X, trace.Y, trace.Z);
P_HitWater (thepuff, trace.Sector);
}
}
if (trace.Crossed3DWater || trace.CrossedWater)
{
if (thepuff != NULL)
if (trace.Crossed3DWater || trace.CrossedWater)
{
SpawnDeepSplash (source, trace, thepuff, vx, vy, vz, shootz, trace.Crossed3DWater != NULL);
}
thepuff->Destroy ();
}
thepuff->Destroy ();
// Draw the slug's trail.
end.X = FIXED2FLOAT(trace.X);