aboutsummaryrefslogtreecommitdiff
path: root/engines/groovie
diff options
context:
space:
mode:
authorJohannes Schickel2009-09-14 18:40:05 +0000
committerJohannes Schickel2009-09-14 18:40:05 +0000
commit5ed03fcd3ae9ec219f40736056c73f1a0bed5b4c (patch)
tree31cbc1825295cafcfc19e4571a32862773e5a693 /engines/groovie
parent8ac3db080131713a4c7aa50f46557f3e6c726356 (diff)
downloadscummvm-rg350-5ed03fcd3ae9ec219f40736056c73f1a0bed5b4c.tar.gz
scummvm-rg350-5ed03fcd3ae9ec219f40736056c73f1a0bed5b4c.tar.bz2
scummvm-rg350-5ed03fcd3ae9ec219f40736056c73f1a0bed5b4c.zip
Fix valgrind warning.
svn-id: r44084
Diffstat (limited to 'engines/groovie')
-rw-r--r--engines/groovie/music.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp
index a92beee17e..0566b611d5 100644
--- a/engines/groovie/music.cpp
+++ b/engines/groovie/music.cpp
@@ -557,7 +557,14 @@ void MusicPlayerXMI::setTimbreAD(byte channel, const Timbre &timbre) {
}
// Prepare the AdLib Instrument array from the GTL entry
- byte data[13];
+ //
+ // struct AdlibInstrument used by our AdLib MIDI synth is 30 bytes,
+ // since we pass data + 2 for non precussion instruments we need to
+ // have a buffer of size 32, so there are no invalid memory reads,
+ // when setting up an AdLib instrument.
+ byte data[32];
+ memset(data, 0, sizeof(data));
+
data[2] = timbre.data[1]; // mod_characteristic
data[3] = timbre.data[2] ^ 0x3F; // mod_scalingOutputLevel
data[4] = ~timbre.data[3]; // mod_attackDecay