mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Add a null check in zip file parsing
This commit is contained in:
@@ -637,6 +637,11 @@ bool ZipExtractFileToMemory(struct zip *z, int fileIndex, std::string *data) {
|
||||
data->resize(readSize);
|
||||
|
||||
zip_file *zf = zip_fopen_index(z, fileIndex, 0);
|
||||
if (!zf) {
|
||||
ERROR_LOG(Log::HLE, "Failed to zip_fopen_index file %d from zip", fileIndex);
|
||||
return false;
|
||||
}
|
||||
|
||||
zip_int64_t retval = zip_fread(zf, data->data(), readSize);
|
||||
zip_fclose(zf);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user