diff options
author | Filippos Karapetis | 2014-05-16 20:26:49 +0300 |
---|---|---|
committer | Filippos Karapetis | 2014-05-16 20:29:37 +0300 |
commit | a197d91df64cb625c6640fdd9fe0a5f74d61a208 (patch) | |
tree | 5850eede4185e78aca78b3f785d1714f3aac1180 | |
parent | ede08b748a7af7912ed3dde37eea22a1fb2bb684 (diff) | |
download | scummvm-rg350-a197d91df64cb625c6640fdd9fe0a5f74d61a208.tar.gz scummvm-rg350-a197d91df64cb625c6640fdd9fe0a5f74d61a208.tar.bz2 scummvm-rg350-a197d91df64cb625c6640fdd9fe0a5f74d61a208.zip |
MADS: Add a sanity check in pollActiveChannel()
This avoids a crash when Rex is knocked unconscious in scene 318
-rw-r--r-- | engines/mads/nebular/sound_nebular.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/mads/nebular/sound_nebular.cpp b/engines/mads/nebular/sound_nebular.cpp index 5ee34b416f..666b686267 100644 --- a/engines/mads/nebular/sound_nebular.cpp +++ b/engines/mads/nebular/sound_nebular.cpp @@ -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(); |