aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2015-10-11 16:51:49 -0400
committerPaul Gilbert2015-10-11 16:51:49 -0400
commit404076dcbea4a6b8a1dc0eec3f4bcbb75296bdd5 (patch)
tree5a83c5021c60c2d9442be5587e2d50731f3ed757
parent0a1f5dbd4ca2592badfcc775926ac3708eb17413 (diff)
downloadscummvm-rg350-404076dcbea4a6b8a1dc0eec3f4bcbb75296bdd5.tar.gz
scummvm-rg350-404076dcbea4a6b8a1dc0eec3f4bcbb75296bdd5.tar.bz2
scummvm-rg350-404076dcbea4a6b8a1dc0eec3f4bcbb75296bdd5.zip
SHERLOCK: RT: Fix frame memory leak in StreamingImageFile
-rw-r--r--engines/sherlock/image_file.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/sherlock/image_file.cpp b/engines/sherlock/image_file.cpp
index 1a1f295c5c..a1636e9195 100644
--- a/engines/sherlock/image_file.cpp
+++ b/engines/sherlock/image_file.cpp
@@ -1049,6 +1049,7 @@ void StreamingImageFile::close() {
_stream = nullptr;
_frameNumber = -1;
_active = false;
+ _imageFrame._frame.free();
}
bool StreamingImageFile::getNextFrame() {
@@ -1079,6 +1080,9 @@ bool StreamingImageFile::getNextFrame() {
_imageFrame._size = frameStream->readUint16LE() - 11;
_imageFrame._rleMarker = frameStream->readByte();
+ // Free the previous frame
+ _imageFrame._frame.free();
+
// Decode the frame
if (_compressed) {
delete frameStream;