fix(libSceAudioOut): avoid partial output write in sceAudioOut2UserGetSupportedAttributes #25046
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/25046"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by gurtgg on 2026-11-21T15:50:44Z.
What
sceAudioOut2UserGetSupportedAttributes(core/libs/prx/libSceAudioOut/src/AudioOut2User.cpp), which previously overwrote*contextAttributesviaCopyUserOutput_nid_no_patchbefore failing to write an unwritable non-nullportAttributespointer and returning0x80268001.CopyUserInput_nid_no_patchwrappingGuestCopyIn_nid_no_patchwitherrnosave/restore; when bothcontextAttributesandportAttributesare non-null, snapshot*contextAttributesbefore writingcontextand restore the saved value if writingportAttributesfails, preserving hosterrno.docs/dev/debt/changes/audioout2-user-atomic-attr-outputs.md(high-reach PRX audio librarylibSceAudioOut/libSceAudioOut2).Tested
CheckUserSupportedAttributes(core/libs/prx/libSceAudioOut/tests/AudioOut2AmbisonicsEncode.cpp): verifies that an unwritableportAttributesleavescontextAttr == 0xdeadbeefuunchanged (overwritten to0before fix) and preserveserrno == 71while returning0x80268001, verifies unwritablecontextAttributesleavesportAttr == 0xcafebabeuunchanged anderrno == 71, and checks valid output values (contextAttr == 0,portAttr == 3).Checklist
tools/check_conventions.pyrules verified (UTF-8 no-BOM LF, zero disallowed comments, Conventional Commits)mainand passes after fixImported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-21T16:05:15Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
5b5bda4fcc:tools/check_conventions.pypassed.audio_out2_ambisonics_encode_testsbuilt cleanly.audio_out2_ambisonics_encode):core/libs/prx/libSceAudioOut/src/AudioOut2User.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me