MADS: Avoid potential crash for reading beyond end of sound data

This commit is contained in:
Paul Gilbert 2020-08-29 15:05:21 -07:00
parent 6f8aa0b21b
commit b513242292

View File

@ -466,6 +466,7 @@ void ASound::pollActiveChannel() {
}
if (pSrc > chan->_ptrEnd) {
warning("Read beyond end of loaded sound data");
return;
}
if (!(*pSrc & 0x80) || (*pSrc <= 0xF0)) {