fix(libScePngDec): check the pixel stream checksum before writing the last row #27748
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27748"
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 bipinkrish on 2026-11-27T07:17:30Z.
What
Read non-interlaced RGBA and BGRA output one row at a time with the existing libpng decoder. A bad Adler-32 checksum now returns
0x80690012and leaves the last output row untouched. Completed rows are still available to the caller, including when the stream ends inside an IDAT chunk.Tested
Built the guest PNG decoder on Linux x86-64. All eight focused PNG CTests passed. The new regression failed on the base revision and passed on this branch. It checks the error, the bytes written, and the destination guards when the checksum falls in one IDAT or crosses chunk boundaries.
Replayed all eight published 11.60 probe cases through the host guest library. The return values, dimensions, row prefixes, and guards matched the recorded results. A separate comparison of 936 valid-image cases found identical output across the previous and updated decoders. Console measurements and probe source.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T07:25:43Z.
Review: COMMENTED
Actionable comments posted: 1
e918bdec-647c-4c30-a99a-b8bd77b0063fReviewing files that changed from the base of the PR and between
bd0af686a9and4301ad6599.core/libs/prx/libScePngDec/Export.cppcore/libs/tests/GuestPngDec.cppdocs/dev/debt/changes/fix-pngdec-short-idat.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T07:30:30Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the review is complete, and the inspected implementation supports merging.
What I ran
Reviewed head
4301ad65995d6bd5bbfc573f7daff8efd339bc3b. No commands or tests were run. I read the prepared description, commits, diff, manifest, and the full text of all three changed files:core/libs/prx/libScePngDec/Export.cpp,core/libs/tests/GuestPngDec.cpp, anddocs/dev/debt/changes/fix-pngdec-short-idat.md. The manifest marks all three as reviewed; no excluded files were listed.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run the reported CTests, build, host case comparisons, or console probes. Those results are author-reported, not independently verified. No repository files outside the changed files were read, and no files were excluded by the manifest.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T09:17:35Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the available source supports the reported checksum behavior, and the focused test covers the changed path.
What I ran
Reviewed head
ec14088d3f0db8e4d71fddeb0589ea3fa23f4c5b. Read the prepared diff and all three changed files. No tests or builds were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build and CTest results, console behavior, and the reported image comparisons were not independently verified.
files.jsonwas unavailable; the manifest lists three changed files, and all three were read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-27T14:35:40Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
ec14088d3f:tools/check_conventions.pypassed.guest_png_dec_testsbuilt cleanly.guest_png_dec):core/libs/prx/libScePngDec/Export.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-11-28T05:06:26Z.
Review: APPROVED
Checked head
ec14088d3f. All on Windows 11 with WinLibs GCC 15.2 (Release), applied tomaina163d4b886together with #27930, #27929, #27926, #27925, #27924, #27923, #27922, #27901, #27828, #27771, #27755, #27682, #27765.tools/check_conventions.py --headandtools/debt_fold.py --checkpassed and the full build succeeded.guest_png_decand the threeguest_png_dec_delete*tests pass. In the full CPU suite (5,120 tests) the only failures are unrelated:windows_read_trap_unknownfails onmaintoo (fixed in #28028).frame_capture_minimize,jpeg_external_toolchainandguest_pthread_mutex_contentionare timeouts under load; they pass when run on their own.guest_audio_in_capturepasses 20/20 onmainand with #27922.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T13:58:33Z.
Review: COMMENTED
Built and ran
guest_png_decon Linux with this head integrated. The suite passed, including the corrupt-checksum cases for RGBA and BGRA. I checked the row-write ordering against the error path. The decoder publishes completed rows and holds back the last row until libpng accepts the stream checksum.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.