Skip to content

Commit

Permalink
ZVISION: Add a return statement for when image load fails
Browse files Browse the repository at this point in the history
  • Loading branch information
RichieSams committed Aug 4, 2013
1 parent 47161ef commit b316df9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions engines/zvision/image.cpp
Expand Up @@ -63,9 +63,10 @@ void ZVision::renderImageToScreen(const Common::String &fileName, uint32 x, uint


// Decode // Decode
Graphics::TGADecoder tga; Graphics::TGADecoder tga;
if (!tga.loadStream(file)) if (!tga.loadStream(file)) {
error("Error while reading TGA image"); error("Error while reading TGA image");
file.close(); return;
}


const Graphics::Surface *tgaSurface = tga.getSurface(); const Graphics::Surface *tgaSurface = tga.getSurface();
_system->copyRectToScreen(tgaSurface->pixels, tgaSurface->pitch, x, y, tgaSurface->w, tgaSurface->h); _system->copyRectToScreen(tgaSurface->pixels, tgaSurface->pitch, x, y, tgaSurface->w, tgaSurface->h);
Expand Down

0 comments on commit b316df9

Please sign in to comment.