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

Prevent detecting corrupt PNG file #392

Merged
merged 3 commits into from
Sep 14, 2020

Conversation

Borewit
Copy link
Collaborator

@Borewit Borewit commented Sep 13, 2020

Prevent throwing read error reading a PNG with an invalid chunk length.

Return undefined if a PNG has an invalid chunk length.

Alternative solution: #393.

Fix #391.

@Borewit Borewit changed the title Issue 391 png illegal chunk length undefined Prevent throwing read error on PNG file with an invalid chunk length Sep 13, 2020
@Borewit Borewit changed the title Prevent throwing read error on PNG file with an invalid chunk length Prevent detecting corrupt PNG file Sep 13, 2020
@sindresorhus
Copy link
Owner

I think this is the correct solution. Can you add a test?

@Borewit Borewit force-pushed the issue-391-png-illegal-chunk-length-undefined branch 3 times, most recently from 7545e4b to 6656927 Compare September 14, 2020 06:32
@Borewit Borewit self-assigned this Sep 14, 2020
@Borewit Borewit force-pushed the issue-391-png-illegal-chunk-length-undefined branch from 6656927 to 22b0d9d Compare September 14, 2020 06:35
@Borewit
Copy link
Collaborator Author

Borewit commented Sep 14, 2020

I think this is the correct solution. Can you add a test?

I revived the false positive tests (removed in 648e210) and added the corrupt PNG sample to that.

@sindresorhus sindresorhus merged commit ec88386 into master Sep 14, 2020
@sindresorhus sindresorhus deleted the issue-391-png-illegal-chunk-length-undefined branch September 14, 2020 18:49
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.

Corrupt PNG file (invalid chunk length) causes read error
2 participants