aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-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;