aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/zvision/image.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/zvision/image.cpp b/engines/zvision/image.cpp
index cacfec302c..c4823813dc 100644
--- a/engines/zvision/image.cpp
+++ b/engines/zvision/image.cpp
@@ -63,9 +63,10 @@ void ZVision::renderImageToScreen(const Common::String &fileName, uint32 x, uint
// Decode
Graphics::TGADecoder tga;
- if (!tga.loadStream(file))
+ if (!tga.loadStream(file)) {
error("Error while reading TGA image");
- file.close();
+ return;
+ }
const Graphics::Surface *tgaSurface = tga.getSurface();
_system->copyRectToScreen(tgaSurface->pixels, tgaSurface->pitch, x, y, tgaSurface->w, tgaSurface->h);