mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 13:48:40 +00:00
seems that we can't MapViewOfFile big images , return an error in failure
This commit is contained in:
@@ -54,6 +54,11 @@ bool PKG::extract(const std::string& filepath, const std::string& extractPath, s
|
|||||||
}
|
}
|
||||||
file.Seek(0, fsSeekSet);
|
file.Seek(0, fsSeekSet);
|
||||||
pkg = (U08*)mmap(pkgSize, file.fileDescr());
|
pkg = (U08*)mmap(pkgSize, file.fileDescr());
|
||||||
|
if (pkg == nullptr)
|
||||||
|
{
|
||||||
|
failreason = "Can't allocate size for image";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
file.Read(pkg, pkgSize);
|
file.Read(pkg, pkgSize);
|
||||||
|
|
||||||
|
|||||||
@@ -135,6 +135,10 @@ public:
|
|||||||
if (hHandle != NULL) {
|
if (hHandle != NULL) {
|
||||||
pStart = MapViewOfFile(hHandle, FILE_MAP_COPY, 0, 0, sLength);
|
pStart = MapViewOfFile(hHandle, FILE_MAP_COPY, 0, 0, sLength);
|
||||||
}
|
}
|
||||||
|
if(pStart == NULL)
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
return pStart;
|
return pStart;
|
||||||
}
|
}
|
||||||
int munmap(void* pStart) {
|
int munmap(void* pStart) {
|
||||||
|
|||||||
Reference in New Issue
Block a user