Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Palette chunk check starts at wrong index #6

Open
vHeemstra opened this issue Oct 25, 2023 · 1 comment · May be fixed by #7
Open

Palette chunk check starts at wrong index #6

vHeemstra opened this issue Oct 25, 2023 · 1 comment · May be fixed by #7

Comments

@vHeemstra
Copy link

vHeemstra commented Oct 25, 2023

if (imageData[29] !== 'P' && imageData[30] !== 'L' && imageData[31] !== 'T' && imageData[32] !== 'E') {

The indexes for the PLTE-chunk check are wrong. They should be further, depending on the length of the IHDR-chunk + the 4 byte CRC of that chunk (see specification).

In this case, it should skip 4 bytes (CRC of the IHDR-chunk) and another 4 bytes (the size indicator of the PLTE-chunk).

Check out my visual helper for PNG.

@vHeemstra vHeemstra linked a pull request Oct 25, 2023 that will close this issue
@kettek
Copy link
Owner

kettek commented Nov 2, 2023

Been quite busy, will review and double-check soon

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 a pull request may close this issue.

2 participants