Skip to content
Permalink
Browse files

ZVISION: Add a return statement for when image load fails

  • Loading branch information...
RichieSams committed Jul 17, 2013
1 parent 47161ef commit b316df9e821a7cb27290e8ebed49eb78c2ee5884
Showing with 3 additions and 2 deletions.
  1. +3 −2 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);

0 comments on commit b316df9

Please sign in to comment.
You can’t perform that action at this time.