diff --git a/Common/File/VFS/ZipFileReader.cpp b/Common/File/VFS/ZipFileReader.cpp index 8fd7c6d3e4..a3f85850b4 100644 --- a/Common/File/VFS/ZipFileReader.cpp +++ b/Common/File/VFS/ZipFileReader.cpp @@ -58,8 +58,12 @@ uint8_t *ZipFileReader::ReadFile(const char *path, size_t *size) { std::lock_guard guard(lock_); // Figure out the file size first. struct zip_stat zstat; - zip_stat(zip_file_, temp_path.c_str(), ZIP_FL_NOCASE | ZIP_FL_UNCHANGED, &zstat); - zip_file *file = zip_fopen(zip_file_, temp_path.c_str(), ZIP_FL_NOCASE | ZIP_FL_UNCHANGED); + int retval = zip_stat(zip_file_, temp_path.c_str(), ZIP_FL_NOCASE | ZIP_FL_UNCHANGED, &zstat); + if (retval != 0) { + ERROR_LOG(Log::IO, "Error opening %s from ZIP", temp_path.c_str()); + return 0; + } + zip_file *file = zip_fopen_index(zip_file_, zstat.index, ZIP_FL_NOCASE | ZIP_FL_UNCHANGED); if (!file) { ERROR_LOG(Log::IO, "Error opening %s from ZIP", temp_path.c_str()); return 0; diff --git a/GPU/Common/TextureReplacer.cpp b/GPU/Common/TextureReplacer.cpp index 0fd9cfb9f3..bd31cdda88 100644 --- a/GPU/Common/TextureReplacer.cpp +++ b/GPU/Common/TextureReplacer.cpp @@ -240,6 +240,7 @@ bool TextureReplacer::LoadIni(std::string *error) { void TextureReplacer::ScanForHashNamedFiles(VFSBackend *dir, std::map> &filenameMap) { // Scan the root of the texture folder/zip and preinitialize the hash map. + // TODO: Could put VFSFileReference into the map... std::vector filesInRoot; dir->GetFileListing("", &filesInRoot, nullptr); for (auto file : filesInRoot) {