[Scummvm-cvs-logs] SF.net SVN: scummvm:[33717] scummvm/branches/branch-0-12-0/common/unarj.cpp
knakos at users.sourceforge.net
knakos at users.sourceforge.net
Sat Aug 9 20:13:37 CEST 2008
Revision: 33717
http://scummvm.svn.sourceforge.net/scummvm/?rev=33717&view=rev
Author: knakos
Date: 2008-08-09 18:13:36 +0000 (Sat, 09 Aug 2008)
Log Message:
-----------
hotfix around drascula mem leak problems. drascula is now playable. see also bug report (sync)
Modified Paths:
--------------
scummvm/branches/branch-0-12-0/common/unarj.cpp
Modified: scummvm/branches/branch-0-12-0/common/unarj.cpp
===================================================================
--- scummvm/branches/branch-0-12-0/common/unarj.cpp 2008-08-09 18:12:43 UTC (rev 33716)
+++ scummvm/branches/branch-0-12-0/common/unarj.cpp 2008-08-09 18:13:36 UTC (rev 33717)
@@ -75,7 +75,7 @@
return CRC ^ 0xFFFFFFFF;
}
-ArjFile::ArjFile() {
+ArjFile::ArjFile() : _uncompressedData(NULL) {
InitCRC();
_isOpen = false;
_fallBack = false;
@@ -256,6 +256,11 @@
_compsize = hdr->compSize;
_origsize = hdr->origSize;
+ // FIXME: This hotfix prevents Drascula from leaking memory.
+ // As far as sanity checks go this is not bad, but the engine should be fixed.
+ if (_uncompressedData)
+ free(_uncompressedData);
+
_uncompressedData = (byte *)malloc(_origsize);
_outstream = new MemoryWriteStream(_uncompressedData, _origsize);
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