From b316df9e821a7cb27290e8ebed49eb78c2ee5884 Mon Sep 17 00:00:00 2001 From: richiesams Date: Wed, 17 Jul 2013 15:45:09 -0500 Subject: ZVISION: Add a return statement for when image load fails --- engines/zvision/image.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/zvision/image.cpp') 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); -- cgit v1.2.3