MADS: Add a sanity check in pollActiveChannel()

This avoids a crash when Rex is knocked unconscious in scene 318
This commit is contained in:
Filippos Karapetis 2014-05-16 20:26:49 +03:00
parent ede08b748a
commit a197d91df6

View File

@ -413,6 +413,10 @@ void ASound::pollActiveChannel() {
if (--_activeChannelPtr->_activeCount <= 0) {
for (;;) {
byte *pSrc = chan->_pSrc;
if (!chan->_ptr1) {
warning("pollActiveChannel(): No data found for sound channel");
break;
}
if (!(*pSrc & 0x80) || (*pSrc <= 0xF0)) {
if (updateFlag)
updateActiveChannel();