diff options
author | David Turner | 2010-12-14 22:25:10 +0000 |
---|---|---|
committer | David Turner | 2010-12-14 22:25:10 +0000 |
commit | 3a5c8e6cfaeaa8e6a2ff421222418d2ea22721c1 (patch) | |
tree | 3e5eb9505b4a7d8f77f8270e817b1ce8d1587fb4 /sound/softsynth/mt32/synth.cpp | |
parent | d4ce60336166f2a18632e4bb3fe54d5bdff59651 (diff) | |
download | scummvm-rg350-3a5c8e6cfaeaa8e6a2ff421222418d2ea22721c1.tar.gz scummvm-rg350-3a5c8e6cfaeaa8e6a2ff421222418d2ea22721c1.tar.bz2 scummvm-rg350-3a5c8e6cfaeaa8e6a2ff421222418d2ea22721c1.zip |
SOUND: Fix Un-initialised Memory Reads in MT-32 Emulator, reported by Valgrind.
svn-id: r54909
Diffstat (limited to 'sound/softsynth/mt32/synth.cpp')
-rw-r--r-- | sound/softsynth/mt32/synth.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/softsynth/mt32/synth.cpp b/sound/softsynth/mt32/synth.cpp index 8cf2233654..55ca11ced7 100644 --- a/sound/softsynth/mt32/synth.cpp +++ b/sound/softsynth/mt32/synth.cpp @@ -337,7 +337,8 @@ bool Synth::initRhythmTimbre(int timbreNum, const Bit8u *mem, unsigned int memLe memcpy(&timbre->common, mem, 14); unsigned int memPos = 14; char drumname[11]; - Common::strlcpy(drumname, timbre->common.name, 11); + memset(drumname, 0, 11); + memcpy(drumname, timbre->common.name, 10); for (int t = 0; t < 4; t++) { if (((timbre->common.pmute >> t) & 0x1) == 0x1) { if (memPos + 58 >= memLen) { |