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

BUG: Avoid exceeding recursion depth when retrieving image mode #2251

Merged
merged 2 commits into from
Oct 10, 2023

Conversation

stefan6419846
Copy link
Collaborator

Previously, retrieving the image mode could lead to an infinite loop when nested color spaces have been used ("RecursionError: maximum recursion depth exceeded in comparison"). This has been fixed by limiting the default depth which is allowed.

@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (5c3550f) 94.44% compared to head (d9aa46b) 94.45%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2251   +/-   ##
=======================================
  Coverage   94.44%   94.45%           
=======================================
  Files          43       43           
  Lines        7621     7624    +3     
  Branches     1502     1503    +1     
=======================================
+ Hits         7198     7201    +3     
  Misses        261      261           
  Partials      162      162           
Files Coverage Δ
pypdf/_xobj_image_helpers.py 92.14% <100.00%> (+0.17%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MartinThoma MartinThoma merged commit c6908ea into py-pdf:main Oct 10, 2023
12 checks passed
@MartinThoma
Copy link
Member

Thank you @stefan6419846 for investigating that issue + creating a PDF that would cause the issue 🙏

MartinThoma added a commit that referenced this pull request Oct 10, 2023
## What's new

### Bug Fixes (BUG)
-  Avoid exceeding recursion depth when retrieving image mode (#2251) by @stefan6419846

### Maintenance (MAINT)
-  Bump sample-files by @MartinThoma

[Full Changelog](3.16.3...3.16.4)
@MartinThoma
Copy link
Member

I've just created a new release for this

@MartinThoma MartinThoma added the nf-security Non-functional change: Security label Oct 10, 2023
@stefan6419846 stefan6419846 deleted the get_imagemode_nesting branch October 10, 2023 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nf-security Non-functional change: Security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants