diff options
author | Strangerke | 2015-12-24 08:30:50 +0100 |
---|---|---|
committer | Strangerke | 2015-12-24 08:30:50 +0100 |
commit | 1206fe22b82a6b0af554e86b92afbbe80908f583 (patch) | |
tree | 2b8120b952f3465ea98f3853e5e28c07f66dd75b /engines/lab | |
parent | 746f494c8501eba833462eda77f25f216c342c10 (diff) | |
download | scummvm-rg350-1206fe22b82a6b0af554e86b92afbbe80908f583.tar.gz scummvm-rg350-1206fe22b82a6b0af554e86b92afbbe80908f583.tar.bz2 scummvm-rg350-1206fe22b82a6b0af554e86b92afbbe80908f583.zip |
LAB: Fix out of bound in writeColorRegs
Diffstat (limited to 'engines/lab')
-rw-r--r-- | engines/lab/dispman.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp index 6c261107e9..0457da876a 100644 --- a/engines/lab/dispman.cpp +++ b/engines/lab/dispman.cpp @@ -483,9 +483,10 @@ void DisplayMan::setAmigaPal(uint16 *pal) { } void DisplayMan::writeColorRegs(byte *buf, uint16 first, uint16 numReg) { + assert(first + numReg <= 256); byte tmp[256 * 3]; - for (int i = 0; i < 256 * 3; i++) + for (int i = 0; i < numReg * 3; i++) tmp[i] = (buf[i] << 2) | (buf[i] >> 4); // better results than buf[i] * 4 _vm->_system->getPaletteManager()->setPalette(tmp, first, numReg); |