mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:50:53 +01:00
[PR #259] Conformance reader rejects invalid critical PNG chunk structure #312
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#312
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/259
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:old-pr/9989📝 Commits (2)
b14531aReject invalid critical PNG chunk structure in conformance reads48a5f2bReject non-letter PNG chunk types after review📊 Changes
2 files changed (+52 additions, -0 deletions)
View changed files
📝
tests/test_conformance_png_transparency.py(+32 -0)📝
tools/conformance/compare.py(+20 -0)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Restores
#7181after the repository-transfer closure. The original PR cannot be reopened by its author (viewerCanReopen: false). This resubmission uses the same branch and unchanged head48a5f2bd9bf1183f334e797e21bbef19039902f3. Original independent review/test evidence: https://github.com/ProjectLeonida/Leonida/pull/7181#issuecomment-7108237560.The PNG reader accepted duplicate headers, unsupported critical chunks, split IDAT sequences, a nonempty IEND, and malformed or misplaced palettes. It now rejects these inputs before using their pixels in a comparison. Following review, chunk types must also contain four ASCII letters, so names such as
1234cannot be treated as ancillary chunks.Coordination claim. The checks follow PNG chunk ordering and critical chunk definitions. Valid RGB/RGBA images still support consecutive split IDAT chunks, including empty pieces, optional palettes and ancillary text.
Rebased onto main
1ce6eb5f5. Tested head48a5f2bd9on Windows with Python 3.12.16 and synthetic pixels only: all 6 focused tests and the 22-check compare.py selftest pass. The three new invalid-name cases fail against the rebased version before the review fix; the original seven invalid-structure cases were also verified against the original parent. Compilation, diff whitespace and game-data checks pass. CPU-only, no GPU run.AI-assisted (Codex).
Fresh integration verification against ProjectLeonida/Leonida main "
d083a2cc3": clean merge, tests/test_conformance_png_transparency.py: 6 tests; compare.py selftest: all 22 checks passed. Whitespace and changed-file game-data checks passed. Windows, Python 3.12.16, CPU only, synthetic inputs; no GPU run. AI-assisted (Codex).Resubmission claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116960294
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.