diff options
| author | Torbjörn Andersson | 2014-10-25 20:52:14 +0200 | 
|---|---|---|
| committer | Torbjörn Andersson | 2014-10-25 20:52:14 +0200 | 
| commit | b6302c6e5155af097940c0043e1b7941c2c1fefe (patch) | |
| tree | c78fa283612737d7cc73b6346d40ca1d353560ae | |
| parent | 9c885719fd27be0c84ede2f403dc5ab82065ecd4 (diff) | |
| download | scummvm-rg350-b6302c6e5155af097940c0043e1b7941c2c1fefe.tar.gz scummvm-rg350-b6302c6e5155af097940c0043e1b7941c2c1fefe.tar.bz2 scummvm-rg350-b6302c6e5155af097940c0043e1b7941c2c1fefe.zip | |
PRINCE: Fix potential out-of-bounds write (CID 1248504)
There are kMaxTexts text slots, so kMaxTexts itself is not valid.
| -rw-r--r-- | engines/prince/prince.cpp | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index 29c434e9c9..17cef6327f 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -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;  	} | 
