diff options
author | Thomas Fach-Pedersen | 2014-05-30 13:53:42 -0700 |
---|---|---|
committer | Eugene Sandulenko | 2016-09-29 22:33:35 +0200 |
commit | d93ecabc7ae5a24dabc4e21a6fcb5ec37e74566d (patch) | |
tree | 329fd0247ef27dd84486fe47c2b024380620436e /engines/bladerunner | |
parent | eefea240c72a464857fbe463b8604c6ffa112e8f (diff) | |
download | scummvm-rg350-d93ecabc7ae5a24dabc4e21a6fcb5ec37e74566d.tar.gz scummvm-rg350-d93ecabc7ae5a24dabc4e21a6fcb5ec37e74566d.tar.bz2 scummvm-rg350-d93ecabc7ae5a24dabc4e21a6fcb5ec37e74566d.zip |
BLADERUNNER: Fix memory leaks in VQADecoder
Diffstat (limited to 'engines/bladerunner')
-rw-r--r-- | engines/bladerunner/vqa_decoder.cpp | 11 | ||||
-rw-r--r-- | engines/bladerunner/vqa_decoder.h | 6 |
2 files changed, 13 insertions, 4 deletions
diff --git a/engines/bladerunner/vqa_decoder.cpp b/engines/bladerunner/vqa_decoder.cpp index ba30e73ee4..f2aee5dd33 100644 --- a/engines/bladerunner/vqa_decoder.cpp +++ b/engines/bladerunner/vqa_decoder.cpp @@ -118,6 +118,9 @@ const char *strTag(uint32 tag) VQADecoder::VQADecoder() : _s(nullptr), + _frameInfo(nullptr), + _videoTrack(nullptr), + _audioTrack(nullptr), _maxVIEWChunkSize(0), _maxZBUFChunkSize(0), _maxAESCChunkSize(0) @@ -125,6 +128,9 @@ VQADecoder::VQADecoder() } VQADecoder::~VQADecoder() { + delete _audioTrack; + delete _videoTrack; + delete[] _frameInfo; } bool VQADecoder::loadStream(Common::SeekableReadStream *s) { @@ -172,10 +178,7 @@ bool VQADecoder::loadStream(Common::SeekableReadStream *s) { } while (chd.id != kFINF); _videoTrack = new VQAVideoTrack(this); - // addTrack(_videoTrack); - _audioTrack = new VQAAudioTrack(this); - // addTrack(_audioTrack); /* for (int i = 0; i != _loopInfo.loopCount; ++i) { @@ -559,6 +562,8 @@ VQADecoder::VQAVideoTrack::~VQAVideoTrack() { delete[] _zbufChunk; delete[] _vpointer; + if (_surface) + _surface->free(); delete _surface; } diff --git a/engines/bladerunner/vqa_decoder.h b/engines/bladerunner/vqa_decoder.h index 110ca704c5..ca7e067305 100644 --- a/engines/bladerunner/vqa_decoder.h +++ b/engines/bladerunner/vqa_decoder.h @@ -107,8 +107,12 @@ private: Loop *loops; LoopInfo() - : loopCount(0) + : loopCount(0), + loops(nullptr) {} + ~LoopInfo() { + delete[] loops; + } }; struct ClipInfo |