diff --git a/src/engine/client/graphics.cpp b/src/engine/client/graphics.cpp index 1e9a79cf7..87cabd089 100644 --- a/src/engine/client/graphics.cpp +++ b/src/engine/client/graphics.cpp @@ -387,10 +387,16 @@ int CGraphics_OpenGL::LoadPNG(CImageInfo *pImg, const char *pFilename) IOHANDLE File = m_pStorage->OpenFile(pFilename, IOFLAG_READ, aCompleteFilename, sizeof(aCompleteFilename)); if(File) io_close(File); + else + { + dbg_msg("game/png", "failed to open file. filename='%s'", aCompleteFilename); + return 0; + } if(png_open_file(&Png, aCompleteFilename) != PNG_NO_ERROR) // ignore_convention { dbg_msg("game/png", "failed to open file. filename='%s'", aCompleteFilename); + png_close_file(&Png); // ignore_convention return 0; }