diff options
author | Torbjörn Andersson | 2012-11-19 07:18:05 +0100 |
---|---|---|
committer | Torbjörn Andersson | 2012-11-19 07:18:05 +0100 |
commit | 9e995991e7598f235392700f808ed8aebdc64b75 (patch) | |
tree | e8de0bff9ccad5a6a82c6871bede3994c551ea9f | |
parent | cb21d7309e1f559ce5e99ad7fe826f9ecd00ac37 (diff) | |
download | scummvm-rg350-9e995991e7598f235392700f808ed8aebdc64b75.tar.gz scummvm-rg350-9e995991e7598f235392700f808ed8aebdc64b75.tar.bz2 scummvm-rg350-9e995991e7598f235392700f808ed8aebdc64b75.zip |
SCUMM: Fix crash when Macintosh instruments aren't available
Initialise _channel[] even when the instruments aren't available.
Otherwise, ScummVM will crash in a number of places including,
but not limited to, when loading savegames.
-rw-r--r-- | engines/scumm/player_mac.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/engines/scumm/player_mac.cpp b/engines/scumm/player_mac.cpp index ef97c2d452..6cfbec398e 100644 --- a/engines/scumm/player_mac.cpp +++ b/engines/scumm/player_mac.cpp @@ -43,11 +43,6 @@ Player_Mac::Player_Mac(ScummEngine *scumm, Audio::Mixer *mixer, int numberOfChan } void Player_Mac::init() { - if (!checkMusicAvailable()) { - _channel = NULL; - return; - } - _channel = new Player_Mac::Channel[_numberOfChannels]; int i; @@ -89,6 +84,10 @@ void Player_Mac::init() { setMusicVolume(255); + if (!checkMusicAvailable()) { + return; + } + _mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); } |