From 0d6fa01408bd1e8b247c75ff441c715d81e23a29 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 15 Sep 2015 14:03:21 +0200 Subject: SHERLOCK: 3DO: SS: fix video player memory leak --- engines/sherlock/scalpel/scalpel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/sherlock/scalpel') diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp index a169b905b9..d407b596c9 100644 --- a/engines/sherlock/scalpel/scalpel.cpp +++ b/engines/sherlock/scalpel/scalpel.cpp @@ -1267,6 +1267,7 @@ bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::P Graphics::Surface tempSurface; Common::Point framePos(pos.x, pos.y); + ImageFile3DO *frameImageFile = nullptr; ImageFrame *frameImage = nullptr; bool frameShown = false; @@ -1283,7 +1284,7 @@ bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::P framePos.y -= 8; // frame is 8 pixels on left + top, and 7 pixels on right + bottom } - ImageFile3DO *frameImageFile = new ImageFile3DO("vidframe.cel", kImageFile3DOType_Cel); + frameImageFile = new ImageFile3DO("vidframe.cel", kImageFile3DOType_Cel); frameImage = &(*frameImageFile)[0]; } @@ -1400,7 +1401,7 @@ bool ScalpelEngine::play3doMovie(const Common::String &filename, const Common::P delete videoDecoder; if (halfSize) { - delete frameImage; + delete frameImageFile; } // Restore scene -- cgit v1.2.3