aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/gfx/opengl/glimage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sword25/gfx/opengl/glimage.cpp')
-rw-r--r--engines/sword25/gfx/opengl/glimage.cpp2
1 files changed, 2 insertions, 0 deletions
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;
}