diff options
author | Borja Lorente | 2016-08-13 16:57:42 +0200 |
---|---|---|
committer | Borja Lorente | 2016-08-19 16:29:17 +0200 |
commit | 44a6f8a1dbdfa271aaa9ccf4b1ecc48e275ca11a (patch) | |
tree | a71afc88f925667dcd30c75395783abb67d1a5a2 /engines/macventure/image.cpp | |
parent | 479f01b5a708ed1e3294ef1d553d37d270cb97c4 (diff) | |
download | scummvm-rg350-44a6f8a1dbdfa271aaa9ccf4b1ecc48e275ca11a.tar.gz scummvm-rg350-44a6f8a1dbdfa271aaa9ccf4b1ecc48e275ca11a.tar.bz2 scummvm-rg350-44a6f8a1dbdfa271aaa9ccf4b1ecc48e275ca11a.zip |
MACVENTURE: Fix minor memory leaks
Diffstat (limited to 'engines/macventure/image.cpp')
-rw-r--r-- | engines/macventure/image.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/macventure/image.cpp b/engines/macventure/image.cpp index a89eae94be..604d9dbfc6 100644 --- a/engines/macventure/image.cpp +++ b/engines/macventure/image.cpp @@ -98,9 +98,12 @@ void ImageAsset::decodePPIC(ObjID id, Common::Array<byte> &data, uint &bitHeight return; } if (size == 2) { - realID = _container->getItem(id)->readUint16BE(); + Common::SeekableReadStream *newItemStream = _container->getItem(id); + realID = newItemStream->readUint16BE(); + delete newItemStream; } - Common::BitStream32BEMSB stream(_container->getItem(realID), true); + Common::SeekableReadStream *baseStream = _container->getItem(realID); + Common::BitStream32BEMSB stream(baseStream); uint8 mode = stream.getBits(3); int w, h; @@ -133,6 +136,8 @@ void ImageAsset::decodePPIC(ObjID id, Common::Array<byte> &data, uint &bitHeight decodePPIC3(stream, data, bitHeight, bitWidth, rowBytes); break; } + + delete baseStream; } void ImageAsset::decodePPIC0(Common::BitStream & stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) { |