[Scummvm-cvs-logs] scummvm master -> 1206fe22b82a6b0af554e86b92afbbe80908f583

Strangerke Strangerke at scummvm.org
Thu Dec 24 08:36:47 CET 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1206fe22b8 LAB: Fix out of bound in writeColorRegs


Commit: 1206fe22b82a6b0af554e86b92afbbe80908f583
    https://github.com/scummvm/scummvm/commit/1206fe22b82a6b0af554e86b92afbbe80908f583
Author: Strangerke (strangerke at scummvm.org)
Date: 2015-12-24T08:30:50+01:00

Commit Message:
LAB: Fix out of bound in writeColorRegs

Changed paths:
    engines/lab/dispman.cpp



diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp
index 6c26110..0457da8 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);






More information about the Scummvm-git-logs mailing list