fix(libSceVideoOut): validate open parameters and resolution status outputs #14106
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14106"
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 slopgobblercobbler on 2026-10-31T19:11:44Z.
What
core/libs/prx/libSceVideoOut/src/Output.cpp, returnVIDEO_OUT_ERROR_INVALID_HANDLEfromsceVideoOutGetResolutionStatusfor unopened or closed handles matching console measurements, while retaining an exception for null status output pointers as unmeasured.core/libs/tests/GuestVideoOutResolutionStatus.cpp, assertVIDEO_OUT_ERROR_INVALID_HANDLEfor unopened and closed handles, and verify null status output pointers reject with an exception.Tested
core/libs/tests/GuestVideoOutResolutionStatus.cppverifyVIDEO_OUT_ERROR_INVALID_HANDLEon unopened and closed handles and exception rejection on null status pointers.python tools/check_conventions.py --base upstream/main --head HEAD: 0 findings.Checklist
NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt fileImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T19:13:56Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The parameter-validation paths look consistent with the stated measurements, but the new null-attribute behavior is unmeasured and contradicts the repository rule for unknown behavior.
What I ran
Reviewed head
f26371a44f658eea16d5e2382e39d05d98b863e4against basee30f38577c79f16747eee745a145ff6b37a2dede; both PR-specific merge previews were clean. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0 (c++). No build or C++ tests were run.Results
main.Unedited precheck output
Findings
Blocking
sceVideoOutSetBufferAttributeandsceVideoOutSetBufferAttribute2now return successfully for null pointers (Buffer.cpp at the reviewed head, second helper). The debt entry calls this behavior unmeasured, while the repository instructs that unknown general behavior must throw and be recorded (AGENTS.md at the reviewed base). The test only invokes these void functions with null and does not establish what the console does. Please keep the throw until console behavior is measured, or add pinned measurement evidence and a regression assertion for the measured behavior.Non-blocking
None found in the inspected diff.
Not verified
The C++ tests, build, console behavior, and pending hosted CI were not verified locally.
To get this to a good state
Either restore the throw for these unmeasured null cases or provide reproducible console evidence and test the measured result; I will rerun the same checks on the updated head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T09:12:09Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The null-attribute throws are restored as requested, but
sceVideoOutOpenandsceVideoOutGetResolutionStatusnow return error codes for cases the debt file does not record as measured, which AGENTS.md says must throw and be recorded.What I ran
cff4acf301ba1f7a352eec62a4852499d017b3af(the single rebased commit). Base for the precheck:59bd3b677d67cb5cfdb4a0092ffe644d27cf1a56. The live stack check reports the PR as mergeable, and GitHub reports the merge state as clean.The precheck's ABI and test-quality helpers failed because the head tree has no
tools/directory, so both were run by hand as listed above.Results
possible-unregistered-cpp-testfindings, both false positives:guest_video_out_output_mode_testsandguest_video_out_resolution_status_testsare registered incore/libs/prx/libSceVideoOut/CMakeLists.txtlines 253 and 240cff4acf301Test-quality heuristic, unedited output (manual)
Findings
Blocking
sceVideoOutOpennow returns instead of throwing for unmeasured inputs. At head, an unknownuserId,busTypeorindex(Output.cpplines 95-103) and every open-param check invalidateOpenParam(lines 67-89) returnVIDEO_OUT_ERROR_INVALID_VALUE. Onmainthese paths threwstd::runtime_error(Output.cppin59bd3b677d). The debt entry (docs/dev/debt/libSceVideoOut.mdline 25) gives the return codes but cites no measurement, and it says that whether invalid parameters continue past offset 24 is unknown. AGENTS.md says that when general behaviour is unknown the code must throw and the gap goes in the debt file. Please restore the throws for these cases, or cite a measurement for each return code and pin it in a test.sceVideoOutGetResolutionStatusreturns codes for a null output and an invalid handle, with no source. At head, a null output on an open handle returns0x80290002(line 223) and an invalid handle returns0x8029000B(line 225). The debt entry (line 23) says these were confirmed on a PS5 at firmware 13.40, but unlike the other measurement claims in that file it has no link or capture. Please either link the measurement record for these codes, or restore the throws until it is linked.Non-blocking
sceVideoOutSetBufferAttributeandsceVideoOutSetBufferAttribute2are restored, and their debt entry is removed. This addresses the request in my earlier review of this PR.GuestVideoOutResolutionStatus.cpppin the new codes. Whichever way item 2 is resolved, those assertions should follow the decision.Sources
Permalinks, pinned to commits:
mainbefore this PR,sceVideoOutOpenand its checks threw:github.com/boykopovar/AnyPS5@59bd3b677d/core/libs/prx/libSceVideoOut/src/Output.cpp (L72-L100)github.com/boykopovar/AnyPS5@cff4acf301/core/libs/prx/libSceVideoOut/src/Output.cpp (L67-L103)sceVideoOutGetResolutionStatusreturns for a null output and an invalid handle:github.com/boykopovar/AnyPS5@cff4acf301/core/libs/prx/libSceVideoOut/src/Output.cpp (L217-L225)github.com/boykopovar/AnyPS5@cff4acf301/docs/dev/debt/libSceVideoOut.md (L23-L25)AGENTS.md:github.com/boykopovar/AnyPS5@59bd3b677d/AGENTS.md (L7)Not verified
cff4acf301. The newGuestVideoOutOutputModeandGuestVideoOutResolutionStatusassertions were not run.To get this to a good state
Restore the throws for the unmeasured
sceVideoOutOpenand null-output cases, or add the measurement links and keep the returns with the debt text updated to match. I will rerun the same checks on the updated head.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-06T15:02:40Z.
Review: CHANGES_REQUESTED
Thanks for the updates; the test coverage of each
validateOpenParambranch and the restored debt evidence look good. Two points from the earlier review are still open (same as @MarcZX10's last review):sceVideoOutOpen(Output.cpp:112-142): onmainthese cases threw because the console's answer isn't known. The debt entry now statesVIDEO_OUT_ERROR_INVALID_VALUEbut cites no measurement for the invalid userId, bus type, bus index or open-param cases, and the references we checked (KytyPS5, shadPS4) don't establish them. Either link a console measurement for each case (title/firmware/capture) and keep the returns, or restore the throws and record the gap indocs/dev/debt/libSceVideoOut.md.sceVideoOutGetResolutionStatus(Output.cpp:276-283): the debt entry says a null output on an open handle returning0x80290002was confirmed on a PS5 (13.40), but gives no link or capture; only0x8029000Bfor handles 0-8 was measured before. Please link the record for the null-output case, or keep the throw for it. The0x8029000Bpath is fine as is, and the test assertions should follow whichever way this goes.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T05:49:20Z.
Review: APPROVED
Reviewed — looks good
The review covers the four changed files at head
0a145847d4a3a3c2f2dbd3753a8f5f6e7814b30c; no checks were run, and no concrete blocking defect was verified.What I ran
repo_read.py; no build, tests or other checks were run.Results
Findings
Blocking
None verified.
Non-blocking
None.
Not verified
Build and test results reported in the PR description were not independently confirmed. Console measurements and behavior were not independently confirmed. No files were excluded: all four files marked
reviewedinmanifest.jsonwere read;files.jsonwas not inspected.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T00:10:45Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: restore the null-attribute behavior described in the PR, or remove that claim from the scope if it was not intended for this change.
What I ran
Reviewed head
f478ad158b80fa1fc6a5a76b4a741c03cd364b7ffrom the prepared diff and pinned repository source usingrepo_read.py. No commands or tests were run.Results
Findings
Blocking
sceVideoOutSetBufferAttributeandsceVideoOutSetBufferAttribute2now return early on null pointers without modifying memory, but the prepared manifest and diff contain noBuffer.cppchange. At this head, both functions still throw on null (Buffer.cpp:127-130,191-194), so the stated behavior is not implemented. Add the guards and suitable coverage, or revise the scope if these changes were not intended. The changed-line citation for the scope mismatch isdocs/dev/debt/libSceVideoOut.md:37, which documents the changedsceVideoOutOpenbehavior; no changed line forBuffer.cppexists in the supplied diff.Non-blocking
Sources
Not verified
files.jsonwas not accessible through the reader; manifest lists four included changed files, all of which were read. The changed-file manifest and diff do not includeBuffer.cpp.To get this to a good state
Implement and test the null attribute handling described in the PR, or update the PR description and related claims to match the intended scope. Rerun the relevant tests on the updated head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T19:00:08Z.
Review: APPROVED
Reviewed — looks good
The changed resolution status path now returns the invalid handle code for unopened or closed handles, and its null-pointer behavior remains the documented unmeasured exception.
What I ran
Reviewed head
9e98beb1e424264373e0ccbbb4b9b3a02c7a703ausingrepo_read.py. No tests or prechecks were run; no merged-preview check was performed.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The unit tests and conventions check reported in the PR description were not run during this review. No hardware or console measurements were performed. The review bundle’s
files.jsonwas unavailable; the manifest lists both changed files as included, and both full source files were read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:49:55Z.
Review: COMMENTED
The trial merge onto
c1601e56d5was clean.HasConfig,IsOpen, andGetConfigacquire and release the driver lock separately, andIsOpenitself calls the throwingGetConfig. A close between the checks can therefore still throw the invalid-handle error this change is meant to return. Please use one lookup that returns the live configuration or the guest error, then checkclosingunder its mutex before filling the output. The current fixture checks handles before and after close sequentially. Paired display-backed controls are pending.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.