Skip to content

Commit

Permalink
LAB: Fix out of bound in writeColorRegs
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Dec 24, 2015
1 parent 746f494 commit 1206fe2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engines/lab/dispman.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 1206fe2

Please sign in to comment.