[Scummvm-cvs-logs] SF.net SVN: scummvm:[39736] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Mar 29 14:11:10 CEST 2009


Revision: 39736
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39736&view=rev
Author:   peres001
Date:     2009-03-29 12:11:10 +0000 (Sun, 29 Mar 2009)

Log Message:
-----------
Fixed several free/delete mismatches.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/disk_br.cpp
    scummvm/trunk/engines/parallaction/disk_ns.cpp
    scummvm/trunk/engines/parallaction/iff.cpp

Modified: scummvm/trunk/engines/parallaction/disk_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_br.cpp	2009-03-29 12:10:17 UTC (rev 39735)
+++ scummvm/trunk/engines/parallaction/disk_br.cpp	2009-03-29 12:11:10 UTC (rev 39736)
@@ -513,7 +513,7 @@
 	// Overwrite the first color (transparent key) in the palette
 	info.palette.setEntry(0, pal[0] >> 2, pal[1] >> 2, pal[2] >> 0);
 
-	free(pal);
+	delete []pal;
 
 	// background data is drawn used the upper portion of the palette
 	adjustForPalette(info.bg);
@@ -595,7 +595,7 @@
 	Common::String sName = name;
 
 	Common::SeekableReadStream *stream = openFile("ras/" + sName, ".ras");
-	ILBMDecoder decoder(stream);
+	ILBMDecoder decoder(stream, true);
 
 	Graphics::Surface* surf = new Graphics::Surface;
 	assert(surf);
@@ -731,7 +731,7 @@
 	debugC(5, kDebugDisk, "AmigaDisk_br::loadObjects");
 
 	Common::SeekableReadStream *stream = openFile(name);
-	ILBMDecoder decoder(stream);
+	ILBMDecoder decoder(stream, true);
 
 	uint16 max = objectsMax[part];
 	if (_vm->getFeatures() & GF_DEMO)

Modified: scummvm/trunk/engines/parallaction/disk_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_ns.cpp	2009-03-29 12:10:17 UTC (rev 39735)
+++ scummvm/trunk/engines/parallaction/disk_ns.cpp	2009-03-29 12:11:10 UTC (rev 39736)
@@ -1049,7 +1049,7 @@
 		b = pal[i*3+2];
 		info.layers[i] = (((r << 4) & 0xF00) | (g & 0xF0) | (b >> 4)) & 0xFF;
 	}
-	delete pal;
+	delete []pal;
 
 	info._mask = new MaskBuffer;
 	info._mask->w = info.width;

Modified: scummvm/trunk/engines/parallaction/iff.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/iff.cpp	2009-03-29 12:10:17 UTC (rev 39735)
+++ scummvm/trunk/engines/parallaction/iff.cpp	2009-03-29 12:11:10 UTC (rev 39736)
@@ -123,7 +123,7 @@
 
 // ILBM decoder implementation
 
-ILBMDecoder::ILBMDecoder(Common::SeekableReadStream *in, bool disposeStream) : _in(in), _hasHeader(false), _bodySize((uint32)-1), _paletteSize((uint32)-1) {
+ILBMDecoder::ILBMDecoder(Common::SeekableReadStream *in, bool disposeStream) : _in(in), _disposeStream(disposeStream), _hasHeader(false), _bodySize((uint32)-1), _paletteSize((uint32)-1) {
 	assert(in);
 	_parser.setInputStream(in);
 
@@ -192,9 +192,8 @@
 	Common::SeekableReadStream *bodyStream = _parser.getIFFBlockStream(ID_BODY);
 	assert(bodyStream);
 
-	byte *bitmap = new byte[bitmapSize];
+	byte *bitmap = (byte*)calloc(bitmapSize, 1);
 	assert(bitmap);
-	memset(bitmap, 0, bitmapSize);
 
 	switch (_header.pack) {
 	case 1: {	// PackBits compressed bitmap


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list