ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.69k stars 622 forks source link

Crash when quitting the game while voice is transmitting #1732

Open SamVanheer opened 8 years ago

SamVanheer commented 8 years ago

The game crashes if you quit while voice is transmitting.

To reproduce: Bind a key to the quit command, and another to +voicerecord Press and hold down the voice record button Press the button tied to quit

The crash itself happens because the speaker status is updated after the entity list has been invalidated. It crashes on this line: https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/cl_dll/voice_status.cpp#L408

It is impossible to add a null pointer check here because the returned value is not null, rather a garbage pointer.

chinese-soup commented 3 years ago

Another way to reproduce the same crash on the same line is:

1) You join a server (or create one - map crossfire & don't even have to finish connecting) 2) Disconnect (disconnect) 3) Go to Options -> Voice -> Press Test microphone

The test microphone button in the Options only works if you have not yet connected to a server after launching the game or when you are on a running server (i.e. not disconnected).