[Scummvm-cvs-logs] scummvm master -> 53c4a190fc2337b6f2bec943ca9016f89d8e6f2f

ScummVM git noreply at scummvm.org
Thu Jun 23 09:13:48 CEST 2011


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

Summary:
e05b217b13 GIT: Ignore MSVC analysis build folders
1cc7faa242 DRACI: Replace abort() call by error()
a8b13e8a6b AGOS: Fix operator precedence warning
2f200ac493 ANALYSIS: Fix potential memory leak when using realloc
c52cc84912 AUDIO/BACKENDS/GRAPHICS: Add error checks after allocating memory with malloc
979fc29be6 BASE: Check return value from strtol in DO_OPTION_INT macro
3ece07b14b AUDIO: Replace assignment in return call by separate assignment and return call.
7a882600c6 GRAPHICS: Allocate Common::PEResources on the heap in WinFont::loadFromPE()
5aa1877bef TEENAGENT: Allocate large buffers on the heap instead of the stack
367605d774 TSAGE: Allocate resource decoding buffer on the heap
8a5bda72cc BACKENDS/GRAPHICS: Silence non zero-terminated terminated buffers warnings by initializing the buffers to 0
9ff993382e LURE: Allocate debug strings buffer on the heap
e610a17fc3 DRACI: Allocate no-sound buffer on the heap in LegacySoundArchive::openArchive()
69c7673e53 KYRA: Allocate screen region buffer on the heap
dd21952f98 SCI: Allocate decompression buffers on the heap
7fa3a8bbff BACKENDS: Add better error handling to OSystem_Win32::getDefaultConfigFileName()
53c4a190fc COMMON: Add abort() to the list of forbidden symbols


Commit: e05b217b13b8546c815636cc10c3eb91c4465ab8
    https://github.com/scummvm/scummvm/commit/e05b217b13b8546c815636cc10c3eb91c4465ab8
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:35-07:00

Commit Message:
GIT: Ignore MSVC analysis build folders

Changed paths:
    .gitignore



diff --git a/.gitignore b/.gitignore
index 9cb3984..a928f4d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -85,6 +85,7 @@ project.xcworkspace
 
 /dists/msvc*/[Dd]ebug*/
 /dists/msvc*/[Rr]elease*/
