1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

fix size calculation in get_member_and_attrs

This commit is contained in:
RipleyTom 2024-05-15 13:15:29 +02:00 committed by Elad Ashkenazi
parent 75d6765adc
commit 0a956906de
2 changed files with 11 additions and 2 deletions

View File

@ -1290,7 +1290,7 @@ error_code sceNpMatching2GrantRoomOwner(
error_code sceNpMatching2CreateContext(
vm::cptr<SceNpId> npId, vm::cptr<SceNpCommunicationId> commId, vm::cptr<SceNpCommunicationPassphrase> passPhrase, vm::ptr<SceNpMatching2ContextId> ctxId, s32 option)
{
sceNp2.warning("sceNpMatching2CreateContext(npId=*0x%x, commId=*0x%x(%s), passPhrase=*0x%x, ctxId=*0x%x, option=%d)", npId, commId, commId ? commId->data : "", ctxId, option);
sceNp2.warning("sceNpMatching2CreateContext(npId=*0x%x, commId=*0x%x(%s), passPhrase=*0x%x, ctxId=*0x%x, option=%d)", npId, commId, commId ? commId->data : "", passPhrase, ctxId, option);
auto& nph = g_fxo->get<named_thread<np::np_handler>>();

View File

@ -248,7 +248,16 @@ namespace np
ptr_member->flagAttr = member.flagAttr;
}
u32 needed_data_size = sizeof(SceNpOnlineName) + sizeof(SceNpAvatarUrl) + sizeof(SceNpMatching2RoomGroup);
u32 needed_data_size = 0;
if (member.userInfo.onlineName)
needed_data_size += sizeof(SceNpOnlineName);
if (member.userInfo.avatarUrl)
needed_data_size += sizeof(SceNpAvatarUrl);
if (member.group_id)
needed_data_size += sizeof(SceNpMatching2RoomGroup);
for (usz i = 0; i < binattrs_list.size(); i++)
{