diff options
author | richiesams | 2013-07-17 15:45:09 -0500 |
---|---|---|
committer | richiesams | 2013-08-04 13:32:27 -0500 |
commit | b316df9e821a7cb27290e8ebed49eb78c2ee5884 (patch) | |
tree | 879a6adc6031ca11a290feba68abba9f8f75279e /engines | |
parent | 47161ef30d8d7350a92fe28a031437abb338732c (diff) | |
download | scummvm-rg350-b316df9e821a7cb27290e8ebed49eb78c2ee5884.tar.gz scummvm-rg350-b316df9e821a7cb27290e8ebed49eb78c2ee5884.tar.bz2 scummvm-rg350-b316df9e821a7cb27290e8ebed49eb78c2ee5884.zip |
ZVISION: Add a return statement for when image load fails
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/image.cpp | 5 |
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); |