+/dists/msvc*/[Aa]nalysis*/
 /dists/msvc*/*.lib
 /dists/msvc*/*.SAV
 /dists/msvc*/*.dat


Commit: 1cc7faa2426a59cf4af87b757027f767940910c7
    https://github.com/scummvm/scummvm/commit/1cc7faa2426a59cf4af87b757027f767940910c7
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:36-07:00

Commit Message:
DRACI: Replace abort() call by error()

Changed paths:
    engines/draci/script.cpp



diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp
index c4df9d9..8ff6003 100644
--- a/engines/draci/script.cpp
+++ b/engines/draci/script.cpp
@@ -1160,9 +1160,7 @@ void Script::run(const GPL2Program &program, uint16 offset) {
 				}
 			}
 		} else {
-			debugC(1, kDraciBytecodeDebugLevel, "Unknown opcode %d, %d",
-			    num, subnum);
-			abort();
+			error("Unknown opcode %d, %d", num, subnum);
 		}
 
 		GPLHandler handler = cmd->_handler;


Commit: a8b13e8a6be900995c85f08fd527750e2620c215
    https://github.com/scummvm/scummvm/commit/a8b13e8a6be900995c85f08fd527750e2620c215
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:36-07:00

Commit Message:
AGOS: Fix operator precedence warning

Changed paths:
    engines/agos/string.cpp



diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp
index f9a06cb..410fd5a 100644
--- a/engines/agos/string.cpp
+++ b/engines/agos/string.cpp
@@ -517,8 +517,7 @@ void AGOSEngine::printScreenText(uint vgaSpriteId, uint color, const char *strin
 			y -= textHeight;
 		} else
 			pos = stringLength;
-		padding = (lettersPerRow - pos) % 2 ?
-			(lettersPerRow - pos) / 2 + 1 : (lettersPerRow - pos) / 2;
+		padding = ((lettersPerRow - pos) % 2) ? (lettersPerRow - pos) / 2 + 1 : (lettersPerRow - pos) / 2;
 		while (padding--)
 			*convertedString2++ = ' ';
 		stringLength -= pos;


Commit: 2f200ac49322ff8ccd13c5e8b7a22abbf6ff2610
    https://github.com/scummvm/scummvm/commit/2f200ac49322ff8ccd13c5e8b7a22abbf6ff2610
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:36-07:00

Commit Message:
ANALYSIS: Fix potential memory leak when using realloc

When reallocation is unsuccessful, the passed buffer is not freed. In this case, assigning the result (NULL) will result in a leak of the original memory buffer.
See http://msdn.microsoft.com/en-us/library/kkedhy7c.aspx

Changed paths:
    audio/decoders/voc.cpp
    engines/lure/memory.cpp
    engines/sword25/gfx/image/art.cpp
    engines/sword25/gfx/image/art.h
    engines/touche/resource.cpp



diff --git a/audio/decoders/voc.cpp b/audio/decoders/voc.cpp
index 74ea444..be53f94 100644
--- a/audio/decoders/voc.cpp
+++ b/audio/decoders/voc.cpp
@@ -118,7 +118,11 @@ static byte *loadVOCFromStream(Common::ReadStream &stream, int &size, int &rate,
 			debug(9, "VOC Data Block: %d, %d, %d", rate, packing, len);
 			if (packing == 0) {
 				if (size) {
-					ret_sound = (byte *)realloc(ret_sound, size + len);
+					byte *tmp = (byte *)realloc(ret_sound, size + len);
+					if (!tmp)
+						error("Cannot reallocate memory for VOC Data Block");
+
+					ret_sound = tmp;
 				} else {
 					ret_sound = (byte *)malloc(len);
 				}
diff --git a/engines/lure/memory.cpp b/engines/lure/memory.cpp
index c5c28fa..137a8f6 100644
--- a/engines/lure/memory.cpp
+++ b/engines/lure/memory.cpp
@@ -93,8 +93,12 @@ void MemoryBlock::copyFrom(const byte *src, uint32 srcPos, uint32 destPos, uint3
 
 void MemoryBlock::reallocate(uint32 size1) {
 	_size = size1;
-	_data = (byte *) realloc(_data, size1);
-	if (!_data) error ("Failed reallocating memory block");
+
+	byte *tmp = (byte *) realloc(_data, size1);
+	if (!tmp)
+		error ("[MemoryBlock::reallocate] Failed reallocating memory block");
+
+	_data = tmp;
 }
 
 } // End of namespace Lure
diff --git a/engines/sword25/gfx/image/art.cpp b/engines/sword25/gfx/image/art.cpp
index 2df8bd4..07a2be5 100644
--- a/engines/sword25/gfx/image/art.cpp
+++ b/engines/sword25/gfx/image/art.cpp
@@ -167,9 +167,14 @@ ArtSVP *art_svp_from_vpath(ArtVpath *vpath) {
 			if (points != NULL && n_points >= 2) {
 				if (n_segs == n_segs_max) {
 					n_segs_max <<= 1;
-					svp = (ArtSVP *)realloc(svp, sizeof(ArtSVP) +
-					                            (n_segs_max - 1) *
-					                            sizeof(ArtSVPSeg));
+					ArtSVP *tmp = (ArtSVP *)realloc(svp, sizeof(ArtSVP) +
+					                                    (n_segs_max - 1) *
+					                                    sizeof(ArtSVPSeg));
+
+					if (!tmp)
+						error("Cannot reallocate memory in art_svp_from_vpath()");
+
+					svp = tmp;
 				}
 				svp->segs[n_segs].n_points = n_points;
 				svp->segs[n_segs].dir = (dir > 0);
@@ -204,9 +209,14 @@ ArtSVP *art_svp_from_vpath(ArtVpath *vpath) {
 				y = points[n_points - 1].y;
 				if (n_segs == n_segs_max) {
 					n_segs_max <<= 1;
-					svp = (ArtSVP *)realloc(svp, sizeof(ArtSVP) +
-					                            (n_segs_max - 1) *
-					                            sizeof(ArtSVPSeg));
+					ArtSVP *tmp = (ArtSVP *)realloc(svp, sizeof(ArtSVP) +
+					                                     (n_segs_max - 1) *
+					                                     sizeof(ArtSVPSeg));
+
+					if (!tmp)
+						error("Cannot reallocate memory in art_svp_from_vpath()");
+
+					svp = tmp;
 				}
 				svp->segs[n_segs].n_points = n_points;
 				svp->segs[n_segs].dir = (dir > 0);
@@ -246,9 +256,14 @@ ArtSVP *art_svp_from_vpath(ArtVpath *vpath) {
 		if (n_points >= 2) {
 			if (n_segs == n_segs_max) {
 				n_segs_max <<= 1;
-				svp = (ArtSVP *)realloc(svp, sizeof(ArtSVP) +
-				                            (n_segs_max - 1) *
-				                            sizeof(ArtSVPSeg));
+				ArtSVP *tmp = (ArtSVP *)realloc(svp, sizeof(ArtSVP) +
+				                                     (n_segs_max - 1) *
+				                                      sizeof(ArtSVPSeg));
+
+				if (!tmp)
+					error("Cannot reallocate memory in art_svp_from_vpath()");
+
+				svp = tmp;
 			}
 			svp->segs[n_segs].n_points = n_points;
 			svp->segs[n_segs].dir = (dir > 0);
@@ -1157,8 +1172,13 @@ static int art_svp_writer_rewind_add_segment(ArtSvpWriter *self, int wind_left,
 		                            (swr->n_segs_max - 1) *
 		                            sizeof(ArtSVPSeg));
 		swr->svp = svp;
-		swr->n_points_max = art_renew(swr->n_points_max, int,
-		                              swr->n_segs_max);
+		int *tmp = art_renew(swr->n_points_max, int,
+		                                        swr->n_segs_max);
+
+		if (!tmp)
+			error("Cannot reallocate memory in art_svp_writer_rewind_add_segment()");
+
+		swr->n_points_max = tmp;
 	}
 	seg = &svp->segs[seg_num];
 	seg->n_points = 1;
diff --git a/engines/sword25/gfx/image/art.h b/engines/sword25/gfx/image/art.h
index bfeb31c..942e266 100644
--- a/engines/sword25/gfx/image/art.h
+++ b/engines/sword25/gfx/image/art.h
@@ -51,7 +51,9 @@ namespace Sword25 {
 #define art_expand(p, type, max) \
 			do { \
 				if(max) {\
-					p = art_renew(p, type, max <<= 1); \
+					type *tmp = art_renew(p, type, max <<= 1); \
+					if (!tmp) error("Cannot reallocate memory for art data"); \
+					p = tmp; \
 				} else { \
 					max = 1; \
 					p = art_new(type, 1); \
diff --git a/engines/touche/resource.cpp b/engines/touche/resource.cpp
index 8f4752e..6df6fc0 100644
--- a/engines/touche/resource.cpp
+++ b/engines/touche/resource.cpp
@@ -468,14 +468,22 @@ void ToucheEngine::res_loadSprite(int num, int index) {
 	if (size > spr->size) {
 		debug(8, "Reallocating memory for sprite %d (index %d), %d bytes needed", num, index, size - spr->size);
 		spr->size = size;
-		if (spr->ptr) {
-			spr->ptr = (uint8 *)realloc(spr->ptr, size);
-		} else {
-			spr->ptr = (uint8 *)malloc(size);
-		}
-		if (!spr->ptr) {
-			error("Unable to reallocate memory for sprite %d (%d bytes)", num, size);
+
+		uint8 *buffer = NULL;
+		if (spr->ptr)
+			buffer = (uint8 *)realloc(spr->ptr, size);
+
+		if (!buffer) {
+			// Free previously allocated sprite (when realloc failed)
+			free(spr->ptr);
+
+			buffer = (uint8 *)malloc(size);
 		}
+
+		if (!buffer)
+			error("[ToucheEngine::res_loadSprite] Unable to reallocate memory for sprite %d (%d bytes)", num, size);
+
+		spr->ptr = buffer;
 	}
 	for (int i = 0; i < _currentImageHeight; ++i) {
 		res_decodeScanLineImageRLE(spr->ptr + _currentImageWidth * i, _currentImageWidth);


Commit: c52cc849123ac4a6e4a6ce1f0880cb1cd95e23cd
    https://github.com/scummvm/scummvm/commit/c52cc849123ac4a6e4a6ce1f0880cb1cd95e23cd
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:36-07:00

Commit Message:
AUDIO/BACKENDS/GRAPHICS: Add error checks after allocating memory with malloc

Changed paths:
    audio/rate.cpp
    audio/softsynth/opl/mame.cpp
    backends/vkeybd/virtual-keyboard-parser.cpp
    graphics/scaler.cpp



diff --git a/audio/rate.cpp b/audio/rate.cpp
index 83abd61..0fc23a8 100644
--- a/audio/rate.cpp
+++ b/audio/rate.cpp
@@ -298,6 +298,9 @@ public:
 			_bufferSize = osamp;
 		}
 
+		if (!_buffer)
+			error("[CopyRateConverter::flow] Cannot allocate memory for temp buffer");
+
 		// Read up to 'osamp' samples into our temporary buffer
 		len = input.readBuffer(_buffer, osamp);
 
diff --git a/audio/softsynth/opl/mame.cpp b/audio/softsynth/opl/mame.cpp
index 74699ba..15e869b 100644
--- a/audio/softsynth/opl/mame.cpp
+++ b/audio/softsynth/opl/mame.cpp
@@ -725,6 +725,8 @@ static int OPLOpenTable(void) {
 
 
 	ENV_CURVE = (int *)malloc(sizeof(int) * (2*EG_ENT+1));
+	if (!ENV_CURVE)
+		error("[OPLOpenTable] Cannot allocate memory");
 
 	/* envelope counter -> envelope output table */
 	for (i=0; i < EG_ENT; i++) {
diff --git a/backends/vkeybd/virtual-keyboard-parser.cpp b/backends/vkeybd/virtual-keyboard-parser.cpp
index 5e4ce11..58f0c46 100644
--- a/backends/vkeybd/virtual-keyboard-parser.cpp
+++ b/backends/vkeybd/virtual-keyboard-parser.cpp
@@ -205,6 +205,9 @@ bool VirtualKeyboardParser::parserCallback_event(ParserNode *node) {
 
 		evt->type = VirtualKeyboard::kVKEventModifier;
 		byte *flags = (byte*) malloc(sizeof(byte));
+		if (!flags)
+			error("[VirtualKeyboardParser::parserCallback_event] Cannot allocate memory");
+
 		*(flags) = parseFlags(node->values["modifiers"]);
 		evt->data = flags;
 
@@ -217,6 +220,9 @@ bool VirtualKeyboardParser::parserCallback_event(ParserNode *node) {
 		evt->type = VirtualKeyboard::kVKEventSwitchMode;
 		String& mode = node->values["mode"];
 		char *str = (char*) malloc(sizeof(char) * mode.size() + 1);
+		if (!str)
+			error("[VirtualKeyboardParser::parserCallback_event] Cannot allocate memory");
+
 		memcpy(str, mode.c_str(), sizeof(char) * mode.size());
 		str[mode.size()] = 0;
 		evt->data = str;
diff --git a/graphics/scaler.cpp b/graphics/scaler.cpp
index a35fb90..9ade0e6 100644
--- a/graphics/scaler.cpp
+++ b/graphics/scaler.cpp
@@ -24,6 +24,7 @@
 #include "graphics/scaler/scalebit.h"
 #include "common/util.h"
 #include "common/system.h"
+#include "common/textconsole.h"
 
 int gBitFormat = 565;
 
@@ -90,6 +91,9 @@ void InitLUT(Graphics::PixelFormat format) {
 	if (RGBtoYUV == 0)
 		RGBtoYUV = (uint32 *)malloc(65536 * sizeof(uint32));
 
+	if (!RGBtoYUV)
+		error("[InitLUT] Cannot allocate memory for YUV/LUT buffers");
+
 	for (int color = 0; color < 65536; ++color) {
 		format.colorToRGB(color, r, g, b);
 		Y = (r + g + b) >> 2;


Commit: 979fc29be615fa11a095d59adf37d4077018983c
    https://github.com/scummvm/scummvm/commit/979fc29be615fa11a095d59adf37d4077018983c
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:36-07:00

Commit Message:
BASE: Check return value from strtol in DO_OPTION_INT macro

Changed paths:
    base/commandLine.cpp



diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 61853a1..6d187ac 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -267,8 +267,9 @@ void registerDefaults() {
 #define DO_OPTION_INT(shortCmd, longCmd) \
 	DO_OPTION(shortCmd, longCmd) \
 	char *endptr = 0; \
-	strtol(option, &endptr, 0); \
-	if (endptr == NULL || *endptr != 0) usage("--%s: Invalid number '%s'", longCmd, option);
+	long int retval = strtol(option, &endptr, 0); \
+	if (endptr == NULL || *endptr != 0 || retval == 0 || retval == LONG_MAX || retval == LONG_MIN || errno == ERANGE) \
+		usage("--%s: Invalid number '%s'", longCmd, option);
 
 // Use this for boolean options; this distinguishes between "-x" and "-X",
 // resp. between "--some-option" and "--no-some-option".


Commit: 3ece07b14b0ffcac4050692715c182d637c041a2
    https://github.com/scummvm/scummvm/commit/3ece07b14b0ffcac4050692715c182d637c041a2
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:36-07:00

Commit Message:
AUDIO: Replace assignment in return call by separate assignment and return call.

Changed paths:
    audio/mpu401.cpp



diff --git a/audio/mpu401.cpp b/audio/mpu401.cpp
index caad945..966e367 100644
--- a/audio/mpu401.cpp
+++ b/audio/mpu401.cpp
@@ -33,7 +33,10 @@ void MidiChannel_MPU401::init(MidiDriver *owner, byte channel) {
 bool MidiChannel_MPU401::allocate() {
 	if (_allocated)
 		return false;
-	return (_allocated = true);
+
+	_allocated = true;
+
+	return true;
 }
 
 MidiDriver *MidiChannel_MPU401::device() {


Commit: 7a882600c6778ad7d0bdd357aba92261ae306550
    https://github.com/scummvm/scummvm/commit/7a882600c6778ad7d0bdd357aba92261ae306550
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:36-07:00

Commit Message:
GRAPHICS: Allocate Common::PEResources on the heap in WinFont::loadFromPE()

Changed paths:
    graphics/fonts/winfont.cpp



diff --git a/graphics/fonts/winfont.cpp b/graphics/fonts/winfont.cpp
index 8b60f8a..3bad922 100644
--- a/graphics/fonts/winfont.cpp
+++ b/graphics/fonts/winfont.cpp
@@ -120,15 +120,18 @@ bool WinFont::loadFromNE(const Common::String &fileName, const WinFontDirEntry &
 }
 
 bool WinFont::loadFromPE(const Common::String &fileName, const WinFontDirEntry &dirEntry) {
-	Common::PEResources exe;
+	Common::PEResources *exe = new Common::PEResources();
 
-	if (!exe.loadFromEXE(fileName))
+	if (!exe->loadFromEXE(fileName)) {
+		delete exe;
 		return false;
+	}
 
 	// Let's pull out the font directory
-	Common::SeekableReadStream *fontDirectory = exe.getResource(Common::kPEFontDir, Common::String("FONTDIR"));
+	Common::SeekableReadStream *fontDirectory = exe->getResource(Common::kPEFontDir, Common::String("FONTDIR"));
 	if (!fontDirectory) {
 		warning("No font directory in '%s'", fileName.c_str());
+		delete exe;
 		return false;
 	}
 
@@ -139,18 +142,21 @@ bool WinFont::loadFromPE(const Common::String &fileName, const WinFontDirEntry &
 	// Couldn't match the face name
 	if (fontId == 0xffffffff) {
 		warning("Could not find face '%s' in '%s'", dirEntry.faceName.c_str(), fileName.c_str());
+		delete exe;
 		return false;
 	}
 
 	// Actually go get our font now...
-	Common::SeekableReadStream *fontStream = exe.getResource(Common::kPEFont, fontId);
+	Common::SeekableReadStream *fontStream = exe->getResource(Common::kPEFont, fontId);
 	if (!fontStream) {
 		warning("Could not find font %d in %s", fontId, fileName.c_str());
+		delete exe;
 		return false;
 	}
 
 	bool ok = loadFromFNT(*fontStream);
 	delete fontStream;
+	delete exe;
 	return ok;
 }
 


Commit: 5aa1877beffa71a2cc712a85b74a788e22a924e2
    https://github.com/scummvm/scummvm/commit/5aa1877beffa71a2cc712a85b74a788e22a924e2
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:37-07:00

Commit Message:
TEENAGENT: Allocate large buffers on the heap instead of the stack

Changed paths:
    engines/teenagent/resources.cpp
    engines/teenagent/teenagent.cpp



diff --git a/engines/teenagent/resources.cpp b/engines/teenagent/resources.cpp
index 9e69383..597ca67 100644
--- a/engines/teenagent/resources.cpp
+++ b/engines/teenagent/resources.cpp
@@ -106,13 +106,20 @@ void Resources::loadOff(Graphics::Surface &surface, byte *palette, int id) {
 		error("invalid background %d", id);
 		return;
 	}
-	byte buf[64768];
-	off.read(id, buf, sizeof(buf));
+
+	const uint bufferSize = 64768;
+	byte *buf = (byte *)malloc(bufferSize);
+	if (!buf)
+		error("[Resources::loadOff] Cannot allocate buffer");
+
+	off.read(id, buf, bufferSize);
 
 	byte *src = buf;
 	byte *dst = (byte *)surface.pixels;
 	memcpy(dst, src, 64000);
 	memcpy(palette, buf + 64000, 768);
+
+	free(buf);
 }
 
 Common::SeekableReadStream *Resources::loadLan(uint32 id) const {
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index 724f75b..0289b99 100644
--- a/engines/teenagent/teenagent.cpp
+++ b/engines/teenagent/teenagent.cpp
@@ -216,14 +216,22 @@ Common::Error TeenAgentEngine::loadGameState(int slot) {
 
 	Resources *res = Resources::instance();
 
-	assert(res->dseg.size() >= 0x6478 + 0x777a);
-	char data[0x777a];
+	const uint dataSize = 0x777a;
+	assert(res->dseg.size() >= 0x6478 + dataSize);
+
+	char *data = (char *)malloc(dataSize);
+	if (!data)
+		error("[TeenAgentEngine::loadGameState] Cannot allocate buffer");
+
 	in->seek(0);
-	if (in->read(data, 0x777a) != 0x777a) {
+	if (in->read(data, dataSize) != dataSize) {
+		free(data);
 		return Common::kReadingFailed;
 	}
 
-	memcpy(res->dseg.ptr(0x6478), data, sizeof(data));
+	memcpy(res->dseg.ptr(0x6478), data, dataSize);
+
+	free(data);
 
 	scene->clear();
 	inventory->activate(false);
@@ -290,17 +298,32 @@ bool TeenAgentEngine::showCDLogo() {
 	if (!cdlogo.exists("cdlogo.res") || !cdlogo.open("cdlogo.res"))
 		return true;
 
-	byte bg[0xfa00];
-	byte palette[3*256];
+	const uint bgSize = 0xfa00;
+	const uint paletteSize = 3 * 256;
+
+	byte *bg = (byte *)malloc(bgSize);
+	if (!bg)
+		error("[TeenAgentEngine::showCDLogo] Cannot allocate background buffer");
+
+	byte *palette = (byte *)malloc(paletteSize);
+	if (!palette) {
+		free(bg);
+		error("[TeenAgentEngine::showCDLogo] Cannot allocate palette buffer");
+	}
+
+	cdlogo.read(bg, bgSize);
+	cdlogo.read(palette, paletteSize);
 
-	cdlogo.read(bg, sizeof(bg));
-	cdlogo.read(palette, sizeof(palette));
-	for (uint c = 0; c < 3*256; ++c)
+	for (uint c = 0; c < paletteSize; ++c)
 		palette[c] *= 4;
+
 	_system->getPaletteManager()->setPalette(palette, 0, 0x100);
 	_system->copyRectToScreen(bg, 320, 0, 0, 320, 200);
 	_system->updateScreen();
 
+	free(bg);
+	free(palette);
+
 	for(uint i = 0; i < 20; ++i) {
 		int r = skipEvents();
 		if (r != 0)
@@ -317,43 +340,66 @@ bool TeenAgentEngine::showLogo() {
 	if (!logo.open("unlogic.res"))
 		return true;
 
-	byte bg[0xfa00];
-	byte palette[3*256];
-
 	Common::ScopedPtr<Common::SeekableReadStream> frame(logo.getStream(1));
 	if (!frame)
 		return true;
 
-	frame->read(bg, sizeof(bg));
-	frame->read(palette, sizeof(palette));
-	for (uint c = 0; c < 3*256; ++c)
+	const uint bgSize = 0xfa00;
+	const uint paletteSize = 3 * 256;
+
+	byte *bg = (byte *)malloc(bgSize);
+	if (!bg)
+		error("[TeenAgentEngine::showLogo] Cannot allocate background buffer");
+
+	byte *palette = (byte *)malloc(paletteSize);
+	if (!palette) {
+		free(bg);
+		error("[TeenAgentEngine::showLogo] Cannot allocate palette buffer");
+	}
+
+	frame->read(bg, bgSize);
+	frame->read(palette, paletteSize);
+
+	for (uint c = 0; c < paletteSize; ++c)
 		palette[c] *= 4;
+
 	_system->getPaletteManager()->setPalette(palette, 0, 0x100);
 
+	free(palette);
+
 	uint n = logo.fileCount();
 	for(uint f = 0; f < 4; ++f)
 		for(uint i = 2; i <= n; ++i) {
 			{
 				int r = skipEvents();
-				if (r != 0)
+				if (r != 0) {
+					free(bg);
 					return r > 0? true: false;
+				}
 			}
 			_system->copyRectToScreen(bg, 320, 0, 0, 320, 200);
 
 			frame.reset(logo.getStream(i));
-			if (!frame)
+			if (!frame) {
+				free(bg);
 				return true;
+			}
 
 			Surface s;
 			s.load(frame, Surface::kTypeOns);
-			if (s.empty())
+			if (s.empty()) {
+				free(bg);
 				return true;
+			}
 
 			_system->copyRectToScreen((const byte *)s.pixels, s.w, s.x, s.y, s.w, s.h);
 			_system->updateScreen();
 
 			_system->delayMillis(100);
 		}
+
+	free(bg);
+
 	return true;
 }
 
@@ -364,29 +410,53 @@ bool TeenAgentEngine::showMetropolis() {
 	FilePack varia;
 	varia.open("varia.res");
 
-	byte palette[3*256];
+	const uint paletteSize = 3 * 256;
+	byte *palette = (byte *)malloc(paletteSize);
+	if (!palette)
+		error("[TeenAgentEngine::showMetropolis] Cannot allocate palette buffer");
+
 	{
 		Common::ScopedPtr<Common::SeekableReadStream> s(varia.getStream(5));
-		s->read(palette, sizeof(palette));
-		for (uint c = 0; c < 3*256; ++c)
+		s->read(palette, paletteSize);
+		for (uint c = 0; c < paletteSize; ++c)
 			palette[c] *= 4;
 	}
 
 	_system->getPaletteManager()->setPalette(palette, 0, 0x100);
 
-	byte varia_6[21760], varia_9[18302];
-	varia.read(6, varia_6, sizeof(varia_6));
-	varia.read(9, varia_9, sizeof(varia_9));
+	free(palette);
 
-	byte colors[56 * 160 * 2];
-	memset(colors, 0, sizeof(colors));
+	const uint varia6Size = 21760;
+	const uint varia9Size = 18302;
+	byte *varia_6 = (byte *)malloc(varia6Size);
+	byte *varia_9 = (byte *)malloc(varia9Size);
+	if (!varia_6 || !varia_9) {
+		free(varia_6);
+		free(varia_9);
+
+		error("[TeenAgentEngine::showMetropolis] Cannot allocate buffer");
+	}
+
+	varia.read(6, varia_6, varia6Size);
+	varia.read(9, varia_9, varia9Size);
+
+	const uint colorsSize = 56 * 160 * 2;
+	byte *colors = (byte *)malloc(colorsSize);
+	if (!colors)
+		error("[TeenAgentEngine::showMetropolis] Cannot allocate colors buffer");
+
+	memset(colors, 0, colorsSize);
 
 	int logo_y = -56;
 	for(uint f = 0; f < 300; ++f) {
 		{
 			int r = skipEvents();
-			if (r != 0)
+			if (r != 0) {
+				free(varia_6);
+				free(varia_9);
+				free(colors);
 				return r > 0? true: false;
+			}
 		}
 
 		Graphics::Surface *surface = _system->lockScreen();
@@ -441,6 +511,11 @@ bool TeenAgentEngine::showMetropolis() {
 		_system->updateScreen();
 		_system->delayMillis(100);
 	}
+
+	free(varia_6);
+	free(varia_9);
+	free(colors);
+
 	return true;
 }
 


Commit: 367605d774df038166b14044a5f5ce935f244519
    https://github.com/scummvm/scummvm/commit/367605d774df038166b14044a5f5ce935f244519
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:37-07:00

Commit Message:
TSAGE: Allocate resource decoding buffer on the heap

Changed paths:
    engines/toon/path.cpp
    engines/tsage/resources.cpp



diff --git a/engines/toon/path.cpp b/engines/toon/path.cpp
index dde7be0..43a134e 100644
--- a/engines/toon/path.cpp
+++ b/engines/toon/path.cpp
@@ -342,8 +342,15 @@ next:
 	curX = destx;
 	curY = desty;
 
-	int32 retPathX[4096];
-	int32 retPathY[4096];
+	int32 *retPathX = (int32 *)malloc(4096 * sizeof(int32));
+	int32 *retPathY = (int32 *)malloc(4096 * sizeof(int32));
+	if (!retPathX || !retPathY) {
+		free(retPathX);
+		free(retPathY);
+
+		error("[PathFinding::findPath] Cannot allocate pathfinding buffers");
+	}
+
 	int32 numpath = 0;
 
 	retPathX[numpath] = curX;
@@ -377,8 +384,12 @@ next:
 			}
 		}
 
-		if (bestX < 0 || bestY < 0)
+		if (bestX < 0 || bestY < 0) {
+			free(retPathX);
+			free(retPathY);
+
 			return 0;
+		}
 
 		retPathX[numpath] = bestX;
 		retPathY[numpath] = bestY;
@@ -389,6 +400,10 @@ next:
 
 			memcpy(_tempPathX, retPathX, sizeof(int32) * numpath);
 			memcpy(_tempPathY, retPathY, sizeof(int32) * numpath);
+
+			free(retPathX);
+			free(retPathY);
+
 			return true;
 		}
 
@@ -396,6 +411,9 @@ next:
 		curY = bestY;
 	}
 
+	free(retPathX);
+	free(retPathY);
+
 	return false;
 }
 
diff --git a/engines/tsage/resources.cpp b/engines/tsage/resources.cpp
index d24c564..e6a561f 100644
--- a/engines/tsage/resources.cpp
+++ b/engines/tsage/resources.cpp
@@ -237,8 +237,13 @@ byte *TLib::getResource(uint16 id, bool suppressErrors) {
 	uint16 ctrCurrent = 0x102, ctrMax = 0x200;
 	uint16 word_48050 = 0, currentToken = 0, word_48054 =0;
 	byte byte_49068 = 0, byte_49069 = 0;
-	DecodeReference table[0x1000];
-	for (int i = 0; i < 0x1000; ++i) {
+
+	const uint tableSize = 0x1000;
+	DecodeReference *table = (DecodeReference *)malloc(tableSize * sizeof(DecodeReference));
+	if (!table)
+		error("[TLib::getResource] Cannot allocate table buffer");
+
+	for (int i = 0; i < tableSize; ++i) {
 		table[i].vByte = table[i].vWord = 0;
 	}
 	Common::Stack<uint16> tokenList;
@@ -302,6 +307,8 @@ byte *TLib::getResource(uint16 id, bool suppressErrors) {
 		}
 	}
 
+	free(table);
+
 	assert(bytesWritten == re->uncompressedSize);
 	delete compStream;
 	return dataOut;


Commit: 8a5bda72cca58314c639432d5ab718a70fd42b90
    https://github.com/scummvm/scummvm/commit/8a5bda72cca58314c639432d5ab718a70fd42b90
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:37-07:00

Commit Message:
BACKENDS/GRAPHICS: Silence non zero-terminated terminated buffers warnings by initializing the buffers to 0

Changed paths:
    backends/platform/sdl/sdl.cpp
    graphics/font.cpp



diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 3f85b1a..96d65c5 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -413,6 +413,7 @@ void OSystem_SDL::setupIcon() {
 	for (i = 0; i < ncols; i++) {
 		unsigned char code;
 		char color[32];
+		memset(color, 0, sizeof(color));
 		unsigned int col;
 		if (sscanf(scummvm_icon[1 + i], "%c c %s", &code, color) != 2) {
 			warning("Wrong format of scummvm_icon[%d] (%s)", 1 + i, scummvm_icon[1 + i]);
diff --git a/graphics/font.cpp b/graphics/font.cpp
index cdf9090..d254c64 100644
--- a/graphics/font.cpp
+++ b/graphics/font.cpp
@@ -214,6 +214,8 @@ int bdf_read_header(Common::SeekableReadStream &fp, NewFontData* pf) {
 	char buf[256];
 	char facename[256];
 	char copyright[256];
+	memset(facename, 0, sizeof(facename));
+	memset(copyright, 0, sizeof(copyright));
 
 	/* set certain values to errors for later error checking*/
 	pf->defaultchar = -1;
@@ -235,6 +237,7 @@ int bdf_read_header(Common::SeekableReadStream &fp, NewFontData* pf) {
 				warning("Error: bad 'FONT'");
 				return 0;
 			}
+
 			pf->facename = strdup(facename);
 			continue;
 		}
@@ -243,6 +246,7 @@ int bdf_read_header(Common::SeekableReadStream &fp, NewFontData* pf) {
 				warning("Error: bad 'COPYRIGHT'");
 				return 0;
 			}
+
 			pf->copyright = strdup(copyright);
 			continue;
 		}


Commit: 9ff993382e17d1d7aef96105ad5fa2fe35043b7a
    https://github.com/scummvm/scummvm/commit/9ff993382e17d1d7aef96105ad5fa2fe35043b7a
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:37-07:00

Commit Message:
LURE: Allocate debug strings buffer on the heap

Changed paths:
    engines/lure/debugger.cpp



diff --git a/engines/lure/debugger.cpp b/engines/lure/debugger.cpp
index 6841087..ef4a22f 100644
--- a/engines/lure/debugger.cpp
+++ b/engines/lure/debugger.cpp
@@ -549,14 +549,19 @@ bool Debugger::cmd_showAnim(int argc, const char **argv) {
 }
 
 bool Debugger::cmd_saveStrings(int argc, const char **argv) {
-	StringData &strings = StringData::getReference();
-	char buffer[32768];
-
 	if (argc != 2) {
 		DebugPrintf("strings <stringId>\n");
 		return true;
 	}
 
+	StringData &strings = StringData::getReference();
+
+	char *buffer = (char *)malloc(32768);
+	if (!buffer) {
+		DebugPrintf("Cannot allocate strings buffer\n");
+		return true;
+	}
+
 	uint16 id = strToInt(argv[1]);
 	strings.getString(id, buffer, NULL, NULL);
 	DebugPrintf("%s\n", buffer);
@@ -577,6 +582,9 @@ bool Debugger::cmd_saveStrings(int argc, const char **argv) {
 
 	DebugPrintf("Done\n");
 */
+
+	free(buffer);
+
 	return true;
 }
 


Commit: e610a17fc3c8956aaca4b1f68a73dbfaebb5beb0
    https://github.com/scummvm/scummvm/commit/e610a17fc3c8956aaca4b1f68a73dbfaebb5beb0
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:38-07:00

Commit Message:
DRACI: Allocate no-sound buffer on the heap in LegacySoundArchive::openArchive()

Changed paths:
    engines/draci/sound.cpp



diff --git a/engines/draci/sound.cpp b/engines/draci/sound.cpp
index 106167e..d534f46 100644
--- a/engines/draci/sound.cpp
+++ b/engines/draci/sound.cpp
@@ -67,8 +67,12 @@ void LegacySoundArchive::openArchive(const char *path) {
 	debugC(1, kDraciArchiverDebugLevel, "Loading header");
 
 	uint totalLength = _f->readUint32LE();
+
 	const uint kMaxSamples = 4095;	// The no-sound file is exactly 16K bytes long, so don't fail on short reads
-	uint sampleStarts[kMaxSamples];
+	uint *sampleStarts = (uint *)malloc(kMaxSamples * sizeof(uint));
+	if (!sampleStarts)
+		error("[LegacySoundArchive::openArchive] Cannot allocate buffer for no-sound file");
+
 	for (uint i = 0; i < kMaxSamples; ++i) {
 		sampleStarts[i] = _f->readUint32LE();
 	}
@@ -90,17 +94,22 @@ void LegacySoundArchive::openArchive(const char *path) {
 		}
 		if (_samples[_sampleCount-1]._offset + _samples[_sampleCount-1]._length != totalLength &&
 		    _samples[_sampleCount-1]._offset + _samples[_sampleCount-1]._length - _samples[0]._offset != totalLength) {
-			// WORKAROUND: the stored length is stored with the header for sounds and without the hader for dubbing.  Crazy.
+			// WORKAROUND: the stored length is stored with the header for sounds and without the header for dubbing.  Crazy.
 			debugC(1, kDraciArchiverDebugLevel, "Broken sound archive: %d != %d",
 				_samples[_sampleCount-1]._offset + _samples[_sampleCount-1]._length,
 				totalLength);
 			closeArchive();
+
+			free(sampleStarts);
+
 			return;
 		}
 	} else {
 		debugC(1, kDraciArchiverDebugLevel, "Archive info: empty");
 	}
 
+	free(sampleStarts);
+
 	// Indicate that the archive has been successfully opened
 	_opened = true;
 }


Commit: 69c7673e53e1afd197f1e119059fc351a6daa5e0
    https://github.com/scummvm/scummvm/commit/69c7673e53e1afd197f1e119059fc351a6daa5e0
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:38-07:00

Commit Message:
KYRA: Allocate screen region buffer on the heap

Changed paths:
    engines/kyra/debugger.cpp



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


Commit: dd21952f9845c2d9947c3ad6459f45063f0588d6
    https://github.com/scummvm/scummvm/commit/dd21952f9845c2d9947c3ad6459f45063f0588d6
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:38-07:00

Commit Message:
SCI: Allocate decompression buffers on the heap

Changed paths:
    engines/sci/decompressor.cpp



diff --git a/engines/sci/decompressor.cpp b/engines/sci/decompressor.cpp
index 03a06d2..7e7acab 100644
--- a/engines/sci/decompressor.cpp
+++ b/engines/sci/decompressor.cpp
@@ -181,16 +181,27 @@ int DecompressorLZW::unpackLZW(Common::ReadStream *src, byte *dest, uint32 nPack
 	init(src, dest, nPacked, nUnpacked);
 
 	uint16 token; // The last received value
-
-	uint16 tokenlist[4096]; // pointers to dest[]
-	uint16 tokenlengthlist[4096]; // char length of each token
 	uint16 tokenlastlength = 0;
 
+	uint16 *tokenlist = (uint16 *)malloc(4096 * sizeof(uint16)); // pointers to dest[]
+	uint16* tokenlengthlist = (uint16 *)malloc(4096 * sizeof(uint16)); // char length of each token
+	if (!tokenlist || !tokenlengthlist) {
+		free(tokenlist);
+		free(tokenlengthlist);
+
+		error("[DecompressorLZW::unpackLZW] Cannot allocate token memory buffers");
+	}
+
 	while (!isFinished()) {
 		token = getBitsLSB(_numbits);
 
-		if (token == 0x101)
+		if (token == 0x101) {
+			free(tokenlist);
+			free(tokenlengthlist);
+
 			return 0; // terminator
+		}
+
 		if (token == 0x100) { // reset command
 			_numbits = 9;
 			_endtoken = 0x1FF;
@@ -199,6 +210,10 @@ int DecompressorLZW::unpackLZW(Common::ReadStream *src, byte *dest, uint32 nPack
 			if (token > 0xff) {
 				if (token >= _curtoken) {
 					warning("unpackLZW: Bad token %x", token);
+
+					free(tokenlist);
+					free(tokenlengthlist);
+
 					return SCI_ERROR_DECOMPRESSION_ERROR;
 				}
 				tokenlastlength = tokenlengthlist[token] + 1;
@@ -231,6 +246,9 @@ int DecompressorLZW::unpackLZW(Common::ReadStream *src, byte *dest, uint32 nPack
 		}
 	}
 
+	free(tokenlist);
+	free(tokenlengthlist);
+
 	return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_ERROR;
 }
 
@@ -238,12 +256,19 @@ int DecompressorLZW::unpackLZW1(Common::ReadStream *src, byte *dest, uint32 nPac
                                 uint32 nUnpacked) {
 	init(src, dest, nPacked, nUnpacked);
 
-	byte stak[0x1014];
-	byte lastchar = 0;
-	uint16 stakptr = 0, lastbits = 0;
-	Tokenlist tokens[0x1004];
+	byte *stak = (byte *)malloc(0x1014);
+	Tokenlist *tokens = (Tokenlist *)malloc(0x1004 * sizeof(Tokenlist));
+	if (!stak || !tokens) {
+		free(stak);
+		free(tokens);
+
+		error("[DecompressorLZW::unpackLZW1] Cannot allocate decompression buffers");
+	}
+
 	memset(tokens, 0, sizeof(tokens));
 
+	byte lastchar = 0;
+	uint16 stakptr = 0, lastbits = 0;
 
 	byte decryptstart = 0;
 	uint16 bitstring;
@@ -310,6 +335,10 @@ int DecompressorLZW::unpackLZW1(Common::ReadStream *src, byte *dest, uint32 nPac
 			break;
 		}
 	}
+
+	free(stak);
+	free(tokens);
+
 	return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_ERROR;
 }
 


Commit: 7fa3a8bbffc625232cd24252cf501e2c2b7b2a55
    https://github.com/scummvm/scummvm/commit/7fa3a8bbffc625232cd24252cf501e2c2b7b2a55
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:38-07:00

Commit Message:
BACKENDS: Add better error handling to OSystem_Win32::getDefaultConfigFileName()

Changed paths:
    backends/platform/sdl/win32/win32.cpp



diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index 5b02a20..814f195 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -155,18 +155,31 @@ Common::String OSystem_Win32::getDefaultConfigFileName() {
 				error("Unable to access user profile directory");
 
 			strcat(configFile, "\\Application Data");
-			CreateDirectory(configFile, NULL);
+
+			// If the directory already exists (as it should in most cases),
+			// we don't want to fail, but we need to stop on other errors (such as ERROR_PATH_NOT_FOUND)
+			if (!CreateDirectory(configFile, NULL)) {
+				if (GetLastError() != ERROR_ALREADY_EXISTS)
+					error("Cannot create Application data folder");
+			}
 		}
 
 		strcat(configFile, "\\ScummVM");
-		CreateDirectory(configFile, NULL);
+		if (!CreateDirectory(configFile, NULL)) {
+			if (GetLastError() != ERROR_ALREADY_EXISTS)
+				error("Cannot create ScummVM application data folder");
+		}
+
 		strcat(configFile, "\\" DEFAULT_CONFIG_FILE);
 
 		FILE *tmp = NULL;
 		if ((tmp = fopen(configFile, "r")) == NULL) {
 			// Check windows directory
 			char oldConfigFile[MAXPATHLEN];
-			GetWindowsDirectory(oldConfigFile, MAXPATHLEN);
+			uint ret = GetWindowsDirectory(oldConfigFile, MAXPATHLEN);
+			if (ret == 0 || ret > MAXPATHLEN)
+				error("Cannot retrieve the path of the Windows directory");
+
 			strcat(oldConfigFile, "\\" DEFAULT_CONFIG_FILE);
 			if ((tmp = fopen(oldConfigFile, "r"))) {
 				strcpy(configFile, oldConfigFile);
@@ -178,7 +191,10 @@ Common::String OSystem_Win32::getDefaultConfigFileName() {
 		}
 	} else {
 		// Check windows directory
-		GetWindowsDirectory(configFile, MAXPATHLEN);
+		uint ret = GetWindowsDirectory(configFile, MAXPATHLEN);
+		if (ret == 0 || ret > MAXPATHLEN)
+			error("Cannot retrieve the path of the Windows directory");
+
 		strcat(configFile, "\\" DEFAULT_CONFIG_FILE);
 	}
 


Commit: 53c4a190fc2337b6f2bec943ca9016f89d8e6f2f
    https://github.com/scummvm/scummvm/commit/53c4a190fc2337b6f2bec943ca9016f89d8e6f2f
Author: Julien (littleboy at users.sourceforge.net)
Date: 2011-06-23T00:11:38-07:00

Commit Message:
COMMON: Add abort() to the list of forbidden symbols

Changed paths:
    common/forbidden.h



diff --git a/common/forbidden.h b/common/forbidden.h
index 9cba19c..95c1a47 100644
--- a/common/forbidden.h
+++ b/common/forbidden.h
@@ -29,7 +29,7 @@
  * infrastructure code do not make use of certain "forbidden" APIs, such
  * as fopen(), setjmp(), etc.
  * This is achieved by re-#defining various symbols to a "garbage"
- * string which then trigers a compiler error.
+ * string which then triggers a compiler error.
  *
  * Backend files may #define FORBIDDEN_SYMBOL_ALLOW_ALL if they
  * have to access functions like fopen, fread etc.
@@ -203,6 +203,11 @@
 #define exit(a)	FORBIDDEN_SYMBOL_REPLACEMENT
 #endif
 
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_abort
+#undef abort
+#define abort()	FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
+
 #ifndef FORBIDDEN_SYMBOL_EXCEPTION_getenv
 #undef getenv
 #define getenv(a)	FORBIDDEN_SYMBOL_REPLACEMENT






More information about the Scummvm-git-logs mailing list