hotfix around drascula mem leak problems. see also bug report
svn-id: r33716
This commit is contained in:
parent
355f100793
commit
71f4a15e4e
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue