Error handling fixes (close the file).

This commit is contained in:
Henrik Rydgård committed 2023-03-12 23:05:45 +01:00
1 parent 4b73672b79
commit b1b8fc65cf
1 file changed
+2
+2
View File
@@ -364,6 +364,7 @@ bool ReplacedTexture::LoadLevelData(VFSFileReference *fileRef, const std::string
// Already populated from cache. TODO: Move this above the first read, and take level.w/h from the cache.
if (!out.empty()) {
vfs_->CloseFile(openFile);
*pixelFormat = levelData_->fmt;
return true;
}
@@ -382,6 +383,7 @@ bool ReplacedTexture::LoadLevelData(VFSFileReference *fileRef, const std::string
}
if (!good) {
vfs_->CloseFile(openFile);
return false;
}