hotfix around drascula mem leak problems. see also bug report

svn-id: r33716
This commit is contained in:
Kostas Nakos 2008-08-09 18:12:43 +00:00
parent 355f100793
commit 71f4a15e4e

View file

@ -75,7 +75,7 @@ static uint32 GetCRC(byte *data, int len) {
return CRC ^ 0xFFFFFFFF;
}
ArjFile::ArjFile() {
ArjFile::ArjFile() : _uncompressedData(NULL) {
InitCRC();
_isOpen = false;
_fallBack = false;
@ -256,6 +256,11 @@ bool ArjFile::open(const Common::String &filename) {
_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);