1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-02 19:56:13 +01:00

Fix #6320: Crash when CSS1.DAT is absent

This commit is contained in:
Michael Steenbeek
2017-09-29 10:43:47 +02:00
parent eea40edf0a
commit b2968ce8b0
2 changed files with 3 additions and 1 deletions

View File

@@ -248,7 +248,8 @@ namespace OpenRCT2 { namespace Audio
AudioFormat GetFormat() const override
{
AudioFormat result = { 0 };
if (_source != nullptr)
// The second check is there because NullAudioSource does not implement GetFormat. Avoid calling it.
if (_source != nullptr && _source->GetLength() > 0)
{
result = _source->GetFormat();
}