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 decoding robustness improvements #2550

Merged
merged 3 commits into from
Oct 14, 2023
Merged

Conversation

JimBobSquarePants
Copy link
Member

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

Adds additional checks to the decoder infrastructure to enable us to better handle corrupt files.

Some light formatting cleanup also.

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.

One suggestion, otherwise LGTM.

{
return totalBytesRead;
}

totalBytesRead += bytesRead;
}

return totalBytesRead;
}
Copy link
Member

Choose a reason for hiding this comment

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

Since we are already touching this class: we should check the return value of this.innerStream.Read in InitializeInflateStream when it's skipping 4 bytes.

Copy link
Member

Choose a reason for hiding this comment

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

Pushed the change together with another check.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good changes. Thanks!

@JimBobSquarePants JimBobSquarePants merged commit b8e8b86 into main Oct 14, 2023
8 checks passed
@JimBobSquarePants JimBobSquarePants deleted the js/fix-tiff-streams branch October 14, 2023 04:53
JimBobSquarePants pushed a commit that referenced this pull request Oct 16, 2023
* Tiff decoding robustness improvements (#2550)

* tiled Tiff is not supported in 2.1, delete TiffDecoder_CanDecode_TiledWithBadZlib

* also delete the files

* and the constant
antonfirsov added a commit that referenced this pull request Oct 16, 2023
(accidental push to unprotected branch)
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.

2 participants