[Scummvm-cvs-logs] scummvm master -> 636a28c0dd1488aba38a7bd34ecd4ddd7dfa282a

athrxx athrxx at scummvm.org
Sun Jul 3 14:42:54 CEST 2011


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

Summary:
90fa4cf15f KYRA: formatting
636a28c0dd SCUMM: fix crash in digital iMuse games when using RTL and restarting


Commit: 90fa4cf15fe82b36c9374596ab955eea0939fc8f
    https://github.com/scummvm/scummvm/commit/90fa4cf15fe82b36c9374596ab955eea0939fc8f
Author: athrxx (athrxx at scummvm.org)
Date: 2011-07-03T05:40:55-07:00

Commit Message:
KYRA: formatting

Changed paths:
    engines/kyra/debugger.cpp



diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp
index e8dd9e9..4a48ac0 100644
--- a/engines/kyra/debugger.cpp
+++ b/engines/kyra/debugger.cpp
@@ -71,7 +71,7 @@ bool Debugger::cmd_loadPalette(int argc, const char **argv) {
 	}
 
 	if (_vm->game() != GI_KYRA1 && _vm->resource()->getFileSize(argv[1]) != 768) {
-		uint8 *buffer = (uint8 *)malloc(320 * 200 * sizeof(uint8));
+		uint8 *buffer = new uint8[320 * 200 * sizeof(uint8)];
 		if (!buffer) {
 			DebugPrintf("ERROR: Cannot allocate buffer for screen region!\n");
 			return true;
@@ -82,7 +82,7 @@ bool Debugger::cmd_loadPalette(int argc, const char **argv) {
 		palette.copy(_vm->screen()->getCPagePtr(5), 0, 256);
 		_vm->screen()->copyBlockToPage(5, 0, 0, 320, 200, buffer);
 
-		free(buffer);
+		delete[] buffer;
 	} else if (!_vm->screen()->loadPalette(argv[1], palette)) {
 		DebugPrintf("ERROR: Palette '%s' not found!\n", argv[1]);
 		return true;


Commit: 636a28c0dd1488aba38a7bd34ecd4ddd7dfa282a
    https://github.com/scummvm/scummvm/commit/636a28c0dd1488aba38a7bd34ecd4ddd7dfa282a
Author: athrxx (athrxx at scummvm.org)
Date: 2011-07-03T05:40:57-07:00

Commit Message:
SCUMM: fix crash in digital iMuse games when using RTL and restarting

(static array were not reset to NULL after being freed and therefore didn't get reallocated on restart)

Changed paths:
    engines/scumm/imuse_digi/dimuse_codecs.cpp



diff --git a/engines/scumm/imuse_digi/dimuse_codecs.cpp b/engines/scumm/imuse_digi/dimuse_codecs.cpp
index 69cd893..6edfe0b 100644
--- a/engines/scumm/imuse_digi/dimuse_codecs.cpp
+++ b/engines/scumm/imuse_digi/dimuse_codecs.cpp
@@ -105,7 +105,9 @@ static const byte imxOtherTable[6][64] = {
 
 void releaseImcTables() {
 	free(_destImcTable);
+	_destImcTable = NULL;
 	free(_destImcTable2);
+	_destImcTable2 = NULL;
 }
 
 void initializeImcTables() {






More information about the Scummvm-git-logs mailing list