Repository navigation
test(png_enc): add work-buffer recreate with smaller effective width test - #24594
Conversation
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 03aef0a067:
- Conventions:
tools/check_conventions.pypassed. - Build:
guest_png_enc_context_testsbuilt cleanly. - CTest (
guest_png_enc_context):1/1 Test #5118: guest_png_enc_context ............ Passed 1.38 sec 100% tests passed, 0 tests failed out of 1 - Code reading:
- Verified that the work-memory canaries in workMem2 are properly checked around the buffer boundaries and remain unmodified after encode and delete operations
- Verified that scePngEncCreate correctly initializes in the previously used work buffer with smaller width param and validates against largeEncode (returning 0x80690103 / SCE_PNG_ENC_ERROR_INVALID_IMAGE_PARAM)
- Verified that the rejected encode does not modify output buffer or info struct (retaining original values)
- Verified that the smaller image encode and decode succeeds, matches expected pixel data, and completes without memory corruption
- Verified AGENTS.md compliance regarding no comments, Conventional Commits, clean diff, and lack of leaks or side effects
Looks Good To Me
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this test change; it covers recreation with a smaller width limit and checks rejection, successful encoding, and work-buffer canaries.
What I ran
Reviewed head 03aef0a067ae0a3862de92d30ced963812a8e5e1. Read the PR description, commit summary, manifest, complete diff, and all 103 added lines in core/libs/tests/GuestPngEncContext.cpp. The repository reader was available as repo_read.py; no tests were run in this review.
Results
| Check | Result | Note |
|---|---|---|
| Changed lines reviewed | passed | All added lines read |
| Targeted tests | not run | Author reports Linux and Windows runs |
| Negative control | not run | Author reports the test failed when behavior was disabled |
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not independently run the test or verify the author-reported results. Only core/libs/tests/GuestPngEncContext.cpp was changed and reviewed; there were no excluded changed files.
To get this to a good state
Nothing is required.
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
What
Recreate a PNG encoder context in the same work buffer with a smaller width limit. Check that it rejects the formerly valid image, accepts a smaller image and leaves the surrounding canaries intact.
Tested
ctest -R "^(guest_png_enc_context)$"passed on03aef0a067ae.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)