Skip to content

fix: bound psd layer rle allocation - #22

Merged
IAmJSD merged 1 commit into
Infrawrench:mainfrom
ProdigyRahul:fix/psd-rle-alloc-bound
Aug 25, 2026
Merged

fix: bound psd layer rle allocation#22
IAmJSD merged 1 commit into
Infrawrench:mainfrom
ProdigyRahul:fix/psd-rle-alloc-bound

Conversation

@ProdigyRahul

Copy link
Copy Markdown
Contributor

fixes #21

mirror the composite decoder's 64x expansion guard in the layer decoder, checked after the count table is read so remaining() is the actual payload, and before the allocation.

two tests: an oversized channel is rejected, and a channel sitting exactly at PackBits' 64x worst case still decodes so no valid file is turned away.

before

before

after

after

@IAmJSD IAmJSD left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@IAmJSD
IAmJSD merged commit fdba3cb into Infrawrench:main Aug 25, 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.

a malformed psd can request an unbounded allocation and abort the process

2 participants