1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 20:22:30 +01:00

cellSaveData: Add error param 72, 73 checks for file write ops

This commit is contained in:
Eladash 2020-02-29 07:55:59 +02:00 committed by Ivan
parent 8762f2a588
commit 34a0c3f488

View File

@ -1468,6 +1468,20 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
file = fs::make_stream<std::vector<uchar>>();
}
if (fileSet->fileBufSize < fileSet->fileSize)
{
// ****** sysutil savedata parameter error : 72 ******
savedata_result = {CELL_SAVEDATA_ERROR_PARAM, "72"};
break;
}
if (!fileSet->fileBuf)
{
// ****** sysutil savedata parameter error : 73 ******
savedata_result = {CELL_SAVEDATA_ERROR_PARAM, "73"};
break;
}
// Write to memory file and truncate
const u64 sr = file.seek(fileSet->fileOffset);
const u64 wr = lv2_file::op_write(file, fileSet->fileBuf, access_size);
@ -1500,6 +1514,20 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
file = fs::make_stream<std::vector<uchar>>();
}
if (fileSet->fileBufSize < fileSet->fileSize)
{
// ****** sysutil savedata parameter error : 72 ******
savedata_result = {CELL_SAVEDATA_ERROR_PARAM, "72"};
break;
}
if (!fileSet->fileBuf)
{
// ****** sysutil savedata parameter error : 73 ******
savedata_result = {CELL_SAVEDATA_ERROR_PARAM, "73"};
break;
}
// Write to memory file normally
const u64 sr = file.seek(fileSet->fileOffset);
const u64 wr = lv2_file::op_write(file, fileSet->fileBuf, access_size);