aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-01-01 07:15:52 +1100
committerPaul Gilbert2014-01-01 07:15:52 +1100
commit1cdca7cd7f4108418c0b9077a51b491755770fdb (patch)
tree84c2d72ce94c9617539041ba5141ac7c0c8fb43f
parent577b7cefa0112cf33940e70b33e0cc91a0987f26 (diff)
downloadscummvm-rg350-1cdca7cd7f4108418c0b9077a51b491755770fdb.tar.gz
scummvm-rg350-1cdca7cd7f4108418c0b9077a51b491755770fdb.tar.bz2
scummvm-rg350-1cdca7cd7f4108418c0b9077a51b491755770fdb.zip
VOYEUR: Fix memory leak in animation header class
-rw-r--r--engines/voyeur/animation.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/voyeur/animation.cpp b/engines/voyeur/animation.cpp
index db800ad015..393cd70c26 100644
--- a/engines/voyeur/animation.cpp
+++ b/engines/voyeur/animation.cpp
@@ -100,8 +100,8 @@ RL2Decoder::RL2VideoTrack *RL2Decoder::getVideoTrack() {
/*------------------------------------------------------------------------*/
RL2Decoder::RL2FileHeader::RL2FileHeader() {
- _frameOffsets = NULL;
- _frameSoundSizes = NULL;
+ _frameOffsets = nullptr;
+ _frameSoundSizes = nullptr;
}
RL2Decoder::RL2FileHeader::~RL2FileHeader() {
@@ -137,11 +137,13 @@ void RL2Decoder::RL2FileHeader::load(Common::SeekableReadStream *stream) {
stream->skip(_backSize + 4 * _numFrames);
// Load frame offsets
+ delete[] _frameOffsets;
_frameOffsets = new uint32[_numFrames];
for (int i = 0; i < _numFrames; ++i)
_frameOffsets[i] = stream->readUint32LE();
// Load the size of the sound portion of each frame
+ delete[] _frameSoundSizes;
_frameSoundSizes = new int[_numFrames];
for (int i = 0; i < _numFrames; ++i)
_frameSoundSizes[i] = stream->readUint32LE() & 0xffff;