Skip to content
Snippets Groups Projects

Fix segfault when spectating on an Emerald Hunt map

Merged Hanicef requested to merge Hanicef/SRB2Classic:fix-segfault-emerald-hunt-spec into next

If you create a custom gametype that allows spectating on Emerald Hunt maps, spectators can trigger segfaults by simply joining the game. This happens because spectators have one single tic where player->mo is NULL while joining, which is enough to trigger a NULL-dereference in the Emerald Hunt HUD logic used to detect the distance from an emerald.

This SOC can be used to trigger the bug:

GameType Spectator test
TypeOfLevel = Coop
Identifier = "spectest"
Rules = GTR_CAMPAIGN|GTR_LIVES|GTR_FRIENDLY|GTR_SPAWNENEMIES|GTR_ALLOWEXIT|GTR_EMERALDHUNT|GTR_EMERALDTOKENS|GTR_SPECIALSTAGES|GTR_CUTSCENES|GTR_SPECTATORS|GTR_NOSPECTATORSPAWN
HeaderColor = 133
RankingType = GT_COOP
IntermissionType = int_coop
Description = ""
#

To reproduce:

  • Load the SOC above with a map pack that contains an Emerald Hunt map (CyberDime Realm and Sol Sestancia are two I know of).
  • Start a server with the custom gametype on any Emerald Hunt map.
  • Go into spectator mode.
  • Join back into the game.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
Please register or sign in to reply
Loading