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

Tiff: Add maximum IFD threshold #1892

Merged
merged 2 commits into from
Dec 13, 2021
Merged

Tiff: Add maximum IFD threshold #1892

merged 2 commits into from
Dec 13, 2021

Conversation

brianpopow
Copy link
Collaborator

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

This PR adds a maximum of 65534 IFD directories. Images with more then that will throw a ImageFormatException.
Fixes #1891

@codecov
Copy link

codecov bot commented Dec 13, 2021

Codecov Report

Merging #1892 (f45e184) into master (53456a5) will increase coverage by 0%.
The diff coverage is 80%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1892   +/-   ##
======================================
  Coverage      87%     87%           
======================================
  Files         957     957           
  Lines       50389   50391    +2     
  Branches     6263    6264    +1     
======================================
+ Hits        44176   44180    +4     
+ Misses       5181    5180    -1     
+ Partials     1032    1031    -1     
Flag Coverage Δ
unittests 87% <80%> (+<1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs 93% <75%> (+4%) ⬆️
src/ImageSharp/Formats/Tiff/Ifd/EntryReader.cs 85% <100%> (ø)
src/ImageSharp/Formats/Tiff/TiffThrowHelper.cs 28% <0%> (+14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53456a5...f45e184. Read the comment docs.

Copy link
Member

@antonfirsov antonfirsov left a comment

Choose a reason for hiding this comment

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

Looks good to me, hope this is the only place that has to be changed.

/cc @IldarKhayrutdinov if you have a moment.

Copy link
Contributor

@IldarKhayrutdinov IldarKhayrutdinov left a comment

Choose a reason for hiding this comment

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

good 👍

@brianpopow brianpopow merged commit 2c27919 into master Dec 13, 2021
@brianpopow brianpopow deleted the bp/fix1897 branch December 13, 2021 17:10
@JimBobSquarePants
Copy link
Member

@brianpopow Great job dealing with this.!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TIFF with circular IFD list
4 participants