diff options
| author | Colin Snover | 2016-07-27 08:37:13 -0500 | 
|---|---|---|
| committer | Colin Snover | 2016-07-27 08:49:33 -0500 | 
| commit | bb0d5e00d03680becb349e9fa98e9eb6c83e4c04 (patch) | |
| tree | f7f7de35878e2ef31265632e52379048f51f5261 /engines/sci/graphics | |
| parent | e19922d181e775791f9105b8be7ff410770ede51 (diff) | |
| download | scummvm-rg350-bb0d5e00d03680becb349e9fa98e9eb6c83e4c04.tar.gz scummvm-rg350-bb0d5e00d03680becb349e9fa98e9eb6c83e4c04.tar.bz2 scummvm-rg350-bb0d5e00d03680becb349e9fa98e9eb6c83e4c04.zip  | |
SCI32: Handle remap data outside the game's remap range
Diffstat (limited to 'engines/sci/graphics')
| -rw-r--r-- | engines/sci/graphics/remap32.h | 7 | 
1 files changed, 6 insertions, 1 deletions
diff --git a/engines/sci/graphics/remap32.h b/engines/sci/graphics/remap32.h index 5f629d733e..1b9628c7be 100644 --- a/engines/sci/graphics/remap32.h +++ b/engines/sci/graphics/remap32.h @@ -325,7 +325,12 @@ public:  	 */  	inline bool remapEnabled(uint8 color) const {  		const uint8 index = _remapEndColor - color; -		assert(index < _remaps.size()); +		// At least KQ7 DOS uses remap colors that are outside the valid remap +		// range; in these cases, just treat those pixels as skip pixels (which +		// is how they would be treated in SSCI) +		if (index >= _remaps.size()) { +			return false; +		}  		return (_remaps[index]._type != kRemapNone);  	}  | 
