-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sound sample NULL pointer dereferences #284
Comments
zear
added a commit
to zear/dethrace
that referenced
this issue
Feb 10, 2023
If the sound has been muted (!gS3_enabled) during game data loading, it is then possible to unmute it during gameplay and request a sound effect which doesn't have a sample loaded (most prominent for pratcam sfx). While the code accommodates for such a case, it does it too late, triggering a NULL pointer dereference on platforms which feature memory protection. This bug is most likely an overlook from the DOS era. Fix this by moving the sample NULL pointer check before its first use. Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Fixed in #285. |
zear
added a commit
to zear/dethrace
that referenced
this issue
Feb 12, 2023
If the sound has been muted (!gS3_enabled) during game data loading, it is then possible to unmute it during gameplay and request a sound effect which doesn't have a sample loaded (most prominent for pratcam sfx). While the code accommodates for such a case, it does it too late, triggering a NULL pointer dereference on platforms which feature memory protection. This bug is most likely an overlook from the DOS era. Fix this by moving the sample NULL pointer check before its first use. Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
zear
added a commit
to zear/dethrace
that referenced
this issue
Feb 19, 2023
…-labs#284) If the sound has been muted (!gS3_enabled) during game data loading, it is then possible to unmute it during gameplay and request a sound effect which doesn't have a sample loaded (most prominent for pratcam sfx). While logic in `S3StartSound` accommodates for such a case by loading the missing sample, it first calls `S3CalculateRandomizedFields`, which triggers a NULL pointer dereference on platforms with memory protection. This bug is most likely an overlook from the DOS era. Fix this by checking for NULL pointer before use. Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
zear
added a commit
to zear/dethrace
that referenced
this issue
Feb 19, 2023
…-labs#284) If the sound has been muted (!gS3_enabled) during game data loading, it is then possible to unmute it during gameplay and request a sound effect which doesn't have a sample loaded (most prominent for pratcam sfx). While logic in `S3StartSound` accommodates for such a case by loading the missing sample, it first calls `S3CalculateRandomizedFields`, which triggers a NULL pointer dereference on platforms with memory protection. This bug is most likely an overlook from the DOS era. Fix this by checking for NULL pointer before use. Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
zear
added a commit
to zear/dethrace
that referenced
this issue
Feb 19, 2023
…-labs#284) If the sound has been muted (!gS3_enabled) during game data loading, it is then possible to unmute it during gameplay and request a sound effect which doesn't have a sample loaded (most prominent for pratcam sfx). While logic in `S3StartSound` accommodates for such a case by loading the missing sample, it first calls `S3CalculateRandomizedFields`, which triggers a NULL pointer dereference on platforms with memory protection. This bug is most likely an overlook from the DOS era. Fix this by checking for NULL pointer before use. Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
zear
added a commit
that referenced
this issue
Feb 22, 2023
If the sound has been muted (!gS3_enabled) during game data loading, it is then possible to unmute it during gameplay and request a sound effect which doesn't have a sample loaded (most prominent for pratcam sfx). While logic in `S3StartSound` accommodates for such a case by loading the missing sample, it first calls `S3CalculateRandomizedFields`, which triggers a NULL pointer dereference on platforms with memory protection. This bug is most likely an overlook from the DOS era. Fix this by checking for NULL pointer before use. Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is possible to trigger a NULL pointer dereference by muting sound while in main menu, which prevents sound samples from loading with the rest of game data. When the sound is then unmuted during gameplay, an attempt to play affected sound effects will crash the game. This is most prominent for pratcam sounds.
This issue also occurs in OG and can be triggered in the Windows builds. It most likely has been carried over from the DOS codebase, but hasn't been discovered during original playtesting, since DOS doesn't have the same concept of memory protection as multi-tasking OSes.
Steps to reproduce:
s
in order to mute sound.s
again to unmute sounds.The text was updated successfully, but these errors were encountered: