mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-24 11:36:22 +00:00
PRINCE: Fix potential out-of-bounds write (CID 1248504)
There are kMaxTexts text slots, so kMaxTexts itself is not valid.
This commit is contained in:
parent
9c885719fd
commit
b6302c6e51
@ -730,8 +730,8 @@ bool PrinceEngine::loadSample(uint32 sampleSlot, const Common::String &streamNam
|
||||
bool PrinceEngine::loadVoice(uint32 slot, uint32 sampleSlot, const Common::String &streamName) {
|
||||
debugEngine("Loading wav %s slot %d", streamName.c_str(), slot);
|
||||
|
||||
if (slot > kMaxTexts) {
|
||||
error("Text slot bigger than MAXTEXTS %d", kMaxTexts);
|
||||
if (slot >= kMaxTexts) {
|
||||
error("Text slot bigger than MAXTEXTS %d", kMaxTexts - 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user