fix potential null pointer deref in P_MobjFloorZ/CeilingZ

dont think this ever really hit, but boundsec indeed can be null
it also gets checked if its null above anyways, so why not here?
This commit is contained in:
alufolie91 committed 2026-05-09 20:00:07 +02:00
1 parent f825ca32cc
commit 9328825a7c
1 file changed
+4 -4
+4 -4
View File
@@ -577,7 +577,7 @@ fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t
return P_GetSlopeZAt(slope, testx, testy);
// If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point
if (perfect)
if (perfect && boundsec)
{
size_t i;
line_t *ld;
@@ -666,7 +666,7 @@ fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed
return P_GetSlopeZAt(slope, testx, testy);
// If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point
if (perfect)
if (perfect && boundsec)
{
size_t i;
line_t *ld;
@@ -756,7 +756,7 @@ fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fix
return P_GetSlopeZAt(slope, testx, testy);
// If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point
if (perfect)
if (perfect && boundsec)
{
size_t i;
line_t *ld;
@@ -845,7 +845,7 @@ fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, f
return P_GetSlopeZAt(slope, testx, testy);
// If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point
if (perfect)
if (perfect && boundsec)
{
size_t i;
line_t *ld;