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

Do not crash on ASCII85 in inline images and properly support their colorspaces #1010

Merged
merged 5 commits into from
Jul 15, 2024

Conversation

dhdaines
Copy link
Contributor

Pull request

ASCII85Decode was not properly handled in inline images (because the end tag "EI\n" is very frequently present in ASCII85 streams) causing random crashing.

Also inline images weren't properly being extracted as BMP because we weren't recognizing their abbreviated colorspaces.

Fixes #1008

How Has This Been Tested?

There's a unit test ;-)

Checklist

  • [ x ] I have read CONTRIBUTING.md.
  • [ X ] I have added a concise human-readable description of the change to CHANGELOG.md.
  • [ x ] I have tested that this fix is effective or that this feature works.
  • [ x ] I have added docstrings to newly created methods and classes.
  • [ x ] I have updated the README.md and the readthedocs documentation. Or verified that this is not necessary.

Copy link
Member

@pietermarsman pietermarsman left a comment

Choose a reason for hiding this comment

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

Hi,

Thanks for this contribution! It is looking good but I need some more time to understand the details of this change.

pdfminer/pdfinterp.py Outdated Show resolved Hide resolved
@dhdaines dhdaines requested a review from pietermarsman July 15, 2024 12:54
Copy link
Member

@pietermarsman pietermarsman left a comment

Choose a reason for hiding this comment

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

I've updated the comments and the CHANGELOG a bit.

Thanks for fixing this!

@pietermarsman pietermarsman added this pull request to the merge queue Jul 15, 2024
Merged via the queue into pdfminer:master with commit 1a8bd2f Jul 15, 2024
12 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.

inline image parsing fails when stream data contains "EI\n"
2 participants