[Scummvm-cvs-logs] SF.net SVN: scummvm:[33716] scummvm/trunk/common/unarj.cpp
knakos at users.sourceforge.net
knakos at users.sourceforge.net
Sat Aug 9 20:12:44 CEST 2008
Revision: 33716
http://scummvm.svn.sourceforge.net/scummvm/?rev=33716&view=rev
Author: knakos
Date: 2008-08-09 18:12:43 +0000 (Sat, 09 Aug 2008)
Log Message:
-----------
hotfix around drascula mem leak problems. see also bug report
Modified Paths:
--------------
scummvm/trunk/common/unarj.cpp
Modified: scummvm/trunk/common/unarj.cpp
===================================================================
--- scummvm/trunk/common/unarj.cpp 2008-08-09 18:10:21 UTC (rev 33715)
+++ scummvm/trunk/common/unarj.cpp 2008-08-09 18:12:43 UTC (rev 33716)
@@ -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