aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/player_mac.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2012-11-19 07:18:05 +0100
committerTorbjörn Andersson2012-11-19 07:18:05 +0100
commit9e995991e7598f235392700f808ed8aebdc64b75 (patch)
treee8de0bff9ccad5a6a82c6871bede3994c551ea9f /engines/scumm/player_mac.cpp
parentcb21d7309e1f559ce5e99ad7fe826f9ecd00ac37 (diff)
downloadscummvm-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.
Diffstat (limited to 'engines/scumm/player_mac.cpp')
-rw-r--r--engines/scumm/player_mac.cpp9
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);
}