From b843b2fd3385533955a325ff8819e37ab3b0b2f0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 12 Jul 2016 18:27:33 -0400 Subject: TITANIC: Fix memory leak in image decoders --- engines/titanic/support/image_decoders.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engines/titanic/support/image_decoders.cpp b/engines/titanic/support/image_decoders.cpp index 4203dad97c..495d1d0982 100644 --- a/engines/titanic/support/image_decoders.cpp +++ b/engines/titanic/support/image_decoders.cpp @@ -45,6 +45,7 @@ void CJPEGDecode::decode(OSVideoSurface &surface, const CString &name) { Common::copy((byte *)convertedSurface->getPixels(), (byte *)convertedSurface->getPixels() + surface.getPitch() * surface.getHeight(), (byte *)surface._rawSurface->getPixels()); + convertedSurface->free(); delete convertedSurface; surface.unlock(); } @@ -72,6 +73,7 @@ void CTargaDecode::decode(OSVideoSurface &surface, const CString &name) { Common::copy((byte *)convertedSurface->getPixels(), (byte *)convertedSurface->getPixels() + surface.getPitch() * surface.getHeight(), (byte *)surface._rawSurface->getPixels()); + convertedSurface->free(); delete convertedSurface; surface.unlock(); } -- cgit v1.2.3