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

@ -18,6 +18,7 @@
- Fix: [#6193] All rings in Space Rings use the same secondary colour
- Fix: [#6198] You cannot cancel RCT1 directory selection
- Fix: [#6271] Wrong booster speed tooltip text
- Fix: [#6320] Crash when CSS1.DAT is absent
- Fix: Infinite loop when removing scenery elements with >127 base height.
- Fix: Ghosting of transparent map elements when the viewport is moved in OpenGL mode.
- Improved: [#6186] Transparent menu items now draw properly in OpenGL mode.

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();
}