diff options
author | Florian Kagerer | 2010-07-03 00:06:54 +0000 |
---|---|---|
committer | Florian Kagerer | 2010-07-03 00:06:54 +0000 |
commit | aefc42ab0e066b6cd2fa6eaab2471a908d7bb1fb (patch) | |
tree | 3e5762f286c5252e970d5e1124fb87d00ac32397 /engines | |
parent | 4304a414ab6ab3a46c10ddcd89ff9070caca96d9 (diff) | |
download | scummvm-rg350-aefc42ab0e066b6cd2fa6eaab2471a908d7bb1fb.tar.gz scummvm-rg350-aefc42ab0e066b6cd2fa6eaab2471a908d7bb1fb.tar.bz2 scummvm-rg350-aefc42ab0e066b6cd2fa6eaab2471a908d7bb1fb.zip |
KYRA/PC98 Audio: fix invalid mem access
svn-id: r50608
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/sound_towns.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index e8c8365f85..f6d71f8549 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -1866,9 +1866,10 @@ void TownsPC98_OpnChannel::loadData(uint8 *data) { if (cmd < 0xf0) { tmp++; } else if (cmd == 0xff) { - if (READ_LE_UINT16(tmp)) + if (READ_LE_UINT16(tmp)) { _drv->_looping |= _idFlag; - else + tmp += _drv->_opnFxCmdLen[cmd - 240]; + } else loop = false; } else if (cmd == 0xf6) { // reset repeat section countdown @@ -2512,7 +2513,7 @@ void TownsPC98_OpnSfxChannel::loadData(uint8 *data) { uint8 cmd = *tmp++; if (cmd < 0xf0) { tmp++; - } else if (cmd == 0xff && !*tmp) { + } else if (cmd == 0xff) { loop = false; } else if (cmd == 0xf6) { // reset repeat section countdown @@ -3080,7 +3081,7 @@ void TownsPC98_OpnCore::reset() { for (int i = 0; i < _numChan; i++) { for (int ii = 0; ii < 4; ii++) _chanInternal[i].opr[ii]->reset(); - memset(&_chanInternal[i].feedbuf, 0, 3); + memset(_chanInternal[i].feedbuf, 0, 3); _chanInternal[i].algorithm = 0; _chanInternal[i].frqTemp = 0; _chanInternal[i].enableLeft = _chanInternal[i].enableRight = true; |