aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorChristopher Page2008-08-09 19:03:29 +0000
committerChristopher Page2008-08-09 19:03:29 +0000
commitce3d1e1a7d9ec9860d3fc42d8127a1634051d950 (patch)
treefbf6c9a71e7e4bdb90d502755d282c183562e93b /common
parentf41471d34bb6afb1dc0b6604b1952d10ef583765 (diff)
parent71f4a15e4efebf4de7a25d2b09817cf3a5aa51b5 (diff)
downloadscummvm-rg350-ce3d1e1a7d9ec9860d3fc42d8127a1634051d950.tar.gz
scummvm-rg350-ce3d1e1a7d9ec9860d3fc42d8127a1634051d950.tar.bz2
scummvm-rg350-ce3d1e1a7d9ec9860d3fc42d8127a1634051d950.zip
Merged revisions 33632-33633,33635,33637,33639-33640,33642-33645,33648,33654-33655,33664,33667-33670,33673-33674,33678,33682,33686-33691,33693,33696,33698,33700,33703,33708,33710,33712-33714,33716 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk svn-id: r33720
Diffstat (limited to 'common')
-rw-r--r--common/unarj.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/unarj.cpp b/common/unarj.cpp
index da88c11fc9..9a7766a41f 100644
--- a/common/unarj.cpp
+++ b/common/unarj.cpp
@@ -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);