Skip to content

Commit 195f245

Browse files
jarvesonkd-11
authored andcommitted
cellPad: Clear info structs before setting
1 parent 56b21fd commit 195f245

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rpcs3/Emu/Cell/Modules/cellPad.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ s32 cellPadPeriphGetInfo(vm::ptr<CellPadPeriphInfo> info)
287287

288288
const PadInfo& rinfo = handler->GetInfo();
289289

290+
std::memset(info.get_ptr(), 0, sizeof(CellPadPeriphInfo));
291+
290292
info->max_connect = rinfo.max_connect;
291293
info->now_connect = rinfo.now_connect;
292294
info->system_info = rinfo.system_info;
@@ -394,6 +396,8 @@ s32 cellPadGetInfo(vm::ptr<CellPadInfo> info)
394396
if (!handler)
395397
return CELL_PAD_ERROR_UNINITIALIZED;
396398

399+
std::memset(info.get_ptr(), 0, sizeof(CellPadInfo));
400+
397401
const PadInfo& rinfo = handler->GetInfo();
398402
info->max_connect = rinfo.max_connect;
399403
info->now_connect = rinfo.now_connect;
@@ -424,6 +428,8 @@ s32 cellPadGetInfo2(vm::ptr<CellPadInfo2> info)
424428
if (!handler)
425429
return CELL_PAD_ERROR_UNINITIALIZED;
426430

431+
std::memset(info.get_ptr(), 0, sizeof(CellPadInfo2));
432+
427433
const PadInfo& rinfo = handler->GetInfo();
428434
info->max_connect = rinfo.max_connect;
429435
info->now_connect = rinfo.now_connect;

0 commit comments

Comments
 (0)