Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix size calculation in get_member_and_attrs #15593

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/Modules/sceNp2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>>();

Expand Down
11 changes: 10 additions & 1 deletion rpcs3/Emu/NP/np_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
{
Expand Down