diff --git a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp index 815e51a6a4..9d59b38388 100644 --- a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp @@ -1468,6 +1468,20 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v file = fs::make_stream>(); } + 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>(); } + 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);