From f5a822c34092b1ea6051943f317760f66e590be7 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 7 Sep 2010 23:37:44 +0000 Subject: SWORD25: Added de-allocation of data on image load error svn-id: r53333 --- engines/sword25/gfx/opengl/glimage.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/sword25') diff --git a/engines/sword25/gfx/opengl/glimage.cpp b/engines/sword25/gfx/opengl/glimage.cpp index d265d0bed8..4402e2fff6 100644 --- a/engines/sword25/gfx/opengl/glimage.cpp +++ b/engines/sword25/gfx/opengl/glimage.cpp @@ -75,12 +75,14 @@ GLImage::GLImage(const Common::String &filename, bool &result) : int pitch; if (!ImageLoader::ExtractImageProperties(pFileData, fileSize, colorFormat, _width, _height)) { BS_LOG_ERRORLN("Could not read image properties."); + delete[] pFileData; return; } // Das Bild dekomprimieren if (!ImageLoader::LoadImage(pFileData, fileSize, GraphicEngine::CF_ARGB32, _data, _width, _height, pitch)) { BS_LOG_ERRORLN("Could not decode image."); + delete[] pFileData; return; } -- cgit v1.2.3