Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix NULL pointer dereference in S3CalculateRandomizedFields (#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>
- Loading branch information