Skip to content

Reject truncated PPM pixel data#572

Merged
treeform merged 1 commit intomasterfrom
fix/ppm-truncated-data
Apr 30, 2026
Merged

Reject truncated PPM pixel data#572
treeform merged 1 commit intomasterfrom
fix/ppm-truncated-data

Conversation

@treeform
Copy link
Copy Markdown
Owner

Fixes #563.

Summary:

  • Reject PPM payloads whose decoded pixel count does not match the declared dimensions.
  • Reject partial P6 pixels before decoding.
  • Reject invalid maxVal == 0 values.
  • Add a regression test for the truncated P6 payload from the issue.

Tests:

  • nim r --hints:off --warnings:off tests\test_ppm.nim
  • git diff --check

@treeform treeform merged commit 7f2bebd into master Apr 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PPM decoder accepts truncated pixel data and violates the core Image invariant

1 participant